public class MongoEventService extends AbstractEventService implements LifecycleListener
EventService MongoDB collection| Constructor and Description |
|---|
MongoEventService(com.mongodb.DB db,
String collection)
Construct a event service against a Mongo database and given collection name
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
clear()
Clears all recorded data
|
static com.mongodb.DBObject |
convertEvent(Event event)
Helper method to convert an
Event into a persistable object |
long |
count() |
boolean |
deleteEvent(Event event)
Delete an event from the provider.
|
Event |
getEvent(String id)
Retrieve an event by ID
|
List<Event> |
getEvents(int skip,
int limit)
Only useful for testing: Retrieve all events with paging
|
Event |
nextEvent(String driverId,
long latestScheduledTime)
Retrieve the next event in the queue.
|
String |
putEvent(Event event)
Adds an event to the provider.
|
void |
start() |
void |
stop() |
public MongoEventService(com.mongodb.DB db,
String collection)
public void start()
start in interface LifecycleListenerpublic void stop()
stop in interface LifecycleListenerpublic long count()
count in interface EventServicepublic static com.mongodb.DBObject convertEvent(Event event)
Event into a persistable objectpublic String putEvent(Event event)
EventServiceputEvent in interface EventServiceevent - the event to add (the event ID must be nullpublic Event getEvent(String id)
EventServicegetEvent in interface EventServiceid - the ID of the event as given in putpublic List<Event> getEvents(int skip, int limit)
EventServicegetEvents in interface EventServicepublic Event nextEvent(String driverId, long latestScheduledTime)
nextEvent in interface EventServicedriverId - the ID of the driver performing the search. When supplied, only events
that are assigned to the driver are fetched; when null) any
other driver's events can be fetched as well. Not that this is
independent of data afinity, which is always respected here.latestScheduledTime - the maximum scheduled time for eventspublic boolean deleteEvent(Event event)
EventServicedeleteEvent in interface EventServiceevent - the event to deletepublic boolean clear()
EventServiceclear in interface EventServiceCopyright © 2005–2018 Alfresco Software. All rights reserved.