Class ActiveAasBase
java.lang.Object
de.iip_ecosphere.platform.support.iip_aas.ActiveAasBase
Basic functions for active AAS with notification calls.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSupported notification modes.static interfaceDefines the interface for a notification processor. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ExecutorServiceprivate static final de.iip_ecosphere.platform.support.logging.Loggerprivate static ActiveAasBase.NotificationMode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearCollection(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.static Predicate<de.iip_ecosphere.platform.support.aas.SubmodelElementCollection> createPropertyPredicate(String propertyIdShort, Object propertyValue, String failMessage) Returns a predicate, e.g., forclearCollection(SubmodelElementCollection, Predicate)to delete the given collection based on a property value.static de.iip_ecosphere.platform.support.aas.SubmodelgetSubmodel(String name) Obtains a submodel ofAasPartRegistry.retrieveIipAas().static voidprocessNotification(String subId, ActiveAasBase.NotificationMode mode, ActiveAasBase.NotificationProcessor processor) Processes a notification on a submodel ofAasPartRegistry.retrieveIipAas().static voidprocessNotification(String subId, ActiveAasBase.NotificationProcessor processor) Processes a notification on a submodel ofAasPartRegistry.retrieveIipAas()with the notification#mode modeset in this class.Changes the notification execution mode.
-
Field Details
-
LOGGER
private static final de.iip_ecosphere.platform.support.logging.Logger LOGGER -
mode
-
exec
-
-
Constructor Details
-
ActiveAasBase
public ActiveAasBase()
-
-
Method Details
-
processNotification
Processes a notification on a submodel ofAasPartRegistry.retrieveIipAas()with the notification#mode modeset in this class.- Parameters:
subId- the short id of the submodelprocessor- the processor to execute
-
processNotification
public static void processNotification(String subId, ActiveAasBase.NotificationMode mode, ActiveAasBase.NotificationProcessor processor) Processes a notification on a submodel ofAasPartRegistry.retrieveIipAas().- Parameters:
subId- the short id of the submodelmode- explicit notification mode to be used ifmodeis notActiveAasBase.NotificationMode.NONE. If parameter is null, usemodeinsteadprocessor- the processor to execute
-
setNotificationMode
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 ofAasPartRegistry.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 clearedpred- 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., forclearCollection(SubmodelElementCollection, Predicate)to delete the given collection based on a property value.- Parameters:
propertyIdShort- the property to look forpropertyValue- the value to cause the deletionfailMessage- if an exception occurs, the message lead in (will be followed by the exception message)- Returns:
- the predicate
-