|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fipaos.agent.FIPAOSAgent | +--repserver.RepAgent
RepAgent is an abstract class representing an agent shell suitable for use with a replication server. It is an extension of the standard FIPAOSAgent shell. It adds variables to store the id of the replication server associated with this agent, the name of the replicant group this agent belongs to, the agentID of the message proxy for the replicant group and the current role of the agent.
Responses to various repserver-management tasks are included. The person using this is responsible for including an appropriate set of code in the agents IDLECLASS which will call the message handlers.
A setAState and getAState method stub is included in this abstract class. The user must override these as appropriate.
Inner Class Summary | |
class |
RepAgent.RegisterTask
RegisterTask, registers an agent with a RepGroup |
class |
RepAgent.RepServerManagementTask
Handles other RepServerManagementTask functions. |
class |
RepAgent.StateTask
StateTask sends a request to the repserver, then when an AGREE comes back send an INFORM with the agent state in the content field. |
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 | |
RepAgent(java.lang.String platform_profile_location,
java.lang.String agent_name,
java.lang.String ownership,
fipaos.ont.fipa.fipaman.AgentID rs,
java.lang.String role,
java.lang.String group_name)
Constructor. |
Method Summary | |
void |
doneRepAgent_RegisterTask(fipaos.agent.task.Task t)
|
byte[] |
getAState()
returns a byte stream representing the current state of this agent. |
int |
getConvs()
Get the number of current conversations |
java.lang.String |
getGroupName()
Return the group name of the replicant group this agent is registered with |
LocalPostOffice |
getLocalPostOffice()
|
fipaos.ont.fipa.fipaman.AgentID |
getProxyAID()
Return the AgentID of the message proxy this agent is registered with |
fipaos.ont.fipa.fipaman.AgentID |
getReceiver(fipaos.ont.fipa.ACL acl)
retreive the replytoAID. |
fipaos.ont.fipa.fipaman.AgentID |
getRepServer()
Returns the AgentID of this agents RepServer |
java.lang.String |
getRole()
Returns the current role of this REPLICANT |
void |
goActive()
Code to execute when this agent is set to ACTIVE_AGENT. |
boolean |
isActiveAgent()
Returns true if this agent is currently in ACTIVE_AGENT role |
boolean |
isReplicant()
Returns true if this agent is currently in REPLICANT role |
void |
removeConv(fipaos.agent.conversation.Conversation conv)
remove the given conversation |
boolean |
sendReply(fipaos.ont.fipa.ACL orig_acl,
java.lang.String performative)
|
boolean |
sendReply(fipaos.ont.fipa.ACL orig_acl,
java.lang.String performative,
java.lang.String content)
Send a reply message in response to the given ACL message |
boolean |
setAState(byte[] state)
sets the state for this agent. |
void |
setLocalPostOffice(LocalPostOffice lpo)
|
void |
setRepServer(fipaos.ont.fipa.fipaman.AgentID aid)
|
boolean |
setRole(java.lang.String role)
Sets the role of this agent. |
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, shutdown, startPushing, waitForPushLock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RepAgent(java.lang.String platform_profile_location, java.lang.String agent_name, java.lang.String ownership, fipaos.ont.fipa.fipaman.AgentID rs, java.lang.String role, java.lang.String group_name)
Method Detail |
public void setLocalPostOffice(LocalPostOffice lpo)
setLocalPostOffice
in interface LocalMsg
public LocalPostOffice getLocalPostOffice()
getLocalPostOffice
in interface LocalMsg
public boolean isActiveAgent()
public boolean isReplicant()
public java.lang.String getRole()
public boolean setRole(java.lang.String role)
role
- String representing the role, see RSCONSTANTS.public fipaos.ont.fipa.fipaman.AgentID getRepServer()
public void setRepServer(fipaos.ont.fipa.fipaman.AgentID aid)
public void doneRepAgent_RegisterTask(fipaos.agent.task.Task t)
public java.lang.String getGroupName()
public fipaos.ont.fipa.fipaman.AgentID getProxyAID()
public void goActive()
public byte[] getAState()
public boolean setAState(byte[] state)
state
- a byte stream representing the state of this agent.
returns true if successful.public fipaos.ont.fipa.fipaman.AgentID getReceiver(fipaos.ont.fipa.ACL acl)
public boolean sendReply(fipaos.ont.fipa.ACL orig_acl, java.lang.String performative, java.lang.String content)
acl
- The ACL object to reply toreason
- Any additional messagepublic boolean sendReply(fipaos.ont.fipa.ACL orig_acl, java.lang.String performative)
public int getConvs()
public void removeConv(fipaos.agent.conversation.Conversation conv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |