public class Event extends Object implements 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 |
protected static int |
ALL_OBJECTS_MASK |
protected static int |
BITSTREAM |
protected static int |
BUNDLE |
protected static int |
COLLECTION |
protected static int |
COMMUNITY |
static int |
CREATE
Event (Action) types
|
static int |
DELETE |
protected static int |
EPERSON |
static int |
EVENT_MASK |
protected static String[] |
eventTypeText |
protected static int |
GROUP |
static int |
INSTALL |
protected static int |
ITEM |
static int |
MODIFY |
static int |
MODIFY_METADATA |
protected static int |
NONE
XXX NOTE: with ALL_OBJECTS_MASK *AND* objTypeToMask hash *
|
protected static Map<Integer,Integer> |
objMaskToType |
protected static Map<Integer,Integer> |
objTypeToMask |
static int |
REMOVE |
protected static int |
SITE |
static int |
SUBJECT_MASK
Index of filter parts in their array:
|
| Constructor and Description |
|---|
Event(int eventType,
int subjectType,
UUID subjectID,
int objectType,
UUID objectID,
String detail)
Constructor.
|
Event(int eventType,
int subjectType,
UUID subjectID,
int objectType,
UUID objectID,
String detail,
ArrayList<String> identifiers)
Constructor.
|
Event(int eventType,
int subjectType,
UUID subjectID,
String detail)
Constructor.
|
Event(int eventType,
int subjectType,
UUID subjectID,
String detail,
ArrayList<String> identifiers)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
coreTypeToMask(int core) |
boolean |
equals(Object other)
Compare two events.
|
BitSet |
getBitSet() |
int |
getCurrentUser() |
String |
getDetail() |
int |
getDispatcher() |
int |
getEventType() |
String |
getEventTypeAsString()
Get the text name of event (action) type.
|
String |
getExtraLogInfo() |
List<String> |
getIdentifiers() |
DSpaceObject |
getObject(Context context)
Get the DSpace object which is the "object" of an event.
|
UUID |
getObjectID() |
int |
getObjectType() |
String |
getObjectTypeAsString() |
DSpaceObject |
getSubject(Context context)
Syntactic sugar to get the DSpace object which is the "subject" of an
event.
|
UUID |
getSubjectID() |
int |
getSubjectType() |
String |
getSubjectTypeAsString() |
long |
getTimeStamp() |
String |
getTransactionID() |
int |
hashCode() |
protected int |
log2(int n) |
protected int |
maskTypeToCore(int mask) |
static int |
parseEventType(String s)
Interpret named event type.
|
static int |
parseObjectType(String s)
Translate a textual DSpace Object type name into an event subject-type
mask.
|
boolean |
pass(List<int[]> filters)
Test whether this event would pass through a list of filters.
|
void |
setBitSet(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(String info) |
void |
setTransactionID(String tid)
Sets value of transactionID element of the event.
|
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
protected static final String[] eventTypeText
protected static final int NONE
protected static final int BITSTREAM
protected static final int BUNDLE
protected static final int ITEM
protected static final int COLLECTION
protected static final int COMMUNITY
protected static final int SITE
protected static final int GROUP
protected static final int EPERSON
protected static final int ALL_OBJECTS_MASK
public Event(int eventType,
int subjectType,
UUID subjectID,
String detail)
Event(int, int, UUID, java.lang.String).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,
UUID subjectID,
String detail,
ArrayList<String> identifiers)
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.identifiers - array containing all identifiers of the dso or an empty arraypublic Event(int eventType,
int subjectType,
UUID subjectID,
int objectType,
UUID objectID,
String detail)
Event(int, int, UUID, int, UUID, java.lang.String) instead.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 Event(int eventType,
int subjectType,
UUID subjectID,
int objectType,
UUID objectID,
String detail,
ArrayList<String> identifiers)
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.identifiers - array containing all identifiers of the dso or an empty arraypublic boolean equals(Object other)
public void setDispatcher(int id)
id - the unique (hash code) value characteristic of the dispatcher.protected int coreTypeToMask(int core)
protected int maskTypeToCore(int mask)
public DSpaceObject getObject(Context context) throws SQLException
SQLExceptionpublic DSpaceObject getSubject(Context context) throws SQLException
SQLExceptionpublic UUID getSubjectID()
public UUID getObjectID()
public int getSubjectType()
public int getObjectType()
public String getSubjectTypeAsString()
public String getObjectTypeAsString()
public static int parseObjectType(String s)
s - text name of object type.public int getEventType()
public String getEventTypeAsString()
public static int parseEventType(String s)
s - name of event type.public long getTimeStamp()
public int getDispatcher()
public String getDetail()
public List<String> getIdentifiers()
public String getTransactionID()
public void setTransactionID(String tid)
tid - new value of transactionID.public void setCurrentUser(int uid)
public int getCurrentUser()
public void setExtraLogInfo(String info)
public String getExtraLogInfo()
public boolean pass(List<int[]> filters)
filters - list of filter masks; each one is an Array of two ints.protected int log2(int n)
public void setBitSet(String consumerName)
consumerName - public BitSet getBitSet()
Copyright © 2017 DuraSpace. All rights reserved.