Class MonitoringAas

  • All Implemented Interfaces:
    de.iip_ecosphere.platform.support.iip_aas.AasContributor

    public class MonitoringAas
    extends java.lang.Object
    implements de.iip_ecosphere.platform.support.iip_aas.AasContributor
    Implements a generic service that maps TraceRecord to an (application) AAS. This service is in development/preliminary. The service does not take any data or produce data, it is just meant to create up the trace record AAS entries. It can be used as a sink. Currently, the service builds up the AAS of an application. However, this functionality shall be moved that the platform is providing the AAS and the service just hooks the traces submodel into.
    Author:
    Holger Eichelberger, SSE
    • Field Detail

      • SUBMODEL_MONITORING

        public static final java.lang.String SUBMODEL_MONITORING
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_UID

        public static final java.lang.String PROPERTY_ALERT_UID
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_CORRELATION_ID

        public static final java.lang.String PROPERTY_ALERT_CORRELATION_ID
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_TIMESTAMP

        public static final java.lang.String PROPERTY_ALERT_TIMESTAMP
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_FIRSTTIMESTAMP

        public static final java.lang.String PROPERTY_ALERT_FIRSTTIMESTAMP
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_LASTTIMESTAMP

        public static final java.lang.String PROPERTY_ALERT_LASTTIMESTAMP
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_CLEARTIMESTAMP

        public static final java.lang.String PROPERTY_ALERT_CLEARTIMESTAMP
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_SOURCE

        public static final java.lang.String PROPERTY_ALERT_SOURCE
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_NAME

        public static final java.lang.String PROPERTY_ALERT_NAME
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_INFO

        public static final java.lang.String PROPERTY_ALERT_INFO
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_INSTANCE

        public static final java.lang.String PROPERTY_ALERT_INSTANCE
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_SEVERITY

        public static final java.lang.String PROPERTY_ALERT_SEVERITY
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_PRIORITY

        public static final java.lang.String PROPERTY_ALERT_PRIORITY
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_TAGS

        public static final java.lang.String PROPERTY_ALERT_TAGS
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_DESCRIPTION

        public static final java.lang.String PROPERTY_ALERT_DESCRIPTION
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_EVENT_TYPE

        public static final java.lang.String PROPERTY_ALERT_EVENT_TYPE
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_PROBABLE_CAUSE

        public static final java.lang.String PROPERTY_ALERT_PROBABLE_CAUSE
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_CURRENT_VALUE

        public static final java.lang.String PROPERTY_ALERT_CURRENT_VALUE
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_URL

        public static final java.lang.String PROPERTY_ALERT_URL
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_STATUS

        public static final java.lang.String PROPERTY_ALERT_STATUS
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_RULE_EXPRESSION

        public static final java.lang.String PROPERTY_ALERT_RULE_EXPRESSION
        See Also:
        Constant Field Values
      • PROPERTY_ALERT_RULE_TIME_LIMIT

        public static final java.lang.String PROPERTY_ALERT_RULE_TIME_LIMIT
        See Also:
        Constant Field Values
      • timeout

        private long timeout
      • lastCleanup

        private long lastCleanup
      • cleanupTimeout

        private long cleanupTimeout
    • Constructor Detail

      • MonitoringAas

        public MonitoringAas()
    • Method Detail

      • contributeTo

        public de.iip_ecosphere.platform.support.aas.Aas contributeTo​(de.iip_ecosphere.platform.support.aas.Aas.AasBuilder aasBuilder,
                                                                      de.iip_ecosphere.platform.support.aas.InvocablesCreator iCreator)
        Specified by:
        contributeTo in interface de.iip_ecosphere.platform.support.iip_aas.AasContributor
      • contributeTo

        public void contributeTo​(de.iip_ecosphere.platform.support.aas.ProtocolServerBuilder sBuilder)
        Specified by:
        contributeTo in interface de.iip_ecosphere.platform.support.iip_aas.AasContributor
      • isValid

        public boolean isValid()
        Specified by:
        isValid in interface de.iip_ecosphere.platform.support.iip_aas.AasContributor
      • getKind

        public de.iip_ecosphere.platform.support.iip_aas.AasContributor.Kind getKind()
        Specified by:
        getKind in interface de.iip_ecosphere.platform.support.iip_aas.AasContributor
      • handleNew

        private void handleNew​(de.iip_ecosphere.platform.transport.status.Alert data)
        Handles a new alert and cleans up outdated ones.
        Parameters:
        data - the alert data
      • safe

        private static java.lang.String safe​(java.lang.String string)
        Returns at minimum a non-empty string.
        Parameters:
        string - the input string
        Returns:
        string or empty if null
      • cleanup

        private void cleanup​(de.iip_ecosphere.platform.support.aas.Aas aas)
        Cleans up outdated alerts.
        Parameters:
        aas - the AAS to clean up
      • cleanup

        private void cleanup​(de.iip_ecosphere.platform.support.aas.SubmodelElementCollection alerts,
                             long timestamp)
        Cleans up outdated alerts.
        Parameters:
        alerts - the alerts SMEC.
        timestamp - the timestamp before alerts shall be cleared