Changeset 21 for src/main/java
- Timestamp:
- 10/06/20 13:12:31 (4 years ago)
- Location:
- src/main/java/geniusweb/partiesserver
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/geniusweb/partiesserver/Info.java
r1 r21 23 23 24 24 /** 25 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse26 * response). Returns27 * <ul>28 * <li>URL with websocket address to contact the now running agent.29 * <li>SC_NOT_FOUND (404) if attempt is made to access non-running30 * 31 * <li>SC_SERVICE_UNAVAILABLE (503) if there are no free slots to run32 * theparty.33 * 34 * 35 * 25 * see 26 * {@link HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)}. 27 * Returns to the http caller 28 * <ul> 29 * <li>URL with websocket address to contact the now running agent. 30 * <li>SC_NOT_FOUND (404) if attempt is made to access non-running party. 31 * <li>SC_SERVICE_UNAVAILABLE (503) if there are no free slots to run the 32 * party. 33 * <li>SC_EXPECTATION_FAILED (417) if something else goes wrong during 34 * instantiating the party (then see logs for more details) 35 * </ul> 36 36 */ 37 37 @Override -
src/main/java/geniusweb/partiesserver/RunParty.java
r8 r21 43 43 44 44 /** 45 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse46 * response). Returns47 * <ul>48 * <li>URL with websocket address to contact the now running agent.49 * <li>SC_NOT_FOUND (404) if attempt is made to access non-running50 * 51 * <li>SC_SERVICE_UNAVAILABLE (503) if there are no free slots to run52 * theparty.53 * 54 * 55 * 45 * See 46 * {@link HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)}. 47 * Returns 48 * <ul> 49 * <li>URL with websocket address to contact the now running agent. 50 * <li>SC_NOT_FOUND (404) if attempt is made to access non-running party. 51 * <li>SC_SERVICE_UNAVAILABLE (503) if there are no free slots to run the 52 * party. 53 * <li>SC_EXPECTATION_FAILED (417) if something else goes wrong during 54 * instantiating the party (then see logs for more details) 55 * </ul> 56 56 */ 57 57 @Override -
src/main/java/geniusweb/partiesserver/repository/AvailableParty.java
r1 r21 17 17 * @param name the filename. This is not a {@link PartyId}. 18 18 * @param partyclass the class of the party. 19 * @throws IllegalAccessException 20 * @throws InstantiationException 19 * @throws ClassNotFoundException if unknown partyclass 21 20 */ 22 21 public AvailableParty(String name, Class<? extends Party> partyclass) -
src/main/java/geniusweb/partiesserver/repository/RunningParty.java
r18 r21 10 10 11 11 import geniusweb.actions.PartyId; 12 import geniusweb.connection.DefaultConnection;13 12 import geniusweb.inform.Inform; 14 13 import geniusweb.partiesserver.RunningPartiesUpdater; … … 52 51 * @param party the new party 53 52 * @param id the new id for the party. 53 * @param name the name, this should match the filename 54 54 * @param start the start date for this party. Usually set to current time. 55 55 * @param end the end date for this party … … 72 72 73 73 /** 74 * Create instance from availableparty75 *76 74 * @param availableparty the {@link AvailableParty} 77 * @param name the (file)name78 75 * @param maxlifetimems the maximum life time for this party (ms). The 79 76 * party will be killed and removed after this point. … … 81 78 * time plus the worst time to actual start up of the 82 79 * negotiation 83 * @throws IllegalAccessException 84 * @throws InstantiationException 80 * @return a new RunningParty being an instance of availableparty 81 * @throws IllegalAccessException if the class or its nullary constructor is 82 * not accessible. 83 * 84 * @throws InstantiationException if this Class represents an abstract 85 * class, an interface, an array class, a 86 * primitive type, or void; or if the class 87 * has no nullary constructor; or if the 88 * instantiation fails for some other reason. 89 * 85 90 */ 86 91 public static RunningParty create(AvailableParty availableparty, … … 104 109 * {@link RunningPartiesUpdater} will keep an eye on the 105 110 * time and handle removal after time is up. 106 * 107 */ 108 public static RunningParty create(Party party, String name, 111 * @return new RunningParty created from the Party instance. 112 * 113 */ 114 private static RunningParty create(Party party, String name, 109 115 long maxRunTimeMS) { 110 116 if (maxRunTimeMS <= 0) { … … 133 139 134 140 /** 135 * The name, this should match the filename in the repo (without the .jar).136 * 137 * @return141 * @return The name, this should match the filename in the repo (without the 142 * .jar). 143 * 138 144 */ 139 145 public String getName() { … … 207 213 208 214 /** 209 * You must have called {@link # connect(DefaultConnection)} before calling215 * You must have called {@link #withConnection(PartySocket)} before calling 210 216 * this. 211 217 * 212 * @param info 218 * @param info the {@link Inform} to be sent to the {@link #connection} 213 219 */ 214 220 public void inform(Inform info) { -
src/main/java/geniusweb/partiesserver/websocket/PartySocket.java
r18 r21 19 19 import javax.websocket.server.ServerEndpoint; 20 20 21 import com.fasterxml.jackson.core.JsonParseException;22 import com.fasterxml.jackson.databind.JsonMappingException;23 21 import com.fasterxml.jackson.databind.ObjectMapper; 24 22 … … 124 122 * {@link Inform} 125 123 * @param session the session. We already have this info. 124 * @throws IOException if there is a socket/connection error, we can't parse 125 * the received data, etc 126 126 */ 127 127 @OnMessage 128 128 public void onMessage(String informmessage, Session session) 129 throws JsonParseException, JsonMappingException,IOException {129 throws IOException { 130 130 if (this.session != session) { 131 131 throw new IllegalStateException("Unexpected change of session ID");
Note:
See TracChangeset
for help on using the changeset viewer.