Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
Reality Interface Classes: Class DDATcp (JReal) (ddatcp.html)
|
Reality Interface Classes | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.northgateis.comms.dda.DDATcp
Defines an object that creates a DDA TCP connection to a Reality database and supplies methods to access this connection.
Typical usage:
DDATcp con = new DDATcp("host","database","user","account","server"); con.connect() DDAMsg msg = new DDAMsg(1, 0, "Qualifier".getBytes(), "Data".getBytes()); con.send(msg) // as required msg = con.receive() // as required con.disconnect() // not essential as destroying the class will disconnectIt is valid to disconnect and reconnect using the same class if required.
Any DDA or IO exception received during the life of a connection will require a new connect() before any more data can be transfered.
Debugging can be turned on by setting the dda.debug property either on the command line or in the reality.properties file. The property should be set to "on". This will result in all DDA messages sent and received being printed on System.err.
Field Summary | |
static int | DEFAULT_PORT The default port used by to connect to a DDA server |
Constructor Summary | |
DDATcp(DDAConnectionSpec spec,
java.lang.String server) Define a new DDA TCP connection using a DDAConnectionSpec | |
DDATcp(java.lang.String host,
int port,
java.lang.String database,
java.lang.String user,
java.lang.String account,
java.lang.String server) Define a new DDA TCP connection for a non default port. | |
DDATcp(java.lang.String host,
java.lang.String database,
java.lang.String user,
java.lang.String account,
java.lang.String server) Define a new DDA TCP connection for the default port. |
Method Summary | |
void | connect() Connect to the TCP host and the DDA server. |
boolean | dataAvailable() Test if data available for input |
static void | debug(boolean on) Turn on/off the debug flag. |
void | disconnect() Close the TCP connection |
DDAMsg | receive() Receive a DDA message |
void | send(DDAMsg msg) Send a DDA message. |
void | setServer(java.lang.String server) Overide the server name used when instantiating the class. |
void | setTimeout(byte Tout) Set the timeout when making a connection |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int DEFAULT_PORT
Constructor Detail |
public DDATcp(java.lang.String host, int port, java.lang.String database, java.lang.String user, java.lang.String account, java.lang.String server)
host
- String specifying the host name
to connect to.port
- the port number to use.database
- String specifying the database name
to connect to.user
- String specifying the user-id used to
connect to the database, with an optional comma seperated passwordaccount
- String specifying the account used to
connect to the database, with an optional comma
seperated passwordserver
- String specifying server to runpublic DDATcp(java.lang.String host, java.lang.String database, java.lang.String user, java.lang.String account, java.lang.String server)
host
- String specifying the host name
to connect to.database
- String specifying the database name
to connect to.user
- String specifying the user-id used to
connect to the database, with an optional comma
seperated passwordaccount
- String specifying the account used to
connect to the database, with an optional comma
seperated passwordserver
- String specifying server to runpublic DDATcp(DDAConnectionSpec spec, java.lang.String server)
spec
- DDAConnectionSpec specifying the
connection detailsserver
- String specifying server to runMethod Detail |
public void connect() throws java.io.IOException, com.northgateis.comms.dda.DDAException
public void disconnect()
public void send(DDAMsg msg) throws java.io.IOException
msg
- the DDAMsg to send.public DDAMsg receive() throws java.io.IOException
public boolean dataAvailable() throws java.io.IOException
public void setTimeout(byte Tout)
Tout
- the connection timeout in minutespublic static void debug(boolean on)
on
- true to turn debugging on, false to turn it offpublic void setServer(java.lang.String server)
server
- Name of the server to use.
| Reality Interface Classes | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |