ihelp
Class UIAgent

java.lang.Object
  |
  +--fipaos.agent.FIPAOSAgent
        |
        +--ihelp.UIAgent
All Implemented Interfaces:
fipaos.agent.conversation.ConversationListener

public class UIAgent
extends fipaos.agent.FIPAOSAgent

A user interface agent. This is a subclass of the standard FIPAOSAgent rather than a replicant. Since this is a user interface, there is no need to replicate this. Shows that regular agents and replicate agents can co-exist.


Inner Class Summary
 class UIAgent.AddKeywordTask
           
 class UIAgent.FindHelpTask
           
 class UIAgent.FindPersAgentTask
          Find my personal agent from the DF, then contact it.
 class UIAgent.GetKeywordsTask
           
 class UIAgent.IdleTask
           
 class UIAgent.SwitchStatusTask
          Send a message to my personal agent to toggle my status.
 
Inner classes inherited from class fipaos.agent.FIPAOSAgent
fipaos.agent.FIPAOSAgent.TopLevelHandlerTask
 
Fields inherited from class fipaos.agent.FIPAOSAgent
_database_profile, _registered_with, _state, _tm
 
Constructor Summary
UIAgent(java.lang.String platform, java.lang.String name, java.lang.String ownership, java.lang.String persname)
           
 
Method Summary
 void activate()
          This method is invoked when GUI should be shown - generally this is invoked by the AgentLoader when the Agent is in the List of running Agents - the default implementation in FIPAOSAgent does nothing.
 void addKeyword(java.lang.String kw)
          if the personal agent is online, start the AddKeywordTask task
 void doneUIAgent_AddKeywordTask(fipaos.agent.task.Task t)
          once the AddKeywordTask is done.
 void doneUIAgent_FindHelpTask(java.lang.Object o)
          when the FindHelpTask is done...
 void doneUIAgent_FindPersAgentTask(fipaos.agent.task.Task t)
          once FindPersAgentTask completes update the GUI
 void doneUIAgent_SwitchStatusTask(fipaos.agent.task.Task t)
           
 void findHelp(java.lang.String kw)
          start a FindHelpTask to find helpers for the given keyword
 void findPersAgent()
          start a FindPersAgentTask to find my personal agent
 int getConvs()
          Get the number of current conversations
 java.lang.String getKeywords()
           
 java.lang.String getPersAgent()
           
 java.lang.String getStatus()
           
static void main(java.lang.String[] args)
          Test-harness
 void printCounts()
           
 void shutdown()
          Invoked when this Agent is about to be shutdown - this overrides the shutdown() method in the FIPAOSAgent class to enable the CountAgentGUI associated with this CountAgent to be removed
 void switchStatus()
           
 void timeoutUIAgent_FindHelpTask(fipaos.agent.task.Task t)
          when the FindHelpTask times out
 void timeoutUIAgent_FindPersAgentTask(fipaos.agent.task.Task t)
          if the FindPersAgentTask timeouts
 
Methods inherited from class fipaos.agent.FIPAOSAgent
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

UIAgent

public UIAgent(java.lang.String platform,
               java.lang.String name,
               java.lang.String ownership,
               java.lang.String persname)
Method Detail

shutdown

public void shutdown()
Invoked when this Agent is about to be shutdown - this overrides the shutdown() method in the FIPAOSAgent class to enable the CountAgentGUI associated with this CountAgent to be removed
Overrides:
shutdown in class fipaos.agent.FIPAOSAgent

activate

public void activate()
This method is invoked when GUI should be shown - generally this is invoked by the AgentLoader when the Agent is in the List of running Agents - the default implementation in FIPAOSAgent does nothing.
Overrides:
activate in class fipaos.agent.FIPAOSAgent

findPersAgent

public void findPersAgent()
start a FindPersAgentTask to find my personal agent

doneUIAgent_FindPersAgentTask

public void doneUIAgent_FindPersAgentTask(fipaos.agent.task.Task t)
once FindPersAgentTask completes update the GUI

timeoutUIAgent_FindPersAgentTask

public void timeoutUIAgent_FindPersAgentTask(fipaos.agent.task.Task t)
if the FindPersAgentTask timeouts

addKeyword

public void addKeyword(java.lang.String kw)
if the personal agent is online, start the AddKeywordTask task

doneUIAgent_AddKeywordTask

public void doneUIAgent_AddKeywordTask(fipaos.agent.task.Task t)
once the AddKeywordTask is done.

switchStatus

public void switchStatus()

doneUIAgent_SwitchStatusTask

public void doneUIAgent_SwitchStatusTask(fipaos.agent.task.Task t)

findHelp

public void findHelp(java.lang.String kw)
start a FindHelpTask to find helpers for the given keyword

getConvs

public int getConvs()
Get the number of current conversations

printCounts

public void printCounts()

doneUIAgent_FindHelpTask

public void doneUIAgent_FindHelpTask(java.lang.Object o)
when the FindHelpTask is done...

timeoutUIAgent_FindHelpTask

public void timeoutUIAgent_FindHelpTask(fipaos.agent.task.Task t)
when the FindHelpTask times out

getStatus

public java.lang.String getStatus()

getKeywords

public java.lang.String getKeywords()

getPersAgent

public java.lang.String getPersAgent()

main

public static void main(java.lang.String[] args)
Test-harness