Class ApplicationInstanceAasConstructor

java.lang.Object
de.iip_ecosphere.platform.support.iip_aas.ApplicationInstanceAasConstructor

public class ApplicationInstanceAasConstructor extends Object
A class to construct the AAS submodel for application instances. This class is intentionally not an AAS rather than it provides the way to construct and modify it. The ApplicationInstancesAasClient is related.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • ApplicationInstanceAasConstructor

      public ApplicationInstanceAasConstructor()
  • Method Details

    • firstAppWithoutAppId

      public static boolean firstAppWithoutAppId()
      Returns whether the first application shall receive an app id.
      Returns:
      true for no app id, false else (default)
    • notifyAppNewInstance

      public static String notifyAppNewInstance(String appId, String planId)
      Called to notify that a new instance of the application appId is about to be started.
      Parameters:
      appId - the application id
      planId - the id of the deployment plan starting the plan
      Returns:
      the id of the new instance to be passed on to the service starts, may be null for default/legacy start
    • getAasAppInstanceId

      private static String getAasAppInstanceId(String appId, int instanceId)
      Returns the AAS application instance id.
      Parameters:
      appId - the application id
      instanceId - the instance id
      Returns:
      the application instance id ready to be used as id short in an AAS
    • getAasAppInstanceId

      private static String getAasAppInstanceId(String appId, String instanceId)
      Returns the AAS application instance id.
      Parameters:
      appId - the application id
      instanceId - the instance id
      Returns:
      the application instance id ready to be used as id short in an AAS
    • notifyAppInstanceStopped

      public static int notifyAppInstanceStopped(String appId, String instanceId)
      Called to notify that an app instance was stopped.
      Parameters:
      appId - the application id of the instance that was stopped
      instanceId - the instance id of the instance, may be null or empty for legacy application starts
      Returns:
      the remaining instances (across all deployment plans)
    • countAppInstances

      static int countAppInstances(String appId, String planId, de.iip_ecosphere.platform.support.aas.Submodel sub)
      Return the number of application instances with the given appId.
      Parameters:
      appId - the application id to look for
      planId - the deployment plan id to filter for, may be empty or null to not filter for deployment plans
      sub - the submodel to take the data from
      Returns:
      the number of instances