public class MongoResultService extends AbstractResultService
ResultService.EventSummary, ResultService.ResultHandler
Constructor and Description |
---|
MongoResultService(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 |
countEventsByFailure() |
long |
countEventsByName(String name)
Count the number of previously-completed events with the given name.
|
long |
countEventsBySuccess() |
String |
getDataLocation()
Get details on the location of the results that the service is accessing
|
List<String> |
getEventNames()
Get a discrete list of event names from across all the results
|
long |
getMaxStartTime() |
long |
getMinStartTime() |
List<EventRecord> |
getResults(boolean successOrFail,
int skip,
int limit)
Retrieve a page of event results matching the success property.
|
List<EventRecord> |
getResults(long startTime,
String eventName,
Boolean successOrFail,
int skip,
int limit)
Retrieve a page of event results using a time window
|
List<EventRecord> |
getResults(String eventName,
int skip,
int limit)
Retrieve a page of event results by event name
|
List<EventRecord> |
getResultsForSession(String eventSessionId,
int skip,
int limit)
Retrieve a page of event results by event session ID
|
EventRecord |
recordResult(EventRecord result)
Simply store an event for later use
|
getResults, getResults
public MongoResultService(org.springframework.data.mongodb.core.MongoTemplate mongo, String collection)
mongo
- the MongoDB template to usecollection
- the name of the MongoDB collectionpublic String getDataLocation()
ResultService
public EventRecord recordResult(EventRecord result)
ResultService
result
- the result to storepublic List<EventRecord> getResults(String eventName, int skip, int limit)
ResultService
eventName
- the name of the event as recordedskip
- the number of results to skip (for paging)limit
- the number of results to retrievepublic List<EventRecord> getResults(boolean successOrFail, int skip, int limit)
ResultService
public List<EventRecord> getResultsForSession(String eventSessionId, int skip, int limit)
ResultService
eventSessionId
- the event session ID
skip
- the number of results to skip (for paging)limit
- the number of results to retrievepublic List<EventRecord> getResults(long startTime, String eventName, Boolean successOrFail, int skip, int limit)
ResultService
startTime
- the first event time (inclusive, milliseconds)eventName
- the name of the event to use or null for all event namessuccessOrFail
- true for success only or false for failures (null for all)public List<String> getEventNames()
ResultService
public long countEventsByName(String name)
ResultService
name
- the name of the event as recoredpublic long countEventsBySuccess()
public long countEventsByFailure()
public long getMinStartTime()
public long getMaxStartTime()
Copyright © 2014. All rights reserved.