Package com.attivio.service
Class MockUnclusteredEventStore
- java.lang.Object
-
- com.attivio.service.MockUnclusteredEventStore
-
- All Implemented Interfaces:
EventStoreApi,java.io.Closeable,java.lang.AutoCloseable
public class MockUnclusteredEventStore extends java.lang.Object implements EventStoreApi, java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description MockUnclusteredEventStore()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledgeEvent(long eventId, java.lang.String user, java.lang.String reason)longaddEvent(SystemEvent event)static voidclear()voidclose()longcountEvents()SystemEventgetEvent(long eventId)EventQuerygetEvents(EventQuery query)Executes the event query.
-
-
-
Method Detail
-
clear
public static void clear()
-
addEvent
public long addEvent(SystemEvent event) throws AttivioException
- Specified by:
addEventin interfaceEventStoreApi- Returns:
- event Id
- Throws:
AttivioException
-
getEvent
public SystemEvent getEvent(long eventId)
- Specified by:
getEventin interfaceEventStoreApi- Returns:
- the SystemEvent for the eventId
-
getEvents
public EventQuery getEvents(EventQuery query) throws AttivioException
Description copied from interface:EventStoreApiExecutes the event query. IfEventQuery.getMaxFetchSize()is > 0, multiple calls might be needed to get all the events. In that case,getEvents()should be called untilEventQuery.isDone()returnstrue. Note that the last call might return an empty list. An exception is thrown ifgetEvents()is called afterEventQuery.isDone().EventQuery eventQuery = new EventQuery(); eventQuery.setSubsystem(subsystem); eventQuery.setStart(start); eventQuery.setEnd(end); eventQuery.setGetAlreadyAcknowledged(getAcknoledeged); eventQuery.setMaxFetchSize(maxFetchSize); while (!eventQuery.isDone()) { eventQuery = eventStore().getEvents(eventQuery); // Do something with eventQuery.getEventList() }- Specified by:
getEventsin interfaceEventStoreApi- Parameters:
query- the caller must pass the EventQuery object returned from the previous call- Returns:
- the query object to be used in the next getEvents call
- Throws:
AttivioException
-
acknowledgeEvent
public void acknowledgeEvent(long eventId, java.lang.String user, java.lang.String reason) throws AttivioException- Specified by:
acknowledgeEventin interfaceEventStoreApi- Throws:
AttivioException
-
countEvents
public long countEvents() throws AttivioException- Specified by:
countEventsin interfaceEventStoreApi- Returns:
- the number of stored events
- Throws:
AttivioException
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-