| 1 | package tmcsim.interfaces; |
|---|
| 2 | |
|---|
| 3 | import java.awt.List; |
|---|
| 4 | import java.rmi.Remote; |
|---|
| 5 | import java.rmi.RemoteException; |
|---|
| 6 | import java.util.LinkedList; |
|---|
| 7 | |
|---|
| 8 | import javax.swing.JList; |
|---|
| 9 | import javax.swing.table.DefaultTableModel; |
|---|
| 10 | |
|---|
| 11 | import tmcsim.client.cadclientgui.data.CADData; |
|---|
| 12 | import tmcsim.client.cadclientgui.data.CardfileDataObject; |
|---|
| 13 | import tmcsim.client.cadclientgui.data.CardfileList; |
|---|
| 14 | import tmcsim.client.cadclientgui.data.ChangeLog; |
|---|
| 15 | import tmcsim.client.cadclientgui.enums.CADScriptTags.UNIT_TAGS; |
|---|
| 16 | import tmcsim.client.cadclientgui.enums.CADScriptTags; |
|---|
| 17 | import tmcsim.client.cadclientgui.enums.IncidentEnums; |
|---|
| 18 | import tmcsim.client.cadclientgui.enums.UnitStatusEnums; |
|---|
| 19 | import tmcsim.client.cadclientgui.enums.CADDataEnums.*; |
|---|
| 20 | |
|---|
| 21 | public interface CADInterface extends Remote{ |
|---|
| 22 | |
|---|
| 23 | /** |
|---|
| 24 | * Registers a remote CADClient for callback. |
|---|
| 25 | * |
|---|
| 26 | * @param client Interface to the CADClient for callback RMI |
|---|
| 27 | * @throws RemoteException if there is an error in the RMI communication. |
|---|
| 28 | */ |
|---|
| 29 | public void registerForCallback(CADClientInterface client) |
|---|
| 30 | throws RemoteException; |
|---|
| 31 | |
|---|
| 32 | /** |
|---|
| 33 | * Unregisters a remote CADClient from callback. |
|---|
| 34 | * @param client Interface to the CADClient for callback RMI |
|---|
| 35 | * @throws RemoteException if there is an error in the RMI communication. |
|---|
| 36 | */ |
|---|
| 37 | public void unregisterForCallback(CADClientInterface client) |
|---|
| 38 | throws RemoteException; |
|---|
| 39 | |
|---|
| 40 | /** |
|---|
| 41 | * Checks the CADData for an existing incident with id |
|---|
| 42 | * @param id the incident id |
|---|
| 43 | * @return true if CADData contains such an incident, otherwise false. |
|---|
| 44 | * @throws RemoteException |
|---|
| 45 | */ |
|---|
| 46 | public boolean checkForValidIncidentID(int id) throws RemoteException; |
|---|
| 47 | |
|---|
| 48 | /** |
|---|
| 49 | * Uses an Incident's masterInc to lookup its ID. |
|---|
| 50 | * @param masterInc the Incident to look up |
|---|
| 51 | * @return the same Incident's ID, -1 if invalid masterInc |
|---|
| 52 | * @throws RemoteException |
|---|
| 53 | */ |
|---|
| 54 | public int getIncidentId(String masterInc) throws RemoteException; |
|---|
| 55 | |
|---|
| 56 | /** |
|---|
| 57 | * Returns a table model out of CADData based on tag. |
|---|
| 58 | * @param tag a CADDataEnums tag |
|---|
| 59 | * @throws RemoteException |
|---|
| 60 | */ |
|---|
| 61 | public DefaultTableModel getCadDataTable(TABLE tag) throws RemoteException; |
|---|
| 62 | |
|---|
| 63 | /** |
|---|
| 64 | * Returns the specified incident's table based on the tag. |
|---|
| 65 | * @param tag a CADDataEnums tag |
|---|
| 66 | * @param incidentId the incident's ID to look up |
|---|
| 67 | * @return |
|---|
| 68 | * @throws RemoteException |
|---|
| 69 | */ |
|---|
| 70 | public DefaultTableModel getCadDataIncidentTable(INC_TABLE tag, int incidentId) throws RemoteException; |
|---|
| 71 | |
|---|
| 72 | /** |
|---|
| 73 | * Adds a row of data to a specified incident's table based on the tag. |
|---|
| 74 | * @param tag a CADDataEnums tag |
|---|
| 75 | * @param incidentId the incident's ID to look up |
|---|
| 76 | * @fields the row of fields to add to the specified table |
|---|
| 77 | * @throws RemoteException |
|---|
| 78 | */ |
|---|
| 79 | public void addCadDataIncidentTable(INC_TABLE tag, int incidentId, String[] fields) throws RemoteException; |
|---|
| 80 | |
|---|
| 81 | /** |
|---|
| 82 | * Returns an object out of Incident based on tag. |
|---|
| 83 | * @param tag a CADDataEnums tag |
|---|
| 84 | * @param incidentId the incident's ID to look up |
|---|
| 85 | * @throws RemoteException |
|---|
| 86 | */ |
|---|
| 87 | public Object getCadDataIncVal(INC_VAL tag, int incidentId) throws RemoteException; |
|---|
| 88 | |
|---|
| 89 | /** |
|---|
| 90 | * Set incidentId's field based on tag to value. |
|---|
| 91 | * @param tag a CADDataEnums tag |
|---|
| 92 | * @param incidentId the incident's ID to look up |
|---|
| 93 | * @throws RemoteException |
|---|
| 94 | */ |
|---|
| 95 | public void setCadDataIncVal(INC_VAL tag, int incidentId, String value) throws RemoteException; |
|---|
| 96 | |
|---|
| 97 | /** |
|---|
| 98 | * Returns a string out of IncidentLocation based on tag. |
|---|
| 99 | * @param tag a CADDataEnums tag |
|---|
| 100 | * @param incidentId the incident's ID to look up |
|---|
| 101 | * @throws RemoteException |
|---|
| 102 | */ |
|---|
| 103 | public String getCadDataIncLoc(INC_LOC tag, int incidentId) throws RemoteException; |
|---|
| 104 | |
|---|
| 105 | /** |
|---|
| 106 | * Set incidentId's field based on tag to value. |
|---|
| 107 | * @param tag a CADDataEnums tag |
|---|
| 108 | * @param incidentId the incident's ID to look up |
|---|
| 109 | * @throws RemoteException |
|---|
| 110 | */ |
|---|
| 111 | public void setCadDataIncLoc(INC_LOC tag, int incidentId, String value) throws RemoteException; |
|---|
| 112 | |
|---|
| 113 | /** |
|---|
| 114 | * Returns a string out of IncidentCaller based on tag. |
|---|
| 115 | * @param tag a CADDataEnums tag |
|---|
| 116 | * @param incidentId the incident's ID to look up |
|---|
| 117 | * @throws RemoteException |
|---|
| 118 | */ |
|---|
| 119 | public String getCadDataIncCaller(INC_CALLER tag, int incidentId) throws RemoteException; |
|---|
| 120 | |
|---|
| 121 | /** |
|---|
| 122 | * Set incidentId's field based on tag to value. |
|---|
| 123 | * @param tag a CADDataEnums tag |
|---|
| 124 | * @param incidentId the incident's ID to look up |
|---|
| 125 | * @throws RemoteException |
|---|
| 126 | */ |
|---|
| 127 | public void setCadDataIncCaller(INC_CALLER tag, int incidentId, String value) throws RemoteException; |
|---|
| 128 | |
|---|
| 129 | /** |
|---|
| 130 | * Returns a string out of IncidentProblem based on tag. |
|---|
| 131 | * @param tag a CADDataEnums tag |
|---|
| 132 | * @param incidentId the incident's ID to look up |
|---|
| 133 | * @throws RemoteException |
|---|
| 134 | */ |
|---|
| 135 | public String getCadDataIncProblem(INC_PROBLEM tag, int incidentId) throws RemoteException; |
|---|
| 136 | |
|---|
| 137 | /** |
|---|
| 138 | * Set incidentId's field based on tag to value. |
|---|
| 139 | * @param tag a CADDataEnums tag |
|---|
| 140 | * @param incidentId the incident's ID to look up |
|---|
| 141 | * @throws RemoteException |
|---|
| 142 | */ |
|---|
| 143 | public void setCadDataIncProblem(INC_PROBLEM tag, int incidentId, String value) throws RemoteException; |
|---|
| 144 | |
|---|
| 145 | /** |
|---|
| 146 | * Returns a string out of IncidentGeneralInfo based on tag. |
|---|
| 147 | * @param tag a CADDataEnums tag |
|---|
| 148 | * @param incidentId the incident's ID to look up |
|---|
| 149 | * @throws RemoteException |
|---|
| 150 | */ |
|---|
| 151 | public String getCadDataIncGenInfo(INC_GEN_INFO tag, int incidentId) throws RemoteException; |
|---|
| 152 | |
|---|
| 153 | /** |
|---|
| 154 | * Set incidentId's field based on tag to value. |
|---|
| 155 | * @param tag a CADDataEnums tag |
|---|
| 156 | * @param incidentId the incident's ID to look up |
|---|
| 157 | * @throws RemoteException |
|---|
| 158 | */ |
|---|
| 159 | public void setCadDataIncGenInfo(INC_GEN_INFO tag, int incidentId, String value) throws RemoteException; |
|---|
| 160 | |
|---|
| 161 | /** |
|---|
| 162 | * Returns a string out of IncidentResponse based on tag. |
|---|
| 163 | * @param tag a CADDataEnums tag |
|---|
| 164 | * @param incidentId the incident's ID to look up |
|---|
| 165 | * @throws RemoteException |
|---|
| 166 | */ |
|---|
| 167 | public String getCadDataIncResp(INC_RESP tag, int incidentId) throws RemoteException; |
|---|
| 168 | |
|---|
| 169 | /** |
|---|
| 170 | * Set incidentId's field based on tag to value. |
|---|
| 171 | * @param tag a CADDataEnums tag |
|---|
| 172 | * @param incidentId the incident's ID to look up |
|---|
| 173 | * @throws RemoteException |
|---|
| 174 | */ |
|---|
| 175 | public void setCadDataIncResp(INC_RESP tag, int incidentId, String value) throws RemoteException; |
|---|
| 176 | |
|---|
| 177 | /** |
|---|
| 178 | * Returns a string out of IncidentAdditionalInfo based on tag. |
|---|
| 179 | * @param tag a CADDataEnums tag |
|---|
| 180 | * @param incidentId the incident's ID to look up |
|---|
| 181 | * @throws RemoteException |
|---|
| 182 | */ |
|---|
| 183 | public String getCadDataIncAddInfo(INC_ADD_INFO tag, int incidentId) throws RemoteException; |
|---|
| 184 | |
|---|
| 185 | /** |
|---|
| 186 | * Set incidentId's field based on tag to value. |
|---|
| 187 | * @param tag a CADDataEnums tag |
|---|
| 188 | * @param incidentId the incident's ID to look up |
|---|
| 189 | * @throws RemoteException |
|---|
| 190 | */ |
|---|
| 191 | public void setCadDataIncAddInfo(INC_ADD_INFO tag, int incidentId, String value) throws RemoteException; |
|---|
| 192 | |
|---|
| 193 | /** |
|---|
| 194 | * Returns a string out of IncidentActivities based on tag. |
|---|
| 195 | * @param tag a CADDataEnums tag |
|---|
| 196 | * @param incidentId the incident's ID to look up |
|---|
| 197 | * @throws RemoteException |
|---|
| 198 | */ |
|---|
| 199 | public String getCadDataIncActivities(INC_ACTIVITIES tag, int incidentId) throws RemoteException; |
|---|
| 200 | |
|---|
| 201 | /** |
|---|
| 202 | * Set incidentId's field based on tag to value. |
|---|
| 203 | * @param tag a CADDataEnums tag |
|---|
| 204 | * @param incidentId the incident's ID to look up |
|---|
| 205 | * @throws RemoteException |
|---|
| 206 | */ |
|---|
| 207 | public void setCadDataIncActivities(INC_ACTIVITIES tag, int incidentId, String value) throws RemoteException; |
|---|
| 208 | |
|---|
| 209 | /** |
|---|
| 210 | * Returns a string out of IncidentCallback based on tag. |
|---|
| 211 | * @param tag a CADDataEnums tag |
|---|
| 212 | * @param incidentId the incident's ID to look up |
|---|
| 213 | * @throws RemoteException |
|---|
| 214 | */ |
|---|
| 215 | public String getCadDataIncCallBack(INC_CALLBACK tag, int incidentId) throws RemoteException; |
|---|
| 216 | |
|---|
| 217 | /** |
|---|
| 218 | * Returns a string out of IncidentEditLog based on tag. |
|---|
| 219 | * @param tag a CADDataEnums tag |
|---|
| 220 | * @param incidentId the incident's ID to look up |
|---|
| 221 | * @throws RemoteException |
|---|
| 222 | */ |
|---|
| 223 | public String getCadDataIncEditLog(INC_EDIT_LOG tag, int incidentId) throws RemoteException; |
|---|
| 224 | |
|---|
| 225 | /** |
|---|
| 226 | * Returns a string out of IncidentInfo based on tag. |
|---|
| 227 | * @param tag a CADDataEnums tag |
|---|
| 228 | * @param incidentId the incident's ID to look up |
|---|
| 229 | * @throws RemoteException |
|---|
| 230 | */ |
|---|
| 231 | public String getCadDataIncInfo(INC_INFO tag, int incidentId) throws RemoteException; |
|---|
| 232 | |
|---|
| 233 | /** |
|---|
| 234 | * Returns a string out of IncidentTimes based on tag. |
|---|
| 235 | * @param tag a CADDataEnums tag |
|---|
| 236 | * @param incidentId the incident's ID to look up |
|---|
| 237 | * @throws RemoteException |
|---|
| 238 | */ |
|---|
| 239 | public String getCadDataIncTimes(INC_TIMES tag, int incidentId) throws RemoteException; |
|---|
| 240 | |
|---|
| 241 | /** |
|---|
| 242 | * Returns a CardfileList matching the tag. |
|---|
| 243 | */ |
|---|
| 244 | public CardfileList getCardfileList(CARDFILE tag) throws RemoteException; |
|---|
| 245 | |
|---|
| 246 | /** |
|---|
| 247 | * Receives the fields of the ChangeLog in Cardfile.java and uses those fields |
|---|
| 248 | * to make changes to its own copy of the Cardfiledata. |
|---|
| 249 | */ |
|---|
| 250 | public void editCardfile(ChangeLog log) throws RemoteException; |
|---|
| 251 | |
|---|
| 252 | /** |
|---|
| 253 | * Obtain a new unique ID for a cardfileDataObject. |
|---|
| 254 | */ |
|---|
| 255 | public int obtainNewUniqueId() throws RemoteException; |
|---|
| 256 | |
|---|
| 257 | /** |
|---|
| 258 | * Returns the unitNum's status. |
|---|
| 259 | * @param unitNum the unitNum to look up |
|---|
| 260 | * @throws RemoteException |
|---|
| 261 | */ |
|---|
| 262 | public UnitStatusEnums getCadDataUnitStatus(String unitNum) throws RemoteException; |
|---|
| 263 | |
|---|
| 264 | /** |
|---|
| 265 | * Returns a string field from Unit based on tag. |
|---|
| 266 | * @param tag a CADScriptTags tag |
|---|
| 267 | * @param unitNum the unitNum to look up |
|---|
| 268 | * @return A string value |
|---|
| 269 | * @throws RemoteException |
|---|
| 270 | */ |
|---|
| 271 | public String getCadDataUnitValue(String unitNum, CADScriptTags.UNIT_TAGS tag) throws RemoteException; |
|---|
| 272 | |
|---|
| 273 | /** |
|---|
| 274 | * Sets a field from Unit based on tag. |
|---|
| 275 | * @param tag a CADScriptTags tag |
|---|
| 276 | * @param unitNum the unitNum to look up |
|---|
| 277 | * @param value the new value to be set |
|---|
| 278 | * @throws RemoteException |
|---|
| 279 | */ |
|---|
| 280 | public void setCadDataUnitValue(String unitNum, UNIT_TAGS tag, Object value) throws RemoteException; |
|---|
| 281 | |
|---|
| 282 | /** |
|---|
| 283 | * Assigns a unit to the specified incident. |
|---|
| 284 | * @param unitNum the unitNum to look up |
|---|
| 285 | * @param id the incident id that this unit is assigned to. |
|---|
| 286 | * @throws RemoteException |
|---|
| 287 | */ |
|---|
| 288 | public void setCadDataUnitAssignedId(String unitNum, int id) throws RemoteException; |
|---|
| 289 | |
|---|
| 290 | /** |
|---|
| 291 | * Adds a unit to the incident's list of assigned units. |
|---|
| 292 | * @param incidentId the incident |
|---|
| 293 | * @param assignedUnitNum the unit that's been assigned to the incident |
|---|
| 294 | * @throws RemoteException |
|---|
| 295 | */ |
|---|
| 296 | public void addCadDataIncidentAssignedUnitNum(int incidentId, String assignedUnitNum) throws RemoteException; |
|---|
| 297 | |
|---|
| 298 | /** |
|---|
| 299 | * Sets the specified incident to the specified status. |
|---|
| 300 | * @param incidentId the incident |
|---|
| 301 | * @param status the status of the incident |
|---|
| 302 | * @throws RemoteException |
|---|
| 303 | */ |
|---|
| 304 | public void setCadDataIncidentStatus(int incidentId, IncidentEnums status) throws RemoteException; |
|---|
| 305 | |
|---|
| 306 | /** |
|---|
| 307 | * Returns a LinkedList containing entries that match the search string. |
|---|
| 308 | * @param search the string entry to be searched |
|---|
| 309 | * @return linked list of CardfileDataObjects matching search |
|---|
| 310 | */ |
|---|
| 311 | public LinkedList<CardfileDataObject> getSearchList(String search) throws RemoteException; |
|---|
| 312 | |
|---|
| 313 | /** Convenience method for clients to get current ATMS time. |
|---|
| 314 | * |
|---|
| 315 | * @return current ATMS time in milliseconds. |
|---|
| 316 | */ |
|---|
| 317 | public long getATMStime() throws RemoteException; |
|---|
| 318 | } |
|---|
| 319 | |
|---|