org.alfresco.bm.event
Class Event

java.lang.Object
  extended by org.alfresco.bm.event.Event
Direct Known Subclasses:
RecordedEvent

public class Event
extends Object

An event that is persisted and retrieved for processing.

Since:
1.0
Author:
Derek Hulley

Field Summary
static String EVENT_BEAN_PREFIX
           
static String EVENT_NAME_START
           
static String EVENT_NAME_STOP
           
static String FIELD_END_TIME
           
static String FIELD_ID
           
static String FIELD_NAME
           
static String FIELD_OWNER_ID
           
static String FIELD_SCHEDULED_TIME
           
static String FIELD_START_TIME
           
static String INDEX_NEXT_AVAILABLE_EVENT
           
 
Constructor Summary
Event()
          Default constructor for loading up from queues
Event(String name)
          Construct an immediate, unprocessed event without payload data
Event(String name, long createdTime, long scheduledTime)
          Construct a scheduled, unprocessed event without payload data
Event(String name, long createdTime, long scheduledTime, long startTime, long endTime, Serializable data)
          Constructor an event that has not been processed
Event(String name, long createdTime, long scheduledTime, Serializable data)
          Construct a scheduled, unprocessed event with payload data
Event(String name, Serializable data)
          Construct an immediate, unprocessed event with payload data
 
Method Summary
static void checkIndexes(org.springframework.data.mongodb.core.MongoTemplate mongo, String collection)
          Ensure that the MongoDB collection has the required indexes for events.
 boolean equals(Object obj)
           
 long getCreatedTime()
           
 Serializable getData()
           
 long getEndTime()
           
 String getId()
           
 String getName()
           
 String getOwnerId()
          Get the identifier of the process owning the event lock
 long getScheduledTime()
           
 long getStartTime()
           
 int hashCode()
           
 void setCreatedTime(long createdTime)
           
 void setData(Serializable data)
           
 void setEndTime(long endTime)
          Set the process end time provided it is greater than the start time.
 void setId(String id)
           
 void setName(String name)
           
 void setOwnerId(String ownerId)
          Set the identifier of the process owning the event lock
 void setScheduledTime(long scheduledTime)
           
 void setStartTime(long startTime)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FIELD_ID

public static final String FIELD_ID
See Also:
Constant Field Values

FIELD_NAME

public static final String FIELD_NAME
See Also:
Constant Field Values

FIELD_SCHEDULED_TIME

public static final String FIELD_SCHEDULED_TIME
See Also:
Constant Field Values

FIELD_OWNER_ID

public static final String FIELD_OWNER_ID
See Also:
Constant Field Values

FIELD_START_TIME

public static final String FIELD_START_TIME
See Also:
Constant Field Values

FIELD_END_TIME

public static final String FIELD_END_TIME
See Also:
Constant Field Values

INDEX_NEXT_AVAILABLE_EVENT

public static final String INDEX_NEXT_AVAILABLE_EVENT
See Also:
Constant Field Values

EVENT_NAME_START

public static final String EVENT_NAME_START
See Also:
Constant Field Values

EVENT_NAME_STOP

public static final String EVENT_NAME_STOP
See Also:
Constant Field Values

EVENT_BEAN_PREFIX

public static final String EVENT_BEAN_PREFIX
See Also:
Constant Field Values
Constructor Detail

Event

public Event()
Default constructor for loading up from queues


Event

public Event(String name)
Construct an immediate, unprocessed event without payload data

See Also:
Event(String, long, long, Serializable)

Event

public Event(String name,
             Serializable data)
Construct an immediate, unprocessed event with payload data

See Also:
Event(String, long, long, Serializable)

Event

public Event(String name,
             long createdTime,
             long scheduledTime)
Construct a scheduled, unprocessed event without payload data

See Also:
Event(String, long, long, Serializable)

Event

public Event(String name,
             long createdTime,
             long scheduledTime,
             Serializable data)
Construct a scheduled, unprocessed event with payload data

See Also:
Event(String, long, long, long, long, Serializable)

Event

public Event(String name,
             long createdTime,
             long scheduledTime,
             long startTime,
             long endTime,
             Serializable data)
Constructor an event that has not been processed

Parameters:
name - the event name
createdTime - the time the event was created
scheduledTime - when the event should be processed
startTime - when the event processing started (0 for 'not started')
endTime - when processing finished or by which it should have finished
data - the event data
Method Detail

checkIndexes

public static void checkIndexes(org.springframework.data.mongodb.core.MongoTemplate mongo,
                                String collection)
Ensure that the MongoDB collection has the required indexes for events.

Parameters:
mongo - connection to MongoDB
collection - name of DB collection containing events

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getId

public String getId()

setId

public void setId(String id)

getOwnerId

public String getOwnerId()
Get the identifier of the process owning the event lock


setOwnerId

public void setOwnerId(String ownerId)
Set the identifier of the process owning the event lock


getName

public String getName()

setName

public void setName(String name)

getCreatedTime

public long getCreatedTime()

setCreatedTime

public void setCreatedTime(long createdTime)

getScheduledTime

public long getScheduledTime()

setScheduledTime

public void setScheduledTime(long scheduledTime)

getStartTime

public long getStartTime()

setStartTime

public void setStartTime(long startTime)

getEndTime

public long getEndTime()
Returns:
Returns the process end time; never less than the start time.

setEndTime

public void setEndTime(long endTime)
Set the process end time provided it is greater than the start time.


getData

public Serializable getData()

setData

public void setData(Serializable data)


Copyright © 2012. All Rights Reserved.