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 voidclearHistory(java.lang.String connectorName)Removes all history associated with the connector.voidconnectorCompleted(java.lang.String connectorName, long finalDocCount)The connector has completed -- all documents have been fully processed.voidconnectorCompleting(java.lang.String connectorName)The connector is completing -- all documents have been sent but have not finished being processed.voidconnectorPaused(java.lang.String connectorName)A node has paused the connector.voidconnectorQueued(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.voidconnectorReset(java.lang.String connectorName)Indicates that the incremental state of the connector has been reset.voidconnectorResumed(java.lang.String connectorName)A node has resumed a paused connector.voidconnectorStarted(java.lang.String connectorName, long timestamp)A node has started executing the connector.ConnectorExecutionRecordgetCurrentExecutionRecord(java.lang.String connectorName)Note, the connector does not have to be defined.java.lang.Iterable<ConnectorExecutionRecord>getHistory(java.lang.String connectorName)ConnectorExecutionRecordgetLatestHistory(java.lang.String connectorName)voidreset()voidsetClientId(java.lang.String connectorName, java.util.UUID clientId)Associates the provided client id with the current run of the connector.voidupdateExtraRunInfo(java.lang.String connectorName, java.util.List<java.lang.String> extraRunInfo)Updates the extraRunInfo forconnectorName.voidupdateSentCount(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 AttivioExceptionThe connector has been submitted for execution on an AIE node. Indicates a transition from NOT_RUNNING to WAITING_TO_START.- Specified by:
connectorQueuedin interfaceConnectorHistoryApiclientId- the clientId to associate with this iteration of the connectorextraRunInfo- additional metadata to associate with the new executionexternal-trueif 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 AttivioExceptionA node has started executing the connector. Indicates a transition from WAITING_TO_START to RUNNING. Thetimestampparameter 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:
connectorStartedin interfaceConnectorHistoryApitimestamp- the timestamp associated with this connector execution.- Throws:
AttivioException
-
setClientId
public void setClientId(java.lang.String connectorName, java.util.UUID clientId) throws AttivioExceptionAssociates the provided client id with the current run of the connector.- Specified by:
setClientIdin interfaceConnectorHistoryApiclientId- the clientId to associate with this connector execution- Throws:
AttivioException
-
connectorPaused
public void connectorPaused(java.lang.String connectorName) throws AttivioException- Specified by:
connectorPausedin interfaceConnectorHistoryApi- Throws:
AttivioException
-
connectorResumed
public void connectorResumed(java.lang.String connectorName) throws AttivioException- Specified by:
connectorResumedin interfaceConnectorHistoryApi- Throws:
AttivioException
-
connectorCompleting
public void connectorCompleting(java.lang.String connectorName) throws AttivioExceptionThe connector is completing -- all documents have been sent but have not finished being processed. Indicates a transition from RUNNING to COMPLETING.- Specified by:
connectorCompletingin interfaceConnectorHistoryApi- Throws:
AttivioException
-
connectorCompleted
public void connectorCompleted(java.lang.String connectorName, long finalDocCount) throws AttivioExceptionThe 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:
connectorCompletedin interfaceConnectorHistoryApi- Throws:
AttivioException
-
updateSentCount
public void updateSentCount(java.lang.String connectorName, long docCount) throws AttivioExceptionUpdates the number of documents sent byconnectorName.- Specified by:
updateSentCountin interfaceConnectorHistoryApi- Throws:
AttivioException
-
clearHistory
public void clearHistory(java.lang.String connectorName) throws AttivioExceptionRemoves all history associated with the connector. If the connector is currently running the current history is not removed.- Specified by:
clearHistoryin interfaceConnectorHistoryApi- Throws:
AttivioException
-
getLatestHistory
public ConnectorExecutionRecord getLatestHistory(java.lang.String connectorName)
- Specified by:
getLatestHistoryin interfaceConnectorHistoryApi- Returns:
- the
ConnectorExecutionRecordwith the latest finish time ornullif the connector has never completed an execution.
-
getHistory
public java.lang.Iterable<ConnectorExecutionRecord> getHistory(java.lang.String connectorName)
- Specified by:
getHistoryin 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:
getCurrentExecutionRecordin interfaceConnectorHistoryApi- Returns:
- the
ConnectorExecutionRecordof the currently executing connectorconnectorNameornullif the connector is not currently executing.
-
reset
public void reset()
-
connectorReset
public void connectorReset(java.lang.String connectorName) throws AttivioExceptionIndicates 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:
connectorResetin interfaceConnectorHistoryApi- Throws:
AttivioException
-
updateExtraRunInfo
public void updateExtraRunInfo(java.lang.String connectorName, java.util.List<java.lang.String> extraRunInfo) throws AttivioExceptionUpdates the extraRunInfo forconnectorName. The existing run information is replaced withextraRunInfo.- Specified by:
updateExtraRunInfoin interfaceConnectorHistoryApi- Throws:
AttivioException
-
-