fipaos.platform.dfgui
Class DFGUIAgent

java.lang.Object
  |
  +--fipaos.agent.FIPAOSAgent
        |
        +--fipaos.platform.dfgui.DFGUIAgent
All Implemented Interfaces:
ConversationListener
Direct Known Subclasses:
DFGUITestAgent, SwingDFGUIAgent

public abstract class DFGUIAgent
extends FIPAOSAgent

This a basic shell for DFGUI implementations to extend - all Agent based interactions are handled by this class, enabling developers to concentrate on the UI to present this functionality/information


Inner classes inherited from class fipaos.agent.FIPAOSAgent
FIPAOSAgent.TopLevelHandlerTask
 
Fields inherited from class fipaos.agent.FIPAOSAgent
_database_profile, _registered_with, _state, _tm
 
Constructor Summary
DFGUIAgent(java.lang.String name, java.lang.String platform, java.lang.String owner)
          Generic constructor - see FIPAOSAgent
 
Method Summary
protected  boolean deregisterAgent(AgentID df, DFAgentDescription dfad)
          Deregisters the DFAgentDescription with the given DF Agent
abstract  void deregistered(AgentID df, DFAgentDescription df_desc)
          Invoked when an Agent has been deregistered with a DF that has previously been searched
 java.util.Map federatedSearch(AgentID df, int depth)
          Send a federated search to the given DF, and retrieve the results
protected  java.util.Map listAgents(AgentID df)
          Lists the Agents registered with a particular DF.
abstract  void modified(AgentID df, DFAgentDescription df_desc)
          Invoked when an Agent has been modified with a DF that has previously been searched
protected  boolean modifyAgent(AgentID df, DFAgentDescription dfad)
          Modifies the DFAgentDescription within the given DF Agent
protected  boolean registerAgent(AgentID df, DFAgentDescription dfad)
          Registers the DFAgentDescription with the given DF Agent
abstract  void registered(AgentID df, DFAgentDescription df_desc)
          Invoked when an Agent has been registered with a DF that has previously been searched
 void shutdown()
          Shutdown the DFGUI Agent "nicely" (attempts to cancel subscriptions to DF's before killing the Agent).
protected  boolean stopListeningToDF(AgentID df)
          Indicates that the DFGUI should stop listeneing to the DF indicated (i.e.
 
Methods inherited from class fipaos.agent.FIPAOSAgent
activate, addNewProtocol, deregisterWithAMS, deregisterWithDF, forward, forward, getAID, getCM, getCurrentConversation, getHAP, getLocalAMS, getLocalAMSAID, getLocalDF, getLocalDFAID, getNewConversation, getOwnership, getPlatformProfile, getProfile, getState, isShutdown, knowsProtocol, notify, notify, notifyDone, notifyError, notifyMessageInEndedConversation, notifyMessageUndeliverable, notifyTimeout, registeredWith, registeredWithAMS, registeredWithDF, registerWithAMS, registerWithAMS, registerWithAMS, registerWithAMS, registerWithDF, registerWithDF, registerWithDF, registerWithDF, sendNotUnderstood, sendNotUnderstood, setListenerTask, setMessageSender, startPushing, waitForPushLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DFGUIAgent

public DFGUIAgent(java.lang.String name,
                  java.lang.String platform,
                  java.lang.String owner)
Generic constructor - see FIPAOSAgent
Parameters:
name - Name of the Agent
platform - Location of the platform profile
owner - Owner of this Agent
Method Detail

registered

public abstract void registered(AgentID df,
                                DFAgentDescription df_desc)
Invoked when an Agent has been registered with a DF that has previously been searched
Parameters:
df - DF associated with this event
df_desc - DF description of the entry that has been updated

deregistered

public abstract void deregistered(AgentID df,
                                  DFAgentDescription df_desc)
Invoked when an Agent has been deregistered with a DF that has previously been searched
Parameters:
df - DF associated with this event
df_desc - DF description of the entry that has been updated

modified

public abstract void modified(AgentID df,
                              DFAgentDescription df_desc)
Invoked when an Agent has been modified with a DF that has previously been searched
Parameters:
df - DF associated with this event
df_desc - DF description of the entry that has been updated

shutdown

public void shutdown()
Shutdown the DFGUI Agent "nicely" (attempts to cancel subscriptions to DF's before killing the Agent).
Overrides:
shutdown in class FIPAOSAgent

listAgents

protected java.util.Map listAgents(AgentID df)
Lists the Agents registered with a particular DF. This automatically causes the DFGUIAgent to subscribe to updates from this DF, if not already doing so
Parameters:
df - DF to search
Returns:
A Map of Agent name -> DFAgentDescription

federatedSearch

public java.util.Map federatedSearch(AgentID df,
                                     int depth)
Send a federated search to the given DF, and retrieve the results

stopListeningToDF

protected boolean stopListeningToDF(AgentID df)
Indicates that the DFGUI should stop listeneing to the DF indicated (i.e. this cancels the subscription with the DF)
Parameters:
df - The DF to cancel subscriptions with
Returns:
True if the subscription was cancelled OK

registerAgent

protected boolean registerAgent(AgentID df,
                                DFAgentDescription dfad)
Registers the DFAgentDescription with the given DF Agent
Parameters:
df - The DF to register the DFAgentDescription with
dfad - The Agent's details to register
Returns:
True if registration was succesfull

deregisterAgent

protected boolean deregisterAgent(AgentID df,
                                  DFAgentDescription dfad)
Deregisters the DFAgentDescription with the given DF Agent
Parameters:
df - The DF to deregister the DFAgentDescription from
dfad - The Agent's details to deregister
Returns:
True if deregistration was succesfull

modifyAgent

protected boolean modifyAgent(AgentID df,
                              DFAgentDescription dfad)
Modifies the DFAgentDescription within the given DF Agent
Parameters:
df - The DF to modify the DFAgentDescription with
dfad - The Agent's details to modify
Returns:
True if modification was succesfull