public class Event
extends java.lang.Object
implements java.io.Serializable
This class includes tools to help set and use the contents of the event. Note that it describes DSpace data object types in two ways: by the type identifiers in the Constants class, and also by an Event-specific bitmask (used by its internal filters). All public API calls use the Constants version of the data model types.
Note that the type of the event itself is actually descriptive of the action it performs: ADD, MODIFY, etc. The most significant elements of the event are:
| Modifier and Type | Field and Description |
|---|---|
static int |
ADD |
static int |
CREATE
Event (Action) types
|
static int |
DELETE |
static int |
EVENT_MASK |
static int |
INSTALL |
static int |
MODIFY |
static int |
MODIFY_METADATA |
static int |
REMOVE |
static int |
SUBJECT_MASK
Index of filter parts in their array:
|
| Constructor and Description |
|---|
Event(int eventType,
int subjectType,
int subjectID,
int objectType,
int objectID,
java.lang.String detail)
Constructor.
|
Event(int eventType,
int subjectType,
int subjectID,
java.lang.String detail)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other)
Compare two events.
|
java.util.BitSet |
getBitSet() |
int |
getCurrentUser() |
java.lang.String |
getDetail() |
int |
getDispatcher() |
int |
getEventType() |
java.lang.String |
getEventTypeAsString()
Get the text name of event (action) type.
|
java.lang.String |
getExtraLogInfo() |
DSpaceObject |
getObject(Context context)
Get the DSpace object which is the "object" of an event.
|
int |
getObjectID() |
int |
getObjectType() |
java.lang.String |
getObjectTypeAsString() |
DSpaceObject |
getSubject(Context context)
Syntactic sugar to get the DSpace object which is the "subject" of an
event.
|
int |
getSubjectID() |
int |
getSubjectType() |
java.lang.String |
getSubjectTypeAsString() |
long |
getTimeStamp() |
java.lang.String |
getTransactionID() |
int |
hashCode() |
static int |
parseEventType(java.lang.String s)
Interpret named event type.
|
static int |
parseObjectType(java.lang.String s)
Translate a textual DSpace Object type name into an event subject-type
mask.
|
boolean |
pass(java.util.List<int[]> filters)
Test whether this event would pass through a list of filters.
|
void |
setBitSet(java.lang.String consumerName)
Keeps track of which consumers the event has been consumed by.
|
void |
setCurrentUser(int uid) |
void |
setDispatcher(int id)
Set the identifier of the dispatcher that first processed this event.
|
void |
setExtraLogInfo(java.lang.String info) |
void |
setTransactionID(java.lang.String tid)
Sets value of transactionID element of the event.
|
java.lang.String |
toString() |
public static final int CREATE
public static final int MODIFY
public static final int MODIFY_METADATA
public static final int ADD
public static final int REMOVE
public static final int DELETE
public static final int INSTALL
public static final int SUBJECT_MASK
public static final int EVENT_MASK
public Event(int eventType,
int subjectType,
int subjectID,
java.lang.String detail)
eventType - action type, e.g. Event.ADD.subjectType - DSpace Object Type of subject e.g. Constants.ITEM.subjectID - database ID of subject instance.detail - detail information that depends on context.public Event(int eventType,
int subjectType,
int subjectID,
int objectType,
int objectID,
java.lang.String detail)
eventType - action type, e.g. Event.ADD.subjectType - DSpace Object Type of subject e.g. Constants.ITEM.subjectID - database ID of subject instance.objectType - DSpace Object Type of object e.g. Constants.BUNDLE.objectID - database ID of object instance.detail - detail information that depends on context.public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - the event to compare this one topublic int hashCode()
hashCode in class java.lang.Objectpublic void setDispatcher(int id)
id - the unique (hash code) value characteristic of the dispatcher.public DSpaceObject getObject(Context context) throws java.sql.SQLException
java.sql.SQLExceptionpublic DSpaceObject getSubject(Context context) throws java.sql.SQLException
java.sql.SQLExceptionpublic int getSubjectID()
public int getObjectID()
public int getSubjectType()
public int getObjectType()
public java.lang.String getSubjectTypeAsString()
public java.lang.String getObjectTypeAsString()
public static int parseObjectType(java.lang.String s)
s - text name of object type.public int getEventType()
public java.lang.String getEventTypeAsString()
public static int parseEventType(java.lang.String s)
s - name of event type.public long getTimeStamp()
public int getDispatcher()
public java.lang.String getDetail()
public java.lang.String getTransactionID()
public void setTransactionID(java.lang.String tid)
tid - new value of transactionID.public void setCurrentUser(int uid)
public int getCurrentUser()
public void setExtraLogInfo(java.lang.String info)
public java.lang.String getExtraLogInfo()
public boolean pass(java.util.List<int[]> filters)
filters - list of filter masks; each one is an Array of two ints.public void setBitSet(java.lang.String consumerName)
consumerName - public java.util.BitSet getBitSet()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018 DuraSpace. All Rights Reserved.