Class ClientCommunicator
java.lang.Object
ch.autumo.beetroot.server.communication.Communicator
ch.autumo.beetroot.server.communication.ClientCommunicator
Client communicator.
-
Field Summary
Fields inherited from class ch.autumo.beetroot.server.communication.Communicator
CMD_FILE_DELETE, CMD_FILE_RECEIVE_REQUEST, CMD_FILE_REQUEST, CMD_HEALTH, CMD_STOP, HTTP_HEADER_ACCEPT_JSON, HTTP_HEADER_CONTENTTYPE_JSON_UTF8, LOG, MAX_MSG_SIZE, TIMEOUT, USER_AGENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientAnswerRead an answer from the server client side.static voidreInit()Re-initialize client communicator.static ClientAnswersendServerCommand(ServerCommand command) Send a server command client side.Methods inherited from class ch.autumo.beetroot.server.communication.Communicator
checkHttpResponse, isInternalCommand, read, readCommand, readJsonCommand, safeClose, writeAnswer
-
Constructor Details
-
ClientCommunicator
public ClientCommunicator()
-
-
Method Details
-
reInit
public static void reInit()Re-initialize client communicator. -
sendServerCommand
Send a server command client side.- Parameters:
command- server command- Returns:
- client answer
- Throws:
Exception- exception
-
readAnswer
Read an answer from the server client side.- Parameters:
in- input stream- Returns:
- client answer or null, if answer received was invalid
- Throws:
IOException- IO exception
-