Package com.attivio.platform.store
Class MockConnectorHistory
- java.lang.Object
-
- com.attivio.platform.store.MockConnectorHistory
-
- All Implemented Interfaces:
ConnectorHistoryApi
public class MockConnectorHistory extends java.lang.Object implements ConnectorHistoryApi
-
-
Field Summary
-
Fields inherited from interface com.attivio.sdk.client.ConnectorHistoryApi
CONNECTOR_ABANDONMENT_DELAY, CONNECTOR_HISTORY_RECORD_EMPTY_EXECUTIONS
-
-
Constructor Summary
Constructors Constructor Description MockConnectorHistory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearHistory(java.lang.String connectorName)
Removes all history associated with the connector.void
connectorCompleted(java.lang.String connectorName, long finalDocCount)
The connector has completed -- all documents have been fully processed.void
connectorCompleting(java.lang.String connectorName)
The connector is completing -- all documents have been sent but have not finished being processed.void
connectorPaused(java.lang.String connectorName)
A node has paused the connector.void
connectorQueued(java.lang.String connectorName, java.util.UUID clientId, java.lang.String workflow, java.util.List<java.lang.String> extraRunInfo, boolean external)
The connector has been submitted for execution on an AIE node.void
connectorReset(java.lang.String connectorName)
Indicates that the incremental state of the connector has been reset.void
connectorResumed(java.lang.String connectorName)
A node has resumed a paused connector.void
connectorStarted(java.lang.String connectorName, long timestamp)
A node has started executing the connector.ConnectorExecutionRecord
getCurrentExecutionRecord(java.lang.String connectorName)
Note, the connector does not have to be defined.java.lang.Iterable<ConnectorExecutionRecord>
getHistory(java.lang.String connectorName)
ConnectorExecutionRecord
getLatestHistory(java.lang.String connectorName)
void
reset()
void
setClientId(java.lang.String connectorName, java.util.UUID clientId)
Associates the provided client id with the current run of the connector.void
updateExtraRunInfo(java.lang.String connectorName, java.util.List<java.lang.String> extraRunInfo)
Updates the extraRunInfo forconnectorName
.void
updateSentCount(java.lang.String connectorName, long docCount)
Updates the number of documents sent byconnectorName
.
-
-
-
Method Detail
-
connectorQueued
public void connectorQueued(java.lang.String connectorName, java.util.UUID clientId, java.lang.String workflow, java.util.List<java.lang.String> extraRunInfo, boolean external) throws AttivioException
The connector has been submitted for execution on an AIE node. Indicates a transition from NOT_RUNNING to WAITING_TO_START.- Specified by:
connectorQueued
in interfaceConnectorHistoryApi
clientId
- the clientId to associate with this iteration of the connectorextraRunInfo
- additional metadata to associate with the new executionexternal
-true
if the connector is an external connector- Throws:
AttivioException
- with if connector is already executing
-
connectorStarted
public void connectorStarted(java.lang.String connectorName, long timestamp) throws AttivioException
A node has started executing the connector. Indicates a transition from WAITING_TO_START to RUNNING. Thetimestamp
parameter is used to associate a connector execution and subsequent incremental executions with each other. It will generally be the start time of the baseline connector execution.- Specified by:
connectorStarted
in interfaceConnectorHistoryApi
timestamp
- the timestamp associated with this connector execution.- Throws:
AttivioException
-
setClientId
public void setClientId(java.lang.String connectorName, java.util.UUID clientId) throws AttivioException
Associates the provided client id with the current run of the connector.- Specified by:
setClientId
in interfaceConnectorHistoryApi
clientId
- the clientId to associate with this connector execution- Throws:
AttivioException
-
connectorPaused
public void connectorPaused(java.lang.String connectorName) throws AttivioException
- Specified by:
connectorPaused
in interfaceConnectorHistoryApi
- Throws:
AttivioException
-
connectorResumed
public void connectorResumed(java.lang.String connectorName) throws AttivioException
- Specified by:
connectorResumed
in interfaceConnectorHistoryApi
- Throws:
AttivioException
-
connectorCompleting
public void connectorCompleting(java.lang.String connectorName) throws AttivioException
The connector is completing -- all documents have been sent but have not finished being processed. Indicates a transition from RUNNING to COMPLETING.- Specified by:
connectorCompleting
in interfaceConnectorHistoryApi
- Throws:
AttivioException
-
connectorCompleted
public void connectorCompleted(java.lang.String connectorName, long finalDocCount) throws AttivioException
The connector has completed -- all documents have been fully processed. Indicates a transition from COMPLETING to NOT_RUNNING. The current time becomes the time returned byConnectorExecutionRecord.getFinishTime()
for the history record.- Specified by:
connectorCompleted
in interfaceConnectorHistoryApi
- Throws:
AttivioException
-
updateSentCount
public void updateSentCount(java.lang.String connectorName, long docCount) throws AttivioException
Updates the number of documents sent byconnectorName
.- Specified by:
updateSentCount
in interfaceConnectorHistoryApi
- Throws:
AttivioException
-
clearHistory
public void clearHistory(java.lang.String connectorName) throws AttivioException
Removes all history associated with the connector. If the connector is currently running the current history is not removed.- Specified by:
clearHistory
in interfaceConnectorHistoryApi
- Throws:
AttivioException
-
getLatestHistory
public ConnectorExecutionRecord getLatestHistory(java.lang.String connectorName)
- Specified by:
getLatestHistory
in interfaceConnectorHistoryApi
- Returns:
- the
ConnectorExecutionRecord
with the latest finish time ornull
if the connector has never completed an execution.
-
getHistory
public java.lang.Iterable<ConnectorExecutionRecord> getHistory(java.lang.String connectorName)
- Specified by:
getHistory
in interfaceConnectorHistoryApi
- Returns:
- all the history records for this connector.
-
getCurrentExecutionRecord
public ConnectorExecutionRecord getCurrentExecutionRecord(java.lang.String connectorName)
Note, the connector does not have to be defined.- Specified by:
getCurrentExecutionRecord
in interfaceConnectorHistoryApi
- Returns:
- the
ConnectorExecutionRecord
of the currently executing connectorconnectorName
ornull
if the connector is not currently executing.
-
reset
public void reset()
-
connectorReset
public void connectorReset(java.lang.String connectorName) throws AttivioException
Indicates that the incremental state of the connector has been reset. Invalid to call while a connector is currently executing. After this call, the latest history for the connector will have a status ofConnectorExecutionStatus.RESET
.- Specified by:
connectorReset
in interfaceConnectorHistoryApi
- Throws:
AttivioException
-
updateExtraRunInfo
public void updateExtraRunInfo(java.lang.String connectorName, java.util.List<java.lang.String> extraRunInfo) throws AttivioException
Updates the extraRunInfo forconnectorName
. The existing run information is replaced withextraRunInfo
.- Specified by:
updateExtraRunInfo
in interfaceConnectorHistoryApi
- Throws:
AttivioException
-
-