Package jade.core.messaging
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 ofAIDobjects 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 Summary
Fields Modifier and Type Field Description static StringSERVICE_NAMEThis constant represents the name of the Topic Management Service and must be specified in thegetHelper()method of theAgentclass to retrieve the helper of the local TopicManagementService.static StringTOPIC_SUFFIXstatic StringTOPIC_TEMPLATE_WILDCARD
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AIDcreateTopic(String topicName)Create a topic with a given name.voidderegister(AID topic)De-register the agent associated to this helper from a given topicvoidderegister(AID aid, AID topic)De-register a given AID from a given topicbooleanisTopic(AID id)Checks if anAIDrepresents a topicvoidregister(AID topic)Register the agent associated to this helper to a given topicvoidregister(AID aid, AID topic)Register a given AID to a given topic.-
Methods inherited from interface jade.core.ServiceHelper
init
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
This constant represents the name of the Topic Management Service and must be specified in thegetHelper()method of theAgentclass to retrieve the helper of the local TopicManagementService.- See Also:
- Constant Field Values
-
TOPIC_SUFFIX
static final String TOPIC_SUFFIX
- See Also:
- Constant Field Values
-
TOPIC_TEMPLATE_WILDCARD
static final String TOPIC_TEMPLATE_WILDCARD
- 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
AIDobject representing the created topic
-
isTopic
boolean isTopic(AID id)
Checks if anAIDrepresents a topic- Parameters:
id- TheAIDto be checked- Returns:
trueif the givenAIDrepresents a topic.falseotherwise
-
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 registeredtopic- 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-registeredtopic- The topic to de-register from- Throws:
ServiceException- If some error occurs during the de-registration
-
-