|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--mstar.Connection
The connection class is an abstract base class that is used to manage the connection for a collaborative environment session.
| Constructor Summary | |
Connection()
Initialize the connection class with a null hostname and set the port to connect to the collaborative environment at to the default of 4201. |
|
Connection(int port)
Initialize the connection class with a null hostname and set the port to connect to the collaborative environment at to the given port number. |
|
Connection(java.lang.String hostname)
Initialize the connection class with hostname and set the port to connect to the collaborative environment at to the default of 4201. |
|
Connection(java.lang.String hostname,
int port)
Initialize the connection class with hostname and set the port to connect to the collaborative environment at to the given port number. |
|
| Method Summary | |
int |
available()
Returns the number of bytes that can be read from the collaborative environment without blocking. |
abstract void |
clearChatterVector()
Clears the chatter vector that output from the collaborative environment is being stored in. |
void |
connectToMud()
Connect the robot to the Mud/MOO. |
void |
drainConnection()
Drain the connection until there is no more output waiting to be collected. |
abstract void |
drainConnection(boolean wait)
Drain the connection until there is no more output waiting to be collected. |
void |
drainConnectionToSuffix()
Drain the output from the collaborative environment until the suffix that was set using setOutputSuffix is found. |
abstract void |
drainConnectionToSuffix(boolean wait)
Drain the output from the collaborative environment until the suffix that was set using setOutputSuffix is found. |
abstract void |
findOutputPrefix()
Find the output prefix in the input stream. |
abstract java.util.Vector |
getChatterVector()
Returns the chatter vector that output from the collaborative environment is stored in for later processing. |
java.lang.String |
getHostname()
Gets the hostname to connect to. |
java.io.DataInputStream |
getInputStream()
Gets the stream for receiving data from the collaborative environment. |
java.lang.String |
getOutputPrefix()
Gets the string that will be used for the output prefix in commands returned by the collaborative environment. |
java.io.PrintStream |
getOutputStream()
Gets the stream for sending data to the collaborative environment. |
java.lang.String |
getOutputSuffix()
Gets the string that will be used for the output suffix in commands returned by the collaborative environment. |
int |
getPort()
Gets the port to connect at. |
java.lang.String |
getRobotName()
Gets the name of the robot. |
abstract void |
loginToMud(java.lang.String name,
java.lang.String password)
Log the robot into the Mud/MOO. |
abstract void |
logOffMud()
Log the robot off the MUD/MOO. |
java.lang.String |
readLine()
Read a line of output from the MUD/MOO. |
void |
setHostname(java.lang.String hostname)
Sets the hostname to connect to. |
void |
setOutputPrefix(java.lang.String outputPrefix)
Sets the string that will be used for the output prefix in commands returned by the collaborative environment. |
void |
setOutputSuffix(java.lang.String outputSuffix)
Sets the string that will be used for the output suffix in commands returned by the collaborative environment. |
void |
setPort(int port)
Sets the port to connect at. |
void |
setRobotName(java.lang.String robotName)
Sets the name of the robot. |
void |
waitForData()
Wait until data becomes available from the collaborative environment. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public Connection()
public Connection(java.lang.String hostname)
hostname - the name of the host to connect to.
public Connection(java.lang.String hostname,
int port)
hostname - the name of the host to connect to.port - the port to connect to.public Connection(int port)
port - the port to connect to.| Method Detail |
public void setHostname(java.lang.String hostname)
hostname - the hostname to connect to.public java.lang.String getHostname()
public void setPort(int port)
port - the port to connect at.public int getPort()
public java.io.DataInputStream getInputStream()
public java.io.PrintStream getOutputStream()
public void setOutputPrefix(java.lang.String outputPrefix)
outputPrefix - the string to use as the output prefix.public java.lang.String getOutputPrefix()
public void setOutputSuffix(java.lang.String outputSuffix)
outputSuffix - the string to use as the output suffix.public java.lang.String getOutputSuffix()
public void setRobotName(java.lang.String robotName)
robotName - the name of the robot.public java.lang.String getRobotName()
public abstract void findOutputPrefix()
public abstract void drainConnection(boolean wait)
wait - if true, wait for output if none is currently
available. If false, and no data is available then
just return.public void drainConnection()
public void waitForData()
public abstract void drainConnectionToSuffix(boolean wait)
wait - if true, wait for output if none is currently
available. If false, and no data is available then
just return.public void drainConnectionToSuffix()
public abstract java.util.Vector getChatterVector()
public abstract void clearChatterVector()
public void connectToMud()
public abstract void loginToMud(java.lang.String name,
java.lang.String password)
name - the name of the robot.password - the password of the robot.public abstract void logOffMud()
public java.lang.String readLine()
throws java.io.IOException
public int available()
throws java.io.IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||