public class MongoResultService extends AbstractResultService implements LifecycleListener
ResultService.ResultHandler| Constructor and Description |
|---|
MongoResultService(com.mongodb.DB db,
String collection)
Construct a test result provider against a Mongo database and given collection name
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
clear()
Clears all recorded data
|
long |
countResults()
Count the number of events
|
long |
countResultsByEventName(String name)
Count the number of previously-completed events with the given name.
|
long |
countResultsByFailure() |
long |
countResultsBySuccess() |
String |
getDataLocation() |
List<EventDetails> |
getEventDetails(EventResultFilter filter,
String filterEventName,
int skip,
int limit)
Query and returns event result details as requested.
|
List<String> |
getEventNames()
Get a discrete list of event names from across all the results
|
EventRecord |
getFirstResult()
Retrieve the first result by start time
|
EventRecord |
getLastResult()
Retrieve the last result by start time
|
List<EventRecord> |
getResults(long startTime,
long endTime,
boolean chartOnly,
int skip,
int limit)
Retrieve a page of event results using a time window, filtering by chartability
|
List<EventRecord> |
getResults(String eventName,
int skip,
int limit)
Retrieve a page of event results by event name
|
void |
recordResult(EventRecord result)
Simply store an event for later use
|
void |
start() |
void |
stop() |
getResultspublic MongoResultService(com.mongodb.DB db,
String collection)
public void start()
throws Exception
start in interface LifecycleListenerExceptionpublic void stop()
stop in interface LifecycleListenerpublic void recordResult(EventRecord result)
ResultServicerecordResult in interface ResultServiceresult - the result to storepublic String getDataLocation()
getDataLocation in interface ResultServicepublic EventRecord getFirstResult()
ResultServicegetFirstResult in interface ResultServicepublic EventRecord getLastResult()
ResultServicegetLastResult in interface ResultServicepublic List<EventRecord> getResults(String eventName, int skip, int limit)
ResultServicegetResults in interface ResultServiceeventName - 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(long startTime, long endTime, boolean chartOnly, int skip, int limit)
ResultServicegetResults in interface ResultServicestartTime - the first event time (inclusive, milliseconds)endTime - the last event time (exclusive, milliseconds)chartOnly - true to only retrieve results for chartingpublic List<String> getEventNames()
ResultServicegetEventNames in interface ResultServicepublic long countResults()
ResultServicecountResults in interface ResultServicepublic long countResultsByEventName(String name)
ResultServicecountResultsByEventName in interface ResultServicename - the name of the event as recoredpublic long countResultsBySuccess()
countResultsBySuccess in interface ResultServicepublic long countResultsByFailure()
countResultsByFailure in interface ResultServicepublic List<EventDetails> getEventDetails(EventResultFilter filter, String filterEventName, int skip, int limit)
ResultServicegetEventDetails in interface ResultServicefilter - (EventResultFilter) filter by fail / success / nonefilterEventName - (String, optional) if set only the results for the given event will be returnedskip - (int) useful for paginglimit - (int) max number of results to returnpublic boolean clear()
ResultServiceclear in interface ResultServiceCopyright © 2005–2018 Alfresco Software. All rights reserved.