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 |
nextEvent(String serverId,
long latestScheduledTime,
boolean localDataOnly)
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 serverId, long latestScheduledTime, boolean localDataOnly)
serverId - the identifier of the server taking the event (never null)latestScheduledTime - the maximum scheduled time for eventslocalDataOnly - true to limit searches to events that have server-specific
data matching the given server IDpublic 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 © 2014. All rights reserved.