Interface TopicManagementHelper

  • All Superinterfaces:
    ServiceHelper

    public interface TopicManagementHelper
    extends ServiceHelper
    The TopicManagementHelper provides methods that allows creating topic objects and registering/deregistering to topics. Topics are represented by means of AID objects so that they can be used as receivers of ACLMessages. In this way sending a message to an agent or sending a message about a topic is completely uniform.
    Author:
    Giovanni Caire - TILAB
    • Field Detail

      • SERVICE_NAME

        static final String SERVICE_NAME
        This constant represents the name of the Topic Management Service and must be specified in the getHelper() method of the Agent class to retrieve the helper of the local TopicManagementService.
        See Also:
        Constant Field Values
    • Method Detail

      • createTopic

        AID createTopic​(String topicName)
        Create a topic with a given name.
        Parameters:
        topicName - The name of the topic to be created
        Returns:
        The AID object representing the created topic
      • isTopic

        boolean isTopic​(AID id)
        Checks if an AID represents a topic
        Parameters:
        id - The AID to be checked
        Returns:
        true if the given AID represents a topic. false otherwise
      • register

        void register​(AID topic)
               throws ServiceException
        Register the agent associated to this helper to a given topic
        Parameters:
        topic - The topic to register to
        Throws:
        ServiceException - If some error occurs during the registration
      • register

        void register​(AID aid,
                      AID topic)
               throws ServiceException
        Register a given AID to a given topic. Registering a specific AID instead of the agent AID, allows registering an Alias or a Virtual agent AID
        Parameters:
        aid - The AID that is going to be registered
        topic - The topic to register to
        Throws:
        ServiceException - If some error occurs during the registration
      • deregister

        void deregister​(AID topic)
                 throws ServiceException
        De-register the agent associated to this helper from a given topic
        Parameters:
        topic - The topic to de-register from
        Throws:
        ServiceException - If some error occurs during the de-registration
      • deregister

        void deregister​(AID aid,
                        AID topic)
                 throws ServiceException
        De-register a given AID from a given topic
        Parameters:
        aid - The AID that is going to be de-registered
        topic - The topic to de-register from
        Throws:
        ServiceException - If some error occurs during the de-registration