Interface Service
-
- All Superinterfaces:
ParameterConfigurerProvider,ServiceBase
- All Known Subinterfaces:
GenericMultiTypeService,MonitoringService,UpdatingMonitoringService
- All Known Implementing Classes:
AbstractProcessService,AbstractPythonProcessService,AbstractRestProcessService,AbstractRunnablesService,AbstractService,AbstractStringProcessService,ConnectorServiceWrapper,DefaultServiceImpl,FamilyServiceStub,MockingConnectorServiceWrapper,PythonAsyncProcessService,PythonSyncProcessService,ServiceStub,TraceToAasService
public interface Service extends ParameterConfigurerProvider, ServiceBase
Defines the (administrative) interface of an IIP-Ecosphere service.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
-
Fields inherited from interface de.iip_ecosphere.platform.services.environment.switching.ServiceBase
APPLICATION_SEPARATOR, DEFAULT_APPLICATION_INSTANCE_ID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidactivate()Activates the service.java.lang.StringgetDescription()The description of the service.ServiceKindgetKind()Returns the service kind.java.lang.StringgetName()The name of the service.default de.iip_ecosphere.platform.support.ServerAddressgetNetMgtKeyAddress()Returns the resolved network address of the netMgtKey specified in the service descriptor.default ParameterConfigurer<?>getParameterConfigurer(java.lang.String paramName)Returns the parameter configurer for a given parameter.default java.util.Set<java.lang.String>getParameterNames()The set of parameter names.de.iip_ecosphere.platform.support.iip_aas.VersiongetVersion()The version of the service.booleanisDeployable()Returns whether the service is deployable in distributable manner or fixed in deployment location.booleanisTopLevel()Returns whether the service is a top-level service.voidmigrate(java.lang.String resourceId)Migrates a service.voidpassivate()Passivates the service.voidreconfigure(java.util.Map<java.lang.String,java.lang.String> values)Reconfigures the service.voidswitchTo(java.lang.String targetId)Switches to an interface-compatible service.voidupdate(java.net.URI location)Updates the service by the service in the givenlocation.-
Methods inherited from interface de.iip_ecosphere.platform.services.environment.switching.ServiceBase
getId, getState, setState
-
-
-
-
Method Detail
-
getName
java.lang.String getName()
The name of the service.- Returns:
- the name
-
getVersion
de.iip_ecosphere.platform.support.iip_aas.Version getVersion()
The version of the service.- Returns:
- the version
-
getDescription
java.lang.String getDescription()
The description of the service.- Returns:
- the description, may be empty
-
isDeployable
boolean isDeployable()
Returns whether the service is deployable in distributable manner or fixed in deployment location.- Returns:
truefor deployable,falsefor fixed
-
isTopLevel
boolean isTopLevel()
Returns whether the service is a top-level service.- Returns:
truefor top-level,falsefor nested
-
getKind
ServiceKind getKind()
Returns the service kind.- Returns:
- the service kind
-
getNetMgtKeyAddress
default de.iip_ecosphere.platform.support.ServerAddress getNetMgtKeyAddress()
Returns the resolved network address of the netMgtKey specified in the service descriptor.- Returns:
- the resolved address, may be null in particular if no key was specified in the service descriptor
-
migrate
void migrate(java.lang.String resourceId) throws java.util.concurrent.ExecutionExceptionMigrates a service. However, it may be required to migrate/move the containing artifact. [adaptation]- Parameters:
resourceId- the target resource id, e.g., a device- Throws:
java.util.concurrent.ExecutionException- if migration fails
-
update
void update(java.net.URI location) throws java.util.concurrent.ExecutionExceptionUpdates the service by the service in the givenlocation. This operation is responsible for stopping the running service (if needed), replacing it, starting the new service.- Parameters:
location- the location of the new service, e.g., an URL- Throws:
java.util.concurrent.ExecutionException- if the given service cannot be updated for some reason, e.g., because the replacement service is not an evolved version of the running service
-
switchTo
void switchTo(java.lang.String targetId) throws java.util.concurrent.ExecutionExceptionSwitches to an interface-compatible service. This method cares for stopping the old service, performing a handover if adequate, starting thetargetservice. [adaptation]- Parameters:
targetId- the id of the target service- Throws:
java.util.concurrent.ExecutionException- if switching the service cannot be performed for some reason
-
activate
void activate() throws java.util.concurrent.ExecutionExceptionActivates the service. [adaptation]- Throws:
java.util.concurrent.ExecutionException- in case that activating fails, e.g., because the service is already active
-
passivate
void passivate() throws java.util.concurrent.ExecutionExceptionPassivates the service. [adaptation]- Throws:
java.util.concurrent.ExecutionException- in case that passivating fails, e.g., because the service is already passive
-
reconfigure
void reconfigure(java.util.Map<java.lang.String,java.lang.String> values) throws java.util.concurrent.ExecutionExceptionReconfigures the service. [adaptation]- Parameters:
values- the (service-specific) name-value mapping that shall lead to a reconfiguration of the service; values come either as primitive values or as JSON structures complying with the parameter descriptor. The service is responsible for correct JSON de-serialization according to the respective descriptor.- Throws:
java.util.concurrent.ExecutionException- if reconfiguration fails
-
getParameterConfigurer
default ParameterConfigurer<?> getParameterConfigurer(java.lang.String paramName)
Description copied from interface:ParameterConfigurerProviderReturns the parameter configurer for a given parameter. We need this generic approach to ease code generation and initial setting of parameter values.- Specified by:
getParameterConfigurerin interfaceParameterConfigurerProvider- Parameters:
paramName- the name of the parameter- Returns:
- the associated parameter configurer or null if there is none
-
getParameterNames
default java.util.Set<java.lang.String> getParameterNames()
Description copied from interface:ParameterConfigurerProviderThe set of parameter names.- Specified by:
getParameterNamesin interfaceParameterConfigurerProvider- Returns:
- the parameter names, may be null for none
-
-