|
Reality Interface Classes | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.northgateis.reality.rsc
Class RSCConnection
java.lang.Object | +--java.util.Observable | +--com.northgateis.reality.rsc.RSCConnection
- Direct Known Subclasses:
- RealWeb
- public class RSCConnection
- extends java.util.Observable
Creates and manages a new connection to an RSC server.
Provides methods to generate primitive RSC server operations.
Apart from the constructor, the only methods that need to be
called directly from this class are connect() and disconnect().
The primative RSC server operations are normally invoked via the
RSC
class.
See this class for more information.
Constructor Summary | |
RSCConnection(DDAConnectionSpec spec)
Configure a new RSC connection using a DDAConnectionSpec |
|
RSCConnection(java.lang.String host,
int port,
java.lang.String database,
java.lang.String userPassword,
java.lang.String accountPassword)
Configure a new RSC connection using a non default port |
|
RSCConnection(java.lang.String section,
java.lang.String userPassword,
java.lang.String accountPassword)
Configure a new RSC connection using a winsni.ini file entry. |
|
RSCConnection(java.lang.String host,
java.lang.String database,
java.lang.String userPassword,
java.lang.String accountPassword)
Configure a new RSC connection using the default port |
Method Summary | |
void | connect() connect to the RSC server |
void | disconnect() disconnect from the RSC server |
byte[] | doItAll(byte[] buf) Send a DOITALL command to the server and await its response |
void | execute(int reference) Send an EXECUTE command to the server and await its response |
byte[] | getParam(int reference,
int index) Get a parameter from the server |
void | prepare(RSCDescriptor desc) Send a prepare message to the server and process its response. |
void | release(int reference,
int type) Send a RELEASE command to the server of type specified and await its response |
void | releaseData(int reference) Send a RELEASE command to the server specifying only release the data, and await its response |
void | releaseSubroutine(int reference) Send a RELEASE command to the server specifying release the subroutine, and await its response |
void | sendParam(int reference,
int index,
byte[] value) Send a parameter to the server |
void | setServer(java.lang.String name) Set the server name to connect to. |
Methods inherited from class java.util.Observable |
addObserver,
countObservers,
deleteObserver,
deleteObservers,
hasChanged,
notifyObservers,
notifyObservers |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
RSCConnection
public RSCConnection(java.lang.String host, int port, java.lang.String database, java.lang.String userPassword, java.lang.String accountPassword)
- Configure a new RSC connection using a non default port
- Parameters:
host
- String specifying the host name to connect to.port
- the port number to use.database
- String specifying the database name to connect to.userPassword
- String specifying the user-id used to connect to the database, with an optional comma separated passwordaccountPassword
- String specifying the account used to connect to the database, with an optional comma separated password
RSCConnection
public RSCConnection(java.lang.String host, java.lang.String database, java.lang.String userPassword, java.lang.String accountPassword)
- Configure a new RSC connection using the default port
- Parameters:
host
- String specifying the host name to connect to.database
- String specifying the database name to connect to.userPassword
- String specifying the user-id used to connect to the database, with an optional comma separated passwordaccountPassword
- String specifying the account used to connect to the database, with an optional comma separated password
RSCConnection
public RSCConnection(java.lang.String section, java.lang.String userPassword, java.lang.String accountPassword) throws java.io.IOException
- Configure a new RSC connection using a winsni.ini file entry.
Be sure to see the
SNI
class description on usage of the winsni.ini file- Parameters:
section
- String specifying the winsni section nameuserPassword
- String specifying the user-id used to connect to the database, with an optional comma separated passwordaccountPassword
- String specifying the account used to connect to the database, with an optional comma separated password
RSCConnection
public RSCConnection(DDAConnectionSpec spec)
- Configure a new RSC connection using a DDAConnectionSpec
- Parameters:
spec
- DDAConnectionSpec specifying connection
Method Detail |
connect
public void connect() throws RSCException
- connect to the RSC server
- Throws:
- RSCException - something went wrong
disconnect
public void disconnect()
- disconnect from the RSC server
prepare
public void prepare(RSCDescriptor desc) throws RSCException
- Send a prepare message to the server and process its response.
The response to a prepare message is a string describing the
parameters of the subroutine. This string is saved in the
RSCDescriptor.
- Parameters:
desc
- RSCDescriptor of subroutine- Throws:
- RSCException - something went wrong
sendParam
public void sendParam(int reference, int index, byte[] value) throws RSCException
- Send a parameter to the server
getParam
public byte[] getParam(int reference, int index) throws RSCException
- Get a parameter from the server
execute
public void execute(int reference) throws RSCException
- Send an EXECUTE command to the server and await its response
doItAll
public byte[] doItAll(byte[] buf) throws RSCException
- Send a DOITALL command to the server and await its response
- Parameters:
buf
- byte array containing DOITALL command- Returns:
- String in SENDALL format containing the subroutines results
- Throws:
- RSCException - something went wrong
releaseData
public void releaseData(int reference) throws RSCException
- Send a RELEASE command to the server specifying only release the data, and await its response
releaseSubroutine
public void releaseSubroutine(int reference) throws RSCException
- Send a RELEASE command to the server specifying release the subroutine, and await its response
release
public void release(int reference, int type) throws RSCException
- Send a RELEASE command to the server of type specified and await its response
setServer
public void setServer(java.lang.String name)
- Set the server name to connect to.
- Parameters:
server
- the new server name.
| Reality Interface Classes | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2000 NEC Software Services (UK) Limited