Package org.netxms.client.events
Class EventProcessingPolicyRule
- java.lang.Object
-
- org.netxms.client.events.EventProcessingPolicyRule
-
public class EventProcessingPolicyRule extends Object
This class represents single rule of event processing policy.
-
-
Field Summary
Fields Modifier and Type Field Description static intCREATE_TICKETstatic intDISABLEDstatic intGENERATE_ALARMstatic intNEGATED_EVENTSstatic intNEGATED_SOURCEstatic intSEVERITY_ANYstatic intSEVERITY_CRITICALstatic intSEVERITY_MAJORstatic intSEVERITY_MINORstatic intSEVERITY_NORMALstatic intSEVERITY_WARNINGstatic intSTOP_PROCESSINGstatic intTERMINATE_BY_REGEXP
-
Constructor Summary
Constructors Constructor Description EventProcessingPolicyRule()Create empty ruleEventProcessingPolicyRule(org.netxms.base.NXCPMessage msg, int ruleNumber)Create rule from NXCP message.EventProcessingPolicyRule(EventProcessingPolicyRule src)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfillMessage(org.netxms.base.NXCPMessage msg)Fill NXCP message with rule's dataList<ActionExecutionConfiguration>getActions()List<Long>getAlarmCategories()StringgetAlarmKey()StringgetAlarmMessage()SeveritygetAlarmSeverity()intgetAlarmTimeout()longgetAlarmTimeoutEvent()StringgetComments()Get rule's comments.List<Long>getEvents()intgetFlags()UUIDgetGuid()List<String>getPStorageDelete()Map<String,String>getPStorageSet()StringgetRcaScriptName()Get name of root cause analysis script.intgetRuleNumber()Get rule numberStringgetScript()List<Long>getSources()List<String>getTimerCancellations()booleanisDisabled()Check rule's DISABLED flagbooleanisEventsInverted()Check rule's NEGATED_EVENTS flagbooleanisSourceInverted()Check rule's NEGATED_SOURCE flagvoidremoveAlarmCategory(Long categoryId)Remove specific alarm category from categories listvoidsetActions(List<ActionExecutionConfiguration> actions)voidsetAlarmCategories(List<Long> alarmCategoryIds)voidsetAlarmKey(String alarmKey)voidsetAlarmMessage(String alarmMessage)voidsetAlarmSeverity(Severity alarmSeverity)voidsetAlarmTimeout(int alarmTimeout)voidsetAlarmTimeoutEvent(long alarmTimeoutEvent)voidsetComments(String comments)Set rule's comments.voidsetEvents(List<Long> events)voidsetFlags(int flags)voidsetPStorageDelete(List<String> persistentStorageDelete)voidsetPStorageSet(Map<String,String> persistentStorageSet)voidsetRcaScriptName(String rcaScriptName)Set name of root cause analysis script.voidsetRuleNumber(int ruleNumber)Set rule numbervoidsetScript(String script)voidsetSources(List<Long> sources)voidsetTimerCancellations(List<String> timerCancellations)
-
-
-
Field Detail
-
STOP_PROCESSING
public static final int STOP_PROCESSING
- See Also:
- Constant Field Values
-
NEGATED_SOURCE
public static final int NEGATED_SOURCE
- See Also:
- Constant Field Values
-
NEGATED_EVENTS
public static final int NEGATED_EVENTS
- See Also:
- Constant Field Values
-
GENERATE_ALARM
public static final int GENERATE_ALARM
- See Also:
- Constant Field Values
-
DISABLED
public static final int DISABLED
- See Also:
- Constant Field Values
-
TERMINATE_BY_REGEXP
public static final int TERMINATE_BY_REGEXP
- See Also:
- Constant Field Values
-
SEVERITY_NORMAL
public static final int SEVERITY_NORMAL
- See Also:
- Constant Field Values
-
SEVERITY_WARNING
public static final int SEVERITY_WARNING
- See Also:
- Constant Field Values
-
SEVERITY_MINOR
public static final int SEVERITY_MINOR
- See Also:
- Constant Field Values
-
SEVERITY_MAJOR
public static final int SEVERITY_MAJOR
- See Also:
- Constant Field Values
-
SEVERITY_CRITICAL
public static final int SEVERITY_CRITICAL
- See Also:
- Constant Field Values
-
CREATE_TICKET
public static final int CREATE_TICKET
- See Also:
- Constant Field Values
-
SEVERITY_ANY
public static final int SEVERITY_ANY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EventProcessingPolicyRule
public EventProcessingPolicyRule()
Create empty rule
-
EventProcessingPolicyRule
public EventProcessingPolicyRule(EventProcessingPolicyRule src)
Copy constructor
-
EventProcessingPolicyRule
public EventProcessingPolicyRule(org.netxms.base.NXCPMessage msg, int ruleNumber)Create rule from NXCP message.- Parameters:
msg- NXCP message
-
-
Method Detail
-
fillMessage
public void fillMessage(org.netxms.base.NXCPMessage msg)
Fill NXCP message with rule's data- Parameters:
msg- NXCP message
-
getComments
public String getComments()
Get rule's comments.- Returns:
- Rule's comments
-
setComments
public void setComments(String comments)
Set rule's comments.- Parameters:
comments- New comments
-
getScript
public String getScript()
- Returns:
- the script
-
setScript
public void setScript(String script)
- Parameters:
script- the script to set
-
getFlags
public int getFlags()
- Returns:
- the flags
-
setFlags
public void setFlags(int flags)
- Parameters:
flags- the flags to set
-
getAlarmKey
public String getAlarmKey()
- Returns:
- the alarmKey
-
setAlarmKey
public void setAlarmKey(String alarmKey)
- Parameters:
alarmKey- the alarmKey to set
-
getAlarmMessage
public String getAlarmMessage()
- Returns:
- the alarmMessage
-
setAlarmMessage
public void setAlarmMessage(String alarmMessage)
- Parameters:
alarmMessage- the alarmMessage to set
-
getAlarmSeverity
public Severity getAlarmSeverity()
- Returns:
- the alarmSeverity
-
setAlarmSeverity
public void setAlarmSeverity(Severity alarmSeverity)
- Parameters:
alarmSeverity- the alarmSeverity to set
-
getAlarmTimeout
public int getAlarmTimeout()
- Returns:
- the alarmTimeout
-
setAlarmTimeout
public void setAlarmTimeout(int alarmTimeout)
- Parameters:
alarmTimeout- the alarmTimeout to set
-
getAlarmTimeoutEvent
public long getAlarmTimeoutEvent()
- Returns:
- the alarmTimeoutEvent
-
setAlarmTimeoutEvent
public void setAlarmTimeoutEvent(long alarmTimeoutEvent)
- Parameters:
alarmTimeoutEvent- the alarmTimeoutEvent to set
-
getAlarmCategories
public List<Long> getAlarmCategories()
- Returns:
- alarmCategoryIds the alarm category ids
-
setAlarmCategories
public void setAlarmCategories(List<Long> alarmCategoryIds)
- Parameters:
alarmCategoryIds- the alarm category ids to set
-
removeAlarmCategory
public void removeAlarmCategory(Long categoryId)
Remove specific alarm category from categories list- Parameters:
categoryId- alarm category ID
-
getRcaScriptName
public String getRcaScriptName()
Get name of root cause analysis script.- Returns:
- name of root cause analysis script (can be null or empty string if not set)
-
setRcaScriptName
public void setRcaScriptName(String rcaScriptName)
Set name of root cause analysis script.- Parameters:
rcaScriptName- name of root cause analysis script (can be null or empty string to disable RCA)
-
getActions
public List<ActionExecutionConfiguration> getActions()
- Returns:
- the actions
-
setActions
public void setActions(List<ActionExecutionConfiguration> actions)
- Parameters:
actions- the actions to set
-
setTimerCancellations
public void setTimerCancellations(List<String> timerCancellations)
- Parameters:
timerCancellations- the timerCancellations to set
-
setPStorageSet
public void setPStorageSet(Map<String,String> persistentStorageSet)
- Parameters:
persistentStorageSet- the persistentStorageSet to set
-
setPStorageDelete
public void setPStorageDelete(List<String> persistentStorageDelete)
- Parameters:
persistentStorageDelete- the persistentStorageDelete to set
-
isDisabled
public boolean isDisabled()
Check rule's DISABLED flag- Returns:
- true if DISABLED flag set
-
isSourceInverted
public boolean isSourceInverted()
Check rule's NEGATED_SOURCE flag- Returns:
- true if NEGATED_SOURCE flag set
-
isEventsInverted
public boolean isEventsInverted()
Check rule's NEGATED_EVENTS flag- Returns:
- true if NEGATED_EVENTS flag set
-
getGuid
public UUID getGuid()
- Returns:
- the guid
-
getRuleNumber
public int getRuleNumber()
Get rule number- Returns:
- rule number
-
setRuleNumber
public void setRuleNumber(int ruleNumber)
Set rule number- Parameters:
ruleNumber- to set
-
-