|
datum API Documentation | ||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--datum.protocol.Connection
Provides connection services to remote hosts or log files using datum.protocol messages. The host information is passed to the constructor and not the connect method because it is undesirable to reuse Connection objects to more that one host. This is due to the potential damage to the Library services which depend on host specific message definitions.
Library,
Receiver| Constructor Summary | |
Connection(FileReader fileReader,
Receiver receiver)
Creates a connection that holds state information for a specific log file. |
|
Connection(String host,
String[][] definitions,
Receiver receiver)
Creates a connection that holds information for a specific host. |
|
Connection(URL location,
Receiver receiver)
Creates a connection that holds information for a specific log file from a URL. |
|
| Method Summary | |
void |
connect()
Attepts to connect to the host passed to the constructor. |
void |
connect(String routerHost)
Attepts to connect to the host passed to the constructor via a Router. |
void |
disconnect()
Forces the connection to be dropped immediately. |
int |
getDelay()
Returns the miniumum delay between receivedData events. |
boolean |
getImmediateSend()
|
Library |
getLibrary()
Returns a reference to the Library for this Connection. |
String |
getName()
|
boolean |
isConnected()
|
boolean |
isSuspended()
|
void |
run()
Do not use. |
boolean |
send(File file)
|
boolean |
send(Object[] message)
Sends a message over this connection. |
boolean |
sendConfigs(File directory)
|
void |
setDelay(int delay)
Sets the miniumum delay between receivedData events. |
void |
setImmediateSend(boolean immediateSend)
|
void |
setName(String name)
|
void |
setSuspended(boolean suspended)
Pauses the receiveData events, but does not loose any data, or disconnect from the server. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Connection(String host,
String[][] definitions,
Receiver receiver)
host - The IP address or registered (domain) name of the host. E.g.
"127.0.0.1" or "server.rutgers.edu"definitions - An array of message field name definitions. Each String
in the array should be a delimited list of field names,
the first field should be the message type. See the Server class
documentation for an example.receiver - The class that will receive events from this connection.connect(),
connect(java.lang.String),
Server
public Connection(URL location,
Receiver receiver)
location - The URL of the log file to be read. E.g. "http://server.rutgers.edu/sim-out.dpf"receiver - The class that will receive events from this connection.connect()
public Connection(FileReader fileReader,
Receiver receiver)
location - A FileReader for the log file to be read.receiver - The class that will receive events from this connection.connect()| Method Detail |
public void setName(String name)
public String getName()
public String toString()
toString in class Objectpublic void connect()
Receiver.connected(Connection),
Receiver.error(Connection, java.lang.String)public void connect(String routerHost)
routerHost - The address of the Router to be used.Receiver.connected(Connection),
Receiver.error(Connection, java.lang.String)public Library getLibrary()
public boolean isConnected()
public int getDelay()
public void setDelay(int delay)
int - The minimum delay between receivedData events in miliseconds.public void setSuspended(boolean suspended)
public boolean isSuspended()
public boolean sendConfigs(File directory)
public boolean send(File file)
public boolean send(Object[] message)
message - The array of fields to send.public boolean getImmediateSend()
public void setImmediateSend(boolean immediateSend)
public void disconnect()
Receiver.disconnected(Connection)public void run()
run in interface Runnable
|
Up to datum |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||