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 connector
      void reset​(java.lang.String connectorName)
      Resets the incremental state of the named connector
      void resume​(java.lang.String connectorName)
      Resumes the named connector if paused
      java.util.UUID start​(java.lang.String connectorName)
      Starts the named connector
      void stop​(java.lang.String connectorName)
      Stops the connector
      void stop​(java.lang.String connectorName, long shutdownWaitTimeout)
      Stops the connector
      boolean 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 stop
        shutdownWaitTimeout - time in milliseconds to wait for the connector to stop before interrupting it
        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 returns true immediately. See the javadoc for this class for details.
        Parameters:
        clientId - client (returned by start method) to wait for
        timeout - 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 first numDocs IngestDocuments in a List 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 of IngestDocumentss containing the captured documents.
        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