Interface ServiceBase
-
- All Known Subinterfaces:
GenericMultiTypeService,MonitoringService,Service,UpdatingMonitoringService
- All Known Implementing Classes:
AbstractProcessService,AbstractPythonProcessService,AbstractRestProcessService,AbstractRunnablesService,AbstractService,AbstractStringProcessService,ConnectorServiceWrapper,DefaultServiceImpl,FamilyServiceStub,MockingConnectorServiceWrapper,PythonAsyncProcessService,PythonSyncProcessService,ServiceStub,TraceToAasService
public interface ServiceBaseJust the very basics needed to do service switching.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAPPLICATION_SEPARATORstatic java.lang.StringDEFAULT_APPLICATION_INSTANCE_ID
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static java.lang.StringcomposeId(java.lang.String serviceId, java.lang.String applicationId)Composes an (internal) id from a service and an application id.static java.lang.StringcomposeId(java.lang.String serviceId, java.lang.String applicationId, java.lang.String applicationInstanceId)Composes an (internal) id from a service and an application id.static java.lang.StringgetApplicationId(java.lang.String id)Returns the application id from an (internal) id.static java.lang.StringgetApplicationInstanceId(java.lang.String id)Returns the application instance id from an (internal) id.java.lang.StringgetId()Returns the unique id of the service.static java.lang.StringgetServiceId(java.lang.String id)Returns the service id from an (internal) id.ServiceStategetState()Returns the state the service is currently in.voidsetState(ServiceState state)Changes the state.static java.lang.StringvalidateApplicationInstanceId(java.lang.String appInstanceId)Validates an application instance id.
-
-
-
Field Detail
-
APPLICATION_SEPARATOR
static final java.lang.String APPLICATION_SEPARATOR
- See Also:
- Constant Field Values
-
DEFAULT_APPLICATION_INSTANCE_ID
static final java.lang.String DEFAULT_APPLICATION_INSTANCE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
java.lang.String getId()
Returns the unique id of the service. May be a single service id, a service id and a postfixed application id (afterAPPLICATION_SEPARATOR) or a service id with application id and postfixed application instance id (afterAPPLICATION_SEPARATOR)- Returns:
- the unique id
-
getState
ServiceState getState()
Returns the state the service is currently in. [R4c]- Returns:
- the state
-
setState
void setState(ServiceState state) throws java.util.concurrent.ExecutionException
Changes the state. [R133c]- Parameters:
state- the new state- Throws:
java.util.concurrent.ExecutionException- if changing the state fails for some reason
-
getServiceId
static java.lang.String getServiceId(java.lang.String id)
Returns the service id from an (internal) id.- Parameters:
id- the id to split- Returns:
- the service id, may be
idif there is no application id - See Also:
composeId(String, String),composeId(String, String, String)
-
getApplicationId
static java.lang.String getApplicationId(java.lang.String id)
Returns the application id from an (internal) id.- Parameters:
id- the id to split- Returns:
- the application id, may be empty if there is none
- See Also:
composeId(String, String),composeId(String, String, String)
-
getApplicationInstanceId
static java.lang.String getApplicationInstanceId(java.lang.String id)
Returns the application instance id from an (internal) id.- Parameters:
id- the id to split- Returns:
- the application id, may be empty if there is none
- See Also:
composeId(String, String),composeId(String, String, String)
-
validateApplicationInstanceId
static java.lang.String validateApplicationInstanceId(java.lang.String appInstanceId)
Validates an application instance id.- Parameters:
appInstanceId- the id to validate- Returns:
- the validated id, if
appInstanceIdwould be null or empty,DEFAULT_APPLICATION_INSTANCE_IDis returned
-
composeId
static java.lang.String composeId(java.lang.String serviceId, java.lang.String applicationId)Composes an (internal) id from a service and an application id.- Parameters:
serviceId- the service idapplicationId- the application id, may be null or empty for none,APPLICATION_SEPARATORinapplicationIdwill be removed- Returns:
- the composed id
-
composeId
static java.lang.String composeId(java.lang.String serviceId, java.lang.String applicationId, java.lang.String applicationInstanceId)Composes an (internal) id from a service and an application id.- Parameters:
serviceId- the service id,APPLICATION_SEPARATORinserviceIdwill be removedapplicationId- the application id, may be null or empty for none,APPLICATION_SEPARATORinapplicationIdwill be removedapplicationInstanceId- the application instance id, may be null or empty for none, used only ifapplicationIdis given,APPLICATION_SEPARATORinapplicationInstanceIdwill be removed- Returns:
- the composed id
-
-