Class JsonSchemaSocketService

java.lang.Object
jmri.server.json.JsonSocketService<JsonSchemaHttpService>
jmri.server.json.schema.JsonSchemaSocketService

public class JsonSchemaSocketService
extends JsonSocketService<JsonSchemaHttpService>
JSON Service to provide schema data for the running JSON server.
  • Constructor Details

  • Method Details

    • onMessage

      public void onMessage​(String type, com.fasterxml.jackson.databind.JsonNode data, JsonRequest request) throws IOException, JmriException, JsonException
      Description copied from class: JsonSocketService
      Handle an inbound message.
      Specified by:
      onMessage in class JsonSocketService<JsonSchemaHttpService>
      Parameters:
      type - The service type; if the implementing service responds to multiple types, it will need to use this to handle data correctly
      data - JSON data; the contents of this will depend on the implementing service
      request - The JSON request
      Throws:
      IOException - Thrown if the service cannot send a response; this will cause the JSON Server to close its connection to the client if open
      JmriException - Thrown if the request cannot be handled; throwing this will cause the JSON Server to pass a 500 UnsupportedOperation message to the client
      JsonException - Thrown if the service needs to pass an error message back to the client
    • onList

      public void onList​(String type, com.fasterxml.jackson.databind.JsonNode data, JsonRequest request) throws IOException, JmriException, JsonException
      Description copied from class: JsonSocketService
      Handle a request for a list of objects. Note that this should not create listeners for items in the list, but should only create listeners for the object providing the list, if applicable.
      Specified by:
      onList in class JsonSocketService<JsonSchemaHttpService>
      Parameters:
      type - The service type; if the implementing service responds to multiple types, it will need to use this to handle data correctly
      data - JSON data; the contents of this will depend on the implementing service
      request - The JSON request
      Throws:
      IOException - Thrown if the service cannot send a response; this will cause the JSON Server to close its connection to the client if open
      JmriException - Thrown if the request cannot be handled; throwing this will cause the JSON Server to pass a 500 UnsupportedOperation message to the client
      JsonException - If the service needs to pass an error message back to the client; implementing services may throw a JsonException with code 400 and the localized message "UnlistableService" to indicate that type should not be listed
    • onClose

      public void onClose()
      Description copied from class: JsonSocketService
      Perform any teardown required when closing a connection.
      Specified by:
      onClose in class JsonSocketService<JsonSchemaHttpService>