Class AasPartRegistry.AasSetup
java.lang.Object
de.iip_ecosphere.platform.support.iip_aas.AasPartRegistry.AasSetup
- All Implemented Interfaces:
de.iip_ecosphere.platform.support.aas.SetupSpec
- Enclosing class:
AasPartRegistry
public static class AasPartRegistry.AasSetup
extends Object
implements de.iip_ecosphere.platform.support.aas.SetupSpec
The technical setup of the AAS/VAB endpoints as data class to be used with a usual configuration format/YAML
parser. For local server setup/testing,
server and registry shall point to the same server
instance but with different endpoint paths (in memory registry). For a real installation, this information may
differ. Typically, the implementation runs on localhost.- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classWraps a component's endpoint into a component setup.Nested classes/interfaces inherited from interface de.iip_ecosphere.platform.support.aas.SetupSpec
de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent, de.iip_ecosphere.platform.support.aas.SetupSpec.ComponentSetup, de.iip_ecosphere.platform.support.aas.SetupSpec.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate Stringprivate ProtocolAddressHolderprivate AasPartRegistry.AasModeprivate Stringprivate EndpointHolderprivate EndpointHolderprivate Stringprivate Map<de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent, de.iip_ecosphere.platform.support.aas.SetupSpec.ComponentSetup> private EndpointHolderprivate EndpointHolder -
Constructor Summary
ConstructorsConstructorDescriptionAasSetup()Default constructor.AasSetup(AasPartRegistry.AasSetup setup) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionde.iip_ecosphere.platform.support.EndpointadaptEndpoint(de.iip_ecosphere.platform.support.Endpoint endpoint) Potentially adapts the endpoint with respect togetServerEndpoint().static AasPartRegistry.AasSetupReturns a default setup with all hosts toServerAddress.LOCALHOSTand all ports to ephemeral while the registry port is the same as the aas port.static <A extends AasPartRegistry.AasSetup>
AcreateLocalEphemeralSetup(A setup, boolean regPortSame, Supplier<A> supplier) Returns a default setup with all hosts toServerAddress.LOCALHOSTand all ports to ephemeral.static AasPartRegistry.AasSetupcreateLocalEphemeralSetup(AasPartRegistry.AasSetup setup, boolean regPortSame) Returns a default setup with all hosts toServerAddress.LOCALHOSTand all ports to ephemeral.intReturns the AAS startup timeout, i.e., the time we may wait for an AAS server to come up.Returns the access control to allow cross origin.Returns the implementation (server) information.Returns the implementation protocol.de.iip_ecosphere.platform.support.ServerAddressReturns the implementation server information as server address.getMode()Returns the AAS mode.Returns the plugin id of the AAS implementation.Returns the AAS information.de.iip_ecosphere.platform.support.EndpointReturns the registry server information as endpoint.Returns the AAS server information.de.iip_ecosphere.platform.support.EndpointReturns the AAS server information as endpoint.Returns the server host.de.iip_ecosphere.platform.support.aas.SetupSpec.ComponentSetupgetSetup(de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent component) Returns the submodel information.Returns the submodel server information.private de.iip_ecosphere.platform.support.aas.SetupSpec.StateisRunning(ServerAddressHolder holder, de.iip_ecosphere.platform.support.aas.SetupSpec.State state) Returns whether a certain server is running, based on theServerAddressHolder.isRunning()inSetupSpec.State.STOPPEDor based on the notified state else.voidsetAasStartupTimeout(int aasStartupTimeout) Changes the AAS startup timeout, i.e., the time we may wait for an AAS server to come up.voidsetAccessControlAllowOrigin(String accessControlAllowOrigin) Sets the access control to allow cross origin.voidsetImplementation(ProtocolAddressHolder implementation) Defines the implementation (server) information.voidDefines the AAS mode.voidsetPluginId(String pluginId) Sets the plugin id of the AAS implementation.voidsetRegistry(EndpointHolder registry) Defines the registry information.voidsetServer(EndpointHolder aas) Defines the AAS server information.voidsetServerHost(String serverHost) Changes the server host.voidsetSubmodelRegistry(EndpointHolder registry) Defines the registry information.voidDefines the submodel server information.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.support.aas.SetupSpec
areRegistriesRunning, getAasRegistryEndpoint, getAasRegistryKeyStore, getAasRegistryState, getAasRepositoryEndpoint, getAasRepositoryKeyStore, getAasRepositoryState, getAssetServerAddress, getAssetServerKeyStore, getAssetServerState, getSubmodelRegistryEndpoint, getSubmodelRegistryKeyStore, getSubmodelRegistryState, getSubmodelRepositoryEndpoint, getSubmodelRepositoryKeyStore, getSubmodelRepositoryState, notifyAasRegistryStateChange, notifyAasRepositoryStateChange, notifyAssetServerStateChange, notifySubmodelRegistryStateChange, notifySubmodelRepositoryStateChange
-
Field Details
-
server
-
smServer
-
registry
-
smRegistry
-
implementation
-
serverHost
-
mode
-
accessControlAllowOrigin
-
aasStartupTimeout
private int aasStartupTimeout -
pluginId
-
setups
private Map<de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent,de.iip_ecosphere.platform.support.aas.SetupSpec.ComponentSetup> setups
-
-
Constructor Details
-
AasSetup
public AasSetup()Default constructor. -
AasSetup
Copy constructor.- Parameters:
setup- the setup to copy from
-
-
Method Details
-
getServerEndpoint
public de.iip_ecosphere.platform.support.Endpoint getServerEndpoint()Returns the AAS server information as endpoint.- Returns:
- the AAS server information as endpoint
-
getRegistryEndpoint
public de.iip_ecosphere.platform.support.Endpoint getRegistryEndpoint()Returns the registry server information as endpoint.- Returns:
- the registry server information as endpoint
-
getImplementationServer
public de.iip_ecosphere.platform.support.ServerAddress getImplementationServer()Returns the implementation server information as server address.- Returns:
- the implementation server information as server address
-
getImplementationProtocol
Returns the implementation protocol.- Returns:
- the implementation protocol (see
AasFactory)
-
getServer
Returns the AAS server information.- Returns:
- the AAS server information
-
getSubmodelServer
Returns the submodel server information.- Returns:
- the submodel server information
-
setServer
Defines the AAS server information. [required by data mapper]- Parameters:
aas- the AAS server information
-
setSubmodelServer
Defines the submodel server information. [required by data mapper]- Parameters:
aas- the submodel server information
-
getRegistry
Returns the AAS information. [required by data mapper]- Returns:
- the AAS information
-
getSubmodelRegistry
Returns the submodel information. [required by data mapper]- Returns:
- the submodel information
-
getMode
Returns the AAS mode.- Returns:
- the AAS mode
-
getAasStartupTimeout
public int getAasStartupTimeout()Returns the AAS startup timeout, i.e., the time we may wait for an AAS server to come up.- Returns:
- the timeout in ms (default 120000)
-
setAasStartupTimeout
public void setAasStartupTimeout(int aasStartupTimeout) Changes the AAS startup timeout, i.e., the time we may wait for an AAS server to come up.- Parameters:
aasStartupTimeout- the timeout in ms
-
setMode
Defines the AAS mode. [required by data mapper, snakeyaml]- Parameters:
mode- the AAS mode
-
getServerHost
Returns the server host. Often, the address stated inserverorregistryis sufficient. However, if the devices shall use a specific address, while the server shall listen to multiple or all available IP addresses, the address to be used for server instance creation may have to be different, e.g., "localhost" rather than a specific IO.- Returns:
- the server host, may be
AasPartRegistry.NO_SPECIFIC_SERVER_HOSTto indicate that the addresses inserverorregistryshall be used
-
adaptEndpoint
public de.iip_ecosphere.platform.support.Endpoint adaptEndpoint(de.iip_ecosphere.platform.support.Endpoint endpoint) Potentially adapts the endpoint with respect togetServerEndpoint().- Parameters:
endpoint- the endpoint to be adapted- Returns:
- the adapted endpoint or
endpoint
-
setServerHost
Changes the server host.- Parameters:
serverHost- the server host, may beAasPartRegistry.NO_SPECIFIC_SERVER_HOSTto indicate that the addresses inserverorregistryshall be used- See Also:
-
setRegistry
Defines the registry information. [required by data mapper, snakeyaml]- Parameters:
registry- the registry information
-
setSubmodelRegistry
Defines the registry information. [required by data mapper, snakeyaml]- Parameters:
registry- the registry information
-
getImplementation
Returns the implementation (server) information. [required by data mapper, snakeyaml] For convenience, the port number may be invalid and is turned then into an ephemeral port.- Returns:
- the implementation (server) information
-
setImplementation
Defines the implementation (server) information. [required by data mapper, snakeyaml]- Parameters:
implementation- the implementation (server) information
-
setAccessControlAllowOrigin
Sets the access control to allow cross origin. [Snakeyaml]- Parameters:
accessControlAllowOrigin- the information to be placed in the HTTP header field "Access-Control-Allow-Origin"; the specific server orDeploymentRecipe.ANY_CORS_ORIGIN
-
getAccessControlAllowOrigin
Returns the access control to allow cross origin.- Returns:
- the information to be placed in the HTTP header field
"Access-Control-Allow-Origin"; the specific server or
DeploymentRecipe.ANY_CORS_ORIGIN, may be null or empty
-
setPluginId
Sets the plugin id of the AAS implementation. [Snakeyaml]- Parameters:
pluginId- the plugin id of the AAS implementation
-
getPluginId
Returns the plugin id of the AAS implementation.- Returns:
- the plugin id, by default null leading to the default id in
AasFactory
-
createLocalEphemeralSetup
Returns a default setup with all hosts toServerAddress.LOCALHOSTand all ports to ephemeral while the registry port is the same as the aas port.- Returns:
- the local ephemeral setup
-
createLocalEphemeralSetup
public static AasPartRegistry.AasSetup createLocalEphemeralSetup(AasPartRegistry.AasSetup setup, boolean regPortSame) Returns a default setup with all hosts toServerAddress.LOCALHOSTand all ports to ephemeral.- Parameters:
setup- the instance to set up (if null a new one is created)regPortSame- shall the registry port be the same as the AAS port- Returns:
- the local ephemeral setup
-
createLocalEphemeralSetup
public static <A extends AasPartRegistry.AasSetup> A createLocalEphemeralSetup(A setup, boolean regPortSame, Supplier<A> supplier) Returns a default setup with all hosts toServerAddress.LOCALHOSTand all ports to ephemeral.- Type Parameters:
A- the AAS setup type- Parameters:
setup- the instance to set up (if null a new one is created viasupplier)regPortSame- shall the registry port be the same as the AAS portsupplier- a supplier for a new instance- Returns:
- the local ephemeral setup
- See Also:
-
getAssetServerProtocol
- Specified by:
getAssetServerProtocolin interfacede.iip_ecosphere.platform.support.aas.SetupSpec
-
isRunning
private de.iip_ecosphere.platform.support.aas.SetupSpec.State isRunning(ServerAddressHolder holder, de.iip_ecosphere.platform.support.aas.SetupSpec.State state) Returns whether a certain server is running, based on theServerAddressHolder.isRunning()inSetupSpec.State.STOPPEDor based on the notified state else.- Parameters:
holder- the holderstate- the notified state- Returns:
- the actual state
-
getSetup
public de.iip_ecosphere.platform.support.aas.SetupSpec.ComponentSetup getSetup(de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent component) - Specified by:
getSetupin interfacede.iip_ecosphere.platform.support.aas.SetupSpec
-