Class ActiveAasBase

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

public class ActiveAasBase extends Object
Basic functions for active AAS with notification calls.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • ActiveAasBase

      public ActiveAasBase()
  • Method Details

    • processNotification

      public static void processNotification(String subId, ActiveAasBase.NotificationProcessor processor)
      Processes a notification on a submodel of AasPartRegistry.retrieveIipAas() with the notification #mode mode set in this class.
      Parameters:
      subId - the short id of the submodel
      processor - the processor to execute
    • processNotification

      public static void processNotification(String subId, ActiveAasBase.NotificationMode mode, ActiveAasBase.NotificationProcessor processor)
      Processes a notification on a submodel of AasPartRegistry.retrieveIipAas().
      Parameters:
      subId - the short id of the submodel
      mode - explicit notification mode to be used if mode is not ActiveAasBase.NotificationMode.NONE. If parameter is null, use mode instead
      processor - the processor to execute
    • setNotificationMode

      public static ActiveAasBase.NotificationMode setNotificationMode(ActiveAasBase.NotificationMode mo)
      Changes the notification execution mode. [for testing]
      Parameters:
      mo - the new mode
      Returns:
      the last notification mode
    • getSubmodel

      public static de.iip_ecosphere.platform.support.aas.Submodel getSubmodel(String name) throws IOException
      Obtains a submodel of AasPartRegistry.retrieveIipAas().
      Parameters:
      name - the name of the submodel
      Returns:
      the submodel
      Throws:
      IOException - if the submodel cannot be found
    • clearCollection

      public static void clearCollection(de.iip_ecosphere.platform.support.aas.SubmodelElementCollection coll, Predicate<de.iip_ecosphere.platform.support.aas.SubmodelElementCollection> pred)
      Clears a collection from elements responding to the given with the given predicate.
      Parameters:
      coll - the collection to be cleared
      pred - the predicate
    • createPropertyPredicate

      public static Predicate<de.iip_ecosphere.platform.support.aas.SubmodelElementCollection> createPropertyPredicate(String propertyIdShort, Object propertyValue, String failMessage)
      Returns a predicate, e.g., for clearCollection(SubmodelElementCollection, Predicate) to delete the given collection based on a property value.
      Parameters:
      propertyIdShort - the property to look for
      propertyValue - the value to cause the deletion
      failMessage - if an exception occurs, the message lead in (will be followed by the exception message)
      Returns:
      the predicate