Class EcsAasClient
java.lang.Object
de.iip_ecosphere.platform.support.iip_aas.SubmodelClient
de.iip_ecosphere.platform.support.iip_aas.SubmodelElementsCollectionClient
de.iip_ecosphere.platform.ecsRuntime.EcsAasClient
- All Implemented Interfaces:
ContainerOperations,DeviceManagementOperations,EcsClient
public class EcsAasClient
extends de.iip_ecosphere.platform.support.iip_aas.SubmodelElementsCollectionClient
implements EcsClient
A client for
EcsAas for accessing the operations provided by a certain resource.- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields inherited from interface de.iip_ecosphere.platform.ecsRuntime.ContainerOperations
EXC_ALREADY_KNOWN -
Constructor Summary
ConstructorsConstructorDescriptionEcsAasClient(String resourceId) Creates a client instance based on a deployed IIP-AAS fromAasPartRegistrybased on a submodel withresources. -
Method Summary
Modifier and TypeMethodDescriptionaddContainer(URI location) Adds a container to the management domain of this instance, e.g., by downloading it from a container registry.addContainerAsTask(String taskId, URI location) LikeContainerOperations.addContainer(URI)but tracked by ataskId.de.iip_ecosphere.platform.deviceMgt.CredentialsCreates connection details (Credentials), a pair of username and a password for the active remote access server.de.iip_ecosphere.platform.support.aas.SubmodelElementCollectionReturns the collection with all containers of the resources this client was created for.Returns the name of the underlying container system, e.g.Returns the version of the underlying container system.Returns the container id for a given container location as used inContainerOperations.addContainer(URI).Gets the runtimeName of the device.Gets the runtimeVersion of the device.Returns the state of the container.voidmigrateContainer(String id, String resourceId) Migrates the container.voidstartContainer(String id) Starts a container.voidstartContainerAsTask(String taskId, String id) LikeContainerOperations.startContainer(String)but tracked by ataskId.voidstopContainer(String id) Stops the container.voidstopContainerAsTask(String taskId, String id) LikeContainerOperations.stopContainer(String)but tracked by ataskId.voidRemoves the container from the management domain of this instance.voidupdateContainer(String id, URI location) Updates the container by the container in the givenlocation.Methods inherited from class de.iip_ecosphere.platform.support.iip_aas.SubmodelElementsCollectionClient
getLogger, getOperation, getProperty, getSubmodelElementCollectionMethods inherited from class de.iip_ecosphere.platform.support.iip_aas.SubmodelClient
checkNotNull, checkString, clear, getOperation, getProperty, getPropertyStringValue, getSubmodel, requestRefresh
-
Constructor Details
-
EcsAasClient
Creates a client instance based on a deployed IIP-AAS fromAasPartRegistrybased on a submodel withresources.- Parameters:
resourceId- the id used as key inEcsAas.NAME_SUBMODELto denote the resource to operate on- Throws:
IOException- if retrieving the IIP-AAS or the respective submodel fails
-
-
Method Details
-
addContainer
Description copied from interface:ContainerOperationsAdds a container to the management domain of this instance, e.g., by downloading it from a container registry. This defines theidof the container within the management domain of this instance. After a successful execution, the containeridis returned and shall be available and the container shall be in stateContainerState.AVAILABLE.- Specified by:
addContainerin interfaceContainerOperations- Parameters:
location- the location from where to download the container, e.g., an URL- Returns:
- the id of the container
- Throws:
ExecutionException- in case that adding the container fails for some reason
-
startContainer
Description copied from interface:ContainerOperationsStarts a container. The container must be already within the management domain of this instance byContainerOperations.addContainer(URI). The container shall after some time be in stateContainerState.DEPLOYING,ContainerState.DEPLOYEDorContainerState.FAILED.- Specified by:
startContainerin interfaceContainerOperations- Parameters:
id- the id of the container- Throws:
ExecutionException- in case that starting the container fails for some reason
-
stopContainer
Description copied from interface:ContainerOperationsStops the container. The container shall afterwards be in stateContainerState.STOPPED.- Specified by:
stopContainerin interfaceContainerOperations- Parameters:
id- the id of the container to stop, or as fallback the canonical URI of the container descriptor used for adding- Throws:
ExecutionException- if stopping the container fails
-
migrateContainer
Description copied from interface:ContainerOperationsMigrates the container.- Specified by:
migrateContainerin interfaceContainerOperations- Parameters:
id- the id of the containerresourceId- the target resource id, e.g., a device- Throws:
ExecutionException- if migration fails
-
undeployContainer
Description copied from interface:ContainerOperationsRemoves the container from the management domain of this instance. This operation shall only remove the implementation of a non-operational container and, thus, perform a state transition toContainerState.UNDEPLOYINGand ultimately the container shall be removed and its descriptor shall not be available anymore.- Specified by:
undeployContainerin interfaceContainerOperations- Parameters:
id- the id of the container to remove, or as fallback the canonical URI of the container descriptor used for adding- Throws:
ExecutionException- if undeploying the container fails, e.g., because it is still running
-
createRemoteConnectionCredentials
public de.iip_ecosphere.platform.deviceMgt.Credentials createRemoteConnectionCredentials() throws ExecutionExceptionDescription copied from interface:DeviceManagementOperationsCreates connection details (Credentials), a pair of username and a password for the active remote access server.- Specified by:
createRemoteConnectionCredentialsin interfaceDeviceManagementOperations- Returns:
- credentials for the remote access server
- Throws:
ExecutionException- if the execution fails
-
getRuntimeName
Description copied from interface:DeviceManagementOperationsGets the runtimeName of the device.- Specified by:
getRuntimeNamein interfaceDeviceManagementOperations- Returns:
- the runtimeName
- Throws:
ExecutionException- if the execution fails
-
getRuntimeVersion
Description copied from interface:DeviceManagementOperationsGets the runtimeVersion of the device.- Specified by:
getRuntimeVersionin interfaceDeviceManagementOperations- Returns:
- the runtimeVersion
- Throws:
ExecutionException- if the execution fails
-
updateContainer
Description copied from interface:ContainerOperationsUpdates the container by the container in the givenlocation. This operation is responsible for stopping the running container (if needed), replacing it, starting the new container.- Specified by:
updateContainerin interfaceContainerOperations- Parameters:
id- the id of the container to be updatedlocation- the location of the new container, e.g., an URL- Throws:
ExecutionException- if the given container cannot be updated for some reason
-
getState
Description copied from interface:ContainerOperationsReturns the state of the container.- Specified by:
getStatein interfaceContainerOperations- Parameters:
id- the id/URI of the container- Returns:
- the state of the container
-
getContainerSystemName
Description copied from interface:ContainerOperationsReturns the name of the underlying container system, e.g. Docker.- Specified by:
getContainerSystemNamein interfaceContainerOperations- Returns:
- the name
-
getContainerSystemVersion
Description copied from interface:ContainerOperationsReturns the version of the underlying container system. As this version may differ from the syntax conventions ofVersion, we just return here a string.- Specified by:
getContainerSystemVersionin interfaceContainerOperations- Returns:
- the version
-
getContainers
public de.iip_ecosphere.platform.support.aas.SubmodelElementCollection getContainers()Description copied from interface:EcsClientReturns the collection with all containers of the resources this client was created for.- Specified by:
getContainersin interfaceEcsClient- Returns:
- the containers collection, may be null
-
addContainerAsTask
Description copied from interface:EcsClientLikeContainerOperations.addContainer(URI)but tracked by ataskId.- Specified by:
addContainerAsTaskin interfaceEcsClient- Parameters:
taskId- the task id to report onlocation- the location from where to download the container, e.g., an URL- Returns:
- the id of the container
- Throws:
ExecutionException- in case that adding the container fails for some reason
-
startContainerAsTask
Description copied from interface:EcsClientLikeContainerOperations.startContainer(String)but tracked by ataskId.- Specified by:
startContainerAsTaskin interfaceEcsClient- Parameters:
taskId- the task id to report onid- the id of the container- Throws:
ExecutionException- in case that starting the container fails for some reason
-
stopContainerAsTask
Description copied from interface:EcsClientLikeContainerOperations.stopContainer(String)but tracked by ataskId.- Specified by:
stopContainerAsTaskin interfaceEcsClient- Parameters:
taskId- the task id to report onid- the id of the container to stop, or as fallback the canonical URI of the container descriptor used for adding- Throws:
ExecutionException- if stopping the container fails
-
getId
Description copied from interface:ContainerOperationsReturns the container id for a given container location as used inContainerOperations.addContainer(URI).- Specified by:
getIdin interfaceContainerOperations- Parameters:
location- the location- Returns:
- the id of the container, may be empty or nullnull if there is none
-