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 - ChangeSourcetestCase - a JUnit TestCaseinternalFactory - a DocumentHandleFactoryclientFactory - a DocumentHandleFactoryjava.io.IOExceptionpublic void clean()
DocumentSnapshotRepositoryMonitorManagerDocumentSnapshotRepositoryMonitor
threads. After calling this DocumentSnapshotRepositoryMonitor
threads will no longer be able to resume from where they left off last
time.clean in interface DocumentSnapshotRepositoryMonitorManagerpublic int getThreadCount()
DocumentSnapshotRepositoryMonitorManagerDocumentSnapshotRepositoryMonitor threads
that are alive. This method is for testing purposes.getThreadCount in interface DocumentSnapshotRepositoryMonitorManagerpublic void start(java.lang.String checkpoint)
DocumentSnapshotRepositoryMonitorManagerstart in interface DocumentSnapshotRepositoryMonitorManagercheckpoint - for the last completed document or null if none have
been completed.public void stop()
DocumentSnapshotRepositoryMonitorManagerDocumentSnapshotRepositoryMonitor threads.stop in interface DocumentSnapshotRepositoryMonitorManagerpublic 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()
DocumentSnapshotRepositoryMonitorManagerCheckpointAndChangeQueue for this
DocumentSnapshotRepositoryMonitorManagergetCheckpointAndChangeQueue in interface DocumentSnapshotRepositoryMonitorManagerpublic boolean isRunning()
DocumentSnapshotRepositoryMonitorManagerisRunning in interface DocumentSnapshotRepositoryMonitorManagerpublic void acceptGuarantees(java.util.Map<java.lang.String,MonitorCheckpoint> guarantees)
DocumentSnapshotRepositoryMonitorManageracceptGuarantees in interface DocumentSnapshotRepositoryMonitorManagerpublic void setTraversalSchedule(TraversalSchedule traversalSchedule)
DocumentSnapshotRepositoryMonitorManagerTraversalSchedule from TraversalManager which is
TraversalScheduleAware.setTraversalSchedule in interface DocumentSnapshotRepositoryMonitorManager