public interface ServiceDefinition
ServiceHandler
for the service.
It provides the application with the name of the service, the unique ID of
the service, the service type
and the
configured parameters for the service as well as a SharedConfig
for the service if one has been defined. This is passed to the
GatewayApplication
factory methods when adding services.
Modifier and Type | Method and Description |
---|---|
UUID |
getId()
Returns the service identifier.
|
Map<String,Object> |
getParameters()
Returns the configured parameters for the service, defined in the
application section of the service configuration.
|
String |
getServiceName()
Returns the service name.
|
ServiceType |
getServiceType()
Returns the service type.
|
SharedConfig |
getSharedConfig()
Returns the
SharedConfig for the service. |
String getServiceName()
The service name uniquely identifies an instance of a service that is
configured according to the schema of the ServiceType
named by
getServiceType()
.
UUID getId()
The service id uniquely identifies an instance of a service that is created by the framework. ID of a service instance is set when it is created and changes when the service is updated. This can be used to internally identify different service objects with same names.
ServiceType getServiceType()
The service type will be one of those provided by the
GatewayApplication
via its
getApplicationDetails
method.
SharedConfig getSharedConfig()
SharedConfig
for the service.
If the service configuration specified a sharedConfig name then this will return the corresponding sharedConfig with its parameters.
Map<String,Object> getParameters()
The parameters are passed as a map of String keys and Object values which represent the application specific JSON configuration object.
The types of the map values will depend upon the configuration structures. For a simple JSON object with all String values, the values would be of type String. For other JSON primitive value types the value types could be String, Integer, Double etc. For more complex JSON structures the type could be List (for a JSON array) or Map (for a JSON object} and these could have values of any of the previously mentioned types.
Copyright © 2024 DiffusionData Limited. All rights reserved.