public class MongoEventService extends AbstractEventService
EventService MongoDB collection| Constructor and Description |
|---|
MongoEventService(org.springframework.data.mongodb.core.MongoTemplate mongo,
String collection)
Construct a provider that works using the given Mongo instance and
collection name.
|
| Modifier and Type | Method and Description |
|---|---|
long |
count() |
boolean |
deleteEvent(Event event)
Delete an event from the provider.
|
List<Event> |
findEvents(String name,
int skip,
int limit)
Find any event matching the given name, using the paging criteria
|
Event |
getEvent(String id)
Fetch a specific event by unique ID
|
Event |
lockEvent(Event event,
String lockOwner)
Lock an event for processing by the given owner
|
Event |
nextEvent(String dataOwner,
long latestScheduledTime,
long latestQueueTime)
Retrieve the next event in the queue.
|
Event |
putEvent(Event event)
Adds an event to the provider.
|
public MongoEventService(org.springframework.data.mongodb.core.MongoTemplate mongo,
String collection)
mongo - the MongoDB template to usecollection - the name of the MongoDB collectionpublic long count()
public List<Event> findEvents(String name, int skip, int limit)
EventServicename - find events with the given nameskip - the number of results to skiplimit - the maximum number of results to retrievepublic Event nextEvent(String dataOwner, long latestScheduledTime, long latestQueueTime)
dataOwner - the identifier of the client queuing eventslatestQueueTime - the event scheduled time must not be greater than thispublic Event lockEvent(Event event, String lockOwner)
event - the event to locklockOwner - the lock ownerpublic Event getEvent(String id)
EventServiceid - the event IDpublic boolean deleteEvent(Event event)
EventServiceevent - the event to deletepublic Event putEvent(Event event)
EventServiceevent - the event to add (the event ID must be nullCopyright © 2012. All Rights Reserved.