Package de.tudresden.sumo.util
Class Query
java.lang.Object
de.tudresden.sumo.util.Observable
de.tudresden.sumo.util.Query
- Direct Known Subclasses:
- CloseQuery,- CommandProcessor
The Class Query.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddoClose()Disconnect client from the sumo server.protected ResponseMessagedoQuery(RequestMessage msg) Sends a request message to SUMO and returns a response message.protected ResponseContainerdoQuerySingle(Command request) LikedoQuery(RequestMessage), but good for one-command/ one-response queries.protected voiddoSetOrder(int index) Set multi-client ordering index.protected voiddoSimulationStep(double targetTime) Do next time step and update subscription results.protected voidfireAndForget(Command request) fireAndForget function.Gets the out stream.protected ResponseMessagequeryAndVerify(RequestMessage reqMsg) LikedoQuery(RequestMessage); in addition, verifies that all responses are successful and and the statuses match the requests.protected ResponseContainerqueryAndVerifySingle(Command request) LikequeryAndVerify(RequestMessage), but good for one-command/ one-response queries.protected static voidVerify.protected static voidVerify.protected static voidVerify.protected static StringverifyGetVarResponse(Command resp, int commandID, int variable, String objectID) Verify get var response.Methods inherited from class de.tudresden.sumo.util.ObservableaddObserver, notifyObservers
- 
Constructor Details- 
QueryInstantiates a new query.- Parameters:
- sock- the sock
- Throws:
- IOException- Signals that an I/O exception has occurred.
 
 
- 
- 
Method Details- 
doQuerySends a request message to SUMO and returns a response message.- Parameters:
- msg- the msg
- Returns:
- the response message
- Throws:
- IOException- Signals that an I/O exception has occurred.
 
- 
queryAndVerifyLikedoQuery(RequestMessage); in addition, verifies that all responses are successful and and the statuses match the requests.- Parameters:
- reqMsg- the req msg
- Returns:
- the verified response message
- Throws:
- IOException- Signals that an I/O exception has occurred.
- See Also:
 
- 
doQuerySingleLikedoQuery(RequestMessage), but good for one-command/ one-response queries.- Parameters:
- request- the request
- Returns:
- the response container
- Throws:
- IOException- Signals that an I/O exception has occurred.
 
- 
doSetOrderSet multi-client ordering index.- Parameters:
- index- the index
- Throws:
- IOException- Signals that an I/O exception has occurred.
 
- 
doCloseDisconnect client from the sumo server.- Throws:
- IOException- Signals that an I/O exception has occurred.
 
- 
doSimulationStepDo next time step and update subscription results.- Parameters:
- targetTime- the target time
- Throws:
- IOException- Signals that an I/O exception has occurred.
 
- 
queryAndVerifySingleLikequeryAndVerify(RequestMessage), but good for one-command/ one-response queries.- Parameters:
- request- the request
- Returns:
- the response container for the specified request
- Throws:
- IOException- Signals that an I/O exception has occurred.
 
- 
fireAndForgetfireAndForget function.- Parameters:
- request- the request
 
- 
verifyGetVarResponseprotected static String verifyGetVarResponse(Command resp, int commandID, int variable, String objectID) throws TraCIException.UnexpectedData Verify get var response.- Parameters:
- resp- the resp
- commandID- the command ID
- variable- the variable
- objectID- the object ID
- Returns:
- the string
- Throws:
- TraCIException.UnexpectedData- the unexpected data
 
- 
verifyprotected static void verify(String description, Object expected, Object actual) throws TraCIException.UnexpectedData Verify.- Parameters:
- description- the description
- expected- the expected
- actual- the actual
- Throws:
- TraCIException.UnexpectedData- the unexpected data
 
- 
verifyprotected static void verify(String description, int expected, short actual) throws TraCIException.UnexpectedData Verify.- Parameters:
- description- the description
- expected- the expected
- actual- the actual
- Throws:
- TraCIException.UnexpectedData- the unexpected data
 
- 
verifyprotected static void verify(String description, int expected, byte actual) throws TraCIException.UnexpectedData Verify.- Parameters:
- description- the description
- expected- the expected
- actual- the actual
- Throws:
- TraCIException.UnexpectedData- the unexpected data
 
- 
getOutStreamGets the out stream.- Returns:
- the out stream
 
 
-