Package emissary.core

Interface IMobileAgent

    • Method Detail

      • agentId

        String agentId()
        Return the unique agent id
      • getPayload

        IBaseDataObject getPayload()
        Get a reference to the payload this agent is responsible for
      • go

        void go​(Object payload,
                IServiceProviderPlace sourcePlace)
        Send an agent on its way with the specified payload The payload is not processed at sourcePlace, source is only used to get directory access to figure out where to go next.
        Parameters:
        payload - the payload IBaseDataObject or list thereof
        sourcePlace - the place sending the payload the key of this place will be added to the transform history but the payload will not be processed here
      • arrive

        void arrive​(Object payload,
                    IServiceProviderPlace arrivalPlace,
                    int mec,
                    List<DirectoryEntry> iq)
             throws Exception
        Arriving payload assigned to an agent for process at arrivalPlace
        Parameters:
        payload - the payload IBaseDataObject or list thereof
        arrivalPlace - the place to begin processing the payload has already been added to the transform history by the sender
        mec - the move error count to update the agent's state
        iq - the list of DirectoryEntry stored itinerary steps if any
        Throws:
        Exception
      • getMoveErrorCount

        int getMoveErrorCount()
        Retrieve the current move error count
      • getItineraryQueueItems

        DirectoryEntry[] getItineraryQueueItems()
        Retreive the current list of stored itinerary steps
        Returns:
        array of DirectoryEntry
      • isInUse

        boolean isInUse()
        Return true if agent is working on a payload
      • getPayloadForTransport

        Object getPayloadForTransport()
        Get the payload as an object for serialization during transport.
      • getName

        String getName()
        Get the name of the current payload
      • getLastPlaceProcessed

        String getLastPlaceProcessed()
        get the name of the last place processed.
      • killAgent

        void killAgent()
        Call this method to permanently stop the running thread when we finish what we are doing
      • killAgentAsync

        void killAgentAsync()
        Call this method to permanently stop the running thread eventually Returns immediately
      • isZombie

        boolean isZombie()
        Determine if this agent is walking un-dead
      • interrupt

        void interrupt()
        Interrupte the agent's thread
      • getMaxMoveErrors

        int getMaxMoveErrors()
        Get the number of move errors
      • setMaxMoveErrors

        void setMaxMoveErrors​(int value)
        Set the maximum number of move attempts that can error out before this instance will quit trying and set the workflow to be an ERROR condition
        Parameters:
        value - the maximum number of move failures
      • getMaxItinerarySteps

        int getMaxItinerarySteps()
        Get the maximum number of itinerary steps
      • setMaxItinerarySteps

        void setMaxItinerarySteps​(int value)
        Set the maximum number of itinerary steps before this instance will turn the workflow into an ERROR condition
        Parameters:
        value - the new maximum number of steps
      • payloadCount

        default int payloadCount()
        Returns the current payload count of the agent.
        Returns:
        default value of 1