Package org.dspace.services.model
Class Event
- java.lang.Object
-
- org.dspace.services.model.Event
-
- All Implemented Interfaces:
Serializable
public class Event extends Object implements Serializable
This holds all the settings related to an event in the system.- Author:
- Aaron Zeckoski (azeckoski @ gmail.com)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Event.Scope
The event scopes to send events to.
-
Constructor Summary
Constructors Constructor Description Event(String name)
Create a new event with the given name.Event(String name, String resourceReference, boolean modify)
Create a new event with the given name for the given resource (item, collection, etc.).Event(String name, String resourceReference, boolean modify, boolean localOnly)
Create a new event with the given name for the given resource (item, collection, etc.).Event(String name, String resourceReference, String userId, boolean modify)
Create a new event with the given name for the given user on the given resource (item, collection, etc.).Event(String name, String resourceReference, String userId, Map<String,String> properties, Event.Scope[] scopes, boolean modify)
Create a new event with the given name for the given user on the given resource (item, collection, etc.).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getId()
String
getName()
Map<String,String>
getProperties()
String
getResourceReference()
Reference the resource affected by this event.Event.Scope[]
getScopes()
String
getUserId()
boolean
isModify()
Did this event modify something in the system?void
setId(String id)
void
setModify(boolean modify)
void
setName(String name)
void
setProperties(Map<String,String> properties)
void
setResourceReference(String resourceReference)
void
setScopes(Event.Scope[] scopes)
void
setUserId(String userId)
String
toString()
-
-
-
Constructor Detail
-
Event
public Event(String name)
Create a new event with the given name. Will default to a read event (instead of modify event) and to the current user and local/cluster scope.- Parameters:
name
- an event name (e.g. collection.read, item.modify)
-
Event
public Event(String name, String resourceReference, boolean modify)
Create a new event with the given name for the given resource (item, collection, etc.). Defaults to the current user and local/cluster scope.- Parameters:
name
- an event name (e.g. collection.read, item.modify)resourceReference
- the reference (identifier) for the resource affected by this eventmodify
- if true then this is a modify event, if false it is just a read event
-
Event
public Event(String name, String resourceReference, boolean modify, boolean localOnly)
Create a new event with the given name for the given resource (item, collection, etc.). Defaults to the current user and local/cluster scope.- Parameters:
name
- an event name (e.g. collection.read, item.modify)resourceReference
- the reference (identifier) for the resource affected by this eventmodify
- if true then this is a modify event, if false it is just a read eventlocalOnly
- if true then this is a local event only, otherwise it defaults to local/cluster
-
Event
public Event(String name, String resourceReference, String userId, boolean modify)
Create a new event with the given name for the given user on the given resource (item, collection, etc.).- Parameters:
name
- an event name (e.g. collection.read, item.modify)resourceReference
- the reference (identifier) for the resource affected by this eventuserId
- the internal user id for the user who caused this eventmodify
- if true then this is a modify event, if false it is just a read event
-
Event
public Event(String name, String resourceReference, String userId, Map<String,String> properties, Event.Scope[] scopes, boolean modify)
Create a new event with the given name for the given user on the given resource (item, collection, etc.).- Parameters:
name
- an event name (e.g. collection.read, item.modify)resourceReference
- the reference (identifier) for the resource affected by this eventuserId
- the internal user id for the user who caused this eventproperties
- additional properties to send along with this eventscopes
- the scopes to send this event tomodify
- if true then this is a modify event, if false it is just a read event
-
-
Method Detail
-
getId
public String getId()
- Returns:
- the unique identifier for this event (generated by the system)
-
setId
public void setId(String id)
-
getName
public String getName()
- Returns:
- the name of this event (e.g. collection.modify, item.delete)
-
setName
public void setName(String name)
-
getUserId
public String getUserId()
- Returns:
- the internal user id for the user who caused this event
-
setUserId
public void setUserId(String userId)
-
getResourceReference
public String getResourceReference()
Reference the resource affected by this event.- Returns:
- the reference (identifier) for the resource affected by this event OR null if none specified
-
setResourceReference
public void setResourceReference(String resourceReference)
-
isModify
public boolean isModify()
Did this event modify something in the system?- Returns:
- true if this event modified soemthing in the system, false if it was read only
-
setModify
public void setModify(boolean modify)
-
getProperties
public Map<String,String> getProperties()
- Returns:
- the additional properties included with this event if there are any
-
getScopes
public Event.Scope[] getScopes()
- Returns:
- the scopes the this event is sent to
-
setScopes
public void setScopes(Event.Scope[] scopes)
-
-