Package jmri.server.json.operations
Class JsonOperationsServiceFactory
- java.lang.Object
-
- jmri.server.json.operations.JsonOperationsServiceFactory
-
- All Implemented Interfaces:
JmriServiceProviderInterface
,JsonServiceFactory<JsonOperationsHttpService,JsonOperationsSocketService>
public class JsonOperationsServiceFactory extends java.lang.Object implements JsonServiceFactory<JsonOperationsHttpService,JsonOperationsSocketService>
Service factory for the JSON Operations services.
-
-
Constructor Summary
Constructors Constructor Description JsonOperationsServiceFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonOperationsHttpService
getHttpService(com.fasterxml.jackson.databind.ObjectMapper mapper, java.lang.String version)
Create a JSON HTTP service.JsonOperationsSocketService
getSocketService(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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.spi.JsonServiceFactory
getReceivedTypes, getSentTypes
-
-
-
-
Constructor Detail
-
JsonOperationsServiceFactory
public JsonOperationsServiceFactory()
-
-
Method Detail
-
getTypes
public java.lang.String[] getTypes(java.lang.String version)
Description copied from interface:JsonServiceFactory
Get 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:
getTypes
in interfaceJsonServiceFactory<JsonOperationsHttpService,JsonOperationsSocketService>
- Parameters:
version
- The JSON protocol version major component identifier- Returns:
- An array of types this service responds to
-
getSocketService
public JsonOperationsSocketService getSocketService(JsonConnection connection, java.lang.String version)
Description copied from interface:JsonServiceFactory
Create a JSON service for the given connection. This connection can be a WebSocket or raw socket.- Specified by:
getSocketService
in interfaceJsonServiceFactory<JsonOperationsHttpService,JsonOperationsSocketService>
- Parameters:
connection
- The connection for this service to respond toversion
- The JSON protocol version major component identifier- Returns:
- A service or null if the service does not support sockets
-
getHttpService
public JsonOperationsHttpService getHttpService(com.fasterxml.jackson.databind.ObjectMapper mapper, java.lang.String version)
Description copied from interface:JsonServiceFactory
Create a JSON HTTP service.- Specified by:
getHttpService
in interfaceJsonServiceFactory<JsonOperationsHttpService,JsonOperationsSocketService>
- Parameters:
mapper
- The object mapper for the HTTP service to useversion
- The JSON protocol version major component identifier- Returns:
- A servlet or null if the service does not support HTTP
-
-