| java.lang.Object org.dspace.event.Event
Event | public class Event implements Serializable(Code) | | An Event object represents a single action that changed one object in the
DSpace data model. An "atomic" action at the application or business-logic
API level may spawn many of these events.
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:
- (Action) Type - Subject -- DSpace object to which the action
applies, e.g. the Collection to which an ADD adds a member. - Object --
optional, when present it is the other object effected by an action, e.g. the
Item ADDed to a Collection by an ADD. - detail -- a textual summary of
what changed, content and its significance varies by the combination of
action and subject type. - timestamp -- exact millisecond timestamp at
which event was logged.
version: $Revision: 2074 $ |
Constructor Summary | |
public | Event(int eventType, int subjectType, int subjectID, String detail) Constructor.
Parameters: eventType - action type, e.g. | public | Event(int eventType, int subjectType, int subjectID, int objectType, int objectID, String detail) Constructor.
Parameters: eventType - action type, e.g. |
ADD | final public static int ADD(Code) | | |
CREATE | final public static int CREATE(Code) | | Event (Action) types
|
DELETE | final public static int DELETE(Code) | | |
EVENT_MASK | final public static int EVENT_MASK(Code) | | |
MODIFY | final public static int MODIFY(Code) | | |
MODIFY_METADATA | final public static int MODIFY_METADATA(Code) | | |
REMOVE | final public static int REMOVE(Code) | | |
SUBJECT_MASK | final public static int SUBJECT_MASK(Code) | | Index of filter parts in their array:
|
Event | public Event(int eventType, int subjectType, int subjectID, String detail)(Code) | | Constructor.
Parameters: eventType - action type, e.g. Event.ADD Parameters: subjectType - DSpace Object Type of subject e.g. Constants.ITEM. Parameters: subjectID - database ID of subject instance. Parameters: detail - detail information that depends on context. |
Event | public Event(int eventType, int subjectType, int subjectID, int objectType, int objectID, String detail)(Code) | | Constructor.
Parameters: eventType - action type, e.g. Event.ADD Parameters: subjectType - DSpace Object Type of subject e.g. Constants.ITEM. Parameters: subjectID - database ID of subject instance. Parameters: objectType - DSpace Object Type of object e.g. Constants.BUNDLE. Parameters: objectID - database ID of object instance. Parameters: detail - detail information that depends on context. |
equals | public boolean equals(Event other)(Code) | | Compare two events. Ignore any difference in the timestamps. Also ignore
transactionID since that is not always set initially.
Parameters: other - the event to compare this one to |
getCurrentUser | public int getCurrentUser()(Code) | | |
getDispatcher | public int getDispatcher()(Code) | | |
getEventType | public int getEventType()(Code) | | |
getEventTypeAsString | public String getEventTypeAsString()(Code) | | Get the text name of event (action) type.
|
getObjectID | public int getObjectID()(Code) | | |
getObjectType | public int getObjectType()(Code) | | |
getObjectTypeAsString | public String getObjectTypeAsString()(Code) | | |
getSubjectID | public int getSubjectID()(Code) | | |
getSubjectType | public int getSubjectType()(Code) | | |
getSubjectTypeAsString | public String getSubjectTypeAsString()(Code) | | |
getTimeStamp | public long getTimeStamp()(Code) | | |
parseEventType | public static int parseEventType(String s)(Code) | | Interpret named event type.
Parameters: text - name of event type. |
parseObjectType | public static int parseObjectType(String s)(Code) | | Translate a textual DSpace Object type name into an event subject-type
mask. NOTE: This returns a BIT-MASK, not a numeric type value; the mask
is only used within the event system.
Parameters: s - text name of object type. |
pass | public boolean pass(List filters)(Code) | | Parameters: filters - list of filter masks; each one is an Array of two ints. |
setBitSet | public void setBitSet(String consumerName)(Code) | | Keeps track of which consumers the event has been consumed by. Should be
called by a dispatcher when calling consume(Context ctx, String name,
Event event) on an event.
Parameters: consumerName - |
setCurrentUser | public void setCurrentUser(int uid)(Code) | | |
setDispatcher | public void setDispatcher(int id)(Code) | | Set the identifier of the dispatcher that first processed this event.
Parameters: id - the unique (hash code) value characteristic of the dispatcher. |
setExtraLogInfo | public void setExtraLogInfo(String info)(Code) | | |
setTransactionID | public void setTransactionID(String tid)(Code) | | Sets value of transactionID element of the event.
Parameters: tid - new value of transactionID. |
|
|