Class AbstractAasLifecycleDescriptor

java.lang.Object
de.iip_ecosphere.platform.support.iip_aas.AbstractAasLifecycleDescriptor
All Implemented Interfaces:
de.iip_ecosphere.platform.support.LifecycleDescriptor

public class AbstractAasLifecycleDescriptor extends Object implements de.iip_ecosphere.platform.support.LifecycleDescriptor
Implements the generic lifecycle descriptor for the service manager.
Author:
Holger Eichelberger, SSE
  • Field Details

    • PARAM_IIP_PORT

      public static final String PARAM_IIP_PORT
      Explicitly determine the AAS implementation server port. If not given, use an ephemeral one.
      See Also:
    • AAS_HEARTBEAT_PERIOD

      private static final int AAS_HEARTBEAT_PERIOD
      See Also:
    • implServer

      private static de.iip_ecosphere.platform.support.Server implServer
    • implServerBuilder

      private static de.iip_ecosphere.platform.support.aas.ProtocolServerBuilder implServerBuilder
    • waitForIipAas

      private static boolean waitForIipAas
    • name

      private String name
    • setupSupplier

      private Supplier<AasPartRegistry.AasSetup> setupSupplier
    • aasServer

      private de.iip_ecosphere.platform.support.Server aasServer
    • timer

      private Timer timer
  • Constructor Details

  • Method Details

    • setWaitForIipAas

      public static boolean setWaitForIipAas(boolean wait)
      Defines whether we shall wait for the IIP AAs to come up. [testing]
      Parameters:
      wait - true for waiting, false for not waiting
      Returns:
      the previous value
    • getAasSetup

      public AasPartRegistry.AasSetup getAasSetup()
      Returns the AAS setup via the passed in setup supplier.
      Returns:
      the actual AAS setup
    • getOverridePortArg

      protected String getOverridePortArg()
      Returns the name of a command line/system environment parameter overriding PARAM_IIP_PORT.
      Returns:
      the name of the parameter, null for none (default)
    • getPort

      private static int getPort(String[] args, String arg, int init)
      Returns the port value, either from args or from the system environment.
      Parameters:
      args - the command line arguments
      arg - the parameter name to search for
      init - the initial value, a already known port if chained, usually -1
      Returns:
      the port, may be -1 for none
      See Also:
      • OsUtils.getEnv(String)
    • getContributorFilter

      protected Predicate<AasContributor> getContributorFilter()
      Allows to dynamically filter the contributors. May rely on AasPartRegistry.contributors() or on AasPartRegistry.contributorClasses().
      Returns:
      the filter, by default a function that returns true
    • startup

      public void startup(String[] args)
      Specified by:
      startup in interface de.iip_ecosphere.platform.support.LifecycleDescriptor
    • deploy

      private void deploy(String[] args, Predicate<AasContributor> contributorFilter)
      Parameters:
      args - the command line arguments from startup(String[])
      contributorFilter - the AAS contributor filter to apply
    • enableAasHeartbeat

      protected boolean enableAasHeartbeat()
      Returns whether AAS server heartbeat shall be enabled.
      Returns:
      true for enabled, false else
    • waitForAasServer

      protected void waitForAasServer()
      Waits for the AAS server to come up.
    • iipAasExists

      protected boolean iipAasExists()
      Returns whether we have an IIP AAS.
      Returns:
      true the AAS exists, false else
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface de.iip_ecosphere.platform.support.LifecycleDescriptor
    • getShutdownHook

      public Thread getShutdownHook()
      Specified by:
      getShutdownHook in interface de.iip_ecosphere.platform.support.LifecycleDescriptor
    • priority

      public int priority()
      Specified by:
      priority in interface de.iip_ecosphere.platform.support.LifecycleDescriptor