Package com.attivio.sdk.client
Interface ConnectorControlApi
-
- All Superinterfaces:
ExposedApi
public interface ConnectorControlApi extends ExposedApi
API that allows for control over predefined connectors inside the AIE platform. This API requires a sticky client since the client for a set of control actions must communicate with the same server instance of the API. The usage pattern for the service discovery framework is:ConnectorControlApi api = ServiceFactoryFactory.get().getService(ConnectorControlApi.class); // ConnectorControlApi api = ServiceFactoryFactory.get().getService(ConnectorControlApi.class, "nodename", true); // for a specific node String clientId = api.start("connector1"); api.waitForCompletion(clientId, -1);
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<IngestDocument>debugConnector(java.lang.String connectorName, int numDocs)A method to help with debugging connectors.ConnectorExecutionRecordgetExecutionInfo(java.lang.String connectorName)Gets execution information for the connector.voidpause(java.lang.String connectorName)Pauses the named connectorvoidreset(java.lang.String connectorName)Resets the incremental state of the named connectorvoidresume(java.lang.String connectorName)Resumes the named connector if pausedjava.util.UUIDstart(java.lang.String connectorName)Starts the named connectorvoidstop(java.lang.String connectorName)Stops the connectorvoidstop(java.lang.String connectorName, long shutdownWaitTimeout)Stops the connectorbooleanwaitForCompletion(java.util.UUID clientId, long timeout)Wait for the connector to complete with an optional timeout.
-
-
-
Method Detail
-
start
java.util.UUID start(java.lang.String connectorName) throws AttivioExceptionStarts the named connector- Parameters:
connectorName- the connector to start crawling on- Returns:
- the clientId issued for the connector run
- Throws:
AttivioException
-
stop
void stop(java.lang.String connectorName) throws AttivioException
Stops the connector- Parameters:
connectorName- the connector to stop- Throws:
AttivioException
-
stop
void stop(java.lang.String connectorName, long shutdownWaitTimeout) throws AttivioExceptionStops the connector- Parameters:
connectorName- the connector to stopshutdownWaitTimeout- time in milliseconds to wait for the connector to stop before interrupting it- Throws:
AttivioException
-
getExecutionInfo
ConnectorExecutionRecord getExecutionInfo(java.lang.String connectorName) throws AttivioException
Gets execution information for the connector. Defers toConnectorHistoryApi.getCurrentExecutionRecord(String). If the connector is not currently running, then the latest history for the connector is fetched. If the connector has never run then a default ConnectorExecutionRecord is created with a status of NOT_RUNNING.- Parameters:
connectorName- the connector to get execution information for- Returns:
- execution information
- Throws:
AttivioException
-
waitForCompletion
boolean waitForCompletion(java.util.UUID clientId, long timeout)Wait for the connector to complete with an optional timeout. Note, if the connector was not started on the node the API is connected to, this method returnstrueimmediately. See the javadoc for this class for details.- Parameters:
clientId- client (returned by start method) to wait fortimeout- time to wait in milliseconds for all connectors to complete, -1 will cause the client to wait until complete.- Returns:
- true if the connector completed before the timeout, false otherwise.
-
debugConnector
java.util.List<IngestDocument> debugConnector(java.lang.String connectorName, int numDocs) throws AttivioException
A method to help with debugging connectors. This starts the connector and captures the firstnumDocsIngestDocumentsin aListinstead of forwarding the documents to a downstream workflow.- Parameters:
connectorName- The name of the connector to start and capture documents from.numDocs- The maximum number of documents to capture.- Returns:
- A
ListofIngestDocumentss containing the captured documents. - Throws:
AttivioException
-
pause
void pause(java.lang.String connectorName) throws AttivioExceptionPauses the named connector- Parameters:
connectorName-- Throws:
AttivioException
-
resume
void resume(java.lang.String connectorName) throws AttivioExceptionResumes the named connector if paused- Parameters:
connectorName-- Throws:
AttivioException
-
reset
void reset(java.lang.String connectorName) throws AttivioExceptionResets the incremental state of the named connector- Parameters:
connectorName-- Throws:
AttivioException
-
-