Package jmri.server.json
Class JsonClientHandler
java.lang.Object
jmri.server.json.JsonClientHandler
Handler for JSON messages from a TCP socket or WebSocket client.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhen used as a parameter toonMessage(java.lang.String), will cause a "hello" message to be sent to the client. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
HELLO_MSG
When used as a parameter toonMessage(java.lang.String), will cause a "hello" message to be sent to the client.- See Also:
-
-
Constructor Details
-
JsonClientHandler
-
-
Method Details
-
onClose
-
onMessage
Process a JSON string and handle appropriately.See
jmri.server.jsonfor expected JSON objects.- Parameters:
string- the message- Throws:
IOException- if communications with the client is broken- See Also:
-
onMessage
Process a JSON node and handle appropriately.See
jmri.server.jsonfor expected JSON objects.- Parameters:
root- the JSON node.- Throws:
IOException- if communications with the client is broken- See Also:
-
getServices
-