public class Event extends EventObject
All events have the following attributes in common :-
int
and must be unique across the
whole of J2SSH.source
Constructor and Description |
---|
Event(Object source,
int id,
boolean state)
Deprecated.
Use constructor with UUID of the current connection.
|
Event(Object source,
int id,
boolean state,
String uuid) |
Event(Object source,
int id,
Throwable error)
Deprecated.
Use constructor with UUID of the current connection.
|
Event(Object source,
int id,
Throwable error,
String uuid) |
Modifier and Type | Method and Description |
---|---|
Event |
addAttribute(String key,
Object value)
Add an attribute to the event
|
String |
getAllAttributes() |
Object |
getAttribute(String key)
Get the value of an event attribute
|
int |
getId()
Get the unique event id
|
boolean |
getState()
Get the event state.
|
String |
getUuid() |
getSource, toString
public Event(Object source, int id, boolean state)
source
- source of eventid
- event codeboolean
- state true=successful false=unsuccessful@Deprecated public Event(Object source, int id, Throwable error)
source
- id
- error
- public int getId()
public boolean getState()
#STATE_SUCCESSFUL
or
#STATE_UNSUCCESSFUL
.public Object getAttribute(String key)
key
- key of eventpublic String getAllAttributes()
public Event addAttribute(String key, Object value)
key
- key of attributeString
- value of attributepublic String getUuid()
Copyright © 2024. All rights reserved.