ihelp
Class PersAgent

java.lang.Object
  |
  +--fipaos.agent.FIPAOSAgent
        |
        +--repserver.RepAgent
              |
              +--ihelp.PersAgent
All Implemented Interfaces:
fipaos.agent.conversation.ConversationListener, LocalMsg

public class PersAgent
extends RepAgent

A users Personal Agent. Stores a little about a user and knows if the user is on line or off.


Inner Class Summary
 class PersAgent.FindHelpTask
          Find a helper.
 class PersAgent.FindMMTask
           
 class PersAgent.HandleRequestTask
          Handles all incoming i-help requests
 class PersAgent.IdleTask
          IdleTask
 
Inner classes inherited from class repserver.RepAgent
RepAgent.RegisterTask, RepAgent.RepServerManagementTask, RepAgent.StateTask
 
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
PersAgent(java.lang.String platform, java.lang.String name, java.lang.String ownership, fipaos.ont.fipa.fipaman.AgentID rs, java.lang.String role, java.lang.String group_name)
          standard RepAgent constructor
 
Method Summary
 void addKeyword(java.lang.String kw)
          add the given keyword to the list of keywords
 void checkForFailure()
          generate a random number, and if the number is in the range to fail, shutdown this agent.
 void donePersAgent_FindMMTask(fipaos.agent.task.Task t)
           
 byte[] getAState()
          return the state of this agent.
 java.lang.String getKeywords()
          get a string of the list of keywords
 boolean getStatus()
          get the status.
 java.lang.String getStrStatus()
          get the String status.
 fipaos.ont.fipa.fipaman.AgentID getUIAgent()
          get the AgentID of the user interface agent
 java.lang.String getUserName()
          get the user_name for the agent
 void goActive()
          when going to ACTIVE_AGENT, look for a new MMAgent
 boolean hasKeyword(java.lang.String kw)
          return true if the keyword is in the list.
static void main(java.lang.String[] args)
           
 boolean setAState(byte[] b)
          set the state of the agent, given a byte stream.
 void setStatus(boolean st)
          set the status, true is user is available, false otherwise.
 void setUIAgent(fipaos.ont.fipa.fipaman.AgentID aid)
          set the AgentID of the user interface agent
 void setUserName(java.lang.String name)
          set the user_name for the agent
 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
 
Methods inherited from class repserver.RepAgent
doneRepAgent_RegisterTask, getConvs, getGroupName, getLocalPostOffice, getProxyAID, getReceiver, getRepServer, getRole, isActiveAgent, isReplicant, removeConv, sendReply, sendReply, setLocalPostOffice, setRepServer, setRole
 
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

PersAgent

public PersAgent(java.lang.String platform,
                 java.lang.String name,
                 java.lang.String ownership,
                 fipaos.ont.fipa.fipaman.AgentID rs,
                 java.lang.String role,
                 java.lang.String group_name)
standard RepAgent constructor
Method Detail

goActive

public void goActive()
when going to ACTIVE_AGENT, look for a new MMAgent
Overrides:
goActive in class RepAgent

donePersAgent_FindMMTask

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

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

setUserName

public void setUserName(java.lang.String name)
set the user_name for the agent

getUserName

public java.lang.String getUserName()
get the user_name for the agent

setUIAgent

public void setUIAgent(fipaos.ont.fipa.fipaman.AgentID aid)
set the AgentID of the user interface agent

getUIAgent

public fipaos.ont.fipa.fipaman.AgentID getUIAgent()
get the AgentID of the user interface agent

addKeyword

public void addKeyword(java.lang.String kw)
add the given keyword to the list of keywords

getKeywords

public java.lang.String getKeywords()
get a string of the list of keywords

hasKeyword

public boolean hasKeyword(java.lang.String kw)
return true if the keyword is in the list.

setStatus

public void setStatus(boolean st)
set the status, true is user is available, false otherwise.

getStatus

public boolean getStatus()
get the status.

getStrStatus

public java.lang.String getStrStatus()
get the String status.

getAState

public byte[] getAState()
return the state of this agent.
Overrides:
getAState in class RepAgent

setAState

public boolean setAState(byte[] b)
set the state of the agent, given a byte stream.
Overrides:
setAState in class RepAgent
Following copied from class: repserver.RepAgent
Parameters:
state - a byte stream representing the state of this agent. returns true if successful.

checkForFailure

public void checkForFailure()
generate a random number, and if the number is in the range to fail, shutdown this agent.

main

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