|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jade.domain.FIPAServiceCommunicator
|
+--jade.domain.DFServiceCommunicator
This class provides a set of static methods to communicate with
a DF Service that complies with FIPA specifications.
It includes methods to register, deregister, modify and search with a DF.
Each of this method has version with all the needed parameters, or with a
subset of them where, those parameters that can be omitted have been
defaulted to the default DF of the platform, the AID of the sending agent,
the default Search Constraints.
Notice that all these methods blocks every activity of the agent until
the action (i.e. register/deregister/modify/search) has been successfully
executed or a jade.domain.FIPAException exception has been thrown
(e.g. because a FAILURE message has been received by the DF).
In some cases, instead, it is more convenient to execute this task in a
non-blocking way. The method getNonBlockingBehaviour() returns a
non-blocking behaviour of type RequestFIPAServiceBehaviour that can be
added to the queue of the agent behaviours, as usual, by using
Agent.addBehaviour().
| Constructor Summary | |
DFServiceCommunicator()
|
|
| Method Summary | |
static void |
deregister(Agent a)
The default DF of the platform is used. |
static void |
deregister(Agent a,
AID dfName)
A default Agent Description is used which contains only the AID of this agent. |
static void |
deregister(Agent a,
AID dfName,
DFAgentDescription dfd)
Deregister a DFAgentDescription from a DF agent. |
static void |
deregister(Agent a,
DFAgentDescription dfd)
The default DF of the platform is used. |
static RequestFIPAServiceBehaviour |
getNonBlockingBehaviour(Agent a,
AID dfName,
java.lang.String actionName)
the default SearchContraints are used. |
static RequestFIPAServiceBehaviour |
getNonBlockingBehaviour(Agent a,
AID dfName,
java.lang.String actionName,
DFAgentDescription dfd)
the default SearchContraints are used. |
static RequestFIPAServiceBehaviour |
getNonBlockingBehaviour(Agent a,
AID dfName,
java.lang.String actionName,
DFAgentDescription dfd,
SearchConstraints constraints)
In some cases it is more convenient to execute this tasks in a non-blocking way. |
static RequestFIPAServiceBehaviour |
getNonBlockingBehaviour(Agent a,
java.lang.String actionName)
The default DF is used. |
static RequestFIPAServiceBehaviour |
getNonBlockingBehaviour(Agent a,
java.lang.String actionName,
DFAgentDescription dfd)
The defautl DF is used. |
static RequestFIPAServiceBehaviour |
getNonBlockingBehaviour(Agent a,
java.lang.String actionName,
DFAgentDescription dfd,
SearchConstraints constraints)
The default DF is used. |
static void |
modify(Agent a,
AID dfName,
DFAgentDescription dfd)
Modifies data contained within a DF agent. |
static void |
modify(Agent a,
DFAgentDescription dfd)
The default DF of the platform is used. |
static void |
register(Agent a,
AID dfName,
DFAgentDescription dfd)
Register a DFDescriptiont with a DF agent. |
static void |
register(Agent a,
DFAgentDescription dfd)
registers a DFAgentDescription with the default DF |
static java.util.List |
search(Agent a,
AID dfName,
DFAgentDescription dfd)
The default SearchConstraints are used. |
static java.util.List |
search(Agent a,
AID dfName,
DFAgentDescription dfd,
SearchConstraints constraints)
Searches for data contained within a DF agent. |
static java.util.List |
search(Agent a,
DFAgentDescription dfd)
The default DF is used. |
static java.util.List |
search(Agent a,
DFAgentDescription dfd,
SearchConstraints constraints)
The default DF is used. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public DFServiceCommunicator()
| Method Detail |
public static void register(Agent a,
AID dfName,
DFAgentDescription dfd)
throws FIPAException
a - is the Agent performing the registration (it is needed in order
to send/receive messagesdfName - The AID of the DF agent to register with.dfd - A DFAgentDescriptor object containing all
data necessary to the registration. If the Agent name is empty, than
it is set according to the a parameter.refuse or failure messages are
received from the DF to indicate some error condition or when
the method locally discovers that the DFDescription is not valid.
public static void register(Agent a,
DFAgentDescription dfd)
throws FIPAException
DFAgentDescription with the default DFregister(Agent,AID,DFAgentDescription)
public static void deregister(Agent a,
AID dfName,
DFAgentDescription dfd)
throws FIPAException
dfName - The AID of the DF agent to deregister from.dfd - A DFAgentDescription object containing all
data necessary to the deregistration.refuse or failure messages are
received from the DF to indicate some error condition.
public static void deregister(Agent a,
DFAgentDescription dfd)
throws FIPAException
deregister(Agent a, AID dfName, DFAgentDescription dfd)
public static void deregister(Agent a,
AID dfName)
throws FIPAException
deregister(Agent a, AID dfName, DFAgentDescription dfd)
public static void deregister(Agent a)
throws FIPAException
deregister(Agent a, AID dfName, DFAgentDescription dfd)
public static void modify(Agent a,
AID dfName,
DFAgentDescription dfd)
throws FIPAException
a - is the Agent performing the request of modificationdfName - The AID of the DF agent holding the data
to be changed.dfd - A DFAgentDescriptor object containing all
new data values;refuse or failure messages are
received from the DF to indicate some error condition.
public static void modify(Agent a,
DFAgentDescription dfd)
throws FIPAException
modify(Agent a, AID dfName, DFAgentDescription dfd)
public static java.util.List search(Agent a,
AID dfName,
DFAgentDescription dfd,
SearchConstraints constraints)
throws FIPAException
a - is the Agent performing the request of searchdfName - The AID of the DF agent to start search from.dfd - A DFAgentDescription object containing
data to search for; this parameter is used as a template to match
data against.constraints - of the searchList
containing all found
DFAgentDescription objects matching the given
descriptor, subject to given search constraints for search depth
and result size.refuse or failure messages are
received from the DF to indicate some error condition.
public static java.util.List search(Agent a,
DFAgentDescription dfd,
SearchConstraints constraints)
throws FIPAException
search(Agent a, AID dfName, DFAgentDescription dfd, SearchConstraints constraints)
public static java.util.List search(Agent a,
DFAgentDescription dfd)
throws FIPAException
search(Agent a, AID dfName, DFAgentDescription dfd, SearchConstraints constraints)
public static java.util.List search(Agent a,
AID dfName,
DFAgentDescription dfd)
throws FIPAException
search(Agent a, AID dfName, DFAgentDescription dfd, SearchConstraints constraints)
public static RequestFIPAServiceBehaviour getNonBlockingBehaviour(Agent a,
AID dfName,
java.lang.String actionName,
DFAgentDescription dfd,
SearchConstraints constraints)
throws FIPAException
Agent.addBehaviour().
Several ways are available to get the result of this behaviour and the programmer can select one according to his preferred programming style:
a - is the agent performing the taskdfName - is the AID of the DF that should perform the requested actionactionName - is the name of the action (one of the constants defined
in FIPAAgentManagementOntology: REGISTER / DEREGISTER / MODIFY / SEARCH).dfd - is the agent descriptionconstraints - are the search constraints (can be null if this is
not a search operation)FIPAAgentManagementOntology
public static RequestFIPAServiceBehaviour getNonBlockingBehaviour(Agent a,
java.lang.String actionName,
DFAgentDescription dfd,
SearchConstraints constraints)
throws FIPAException
getNonBlockingBehaviour(Agent a, AID dfName, String actionName, DFAgentDescription dfd, SearchConstraints constraints)
public static RequestFIPAServiceBehaviour getNonBlockingBehaviour(Agent a,
java.lang.String actionName)
throws FIPAException
getNonBlockingBehaviour(Agent a, AID dfName, String actionName, DFAgentDescription dfd, SearchConstraints constraints)
public static RequestFIPAServiceBehaviour getNonBlockingBehaviour(Agent a,
AID dfName,
java.lang.String actionName)
throws FIPAException
getNonBlockingBehaviour(Agent a, AID dfName, String actionName, DFAgentDescription dfd, SearchConstraints constraints)
public static RequestFIPAServiceBehaviour getNonBlockingBehaviour(Agent a,
java.lang.String actionName,
DFAgentDescription dfd)
throws FIPAException
getNonBlockingBehaviour(Agent a, AID dfName, String actionName, DFAgentDescription dfd, SearchConstraints constraints)
public static RequestFIPAServiceBehaviour getNonBlockingBehaviour(Agent a,
AID dfName,
java.lang.String actionName,
DFAgentDescription dfd)
throws FIPAException
getNonBlockingBehaviour(Agent a, AID dfName, String actionName, DFAgentDescription dfd, SearchConstraints constraints)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||