Package com.sshtools.common.events
Class Event
java.lang.Object
com.sshtools.common.events.EventObject
com.sshtools.common.events.Event
Superclass of all events that may be fired during the life of J2SSH.
All events have the following attributes in common :-
- Event code. This is an
intand must be unique across the whole of J2SSH. - State. A boolean specifying whether the event is the result of a successful operation or a failed one.
-
Field Summary
Fields inherited from class com.sshtools.common.events.EventObject
source -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(String key, Object value) Add an attribute to the eventgetAttribute(String key) Get the value of an event attributeintgetId()Get the unique event idbooleangetState()Get the event state.Methods inherited from class com.sshtools.common.events.EventObject
getSource, toString
-
Constructor Details
-
Event
- Parameters:
source- source of eventid- event codeboolean- state true=successful false=unsuccessful
-
Event
-
-
Method Details
-
getId
public int getId()Get the unique event id- Returns:
- unique event id
-
getState
public boolean getState()Get the event state. May be one of#STATE_SUCCESSFULor#STATE_UNSUCCESSFUL.- Returns:
- event state
-
getAttribute
Get the value of an event attribute- Parameters:
key- key of event- Returns:
- value
-
getAllAttributes
-
logAttributes
-
addAttribute
Add an attribute to the event- Parameters:
key- key of attributeString- value of attribute- Returns:
- this object, to allow event attribute chains
-