Interface IAgent

  • All Known Implementing Classes:
    CrawlerAgent

    public interface IAgent
    This interface describes the external functionality of an agent class. Agents are all poked at start-up time; they run independently until the JVM is shut down. All agent classes are expected to support the following constructor: xxx() throws ManifoldCFException Agent classes are furthermore expected to be cross-thread, but not necessarily thread-safe in that a given IAgent instance is meant to be used by only one thread at a time. It is furthermore safe to keep stateful data in the IAgent instance object pertaining to the running state of the system. That is, an instance of IAgent used to start the agent will be the same one stopAgent() is called with.
    • Method Detail

      • initialize

        void initialize​(IThreadContext threadContext)
                 throws ManifoldCFException
        Initialize agent environment. This is called before any of the other operations are called, and is meant to insure that the environment is properly initialized.
        Throws:
        ManifoldCFException
      • clusterInit

        void clusterInit​(IThreadContext threadContext)
                  throws ManifoldCFException
        Called ONLY when no other active services of this kind are running. Meant to be used after the cluster has been down for an indeterminate period of time.
        Throws:
        ManifoldCFException
      • cleanUpAllAgentData

        void cleanUpAllAgentData​(IThreadContext threadContext,
                                 java.lang.String currentProcessID)
                          throws ManifoldCFException
        Cleanup after ALL agents processes. Call this method to clean up dangling persistent state when a cluster is just starting to come up. This method CANNOT be called when there are any active agents processes at all.
        Parameters:
        currentProcessID - is the current process ID.
        Throws:
        ManifoldCFException
      • cleanUpAgentData

        void cleanUpAgentData​(IThreadContext threadContext,
                              java.lang.String currentProcessID,
                              java.lang.String cleanupProcessID)
                       throws ManifoldCFException
        Cleanup after agents process. Call this method to clean up dangling persistent state after agent has been stopped. This method CANNOT be called when the agent is active, but it can be called at any time and by any process in order to guarantee that a terminated agent does not block other agents from completing their tasks.
        Parameters:
        currentProcessID - is the current process ID.
        cleanupProcessID - is the process ID of the agent to clean up after.
        Throws:
        ManifoldCFException
      • startAgent

        void startAgent​(IThreadContext threadContext,
                        java.lang.String processID)
                 throws ManifoldCFException
        Start the agent. This method should spin up the agent threads, and then return.
        Parameters:
        processID - is the process ID to start up an agent for.
        Throws:
        ManifoldCFException
      • isOutputConnectionInUse

        boolean isOutputConnectionInUse​(IThreadContext threadContext,
                                        java.lang.String connName)
                                 throws ManifoldCFException
        Request permission from agent to delete an output connection.
        Parameters:
        connName - is the name of the output connection.
        Returns:
        true if the connection is in use, false otherwise.
        Throws:
        ManifoldCFException
      • noteOutputConnectorDeregistration

        void noteOutputConnectorDeregistration​(IThreadContext threadContext,
                                               java.lang.String[] connectionNames)
                                        throws ManifoldCFException
        Note the deregistration of a set of output connections.
        Parameters:
        connectionNames - are the names of the connections being deregistered.
        Throws:
        ManifoldCFException
      • noteOutputConnectorRegistration

        void noteOutputConnectorRegistration​(IThreadContext threadContext,
                                             java.lang.String[] connectionNames)
                                      throws ManifoldCFException
        Note the registration of a set of output connections.
        Parameters:
        connectionNames - are the names of the connections being registered.
        Throws:
        ManifoldCFException
      • noteOutputConnectionChange

        void noteOutputConnectionChange​(IThreadContext threadContext,
                                        java.lang.String connectionName)
                                 throws ManifoldCFException
        Note a change in configuration for an output connection.
        Parameters:
        connectionName - is the name of the connection being changed.
        Throws:
        ManifoldCFException
      • isTransformationConnectionInUse

        boolean isTransformationConnectionInUse​(IThreadContext threadContext,
                                                java.lang.String connName)
                                         throws ManifoldCFException
        Request permission from agent to delete a transformation connection.
        Parameters:
        connName - is the name of the transformation connection.
        Returns:
        true if the connection is in use, false otherwise.
        Throws:
        ManifoldCFException
      • noteTransformationConnectorDeregistration

        void noteTransformationConnectorDeregistration​(IThreadContext threadContext,
                                                       java.lang.String[] connectionNames)
                                                throws ManifoldCFException
        Note the deregistration of a set of transformation connections.
        Parameters:
        connectionNames - are the names of the connections being deregistered.
        Throws:
        ManifoldCFException
      • noteTransformationConnectorRegistration

        void noteTransformationConnectorRegistration​(IThreadContext threadContext,
                                                     java.lang.String[] connectionNames)
                                              throws ManifoldCFException
        Note the registration of a set of transformation connections.
        Parameters:
        connectionNames - are the names of the connections being registered.
        Throws:
        ManifoldCFException
      • noteTransformationConnectionChange

        void noteTransformationConnectionChange​(IThreadContext threadContext,
                                                java.lang.String connectionName)
                                         throws ManifoldCFException
        Note a change in configuration for a transformation connection.
        Parameters:
        connectionName - is the name of the connection being changed.
        Throws:
        ManifoldCFException