public class IOEvent extends EventObject
Modifier and Type | Field and Description |
---|---|
static int[] |
LEGAL_TYPES_OBJECT |
static int[] |
LEGAL_TYPES_OBJECT_ARRAY |
static int[] |
LEGAL_TYPES_RELATION |
static int[] |
LEGAL_TYPES_RELATION_ARRAY |
static int |
OBJECT_ADDED_TO |
static int |
OBJECT_CREATED |
static int |
OBJECT_DELETED |
static int |
OBJECT_LOCK_BROKEN |
static int |
OBJECT_LOCK_TAKEN |
static int |
OBJECT_LOCKED |
static int |
OBJECT_MODIFIED |
static int |
OBJECT_RELATION_CHANGED |
static int |
OBJECT_REMOVED_FROM |
static int |
OBJECT_STATE_CHANGED |
static int |
OBJECT_UNLOCKED |
static int |
ORIGIN_LOCAL |
static int |
ORIGIN_REMOTE |
source
Constructor and Description |
---|
IOEvent(IOEvent pEvent) |
IOEvent(Object source,
int type,
IOHashKey objectKey)
Construct a local object event
|
IOEvent(Object source,
int type,
IOHashKey[] objectKeys)
Construct a local multiple object event
|
IOEvent(Object source,
int type,
IOHashKey[] objectKeys,
int origin)
Construct a multiple object event
|
IOEvent(Object source,
int type,
IOHashKey[] objectKeys,
IOHashKey relationKey)
Construct a local multiple relation event
|
IOEvent(Object source,
int type,
IOHashKey[] objectKeys,
IOHashKey relationKey,
int origin)
Construct a multiple relation event
|
IOEvent(Object source,
int type,
IOHashKey objectKey,
int origin)
Construct an object event
|
IOEvent(Object source,
int type,
IOHashKey objectKey,
IOHashKey relationKey)
Construct a local relation event
|
IOEvent(Object source,
int type,
IOHashKey objectKey,
IOHashKey relationKey,
int origin)
Construct a relation event
|
Modifier and Type | Method and Description |
---|---|
IOObject |
getObject()
Looks up the object of the event, and returns it.
|
protected int[] |
getObjectIds()
Retrieves the ids of all objects belonging to this event.
|
IOHashKey |
getObjectKey()
Retrieves the object key belonging to this event.
|
IOHashKey[] |
getObjectKeys()
Retrieves all object keys belongning to this event.
|
IOObject[] |
getObjects()
Looks up the objects of the event, and returns them in an array.
|
protected int[] |
getObjectTypes()
Retrieves the types of objects that this event contains.
|
int |
getOrigin()
Retrieves the origin of this event.
|
Object |
getParameter(Object pName)
Property:
parameter ; is a way to assosiate parameters with
this event. |
IOObject |
getRelationObject()
Looks up the relation object of the event, and returns it.
|
IOHashKey |
getRelationObjectKey()
Retrieves the relation object key.
|
int |
getType()
Retrieves the type of this event.
|
boolean |
isMultiple()
Check whether or not this is a multiple object event.
|
boolean |
isRelationEvent()
Retrieves true if this is a single or multiple relation event
|
boolean |
isRelationMultiple()
Retrieves true if this is a multiple relation event
|
void |
setParameter(Object pName,
Object pValue)
Property:
parameter ; is a way to assosiate parameters with
this event. |
void |
setSource(Object pSource)
Sets the source of this event.
|
String |
toString()
Retrieves a
String representation of this event. |
getSource
public static final int OBJECT_CREATED
public static final int OBJECT_DELETED
public static final int OBJECT_MODIFIED
public static final int OBJECT_STATE_CHANGED
public static final int OBJECT_ADDED_TO
public static final int OBJECT_REMOVED_FROM
public static final int OBJECT_RELATION_CHANGED
public static final int OBJECT_LOCKED
public static final int OBJECT_UNLOCKED
public static final int OBJECT_LOCK_BROKEN
public static final int OBJECT_LOCK_TAKEN
public static final int[] LEGAL_TYPES_OBJECT
public static final int[] LEGAL_TYPES_OBJECT_ARRAY
public static final int[] LEGAL_TYPES_RELATION
public static final int[] LEGAL_TYPES_RELATION_ARRAY
public static final int ORIGIN_LOCAL
public static final int ORIGIN_REMOTE
public IOEvent(Object source, int type, IOHashKey objectKey, int origin) throws IllegalArgumentException
source
- the source of the eventtype
- the type of event.objectKey
- IOHashKey that refers to the object in questionorigin
- the origin of the eventIllegalArgumentException
- if objectKey parameter is nullpublic IOEvent(Object source, int type, IOHashKey[] objectKeys, int origin) throws IllegalArgumentException
source
- the source of the eventtype
- the type of event.objectKeys
- array of IOHashKey.origin
- the origin of the eventIllegalArgumentException
- if objectKeys param is a null value or has lengt=0public IOEvent(Object source, int type, IOHashKey objectKey, IOHashKey relationKey, int origin) throws IllegalArgumentException
source
- the source of the eventtype
- the type of eventobjectKey
- IOHashKey that refers to one side of the relationrelationKey
- IOHashKey that refers to the other side of the relationorigin
- the origin of the eventIllegalArgumentException
- if objectKey or relationKey is a null valuepublic IOEvent(Object source, int type, IOHashKey[] objectKeys, IOHashKey relationKey, int origin) throws IllegalArgumentException
source
- the source of the eventtype
- the type of eventobjectKeys
- IOHashKey array that refers to one side of the relationrelationKey
- IOHashKey that refers to the other side of the relationorigin
- the origin of the eventIllegalArgumentException
- if objectKeys or relationKey is a null value or objectKeys has length=0public IOEvent(Object source, int type, IOHashKey objectKey) throws IllegalArgumentException
source
- the source of the eventtype
- the type of event.objectKey
- IOHashKey that refers to the object in questionIllegalArgumentException
- if objectKey has value nullpublic IOEvent(Object source, int type, IOHashKey[] objectKeys) throws IllegalArgumentException
source
- the source of the eventtype
- the type of event.objectKeys
- array of IOHashKey.IllegalArgumentException
- if objectKeys param has value null or has length=0public IOEvent(Object source, int type, IOHashKey objectKey, IOHashKey relationKey) throws IllegalArgumentException
source
- the source of the eventtype
- the type of eventobjectKey
- IOHashKey that refers to one side of the relationrelationKey
- IOHashKey that refers to the other side of the relationIllegalArgumentException
- if objectKey or relationKey has value nullpublic IOEvent(Object source, int type, IOHashKey[] objectKeys, IOHashKey relationKey) throws IllegalArgumentException
source
- the source of the eventtype
- the type of eventobjectKeys
- IOHashKey array that refers to one side of the relationrelationKey
- IOHashKey that refers to the other side of the relationIllegalArgumentException
- if objectKeys or relationKey has value null or objectKeys has length=0public IOEvent(IOEvent pEvent)
public void setSource(Object pSource)
pSource
- the source of this eventpublic int getType()
public int getOrigin()
ORIGIN_LOCAL
,
ORIGIN_REMOTE
public boolean isMultiple()
public boolean isRelationEvent()
public boolean isRelationMultiple()
public IOHashKey getObjectKey()
null
if it is a multiple eventpublic IOHashKey[] getObjectKeys()
IOHashKey
s; null
if it is a single-object eventpublic IOHashKey getRelationObjectKey()
isRelationEvent()
returns false, and also if isRelationMultiple()
returns true.IOHashKey
of the related object. This property is only valid if it is a relation event, and if it is not a multiple event.public IOObject getObject() throws SQLException, NoSuchObjectException
getObjectKey()
would return null, this method will also.ObjectLoader
. This value can be null if the objectKey property is null.NoSuchObjectException
- If the object referred to by getObjectKey() does not exist.PersistentStoreException
- If exception occurs in the persistent store (database).SQLException
- This Exception is never thrown by the API.
A PersistentStoreException is thrown instead.ObjectLoader.getObject(IOHashKey)
public IOObject[] getObjects() throws SQLException, NoSuchObjectException
getObjectKeys()
would return null, this method will do so too.ObjectLoader
.
Can be null if the objectKeys property is null.NoSuchObjectException
- If the object referred to by getObjectKey() does not exist.PersistentStoreException
- If exception occurs in the persistent store (database).SQLException
- This Exception is never thrown by the API.
A PersistentStoreException is thrown instead.ObjectLoader.getObject(IOHashKey)
public IOObject getRelationObject() throws SQLException, NoSuchObjectException
getRelationObjectKey()
would return null, this method will also.null
.NoSuchObjectException
- If the object referred to by getObjectKey() does not exist.PersistentStoreException
- If exception occurs in the persistent store (database).SQLException
- This Exception is never thrown by the API.
A PersistentStoreException is thrown instead.protected int[] getObjectTypes()
protected int[] getObjectIds()
public String toString()
String
representation of this event.
This description will typically contain the type of event, all objects
belonging to this event and the attributes belongning to this event.toString
in class EventObject
String
representation of this eventpublic Object getParameter(Object pName)
parameter
; is a way to assosiate parameters with
this event. Use this to add information you need when reacting to the
event.
Convenice method for: getParameter().get(pName);
Retrieves the value to which this map maps the specified key. Returns null if the map contains no mapping for this key. A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null.
pName
- the parameter to search forpublic void setParameter(Object pName, Object pValue)
parameter
; is a way to assosiate parameters with
this event. Use this to add information you need when reacting to the
event.
Convenice method for: getParameter().put(pName, pValue);
Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.
pName
- the key of the parameter that will be associated with this eventpValue
- the value of the parameter that will be assiciated with this event© 1998- 2018 Stibo DX