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
  • Field Details

    • server

      private EndpointHolder server
    • smServer

      private EndpointHolder smServer
    • registry

      private EndpointHolder registry
    • smRegistry

      private EndpointHolder smRegistry
    • implementation

      private ProtocolAddressHolder implementation
    • serverHost

      private String serverHost
    • mode

    • accessControlAllowOrigin

      private String accessControlAllowOrigin
    • aasStartupTimeout

      private int aasStartupTimeout
    • pluginId

      private String 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

      public AasSetup(AasPartRegistry.AasSetup setup)
      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

      public String getImplementationProtocol()
      Returns the implementation protocol.
      Returns:
      the implementation protocol (see AasFactory)
    • getServer

      public EndpointHolder getServer()
      Returns the AAS server information.
      Returns:
      the AAS server information
    • getSubmodelServer

      public EndpointHolder getSubmodelServer()
      Returns the submodel server information.
      Returns:
      the submodel server information
    • setServer

      public void setServer(EndpointHolder aas)
      Defines the AAS server information. [required by data mapper]
      Parameters:
      aas - the AAS server information
    • setSubmodelServer

      public void setSubmodelServer(EndpointHolder aas)
      Defines the submodel server information. [required by data mapper]
      Parameters:
      aas - the submodel server information
    • getRegistry

      public EndpointHolder getRegistry()
      Returns the AAS information. [required by data mapper]
      Returns:
      the AAS information
    • getSubmodelRegistry

      public EndpointHolder getSubmodelRegistry()
      Returns the submodel information. [required by data mapper]
      Returns:
      the submodel information
    • getMode

      public AasPartRegistry.AasMode 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

      public void setMode(AasPartRegistry.AasMode mode)
      Defines the AAS mode. [required by data mapper, snakeyaml]
      Parameters:
      mode - the AAS mode
    • getServerHost

      public String getServerHost()
      Returns the server host. Often, the address stated in server or registry is 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_HOST to indicate that the addresses in server or registry shall be used
    • adaptEndpoint

      public de.iip_ecosphere.platform.support.Endpoint adaptEndpoint(de.iip_ecosphere.platform.support.Endpoint endpoint)
      Potentially adapts the endpoint with respect to getServerEndpoint().
      Parameters:
      endpoint - the endpoint to be adapted
      Returns:
      the adapted endpoint or endpoint
    • setServerHost

      public void setServerHost(String serverHost)
      Changes the server host.
      Parameters:
      serverHost - the server host, may be AasPartRegistry.NO_SPECIFIC_SERVER_HOST to indicate that the addresses in server or registry shall be used
      See Also:
    • setRegistry

      public void setRegistry(EndpointHolder registry)
      Defines the registry information. [required by data mapper, snakeyaml]
      Parameters:
      registry - the registry information
    • setSubmodelRegistry

      public void setSubmodelRegistry(EndpointHolder registry)
      Defines the registry information. [required by data mapper, snakeyaml]
      Parameters:
      registry - the registry information
    • getImplementation

      public ProtocolAddressHolder 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

      public void setImplementation(ProtocolAddressHolder implementation)
      Defines the implementation (server) information. [required by data mapper, snakeyaml]
      Parameters:
      implementation - the implementation (server) information
    • setAccessControlAllowOrigin

      public void setAccessControlAllowOrigin(String accessControlAllowOrigin)
      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 or DeploymentRecipe.ANY_CORS_ORIGIN
    • getAccessControlAllowOrigin

      public String 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

      public void setPluginId(String pluginId)
      Sets the plugin id of the AAS implementation. [Snakeyaml]
      Parameters:
      pluginId - the plugin id of the AAS implementation
    • getPluginId

      public String getPluginId()
      Returns the plugin id of the AAS implementation.
      Returns:
      the plugin id, by default null leading to the default id in AasFactory
    • createLocalEphemeralSetup

      public static AasPartRegistry.AasSetup createLocalEphemeralSetup()
      Returns a default setup with all hosts to ServerAddress.LOCALHOST and 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 to ServerAddress.LOCALHOST and 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 to ServerAddress.LOCALHOST and 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 via supplier)
      regPortSame - shall the registry port be the same as the AAS port
      supplier - a supplier for a new instance
      Returns:
      the local ephemeral setup
      See Also:
      • AasFactory.supportsSamePorts()
    • getAssetServerProtocol

      public String getAssetServerProtocol()
      Specified by:
      getAssetServerProtocol in interface de.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 the ServerAddressHolder.isRunning() in SetupSpec.State.STOPPED or based on the notified state else.
      Parameters:
      holder - the holder
      state - 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:
      getSetup in interface de.iip_ecosphere.platform.support.aas.SetupSpec