es.upv.dsic.gti_ia.architecture
Class FIPAQueryResponder

java.lang.Object
  extended by es.upv.dsic.gti_ia.architecture.FIPAQueryResponder

public class FIPAQueryResponder
extends Object

This class implements the FIPA-Query interaction protocol, Role Responder.

Version:
2009.9.07
Author:
Joan Bellver Faus, GTI-IA, DSIC, UPV

Field Summary
 QueueAgent myAgent
           
 
Constructor Summary
FIPAQueryResponder(QueueAgent _agent, MessageTemplate _template)
          Creates a new FIPA-Query interaction protocol, rol responder.
 
Method Summary
 void action()
          Runs the state machine with the communication protocol
 QueueAgent getQueueAgent()
          Returns the agent.
protected  ACLMessage prepareResponse(ACLMessage request)
          This method is called when the initiator's message is received that matches the message template passed in the constructor.
protected  ACLMessage prepareResultNotification(ACLMessage request, ACLMessage responder)
          This method is called after the response has been sent and only when one of the following two cases arise: the response was an agree message OR no response message was sent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myAgent

public QueueAgent myAgent
Constructor Detail

FIPAQueryResponder

public FIPAQueryResponder(QueueAgent _agent,
                          MessageTemplate _template)
Creates a new FIPA-Query interaction protocol, rol responder.

Parameters:
agent - is the reference to the Agent Object
template - is a MessageTemplate, will serve as a filter for receiving the right message
Method Detail

getQueueAgent

public QueueAgent getQueueAgent()
Returns the agent.

Returns:
QueueAgent

action

public void action()
Runs the state machine with the communication protocol


prepareResponse

protected ACLMessage prepareResponse(ACLMessage request)
                              throws NotUnderstoodException,
                                     RefuseException
This method is called when the initiator's message is received that matches the message template passed in the constructor.

Parameters:
request - initial message
Returns:
message
Throws:
NotUnderstoodException
RefuseException

prepareResultNotification

protected ACLMessage prepareResultNotification(ACLMessage request,
                                               ACLMessage responder)
                                        throws FailureException
This method is called after the response has been sent and only when one of the following two cases arise: the response was an agree message OR no response message was sent.

Parameters:
request - request message
responder - responder message
Returns:
message
Throws:
FailureException


Copyright © 2012 GTI-IA. All Rights Reserved.