Class MonitoringAas
- java.lang.Object
-
- de.iip_ecosphere.platform.monitoring.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.AasContributorImplements a generic service that mapsTraceRecordto 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classMonitoringAas.AlertReceptionCallbackA trace reception callback callingTraceToAasin own threads.
-
Field Summary
Fields Modifier and Type Field Description private longcleanupTimeoutprivate longlastCleanupstatic java.lang.StringPROPERTY_ALERT_CLEARTIMESTAMPstatic java.lang.StringPROPERTY_ALERT_CORRELATION_IDstatic java.lang.StringPROPERTY_ALERT_CURRENT_VALUEstatic java.lang.StringPROPERTY_ALERT_DESCRIPTIONstatic java.lang.StringPROPERTY_ALERT_EVENT_TYPEstatic java.lang.StringPROPERTY_ALERT_FIRSTTIMESTAMPstatic java.lang.StringPROPERTY_ALERT_INFOstatic java.lang.StringPROPERTY_ALERT_INSTANCEstatic java.lang.StringPROPERTY_ALERT_LASTTIMESTAMPstatic java.lang.StringPROPERTY_ALERT_NAMEstatic java.lang.StringPROPERTY_ALERT_PRIORITYstatic java.lang.StringPROPERTY_ALERT_PROBABLE_CAUSEstatic java.lang.StringPROPERTY_ALERT_RULE_EXPRESSIONstatic java.lang.StringPROPERTY_ALERT_RULE_TIME_LIMITstatic java.lang.StringPROPERTY_ALERT_SEVERITYstatic java.lang.StringPROPERTY_ALERT_SOURCEstatic java.lang.StringPROPERTY_ALERT_STATUSstatic java.lang.StringPROPERTY_ALERT_TAGSstatic java.lang.StringPROPERTY_ALERT_TIMESTAMPstatic java.lang.StringPROPERTY_ALERT_UIDstatic java.lang.StringPROPERTY_ALERT_URLstatic java.lang.StringSMEC_ALERTSstatic java.lang.StringSUBMODEL_MONITORINGprivate longtimeout
-
Constructor Summary
Constructors Constructor Description MonitoringAas()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcleanup(de.iip_ecosphere.platform.support.aas.Aas aas)Cleans up outdated alerts.private voidcleanup(de.iip_ecosphere.platform.support.aas.SubmodelElementCollection alerts, long timestamp)Cleans up outdated alerts.de.iip_ecosphere.platform.support.aas.AascontributeTo(de.iip_ecosphere.platform.support.aas.Aas.AasBuilder aasBuilder, de.iip_ecosphere.platform.support.aas.InvocablesCreator iCreator)voidcontributeTo(de.iip_ecosphere.platform.support.aas.ProtocolServerBuilder sBuilder)de.iip_ecosphere.platform.support.iip_aas.AasContributor.KindgetKind()private voidhandleNew(de.iip_ecosphere.platform.transport.status.Alert data)Handles a new alert and cleans up outdated ones.booleanisValid()private static java.lang.Stringsafe(java.lang.String string)Returns at minimum a non-empty string.
-
-
-
Field Detail
-
SUBMODEL_MONITORING
public static final java.lang.String SUBMODEL_MONITORING
- See Also:
- Constant Field Values
-
SMEC_ALERTS
public static final java.lang.String SMEC_ALERTS
- 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
-
-
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:
contributeToin interfacede.iip_ecosphere.platform.support.iip_aas.AasContributor
-
contributeTo
public void contributeTo(de.iip_ecosphere.platform.support.aas.ProtocolServerBuilder sBuilder)
- Specified by:
contributeToin interfacede.iip_ecosphere.platform.support.iip_aas.AasContributor
-
isValid
public boolean isValid()
- Specified by:
isValidin interfacede.iip_ecosphere.platform.support.iip_aas.AasContributor
-
getKind
public de.iip_ecosphere.platform.support.iip_aas.AasContributor.Kind getKind()
- Specified by:
getKindin interfacede.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:
stringor 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
-
-