public class FakeDocumentSnapshotRepositoryMonitorManager extends java.lang.Object implements DocumentSnapshotRepositoryMonitorManager
DocumentSnapshotRepositoryMonitorManager
for testing.Constructor and Description |
---|
FakeDocumentSnapshotRepositoryMonitorManager(ChangeSource changeSource,
junit.framework.TestCase testCase,
DocumentHandleFactory internalFactory,
DocumentHandleFactory clientFactory)
Construct a
FakeDocumentSnapshotRepositoryMonitorManager for
testing. |
Modifier and Type | Method and Description |
---|---|
void |
acceptGuarantees(java.util.Map<java.lang.String,MonitorCheckpoint> guarantees)
Receives information specifying what is guaranteed to be delivered to GSA.
|
void |
clean()
Removes persisted state for
DocumentSnapshotRepositoryMonitor
threads. |
CheckpointAndChangeQueue |
getCheckpointAndChangeQueue()
Returns the
CheckpointAndChangeQueue for this
DocumentSnapshotRepositoryMonitorManager |
int |
getCleanCount()
Returns the number of times
clean() has been called. |
int |
getGuaranteeCount()
Returns the number of times
acceptGuarantees(java.util.Map<java.lang.String, com.google.enterprise.connector.util.diffing.MonitorCheckpoint>) has been called. |
int |
getStartCount()
Returns the number of times
start(String)
has been called. |
int |
getStopCount()
Returns the number of times
stop() has been called. |
int |
getThreadCount()
Returns the number of
DocumentSnapshotRepositoryMonitor threads
that are alive. |
boolean |
isRunning()
Returns whether we are after a start() call and before a stop().
|
void |
setTraversalSchedule(TraversalSchedule traversalSchedule)
Receives
TraversalSchedule from TraversalManager which is
TraversalScheduleAware . |
void |
start(java.lang.String checkpoint)
Ensures all monitor threads are running.
|
void |
stop()
Stops all the configured
DocumentSnapshotRepositoryMonitor threads. |
public FakeDocumentSnapshotRepositoryMonitorManager(ChangeSource changeSource, junit.framework.TestCase testCase, DocumentHandleFactory internalFactory, DocumentHandleFactory clientFactory) throws java.io.IOException
FakeDocumentSnapshotRepositoryMonitorManager
for
testing.changeSource
- ChangeSource
testCase
- a JUnit TestCase
internalFactory
- a DocumentHandleFactory
clientFactory
- a DocumentHandleFactory
java.io.IOException
public void clean()
DocumentSnapshotRepositoryMonitorManager
DocumentSnapshotRepositoryMonitor
threads. After calling this DocumentSnapshotRepositoryMonitor
threads will no longer be able to resume from where they left off last
time.clean
in interface DocumentSnapshotRepositoryMonitorManager
public int getThreadCount()
DocumentSnapshotRepositoryMonitorManager
DocumentSnapshotRepositoryMonitor
threads
that are alive. This method is for testing purposes.getThreadCount
in interface DocumentSnapshotRepositoryMonitorManager
public void start(java.lang.String checkpoint)
DocumentSnapshotRepositoryMonitorManager
start
in interface DocumentSnapshotRepositoryMonitorManager
checkpoint
- for the last completed document or null if none have
been completed.public void stop()
DocumentSnapshotRepositoryMonitorManager
DocumentSnapshotRepositoryMonitor
threads.stop
in interface DocumentSnapshotRepositoryMonitorManager
public int getStartCount()
start(String)
has been called.public int getStopCount()
stop()
has been called.public int getCleanCount()
clean()
has been called.public int getGuaranteeCount()
acceptGuarantees(java.util.Map<java.lang.String, com.google.enterprise.connector.util.diffing.MonitorCheckpoint>)
has been called.public CheckpointAndChangeQueue getCheckpointAndChangeQueue()
DocumentSnapshotRepositoryMonitorManager
CheckpointAndChangeQueue
for this
DocumentSnapshotRepositoryMonitorManager
getCheckpointAndChangeQueue
in interface DocumentSnapshotRepositoryMonitorManager
public boolean isRunning()
DocumentSnapshotRepositoryMonitorManager
isRunning
in interface DocumentSnapshotRepositoryMonitorManager
public void acceptGuarantees(java.util.Map<java.lang.String,MonitorCheckpoint> guarantees)
DocumentSnapshotRepositoryMonitorManager
acceptGuarantees
in interface DocumentSnapshotRepositoryMonitorManager
public void setTraversalSchedule(TraversalSchedule traversalSchedule)
DocumentSnapshotRepositoryMonitorManager
TraversalSchedule
from TraversalManager which is
TraversalScheduleAware
.setTraversalSchedule
in interface DocumentSnapshotRepositoryMonitorManager