agentland.info
Class StartInterfaceAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.resource.ManagedAgent
|
+--mess.MessAgent
|
+--agentland.info.StartInterfaceAgent
- All Implemented Interfaces:
- Agent, Good, Managed, Mess, MetagluePrimitives, Remote, RemoteTagsListener, Serializable, Spy, StartInterface, Userfunction
- public class StartInterfaceAgent
- extends MessAgent
- implements StartInterface
This is the agent that START should communicate with.
StartInterfaceAgent handles commands, queries, and assertions
issued by START. This agent also listens for state change notification
from DeviceAgents, and records the state changes in Jess.
Scripts for agents that support START queries and commands should be added
to the script agentland.info.scripts.knownAgents.
Use fread to send queries or assertions to START. Be sure to
call connectToStart to open the connection first.
- See Also:
AgentAgent,
StartInterface, Serialized Form
| Methods inherited from class mess.MessAgent |
acceptedTagsResult, addMessSpy, addUserfunction, addUserFunctions, assert, assert, assertAttribute, assertSpeechTag, call, callInitScripts, clear, execCommand, facts, fetch, fetchInt, getName, getReturnValue, loadFacts, loadFile, loadGrammar, loadPackages, loadReader, loadScript, loadString, loadURL, messAsk, messAskFree, messSay, messSaySafe, messSaySync, messThink, newFact, newFact, reset, retract, retract, run, runRete, saveFacts, setReturnValue, startRete, store, store, tell |
| Methods inherited from class agentland.resource.ManagedAgent |
connect, getAlert, getNeed, isAvailable, isAvailable, reliesOn, reliesOn, replace, replace, request, request, request, requestAgent, requestAgent, resources, resourcesByAgentID, setNeed, tiedTo, yank, yank, yank |
| Methods inherited from class agentland.util.GoodAgent |
addSpy, addSpy, alert, alertString, beep, error, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName |
| 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, lookupClass, obtainMetaglueAgent, obtainMetaglueAgent, obtainMetaglueAgentByName, reliesOn, reliesOnSynch, removeFrozen, replaceExceptionHandler, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, whereAreYou |
| Methods inherited from interface mess.Mess |
addUserfunction, assert, assert, assertAttribute, assertSpeechTag, clear, execCommand, facts, fetch, fetchInt, loadFacts, loadFile, loadScript, loadString, loadURL, newFact, newFact, reset, retract, retract, run, saveFacts, store |
| Methods inherited from interface agentland.util.Spy |
tell |
notifier
protected Notifier notifier
StartInterfaceAgent
public StartInterfaceAgent()
throws RemoteException
- Creates a new
StartInterfaceAgent instance.
- Throws:
RemoteException - if an error occurs
doCommand
public boolean doCommand(String object,
String args)
throws RemoteException
- Execute a command.
- Specified by:
doCommand in interface StartInterface
- Parameters:
object - the object you are asking aboutargs - other parts of the command- Returns:
- true if successful, false otherwise
- Throws:
RemoteException - if an error occurs
doQuery
public String doQuery(String object,
String args)
throws RemoteException
- Execute a query and return the result.
- Specified by:
doQuery in interface StartInterface
- Parameters:
object - the object you are asking aboutargs - other parts of the query- Returns:
- the answer to the query if successful, null otherwise
- Throws:
RemoteException - if an error occurs
doAssert
public boolean doAssert(String assertion)
throws RemoteException
- Make an assertion.
- Specified by:
doAssert in interface StartInterface
- Parameters:
assertion - the fact to be asserted- Returns:
- true if successful, false otherwise
- Throws:
RemoteException - if an error occurs
hearStateChange
public void hearStateChange(Secret s)
throws RemoteException
- Specified by:
hearStateChange in interface StartInterface
help
public void help()
throws RemoteException
- Prints the queries and commands that this agent can handle on System.out.
- Specified by:
help in interface StartInterface
- Throws:
RemoteException - if an error occurs
showFacts
public void showFacts()
throws RemoteException
- Prints the facts in the system on System.out
- Specified by:
showFacts in interface StartInterface
- Throws:
RemoteException - if an error occurs
connectToStart
public boolean connectToStart()
throws RemoteException
- Call this to set up connection to START
- Specified by:
connectToStart in interface StartInterface
- Returns:
true if successful- Throws:
RemoteException - if an error occurs
fread
public String fread(String input)
throws RemoteException
- Call START's
fread function.
- Specified by:
fread in interface StartInterface
- Parameters:
input - a string to give to fread- Returns:
- START's response
closeConnectionToStart
public void closeConnectionToStart()
throws RemoteException
- Close the connection to START.
- Specified by:
closeConnectionToStart in interface StartInterface
- Throws:
RemoteException - if an error occurs
isConnected
public boolean isConnected()
throws RemoteException
- Specified by:
isConnected in interface StartInterface