Package org.jeyzer.publish.event
Class JzrStandardEvent
- java.lang.Object
-
- org.jeyzer.publish.event.JzrStandardEvent
-
public class JzrStandardEvent extends Object implements JzrEvent
The Jeyzer standard event class is a generic bean representing a Jeyzer applicative monitoring event. Class can be used immediately in a a generic manner or extended.
Non thread safe
Events are created by the application and published through the Jeyzer Monitor handlers.
The code and id must always be set otherwise the event will not get processed when fired or started.
The event id is automatically set by concatenating the given code name and current system time. All other parameters are optional.
-
-
Field Summary
Fields Modifier and Type Field Description protected JzrEventCodecodeprotected Stringidprotected Stringmessageprotected shorttrustFactor
-
Constructor Summary
Constructors Constructor Description JzrStandardEvent(JzrEventCode code)The Jeyzer event constructorJzrStandardEvent(JzrEventCode code, String message)The Jeyzer event constructorJzrStandardEvent(JzrEventCode code, String message, short trustFactor)The Jeyzer event constructorJzrStandardEvent(JzrStandardEvent event)The Jeyzer cloning constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Clone the event.JzrEventCodegetCode()Get the applicative event code.StringgetId()Get the applicative event unique id.StringgetMessage()Get the applicative event message.shortgetTrustFactor()Get the applicative event trust factor.voidsetTrustFactor(short trustFactor)Set the applicative event trust factor.
-
-
-
Field Detail
-
code
protected JzrEventCode code
-
id
protected String id
-
message
protected String message
-
trustFactor
protected short trustFactor
-
-
Constructor Detail
-
JzrStandardEvent
public JzrStandardEvent(JzrEventCode code)
The Jeyzer event constructor- Parameters:
code- the applicative code. Mandatory
-
JzrStandardEvent
public JzrStandardEvent(JzrEventCode code, String message)
The Jeyzer event constructor- Parameters:
code- the applicative code. Mandatorymessage- the applicative event message (description, recommendation). Can be null.
-
JzrStandardEvent
public JzrStandardEvent(JzrEventCode code, String message, short trustFactor)
The Jeyzer event constructor- Parameters:
code- the applicative code. Can be nullmessage- the applicative event message (description, recommendation). Can be null.trustFactor- the applicative trust factor. Between 0 and 100.
-
JzrStandardEvent
public JzrStandardEvent(JzrStandardEvent event)
The Jeyzer cloning constructor- Parameters:
event- the applicative event to clone.
-
-
Method Detail
-
getCode
public JzrEventCode getCode()
Get the applicative event code. Can be null.
-
getId
public String getId()
Get the applicative event unique id.
-
getMessage
public String getMessage()
Get the applicative event message. Can be null.- Specified by:
getMessagein interfaceJzrEvent- Returns:
- the applicative event message
-
getTrustFactor
public short getTrustFactor()
Get the applicative event trust factor.- Specified by:
getTrustFactorin interfaceJzrEvent- Returns:
- the applicative event trust factor
-
setTrustFactor
public void setTrustFactor(short trustFactor)
Set the applicative event trust factor.- Parameters:
trustFactor- the applicative event trust factor
-
-