dk.vajhoej.isam.remote
Class ByteClient

java.lang.Object
  extended by dk.vajhoej.isam.remote.ByteClient
All Implemented Interfaces:
IsamProtocol, IsamProtocolClient

public class ByteClient
extends java.lang.Object
implements IsamProtocolClient

Class ByteClient implement IsamProtocolClient using byte arrays over plain Stream's.


Field Summary
 
Fields inherited from interface dk.vajhoej.isam.remote.IsamProtocol
B_V1, CLOSE, CREATE, DELETE, ERROR, FIND_GE, FIND_GT, FIND_LE, FIND_LT, O_V1, OK, READ, RESULT_CLOSE, RESULT_CURRENT, RESULT_READ, UPDATE
 
Constructor Summary
ByteClient(java.io.InputStream is, java.io.OutputStream os)
          Create instance of ObjectClient.
 
Method Summary
 void close()
          Close ISAM source.
<T> void
create(T o)
          Create record in ISAM source.
<T,TK> void
delete(java.lang.Class<T> t, Key<TK> k)
          Delete record from ISAM source.
 void handshake()
          Send preferred version.
<T,TK> T
read(java.lang.Class<T> t, Key<TK> k)
          Read record from ISAM source.
<T,TK> IsamResult<T>
readXX(int cmd, java.lang.Class<T> t, Key<TK> k)
          Find all records matching criteria.
 void resultClose()
          Close.
<T> T
resultCurrent()
          Return current record.
 boolean resultRead()
          Read record.
<T> void
update(T o)
          Update record in ISAM source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteClient

public ByteClient(java.io.InputStream is,
                  java.io.OutputStream os)
Create instance of ObjectClient.

Parameters:
is - input stream
os - output stream
Method Detail

handshake

public void handshake()
               throws IsamException
Description copied from interface: IsamProtocolClient
Send preferred version.

Specified by:
handshake in interface IsamProtocolClient
Throws:
IsamException - if problem with ISAM source

read

public <T,TK> T read(java.lang.Class<T> t,
                     Key<TK> k)
       throws IsamException,
              RecordException
Description copied from interface: IsamProtocolClient
Read record from ISAM source.

Specified by:
read in interface IsamProtocolClient
Parameters:
t - type to read
k - key of record to read
Returns:
object read
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

create

public <T> void create(T o)
            throws IsamException,
                   RecordException
Description copied from interface: IsamProtocolClient
Create record in ISAM source.

Specified by:
create in interface IsamProtocolClient
Parameters:
o - object to create
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

update

public <T> void update(T o)
            throws IsamException,
                   RecordException
Description copied from interface: IsamProtocolClient
Update record in ISAM source.

Specified by:
update in interface IsamProtocolClient
Parameters:
o - object to update
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

delete

public <T,TK> void delete(java.lang.Class<T> t,
                          Key<TK> k)
            throws IsamException,
                   RecordException
Description copied from interface: IsamProtocolClient
Delete record from ISAM source.

Specified by:
delete in interface IsamProtocolClient
Parameters:
t - type to delete
k - key of record to delete
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

close

public void close()
           throws IsamException
Description copied from interface: IsamProtocolClient
Close ISAM source.

Specified by:
close in interface IsamProtocolClient
Throws:
IsamException - if problem with ISAM source

readXX

public <T,TK> IsamResult<T> readXX(int cmd,
                                   java.lang.Class<T> t,
                                   Key<TK> k)
                     throws IsamException,
                            RecordException
Description copied from interface: IsamProtocolClient
Find all records matching criteria.

Specified by:
readXX in interface IsamProtocolClient
t - type to find
k - key to find
Returns:
result
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

resultRead

public boolean resultRead()
                   throws IsamException,
                          RecordException
Description copied from interface: IsamProtocolClient
Read record.

Specified by:
resultRead in interface IsamProtocolClient
Returns:
true if record read false if record not read
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

resultCurrent

public <T> T resultCurrent()
                throws IsamException,
                       RecordException
Description copied from interface: IsamProtocolClient
Return current record.

Specified by:
resultCurrent in interface IsamProtocolClient
Returns:
current record
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

resultClose

public void resultClose()
                 throws IsamException
Description copied from interface: IsamProtocolClient
Close.

Specified by:
resultClose in interface IsamProtocolClient
Throws:
IsamException - if problem with ISAM source