Overview  Package   Class  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

sajas.domain
Class DFService
java.lang.Object
  sajas.domain.FIPAService
      sajas.domain.DFService

public class DFService
extends FIPAService
The DFService is re-implemented to avoid blocking approaches, given SAJaS single thread nature. Public static methods to register, deregister and search are still available, but implemented as database operations, instead of requiring a FIPA communication with the DF agent.
Author:
joaolopes, hlc
See Also:
jade.domain.DFService

Constructor Summary
DFService()
Method Summary
static jade.lang.acl.ACLMessage
createCancelMessage(Agent a, jade.core.AID dfName, jade.lang.acl.ACLMessage subscribe)
static jade.lang.acl.ACLMessage
createRequestMessage(Agent a, jade.core.AID dfName, String action, jade.domain.FIPAAgentManagement.DFAgentDescription dfd, jade.domain.FIPAAgentManagement.SearchConstraints constraints)
static jade.lang.acl.ACLMessage
createSubscriptionMessage(Agent a, jade.core.AID dfName, jade.domain.FIPAAgentManagement.DFAgentDescription template, jade.domain.FIPAAgentManagement.SearchConstraints constraints)
static jade.domain.FIPAAgentManagement.DFAgentDescription
decodeDone(String s)
          Process the content of the final inform (Done) message resulting from a register or deregister action requested to a DF agent, extracting the df-agent-description contained within.
static jade.domain.FIPAAgentManagement.DFAgentDescription[]
decodeNotification(String s)
          Process the content of the inform message resulting from a subscription with a DF agent, extracting the array of df-agent-description objects contained within.
static jade.domain.FIPAAgentManagement.DFAgentDescription[]
decodeResult(String s)
          Process the content of the final inform (result) message resulting from a search action requested to a DF agent, extracting the array of df-agent-description contained within.
static void
deregister(Agent agent)
static void
deregister(Agent agent, jade.domain.FIPAAgentManagement.DFAgentDescription dfd)
static jade.core.AID
getDFAID()
static void
initialize()
          Initializes the DF service.
static jade.core.AID
parseAID(jade.content.lang.sl.SimpleSLTokenizer parser)
          The parser content has the form: agent-identifier ......)
static jade.domain.FIPAAgentManagement.DFAgentDescription
register(Agent agent, jade.domain.FIPAAgentManagement.DFAgentDescription dfd)
static jade.domain.FIPAAgentManagement.DFAgentDescription[]
search(Agent agent, jade.domain.FIPAAgentManagement.DFAgentDescription dfd)
static jade.domain.FIPAAgentManagement.DFAgentDescription[]
search(Agent agent, jade.domain.FIPAAgentManagement.DFAgentDescription dfd, jade.domain.FIPAAgentManagement.SearchConstraints constraints)
protected static void
setDFAID(jade.core.AID aid)
Methods inherited from class sajas.domain.FIPAService
doFipaRequestClient, doFipaRequestClient
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
DFService
public DFService()
Method Detail
setDFAID
protected static void setDFAID(jade.core.AID aid)

getDFAID
public static jade.core.AID getDFAID()

initialize
public static void initialize()
Initializes the DF service. Programmers should have no need to use this method.

register
public static jade.domain.FIPAAgentManagement.DFAgentDescription register(Agent agent,
                                                                          jade.domain.FIPAAgentManagement.DFAgentDescription dfd)
                                                                   throws jade.domain.FIPAException
Throws:
jade.domain.FIPAException
See Also:
jade.domain.DFService.register(jade.core.Agent, jade.domain.FIPAAgentManagement.DFAgentDescription)

deregister
public static void deregister(Agent agent,
                              jade.domain.FIPAAgentManagement.DFAgentDescription dfd)
                       throws jade.domain.FIPAException
Throws:
jade.domain.FIPAException
See Also:
jade.domain.DFService.deregister(jade.core.Agent, jade.domain.FIPAAgentManagement.DFAgentDescription)

deregister
public static void deregister(Agent agent)
                       throws jade.domain.FIPAException
Throws:
jade.domain.FIPAException
See Also:
jade.domain.DFService.deregister(jade.core.Agent)

search
public static jade.domain.FIPAAgentManagement.DFAgentDescription[] search(Agent agent,
                                                                          jade.domain.FIPAAgentManagement.DFAgentDescription dfd)
                                                                   throws jade.domain.FIPAException
Throws:
jade.domain.FIPAException
See Also:
jade.domain.DFService.search(jade.core.Agent, jade.domain.FIPAAgentManagement.DFAgentDescription)

search
public static jade.domain.FIPAAgentManagement.DFAgentDescription[] search(Agent agent,
                                                                          jade.domain.FIPAAgentManagement.DFAgentDescription dfd,
                                                                          jade.domain.FIPAAgentManagement.SearchConstraints constraints)
                                                                   throws jade.domain.FIPAException
Throws:
jade.domain.FIPAException
See Also:
jade.domain.DFService.search(jade.core.Agent, jade.domain.FIPAAgentManagement.DFAgentDescription, jade.domain.FIPAAgentManagement.SearchConstraints)

createRequestMessage
public static jade.lang.acl.ACLMessage createRequestMessage(Agent a,
                                                            jade.core.AID dfName,
                                                            String action,
                                                            jade.domain.FIPAAgentManagement.DFAgentDescription dfd,
                                                            jade.domain.FIPAAgentManagement.SearchConstraints constraints)
See Also:
jade.domain.DFService.createRequestMessage(jade.core.Agent, jade.core.AID, String, jade.domain.FIPAAgentManagement.DFAgentDescription, jade.domain.FIPAAgentManagement.SearchConstraints)

createSubscriptionMessage
public static jade.lang.acl.ACLMessage createSubscriptionMessage(Agent a,
                                                                 jade.core.AID dfName,
                                                                 jade.domain.FIPAAgentManagement.DFAgentDescription template,
                                                                 jade.domain.FIPAAgentManagement.SearchConstraints constraints)
See Also:
jade.domain.DFService.createSubscriptionMessage(jade.core.Agent, jade.core.AID, jade.domain.FIPAAgentManagement.DFAgentDescription, jade.domain.FIPAAgentManagement.SearchConstraints)

createCancelMessage
public static jade.lang.acl.ACLMessage createCancelMessage(Agent a,
                                                           jade.core.AID dfName,
                                                           jade.lang.acl.ACLMessage subscribe)
See Also:
jade.domain.DFService.createCancelMessage(jade.core.Agent, jade.core.AID, jade.lang.acl.ACLMessage)

decodeDone
public static jade.domain.FIPAAgentManagement.DFAgentDescription decodeDone(String s)
                                                                     throws jade.domain.FIPAException
Process the content of the final inform (Done) message resulting from a register or deregister action requested to a DF agent, extracting the df-agent-description contained within.
Returns:
The DFAgentDescription object included in the "done" expression used as the content of the INFORM message send back by the DF in response to a REQUEST to perform a register, deregister or modify action.
Throws:
jade.domain.FIPAException - If some error occurs while decoding

decodeResult
public static jade.domain.FIPAAgentManagement.DFAgentDescription[] decodeResult(String s)
                                                                         throws jade.domain.FIPAException
Process the content of the final inform (result) message resulting from a search action requested to a DF agent, extracting the array of df-agent-description contained within.
Returns:
The DFAgentDescription objects (as an array) included in the "result" expression used as the content of the INFORM message send back by the DF in response to a REQUEST to perform a search action.
Throws:
jade.domain.FIPAException - If some error occurs while decoding

decodeNotification
public static jade.domain.FIPAAgentManagement.DFAgentDescription[] decodeNotification(String s)
                                                                               throws jade.domain.FIPAException
Process the content of the inform message resulting from a subscription with a DF agent, extracting the array of df-agent-description objects contained within.
Returns:
The DFAgentDescription objects (as an array) included in the "(= (iota...) ...)" expression used as the content of an INFORM message sent back by the DF as a subscription notification.
Throws:
jade.domain.FIPAException - If some error occurs while decoding

parseAID
public static jade.core.AID parseAID(jade.content.lang.sl.SimpleSLTokenizer parser)
                              throws Exception
The parser content has the form: agent-identifier ......)
Throws:
Exception

Overview  Package   Class  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Java API documentation generated with DocFlex/Doclet 1.6.1 using JavadocPro template set.
DocFlex/Doclet is both a multi-format Javadoc doclet and a free edition of DocFlex/Javadoc, which is a template-driven programming tool for rapid development of any Javadoc-based Java API documentation generators (i.e. doclets). If you need to customize your Javadoc without writing a full-blown doclet from scratch, DocFlex/Javadoc may be the only tool able to help you! Find out more at www.docflex.com