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.ConnectorExecutionRecord
getExecutionInfo(java.lang.String connectorName)
Gets execution information for the connector.void
pause(java.lang.String connectorName)
Pauses the named connectorvoid
reset(java.lang.String connectorName)
Resets the incremental state of the named connectorvoid
resume(java.lang.String connectorName)
Resumes the named connector if pausedjava.util.UUID
start(java.lang.String connectorName)
Starts the named connectorvoid
stop(java.lang.String connectorName)
Stops the connectorvoid
stop(java.lang.String connectorName, long shutdownWaitTimeout)
Stops the connectorboolean
waitForCompletion(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 AttivioException
Starts 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 AttivioException
Stops 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 returnstrue
immediately. 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 firstnumDocs
IngestDocuments
in aList
instead 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
List
ofIngestDocuments
s containing the captured documents. - Throws:
AttivioException
-
pause
void pause(java.lang.String connectorName) throws AttivioException
Pauses the named connector- Parameters:
connectorName
-- Throws:
AttivioException
-
resume
void resume(java.lang.String connectorName) throws AttivioException
Resumes the named connector if paused- Parameters:
connectorName
-- Throws:
AttivioException
-
reset
void reset(java.lang.String connectorName) throws AttivioException
Resets the incremental state of the named connector- Parameters:
connectorName
-- Throws:
AttivioException
-
-