Package jmri.server.json.util
Class JsonUtilServiceFactory
- java.lang.Object
- 
- jmri.server.json.util.JsonUtilServiceFactory
 
- 
- All Implemented Interfaces:
- JmriServiceProviderInterface,- JsonServiceFactory<JsonUtilHttpService,JsonUtilSocketService>
 
 public class JsonUtilServiceFactory extends java.lang.Object implements JsonServiceFactory<JsonUtilHttpService,JsonUtilSocketService> 
- 
- 
Constructor SummaryConstructors Constructor Description JsonUtilServiceFactory()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonUtilHttpServicegetHttpService(com.fasterxml.jackson.databind.ObjectMapper mapper, java.lang.String version)Create a JSON HTTP service.java.lang.String[]getReceivedTypes(java.lang.String version)Get the message type(s) services created by this factory receive, if not also listed inJsonServiceFactory.getTypes(String).java.lang.String[]getSentTypes(java.lang.String version)Get the message type(s) services created by this factory send, if not also listed inJsonServiceFactory.getTypes(String).JsonUtilSocketServicegetSocketService(JsonConnection connection, java.lang.String version)Create a JSON service for the given connection.java.lang.String[]getTypes(java.lang.String version)Get the service type(s) for services created by this factory respond to.
 
- 
- 
- 
Constructor Detail- 
JsonUtilServiceFactorypublic JsonUtilServiceFactory() 
 
- 
 - 
Method Detail- 
getTypespublic java.lang.String[] getTypes(java.lang.String version) Description copied from interface:JsonServiceFactoryGet the service type(s) for services created by this factory respond to. These type must have valid schemas for messages received from a client and sent to a client.Types should be single words, in camelCase if needed, unless supporting a plural noun introduced in the JSON 1.x or 2.x protocols and exposed in the JSON 3.0 or newer protocol. If a service returns no types, it will never be used. - Specified by:
- getTypesin interface- JsonServiceFactory<JsonUtilHttpService,JsonUtilSocketService>
- Parameters:
- version- The JSON protocol version major component identifier
- Returns:
- An array of types this service responds to
 
 - 
getSentTypespublic java.lang.String[] getSentTypes(java.lang.String version) Description copied from interface:JsonServiceFactoryGet the message type(s) services created by this factory send, if not also listed inJsonServiceFactory.getTypes(String). These types must only have schemas for messages sent to a client.Types should be single words, in camelCase if needed, unless supporting a plural noun introduced in the JSON 1.x or 2.x protocols and exposed in the JSON 3.0 or newer protocol. - Specified by:
- getSentTypesin interface- JsonServiceFactory<JsonUtilHttpService,JsonUtilSocketService>
- Parameters:
- version- The JSON protocol version major component identifier
- Returns:
- An array of types this service sends, but does not respond to
 
 - 
getReceivedTypespublic java.lang.String[] getReceivedTypes(java.lang.String version) Description copied from interface:JsonServiceFactoryGet the message type(s) services created by this factory receive, if not also listed inJsonServiceFactory.getTypes(String). These types must only have schemas for messages received from a client.Types should be single words, in camelCase if needed, unless supporting a plural noun introduced in the JSON 1.x or 2.x protocols and exposed in the JSON 3.0 or newer protocol. - Specified by:
- getReceivedTypesin interface- JsonServiceFactory<JsonUtilHttpService,JsonUtilSocketService>
- Parameters:
- version- The JSON protocol version major component identifier
- Returns:
- An array of types this service sends, but does not respond to
 
 - 
getSocketServicepublic JsonUtilSocketService getSocketService(JsonConnection connection, java.lang.String version) Description copied from interface:JsonServiceFactoryCreate a JSON service for the given connection. This connection can be a WebSocket or raw socket.- Specified by:
- getSocketServicein interface- JsonServiceFactory<JsonUtilHttpService,JsonUtilSocketService>
- Parameters:
- connection- The connection for this service to respond to
- version- The JSON protocol version major component identifier
- Returns:
- A service or null if the service does not support sockets
 
 - 
getHttpServicepublic JsonUtilHttpService getHttpService(com.fasterxml.jackson.databind.ObjectMapper mapper, java.lang.String version) Description copied from interface:JsonServiceFactoryCreate a JSON HTTP service.- Specified by:
- getHttpServicein interface- JsonServiceFactory<JsonUtilHttpService,JsonUtilSocketService>
- Parameters:
- mapper- The object mapper for the HTTP service to use
- version- The JSON protocol version major component identifier
- Returns:
- A servlet or null if the service does not support HTTP
 
 
- 
 
-