public class WrappedJConnection extends java.lang.Object implements JConnection
Implementation of a connection to a remote jBASE instance.
If constructed in a managed environment then calls will be made through
the managed connection to allow the application server to be notified of
connection events.
DEFAULT_CHARSET, JBASE_DEFAULT_ENCODING
Modifier | Constructor and Description |
---|---|
protected |
WrappedJConnection() |
protected |
WrappedJConnection(JRemoteManagedConnection managedConnection) |
Modifier and Type | Method and Description |
---|---|
void |
begin()
Begin a jBASE transaction.
|
JSubroutineParameters |
call(java.lang.String subroutineName,
JSubroutineParameters parameters)
Call jBASE subroutine.
|
protected void |
checkStatus()
In a managed environment the
checkStatus method checks that
this handle has not been closed. |
void |
close()
Close this connection.
|
void |
commit()
Commit all pending jBASE operations performed in transaction
and mark as complete.
|
JSelectList |
createSelectList(JDynArray jd)
Create a select list object from an existing dynamic array
containing a list of keys separated by attribute markers.
|
JStatement |
createStatement()
Create a statement object that enables queries to be executed and
a JResultSet returned.
|
int |
date()
Return the jBASE internal date.
|
boolean |
echo(int length)
Send an echo request and waits for a reply.
|
JExecuteResults |
execute(java.lang.String command)
Execute a jBASE command.
|
JExecuteResults |
execute(java.lang.String command,
JSelectList selectList)
Execute a jBASE command using an existing select list as a filter.
|
JDynArray |
func(java.lang.String function_name)
Call a jBASE function.
|
JDynArray |
func(java.lang.String function_name,
JSubroutineParameters parameters) |
java.nio.charset.Charset |
getCharset()
Get the Charset for this connection.
|
JDynArray |
getCommon(java.lang.String name)
Return the value of the common with supplied name.
|
protected JConnection |
getConnection()
Get the real connection.
|
protected javax.resource.spi.ManagedConnection |
getManagedConnection() |
EISMetaDataRepository |
getMetaData()
Return meta data of the connected jBASE instance.
|
java.lang.String |
iconv(java.lang.String data,
java.lang.String conversion)
Converts data in external format to internal format.
|
protected boolean |
isClosed() |
java.lang.String |
monitoring(java.lang.String command)
Sends an monitoring command and waits for it's response
|
JDynArray |
newJDynArray()
Create a JDynArray with the correct Charset for this connection.
|
JDynArray |
newJDynArray(java.lang.String str) |
java.lang.String |
oconv(java.lang.String data,
java.lang.String conversion)
Converts internal representations of data to their external form.
|
JFile |
open(java.lang.String filename)
Open jBASE file.
|
void |
rollback()
Rollback all jBASE operations performed in transaction
and mark as complete.
|
protected void |
setConnection(JConnection connection) |
protected void |
setManagedConnection(JRemoteManagedConnection connection) |
void |
setTerminalOutputWriter(java.io.Writer writer) |
boolean |
switchAccount(java.lang.String user,
java.lang.String account,
java.lang.String password)
Switch jBASE account.
|
int |
time()
Return the jBASE internal time.
|
java.lang.String |
toString() |
protected WrappedJConnection()
protected WrappedJConnection(JRemoteManagedConnection managedConnection)
protected javax.resource.spi.ManagedConnection getManagedConnection()
protected void setManagedConnection(JRemoteManagedConnection connection)
protected void checkStatus() throws JRemoteException
In a managed environment the checkStatus
method checks that
this handle has not been closed.
JRemoteException
- if connection status is invalidpublic JDynArray newJDynArray()
JConnection
Create a JDynArray with the correct Charset for this connection.
newJDynArray
in interface JConnection
public JDynArray newJDynArray(java.lang.String str)
newJDynArray
in interface JConnection
public java.nio.charset.Charset getCharset()
JConnection
Get the Charset for this connection. This is used on String operations to convert the bytes received from jBASE to a Java UTF-16 String.
getCharset
in interface JConnection
public void close() throws JRemoteException
Close this connection.
close
in interface JConnection
JRemoteException
protected boolean isClosed()
protected JConnection getConnection() throws JRemoteException
Get the real connection.
JRemoteException
protected void setConnection(JConnection connection)
public boolean switchAccount(java.lang.String user, java.lang.String account, java.lang.String password) throws JRemoteException
Switch jBASE account.
switchAccount
in interface JConnection
user
- username that belongs to the accountaccount
- name of the account to log intopassword
- password of the account to log intoJRemoteException
JConnection.switchAccount(String, String, String)
public JFile open(java.lang.String filename) throws JRemoteException
Open jBASE file.
open
in interface JConnection
JRemoteException
JConnection.open(String)
public JSubroutineParameters call(java.lang.String subroutineName, JSubroutineParameters parameters) throws JSubroutineNotFoundException, JRemoteException
Call jBASE subroutine.
call
in interface JConnection
JSubroutineNotFoundException
JRemoteException
JConnection.open(String)
public JDynArray func(java.lang.String function_name) throws JSubroutineNotFoundException, JRemoteException
JConnection
Call a jBASE function.
func
in interface JConnection
JSubroutineNotFoundException
JRemoteException
public JDynArray func(java.lang.String function_name, JSubroutineParameters parameters) throws JSubroutineNotFoundException, JRemoteException
func
in interface JConnection
JSubroutineNotFoundException
JRemoteException
public JExecuteResults execute(java.lang.String command) throws JRemoteException
JConnection
Execute a jBASE command.
execute
in interface JConnection
JRemoteException
public JExecuteResults execute(java.lang.String command, JSelectList selectList) throws JRemoteException
JConnection
Execute a jBASE command using an existing select list as a filter.
execute
in interface JConnection
JRemoteException
public int date() throws JRemoteException
Return the jBASE internal date. Epoch Dec 31, 1967.
date
in interface JConnection
JRemoteException
JConnection.date()
public int time() throws JRemoteException
Return the jBASE internal time. Seconds since midnight.
time
in interface JConnection
JRemoteException
JConnection.time()
public java.lang.String iconv(java.lang.String data, java.lang.String conversion) throws JRemoteException
JConnection
Converts data in external format to internal format.
iconv
in interface JConnection
data
- data to be convertedconversion
- the conversion commandJRemoteException
public java.lang.String oconv(java.lang.String data, java.lang.String conversion) throws JRemoteException
JConnection
Converts internal representations of data to their external form.
oconv
in interface JConnection
data
- data to be convertedconversion
- the conversion commandJRemoteException
public JDynArray getCommon(java.lang.String name) throws JRemoteException
Return the value of the common with supplied name.
getCommon
in interface JConnection
JRemoteException
JConnection.getCommon(java.lang.String name)
public EISMetaDataRepository getMetaData() throws JRemoteException
JConnection
Return meta data of the connected jBASE instance.
getMetaData
in interface JConnection
JRemoteException
JConnection.getMetaData()
public JStatement createStatement() throws JRemoteException
JConnection
Create a statement object that enables queries to be executed and a JResultSet returned.
createStatement
in interface JConnection
JRemoteException
JConnection.createStatement()
public JSelectList createSelectList(JDynArray jd) throws JRemoteException
JConnection
Create a select list object from an existing dynamic array containing a list of keys separated by attribute markers.
createSelectList
in interface JConnection
jd
- dynamic array containing the keysJRemoteException
JConnection.createSelectList(JDynArray)
public void begin() throws JRemoteException
JConnection
Begin a jBASE transaction.
If a transaction already exists then no action will be taken.
begin
in interface JConnection
JRemoteException
JConnection.commit()
,
JConnection.rollback()
public void commit() throws JRemoteException
JConnection
Commit all pending jBASE operations performed in transaction and mark as complete.
If no transaction exists then no action will be taken.
commit
in interface JConnection
JRemoteException
JConnection.begin()
public void rollback() throws JRemoteException
JConnection
Rollback all jBASE operations performed in transaction and mark as complete.
If no transaction exists then no action will be taken.
rollback
in interface JConnection
JRemoteException
JConnection.begin()
public void setTerminalOutputWriter(java.io.Writer writer)
setTerminalOutputWriter
in interface JConnection
public java.lang.String toString()
toString
in class java.lang.Object
public boolean echo(int length) throws JRemoteException
Send an echo request and waits for a reply.
echo
in interface JConnection
length
- of echo packet to send.JRemoteException
public java.lang.String monitoring(java.lang.String command) throws JRemoteException
Sends an monitoring command and waits for it's response
monitoring
in interface JConnection
command
- to sendJRemoteException
- if monitoring command fails