Package com.attivio.sdk.event
Class SystemEvent
- java.lang.Object
-
- com.attivio.sdk.event.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 toSystemEvent.CorrelationState.END
. Any correlated events in between the start and end should have their correlationState set toSystemEvent.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SystemEvent.Acknowledgement
static class
SystemEvent.CorrelationState
static class
SystemEvent.Severity
-
Constructor Summary
Constructors Constructor Description SystemEvent()
Default constructor that sets the id to a random GUID, the date toSystem.currentTimeMillis()
, and severity toSystemEvent.Severity.SYS_INFO
SystemEvent(SystemEvent.Severity severity, java.lang.String subsystem, java.lang.String description)
Constructor, date set toSystem.currentTimeMillis()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SystemEvent
addMetadata(java.lang.String key, boolean value)
Returns this event.SystemEvent
addMetadata(java.lang.String key, double value)
Returns this event.SystemEvent
addMetadata(java.lang.String key, float value)
Returns this event.SystemEvent
addMetadata(java.lang.String key, int value)
Returns this event.SystemEvent
addMetadata(java.lang.String key, long value)
Returns this event.SystemEvent
addMetadata(java.lang.String key, java.lang.String value)
Returns this event.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:SystemEvent
clone()
int
compareTo(SystemEvent other)
boolean
containsMetadata(java.lang.String key)
True if the specified metdata key has a value in this event.boolean
equals(java.lang.Object obj)
SystemEvent.Acknowledgement
getAcknowledgement()
java.lang.String
getCorrelationId()
SystemEvent.CorrelationState
getCorrelationState()
long
getDate()
Date of the event.java.lang.String
getDescription()
long
getId()
BaseTypesMap<java.lang.String,java.lang.String>
getMetadata()
java.lang.String
getMetadata(java.lang.String key)
Returns the value of the metadata key or null if it does not exist.boolean
getMetadata(java.lang.String key, boolean defaultValue)
Returns the value of the metadata key or null if it does not exist.double
getMetadata(java.lang.String key, double defaultValue)
Returns the value of the metadata key or null if it does not exist.float
getMetadata(java.lang.String key, float defaultValue)
Returns the value of the metadata key or null if it does not exist.int
getMetadata(java.lang.String key, int defaultValue)
Returns the value of the metadata key or null if it does not exist.long
getMetadata(java.lang.String key, long defaultValue)
Returns the value of the metadata key or null if it does not exist.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.java.lang.String
getNodeset()
The name of the nodeset that produced the event.SystemEvent.Severity
getSeverity()
java.lang.String
getSubsystem()
The AIE subsytem that caused the event.int
hashCode()
java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>>
iterator()
metadata about the event.void
setAcknowledgement(SystemEvent.Acknowledgement acknowledgement)
void
setCorrelationId(java.lang.String correlationId)
void
setCorrelationState(SystemEvent.CorrelationState correlationState)
void
setDate(long date)
void
setDescription(java.lang.String message)
void
setId(long id)
void
setMetadata(BaseTypesMap<java.lang.String,java.lang.String> metadata)
void
setNodeset(java.lang.String nodeset)
void
setSeverity(SystemEvent.Severity severity)
void
setSubsystem(java.lang.String subsystem)
java.lang.String
toString()
-
-
-
Constructor Detail
-
SystemEvent
public SystemEvent()
Default constructor that sets the id to a random GUID, the date toSystem.currentTimeMillis()
, and severity toSystemEvent.Severity.SYS_INFO
-
SystemEvent
public SystemEvent(SystemEvent.Severity severity, java.lang.String subsystem, java.lang.String description)
Constructor, date set toSystem.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)
-
getSeverity
public SystemEvent.Severity getSeverity()
-
setSeverity
public void setSeverity(SystemEvent.Severity severity)
-
getDate
public long getDate()
Date of the event. Defaulted by the framework toSystem.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)
-
getCorrelationState
public SystemEvent.CorrelationState getCorrelationState()
-
setCorrelationState
public void setCorrelationState(SystemEvent.CorrelationState correlationState)
-
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 interfacejava.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(SystemEvent other)
- Specified by:
compareTo
in interfacejava.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)
-
getAcknowledgement
public SystemEvent.Acknowledgement getAcknowledgement()
-
setAcknowledgement
public void setAcknowledgement(SystemEvent.Acknowledgement acknowledgement)
-
clone
public SystemEvent clone()
- Overrides:
clone
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-