Class MonitorEventWorkflowUnit
- java.lang.Object
-
- com.activeviam.risk.ref.workflows.units.impl.MonitorEventWorkflowUnit
-
- All Implemented Interfaces:
com.qfs.snl.workflows.units.IWorkflowUnit
,com.quartetfs.fwk.types.IExtendedPluginValue
,Serializable
@QuartetExtendedPluginValue(intf=com.qfs.snl.workflows.units.IWorkflowUnit.class, key="MonitorEventWorkflowUnit") public class MonitorEventWorkflowUnit extends Object implements com.qfs.snl.workflows.units.IWorkflowUnit
- Author:
- ActiveViam
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MonitorEventWorkflowUnit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
enterBreach()
Decides if the event starts a new breach.boolean
exitBreach()
Decides if the event stops the current breach.protected int
getStatusValue(Double status)
Gets a value representing the status.String
getType()
boolean
hasStatusChanged()
void
notifyChanges(List<com.qfs.snl.data.ISentinelEvent> events, com.qfs.snl.messages.IMessageService messageService)
Creates a message, summarizing all changes among events.void
process(com.qfs.snl.workflows.IWorkflowPayload payload)
void
processEvents(List<com.qfs.snl.data.ISentinelEvent> events, com.qfs.snl.alerts.IEventAlertAggregator alertAggregator)
Processes all events in a batch.void
sendMessage(com.qfs.snl.messages.IMessageService messageService)
Sends a message notifying of the transition.protected String
toStatusString(int status)
Gets a name describing the status code.
-
-
-
Field Detail
-
KEY
public static final String KEY
PlUGIN KEY- See Also:
- Constant Field Values
-
payload
protected com.qfs.snl.workflows.IWorkflowPayload payload
-
STOP
protected static final int STOP
- See Also:
- Constant Field Values
-
GOOD
protected static final int GOOD
- See Also:
- Constant Field Values
-
WARNING
protected static final int WARNING
- See Also:
- Constant Field Values
-
FAILURE
protected static final int FAILURE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public String getType()
- Specified by:
getType
in interfacecom.quartetfs.fwk.types.IExtendedPluginValue
-
process
public void process(com.qfs.snl.workflows.IWorkflowPayload payload)
- Specified by:
process
in interfacecom.qfs.snl.workflows.units.IWorkflowUnit
-
hasStatusChanged
public boolean hasStatusChanged()
- Returns:
- true if the status of this monitor has changed.
-
enterBreach
public boolean enterBreach()
Decides if the event starts a new breach.This is true under the condition of a status change.
- Returns:
- true if the event denotes for the first time a failure
-
exitBreach
public boolean exitBreach()
Decides if the event stops the current breach.This is true under the condition of a status change.
- Returns:
- true if the event denotes for the first event after a failure
-
sendMessage
public void sendMessage(com.qfs.snl.messages.IMessageService messageService)
Sends a message notifying of the transition.- Parameters:
messageService
- the service for messaging
-
getStatusValue
protected int getStatusValue(Double status)
Gets a value representing the status.- Parameters:
status
- the event status- Returns:
- the corresponding integer
-
processEvents
public void processEvents(List<com.qfs.snl.data.ISentinelEvent> events, com.qfs.snl.alerts.IEventAlertAggregator alertAggregator)
Processes all events in a batch.This creates new alerts for events breaching and closes others on resolutions.
Events are processed one by one to properly close alerts, even if it reopens it later, as it will be a new alert.
As a consequence, alerts remain created one by one.- Parameters:
events
- events to processalertAggregator
- aggregator managing alerts for events
-
notifyChanges
public void notifyChanges(List<com.qfs.snl.data.ISentinelEvent> events, com.qfs.snl.messages.IMessageService messageService)
Creates a message, summarizing all changes among events.- Parameters:
events
- events to considermessageService
- message service to use for notifications
-
toStatusString
protected String toStatusString(int status)
Gets a name describing the status code.- Parameters:
status
- status code- Returns:
- associated name
-
-