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 void
acknowledgeEvent(long eventId, java.lang.String user, java.lang.String reason)
long
addEvent(SystemEvent event)
static void
clear()
void
close()
long
countEvents()
SystemEvent
getEvent(long eventId)
EventQuery
getEvents(EventQuery query)
Executes the event query.
-
-
-
Method Detail
-
clear
public static void clear()
-
addEvent
public long addEvent(SystemEvent event) throws AttivioException
- Specified by:
addEvent
in interfaceEventStoreApi
- Returns:
- event Id
- Throws:
AttivioException
-
getEvent
public SystemEvent getEvent(long eventId)
- Specified by:
getEvent
in interfaceEventStoreApi
- Returns:
- the SystemEvent for the eventId
-
getEvents
public EventQuery getEvents(EventQuery query) throws AttivioException
Description copied from interface:EventStoreApi
Executes 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:
getEvents
in 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:
acknowledgeEvent
in interfaceEventStoreApi
- Throws:
AttivioException
-
countEvents
public long countEvents() throws AttivioException
- Specified by:
countEvents
in interfaceEventStoreApi
- Returns:
- the number of stored events
- Throws:
AttivioException
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-