Class SystemEvent

  • All Implemented Interfaces:
    UseDefaultConverter, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<SystemEvent>, java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.String>>

    public class SystemEvent
    extends java.lang.Object
    implements java.lang.Comparable<SystemEvent>, java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.String>>, java.io.Serializable, UseDefaultConverter, java.lang.Cloneable
    A significant event in the system.

    A series of events may be linked to each other using correlationIds. The first event in the series should have its correlationState set to SystemEvent.CorrelationState.START. The last event in the series should have its correlationState set to SystemEvent.CorrelationState.END. Any correlated events in between the start and end should have their correlationState set to SystemEvent.CorrelationState.INTERMEDIATE. All events in the series must share the same correlationId. The system does not enforce any of these conventions. Correlation IDs must be 255 characters or less.

    See Also:
    Serialized Form
    • Constructor Detail

      • SystemEvent

        public SystemEvent()
        Default constructor that sets the id to a random GUID, the date to System.currentTimeMillis(), and severity to SystemEvent.Severity.SYS_INFO
      • SystemEvent

        public SystemEvent​(SystemEvent.Severity severity,
                           java.lang.String subsystem,
                           java.lang.String description)
        Constructor, date set to System.currentTimeMillis()
    • Method Detail

      • getId

        public long getId()
      • setId

        public void setId​(long id)
      • getSubsystem

        public java.lang.String getSubsystem()
        The AIE subsytem that caused the event. This can be used by snmp filters for easily classifying events String (as opposed to enum) to allow for new event types by modules and/or customers.
      • setSubsystem

        public void setSubsystem​(java.lang.String subsystem)
      • getMetadata

        public BaseTypesMap<java.lang.String,​java.lang.String> getMetadata()
      • setMetadata

        public void setMetadata​(BaseTypesMap<java.lang.String,​java.lang.String> metadata)
      • getDescription

        public java.lang.String getDescription()
      • setDescription

        public void setDescription​(java.lang.String message)
      • getDate

        public long getDate()
        Date of the event. Defaulted by the framework to System.currentTimeMillis() but settable by code. (for GC case)
      • setDate

        public void setDate​(long date)
      • getCorrelationId

        public java.lang.String getCorrelationId()
      • setCorrelationId

        public void setCorrelationId​(java.lang.String correlationId)
      • addMetadata

        public SystemEvent addMetadata​(java.lang.String key,
                                       java.lang.String value)
        Returns this event.
      • addMetadata

        public SystemEvent addMetadata​(java.lang.String key,
                                       int value)
        Returns this event.
      • addMetadata

        public SystemEvent addMetadata​(java.lang.String key,
                                       long value)
        Returns this event.
      • addMetadata

        public SystemEvent addMetadata​(java.lang.String key,
                                       double value)
        Returns this event.
      • addMetadata

        public SystemEvent addMetadata​(java.lang.String key,
                                       boolean value)
        Returns this event.
      • addMetadata

        public SystemEvent addMetadata​(java.lang.String key,
                                       float value)
        Returns this event.
      • addMetadata

        public SystemEvent addMetadata​(java.lang.String key,
                                       java.lang.Throwable t)
        Adds the Exception's messages and all messages of all causes to the event in the form:
         key.message.0 = top level exception message
         key.message.1 = cause of top level message
         key.message.2 = cause of first caused exception
         key.message.n = root cause message
         
      • containsMetadata

        public boolean containsMetadata​(java.lang.String key)
        True if the specified metdata key has a value in this event.
      • getMetadata

        public java.lang.String getMetadata​(java.lang.String key)
        Returns the value of the metadata key or null if it does not exist.
      • getMetadata

        public java.lang.String getMetadata​(java.lang.String key,
                                            java.lang.String defaultValue)
        Returns the value of the metadata key or null if it does not exist.
      • getMetadata

        public int getMetadata​(java.lang.String key,
                               int defaultValue)
        Returns the value of the metadata key or null if it does not exist.
      • getMetadata

        public long getMetadata​(java.lang.String key,
                                long defaultValue)
        Returns the value of the metadata key or null if it does not exist.
      • getMetadata

        public float getMetadata​(java.lang.String key,
                                 float defaultValue)
        Returns the value of the metadata key or null if it does not exist.
      • getMetadata

        public double getMetadata​(java.lang.String key,
                                  double defaultValue)
        Returns the value of the metadata key or null if it does not exist.
      • getMetadata

        public boolean getMetadata​(java.lang.String key,
                                   boolean defaultValue)
        Returns the value of the metadata key or null if it does not exist.
      • iterator

        public java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.String>> iterator()
        metadata about the event. we will define rules for how certain data types (ContainterPropertyReference, double, List-of-list, etc) get converted to SNMP data types
        Specified by:
        iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.String>>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(SystemEvent other)
        Specified by:
        compareTo in interface java.lang.Comparable<SystemEvent>
      • getNodeset

        public java.lang.String getNodeset()
        The name of the nodeset that produced the event. Nodeset may be single node nodeset.
      • setNodeset

        public void setNodeset​(java.lang.String nodeset)
      • clone

        public SystemEvent clone()
        Overrides:
        clone in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object