Class SysEvent
- All Implemented Interfaces:
Serializable,Comparable<SysEvent>
- Direct Known Subclasses:
HttpEvent,NamedEvent,TimedEvent
The Notifications interface uses these to carry information about system events. Listeners can be registered for particular system event types.
sub-classes should define the compareTo() and hashCode methods. They should also define fields and methods appropriate to the type of event.
For example, the ENTITY_UPDATE event should contain enough information to identify the entity, e.g. the path for a calendar or a uid for the event. It is probably NOT a good idea to have a reference to the actual entity.
Some of these events may be persisted to ensure their survival across system restarts and their generation is considered part of the operation.
Note that we do not modify system events once they are persisted. We retrieve them and delete them from the database.
- Author:
- Mike Douglass
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn attribute for the JMX message header -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidOverride this to add extra attributesintintGet the sequenceinthashCode()static SysEventmakeStatsEvent(String name, Long longValue) static SysEventmakeTimedEvent(String label, long millisecs) voidsetDtstamp(String val) voidsetRelated(SysEvent val) This allows for linking together related events.voidsetSequence(int val) Set the sequencetoString()voidAdd our stuff to the ToString object
-
Field Details
-
syscodeStats
- See Also:
-
syscodeTimedEvent
- See Also:
-
-
Constructor Details
-
SysEvent
Constructor- Parameters:
sysCode- the system event code
-
-
Method Details
-
getSysCode
- Returns:
- the system event code
-
addMessageAttributes
Override this to add extra attributes- Parameters:
attrs- List of attributes for the JMX message header
-
getMessageAttributes
- Returns:
- List of attributes for the JMX message header
-
setDtstamp
- Parameters:
val- a date stamp
-
getDtstamp
- Returns:
- String dtstamp
-
setSequence
public void setSequence(int val) Set the sequence- Parameters:
val- sequence number
-
getSequence
public int getSequence()Get the sequence- Returns:
- int the sequence
-
setRelated
This allows for linking together related events. For example a calendar change event might be triggered by an event being added.- Parameters:
val- the related system event
-
getRelated
- Returns:
- the related system event
-
makeTimedEvent
- Parameters:
label- a useful labelmillisecs- - time for stats- Returns:
- SysEvent
-
makeStatsEvent
- Parameters:
name- for the eventlongValue- a value - often a time- Returns:
- SysEvent
-
compareTo
- Specified by:
compareToin interfaceComparable<SysEvent>
-
hashCode
public int hashCode() -
toStringSegment
Add our stuff to the ToString object- Parameters:
ts- ToString for result
-
toString
-