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 classSystemEvent.Acknowledgementstatic classSystemEvent.CorrelationStatestatic classSystemEvent.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_INFOSystemEvent(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 SystemEventaddMetadata(java.lang.String key, boolean value)Returns this event.SystemEventaddMetadata(java.lang.String key, double value)Returns this event.SystemEventaddMetadata(java.lang.String key, float value)Returns this event.SystemEventaddMetadata(java.lang.String key, int value)Returns this event.SystemEventaddMetadata(java.lang.String key, long value)Returns this event.SystemEventaddMetadata(java.lang.String key, java.lang.String value)Returns this event.SystemEventaddMetadata(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:SystemEventclone()intcompareTo(SystemEvent other)booleancontainsMetadata(java.lang.String key)True if the specified metdata key has a value in this event.booleanequals(java.lang.Object obj)SystemEvent.AcknowledgementgetAcknowledgement()java.lang.StringgetCorrelationId()SystemEvent.CorrelationStategetCorrelationState()longgetDate()Date of the event.java.lang.StringgetDescription()longgetId()BaseTypesMap<java.lang.String,java.lang.String>getMetadata()java.lang.StringgetMetadata(java.lang.String key)Returns the value of the metadata key or null if it does not exist.booleangetMetadata(java.lang.String key, boolean defaultValue)Returns the value of the metadata key or null if it does not exist.doublegetMetadata(java.lang.String key, double defaultValue)Returns the value of the metadata key or null if it does not exist.floatgetMetadata(java.lang.String key, float defaultValue)Returns the value of the metadata key or null if it does not exist.intgetMetadata(java.lang.String key, int defaultValue)Returns the value of the metadata key or null if it does not exist.longgetMetadata(java.lang.String key, long defaultValue)Returns the value of the metadata key or null if it does not exist.java.lang.StringgetMetadata(java.lang.String key, java.lang.String defaultValue)Returns the value of the metadata key or null if it does not exist.java.lang.StringgetNodeset()The name of the nodeset that produced the event.SystemEvent.SeveritygetSeverity()java.lang.StringgetSubsystem()The AIE subsytem that caused the event.inthashCode()java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>>iterator()metadata about the event.voidsetAcknowledgement(SystemEvent.Acknowledgement acknowledgement)voidsetCorrelationId(java.lang.String correlationId)voidsetCorrelationState(SystemEvent.CorrelationState correlationState)voidsetDate(long date)voidsetDescription(java.lang.String message)voidsetId(long id)voidsetMetadata(BaseTypesMap<java.lang.String,java.lang.String> metadata)voidsetNodeset(java.lang.String nodeset)voidsetSeverity(SystemEvent.Severity severity)voidsetSubsystem(java.lang.String subsystem)java.lang.StringtoString()
-
-
-
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:
iteratorin interfacejava.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(SystemEvent other)
- Specified by:
compareToin 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:
clonein classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-