agentland.resource.namer
Class NamerAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--agentland.util.GoodAgent
                                |
                                +--agentland.resource.namer.NamerAgent

public class NamerAgent
extends GoodAgent
implements Namer, ResourceManager

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Field Summary
protected  ConnectionMaker cm
          Agent that will create connections for us
 
Fields inherited from class agentland.util.GoodAgent
alert, notifier
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
NamerAgent()
           
 
Method Summary
 void addRequestHook(AgentID watcher)
          This is so agents can watch all resource requests on the java side and add/modify them if necessary/desired.
 void addTranslation(String start, String target)
           
 void addWatchedOccupation(String s)
           
 boolean clearTranslation(String trans)
          Remove translation from lists.
 boolean clearWatchedOccupation(String occ)
          Remove watched occupation from list.
 boolean connect(AgentID start, AgentID end)
          Connect two agents together (in whatever sense makes sense.)
 Collection getAgentNames(AgentID id)
          Return any known String names for an agentID.
 ResourceBunch lookup(Request req, Context con, AgentID requestor)
          Get a list of things which match the name of request.
protected  void queryAndAddTranslation(AgentID start_id)
           
 void registerInstance(AgentID resID)
          Register a Managed Agent as alive and kicking.
 void removeRequestHook(AgentID watcher)
           
 void replaceFor(AgentID requestor, Resource res, Request req, Context con)
          On behalf of some agent, replace the resource named with some other requested resource and context as defined by the passed request
 ResourceBunch request(Request request, Context context, AgentID requestor)
           
 AgentID translate(AgentID start_id)
          Given an ID, translate it into a new ID.
 AgentID translate(String start_id)
           
 
Methods inherited from class agentland.util.GoodAgent
addSpy, addSpy, alert, alertString, beep, error, getAlert, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName, tell
 
Methods inherited from class metaglue.AgentAgent
addMonitor, alive, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getProperties, getSociety, log, log, obtainMetaglueAgent, obtainMetaglueAgent, obtainMetaglueAgentByName, reliesOn, reliesOn, reliesOn, reliesOnSynch, removeFrozen, replaceExceptionHandler, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, whereAreYou
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

cm

protected ConnectionMaker cm
Agent that will create connections for us
Constructor Detail

NamerAgent

public NamerAgent()
           throws RemoteException
Method Detail

request

public ResourceBunch request(Request request,
                             Context context,
                             AgentID requestor)
                      throws RemoteException
Specified by:
request in interface ResourceManager

addTranslation

public void addTranslation(String start,
                           String target)
                    throws RemoteException
Specified by:
addTranslation in interface Namer

queryAndAddTranslation

protected void queryAndAddTranslation(AgentID start_id)

translate

public AgentID translate(AgentID start_id)
Given an ID, translate it into a new ID.
Specified by:
translate in interface Namer

translate

public AgentID translate(String start_id)
                  throws RemoteException
Specified by:
translate in interface Namer

addWatchedOccupation

public void addWatchedOccupation(String s)
                          throws RemoteException
Specified by:
addWatchedOccupation in interface Namer

clearTranslation

public boolean clearTranslation(String trans)
Remove translation from lists.
Specified by:
clearTranslation in interface Namer
Returns:
true if found and removed.

clearWatchedOccupation

public boolean clearWatchedOccupation(String occ)
                               throws RemoteException
Remove watched occupation from list.
Specified by:
clearWatchedOccupation in interface Namer
Returns:
true if found and removed.

registerInstance

public void registerInstance(AgentID resID)
                      throws RemoteException
Description copied from interface: ResourceManager
Register a Managed Agent as alive and kicking. Should be called in the agent's constructor.
Specified by:
registerInstance in interface ResourceManager

lookup

public ResourceBunch lookup(Request req,
                            Context con,
                            AgentID requestor)
                     throws RemoteException
Description copied from interface: ResourceManager
Get a list of things which match the name of request. Do not actually request anything, just get the things that fill the request.
Specified by:
lookup in interface ResourceManager

replaceFor

public void replaceFor(AgentID requestor,
                       Resource res,
                       Request req,
                       Context con)
                throws RemoteException
Description copied from interface: ResourceManager
On behalf of some agent, replace the resource named with some other requested resource and context as defined by the passed request
Specified by:
replaceFor in interface ResourceManager

connect

public boolean connect(AgentID start,
                       AgentID end)
                throws RemoteException
Description copied from interface: ResourceManager
Connect two agents together (in whatever sense makes sense.)
Specified by:
connect in interface ResourceManager

addRequestHook

public void addRequestHook(AgentID watcher)
                    throws RemoteException
Description copied from interface: ResourceManager
This is so agents can watch all resource requests on the java side and add/modify them if necessary/desired. (So a person locator can add person's location to request info.)
Specified by:
addRequestHook in interface ResourceManager

removeRequestHook

public void removeRequestHook(AgentID watcher)
                       throws RemoteException
Specified by:
removeRequestHook in interface ResourceManager

getAgentNames

public Collection getAgentNames(AgentID id)
                         throws RemoteException
Description copied from interface: ResourceManager
Return any known String names for an agentID. This can be used for speech recog, management of resource or whatall.
Specified by:
getAgentNames in interface ResourceManager