agentland.device.phone
Class PhoneAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.device.phone.PhoneAgent
- All Implemented Interfaces:
- Agent, Good, GuiEnabled, MetagluePrimitives, ModemEventListener, Phone, Remote, Serializable, Spy
- public class PhoneAgent
- extends GoodAgent
- implements Phone, ModemEventListener
- See Also:
- Serialized Form
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, lookupClass, 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 interface agentland.util.Spy |
tell |
WAITING
public static final int WAITING
RINGING
public static final int RINGING
IN_USE
public static final int IN_USE
statusNames
public static final String[] statusNames
status
protected int status
PhoneAgent
public PhoneAgent()
throws RemoteException
cleanUpNumber
public String cleanUpNumber(String number)
throws RemoteException
- Removes all non-digit characters from the string
- Specified by:
cleanUpNumber
in interface Phone
- Parameters:
number
- string to be cleaned up
makeACall
public void makeACall(String number)
throws RemoteException
- Initiates a voice phonecall
- Specified by:
makeACall
in interface Phone
- Parameters:
number
- the phonenumber to dial; can contain spaces and
dashes
hangUp
public void hangUp()
throws RemoteException
- Hangs up and thus ends a phone connection
- Specified by:
hangUp
in interface Phone
- Throws:
RemoteException
- if an error occurs
answer
public void answer()
throws RemoteException
- answers the phone in voice mode
- Specified by:
answer
in interface Phone
sendCommand
public void sendCommand(String cmd)
throws RemoteException
- If you really must....
- Specified by:
sendCommand
in interface Phone
- Parameters:
cmd
- the command to be sent to the modem; if you mess up
it's your fault
getCallLog
public Vector getCallLog()
throws RemoteException
- Specified by:
getCallLog
in interface Phone
- Returns:
- a sorted (by time) vector of recent phonecalls (in
ascending order)
resetCallLog
public void resetCallLog()
throws RemoteException
- Clears the log
- Specified by:
resetCallLog
in interface Phone
updateCallLog
protected void updateCallLog(PhonecallInfo pi)
setStatus
protected void setStatus(int v)
getStatus
public int getStatus()
throws RemoteException
- Specified by:
getStatus
in interface Phone
getStatusString
public String getStatusString()
throws RemoteException
- Specified by:
getStatusString
in interface Phone
modemSays
public void modemSays(String in)
- A call back method - it get's called by the SerialVoiceModem
when stuff arrives through the serial port
- Specified by:
modemSays
in interface ModemEventListener
stoppedRinging
protected void stoppedRinging()
startedRinging
protected void startedRinging()
getGuiMaker
public GuiMaker getGuiMaker()
throws RemoteException
- Specified by:
getGuiMaker
in interface GuiEnabled