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 Details

  • Constructor Details

    • EventProcessingPolicyRule

      public EventProcessingPolicyRule()
      Create empty rule
    • EventProcessingPolicyRule

      public EventProcessingPolicyRule(EventProcessingPolicyRule src)
      Copy constructor
      Parameters:
      src - source rule
    • EventProcessingPolicyRule

      public EventProcessingPolicyRule(NXCPMessage msg, int ruleNumber)
      Create rule from NXCP message.
      Parameters:
      msg - NXCP message
      ruleNumber - this rule number
  • Method Details

    • fillMessage

      public void fillMessage(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
    • getFilterScript

      public String getFilterScript()
      Returns:
      the script
    • setFilterScript

      public void setFilterScript(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 int getAlarmTimeoutEvent()
      Returns:
      the alarmTimeoutEvent
    • setAlarmTimeoutEvent

      public void setAlarmTimeoutEvent(int 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
    • getAlarmCategoryScriptName

      public String getAlarmCategoryScriptName()
      Get name of alarm category script. If set, list of categories returned by that script is used instead of static category list configured for the rule.
      Returns:
      name of alarm category script (can be null or empty string if not set)
    • setAlarmCategoryScriptName

      public void setAlarmCategoryScriptName(String alarmCategoryScriptName)
      Set name of alarm category script.
      Parameters:
      alarmCategoryScriptName - name of alarm category script (can be null or empty string to use static category list)
    • 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)
    • getSources

      public List<Long> getSources()
      Returns:
      the sources
    • getSourceExclusions

      public List<Long> getSourceExclusions()
      Returns:
      the sourceExclusions
    • setSourceExclusions

      public void setSourceExclusions(List<Long> sourceExclusions)
      Parameters:
      sourceExclusions - the sourceExclusions to set
    • getEvents

      public List<Integer> getEvents()
      Returns:
      the events
    • getActions

      public List<ActionExecutionConfiguration> getActions()
      Returns:
      the actions
    • getPStorageSet

      public Map<String,String> getPStorageSet()
      Returns:
      the persistentStorageSet
    • getPStorageDelete

      public List<String> getPStorageDelete()
      Returns:
      the persistentStorageDelete
    • setSources

      public void setSources(List<Long> sources)
      Parameters:
      sources - the sources to set
    • setEvents

      public void setEvents(List<Integer> events)
      Parameters:
      events - the events to set
    • setActions

      public void setActions(List<ActionExecutionConfiguration> actions)
      Parameters:
      actions - the actions to set
    • getTimerCancellations

      public List<String> getTimerCancellations()
      Returns:
      the timerCancellations
    • 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
    • isFilterEmpty

      public boolean isFilterEmpty()
      Check if rule's filter is empty.
      Returns:
      true if rule's filter is empty, false otherwise
    • 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
    • isTimeFramesInverted

      public boolean isTimeFramesInverted()
      Check rule's NEGATED_TIME_FRAMES flag
      Returns:
      true if NEGATED_TIME_FRAMES flag set
    • isCorrelatedEventProcessingAllowed

      public boolean isCorrelatedEventProcessingAllowed()
      Check rule's ACCEPT_CORRELATED flag
      Returns:
      true if ACCEPT_CORRELATED 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
    • getChainId

      public int getChainId()
      Get ID of the chain this rule belongs to (0 = main chain).
      Returns:
      chain ID
    • setChainId

      public void setChainId(int chainId)
      Set ID of the chain this rule belongs to.
      Parameters:
      chainId - chain ID (0 = main chain)
    • getChainCalls

      public List<Integer> getChainCalls()
      Get IDs of chains entered when this rule matches, in execution order.
      Returns:
      list of chain IDs
    • setChainCalls

      public void setChainCalls(List<Integer> chainCalls)
      Set chains entered when this rule matches.
      Parameters:
      chainCalls - list of chain IDs in execution order
    • getActionScript

      public String getActionScript()
      Returns:
      the actionScript
    • setActionScript

      public void setActionScript(String actionScript)
      Parameters:
      actionScript - the actionScript to set
    • getCustomAttributeStorageSet

      public Map<String,String> getCustomAttributeStorageSet()
      Returns:
      the customAttributeStorageSet
    • setCustomAttributeStorageSet

      public void setCustomAttributeStorageSet(Map<String,String> customAttributeStorageSet)
      Parameters:
      customAttributeStorageSet - the customAttributeStorageSet to set
    • getCustomAttributeStorageDelete

      public List<String> getCustomAttributeStorageDelete()
      Returns:
      the customAttributeStorageDelete
    • setCustomAttributeStorageDelete

      public void setCustomAttributeStorageDelete(List<String> customAttributeStorageDelete)
      Parameters:
      customAttributeStorageDelete - the customAttributeStorageDelete to set
    • getTimeFrames

      public List<TimeFrame> getTimeFrames()
      Returns:
      the timeFrames
    • setTimeFrames

      public void setTimeFrames(List<TimeFrame> timeFrames)
      Parameters:
      timeFrames - the timeFrames to set
    • getDowntimeTag

      public String getDowntimeTag()
      Returns:
      the downtimeTag
    • setDowntimeTag

      public void setDowntimeTag(String downtimeTag)
      Parameters:
      downtimeTag - the downtimeTag to set
    • getIncidentDelay

      public int getIncidentDelay()
      Get incident creation delay (in seconds).
      Returns:
      incident creation delay in seconds (0 = immediate)
    • setIncidentDelay

      public void setIncidentDelay(int incidentDelay)
      Set incident creation delay.
      Parameters:
      incidentDelay - incident creation delay in seconds (0 = immediate)
    • getIncidentTitle

      public String getIncidentTitle()
      Get incident title template.
      Returns:
      incident title template (empty string means use alarm message)
    • setIncidentTitle

      public void setIncidentTitle(String incidentTitle)
      Set incident title template.
      Parameters:
      incidentTitle - incident title template (null or empty string means use alarm message)
    • getIncidentDescription

      public String getIncidentDescription()
      Get incident description template.
      Returns:
      incident description template
    • setIncidentDescription

      public void setIncidentDescription(String incidentDescription)
      Set incident description template.
      Parameters:
      incidentDescription - incident description template
    • getIncidentAIAnalysisDepth

      public int getIncidentAIAnalysisDepth()
      Returns:
      the incidentAIAnalysisDepth
    • setIncidentAIAnalysisDepth

      public void setIncidentAIAnalysisDepth(int incidentAIAnalysisDepth)
      Parameters:
      incidentAIAnalysisDepth - the incidentAIAnalysisDepth to set
    • getIncidentAIPrompt

      public String getIncidentAIPrompt()
      Returns:
      the incidentAIPrompt
    • setIncidentAIPrompt

      public void setIncidentAIPrompt(String incidentAIPrompt)
      Parameters:
      incidentAIPrompt - the incidentAIPrompt to set
    • getAiAgentInstructions

      public String getAiAgentInstructions()
      Get instructions for AI agent
      Returns:
      instructions for AI agent
    • setAiAgentInstructions

      public void setAiAgentInstructions(String aiAgentInstructions)
      Set instructions for AI agent
      Parameters:
      aiAgentInstructions - AI agent instructions to set
    • getErrors

      public int getErrors()
      Get errors in rule configuration detected by server. Errors are calculated by server each time policy is sent to client, so they reflect server state at the moment when policy was loaded.
      Returns:
      bit mask of ERROR_xxx constants
    • hasErrors

      public boolean hasErrors()
      Check if server detected any errors in rule configuration.
      Returns:
      true if rule has errors
    • getVersion

      public int getVersion()
      Get rule version for optimistic concurrency control.
      Returns:
      rule version
    • setVersion

      public void setVersion(int version)
      Set rule version.
      Parameters:
      version - new version
    • isModified

      public boolean isModified()
      Check if rule has been modified since loading from server.
      Returns:
      true if modified
    • setModified

      public void setModified(boolean modified)
      Set modified flag.
      Parameters:
      modified - new modified state
    • clearModified

      public void clearModified()
      Clear modified flag.
    • getModifiedByGuid

      public UUID getModifiedByGuid()
      Get GUID of user who last modified this rule.
      Returns:
      user GUID or null
    • getModifiedByName

      public String getModifiedByName()
      Get name of user who last modified this rule.
      Returns:
      user name or null
    • getModificationTime

      public long getModificationTime()
      Get timestamp of last modification.
      Returns:
      modification timestamp (Unix epoch) or 0