public class RegPlugin
extends java.lang.Object
open
method of
the SQLOpenPlugin
interface. Methods that a particular plugin
does not want to implement can just throw a BBjException
,
usually of type BBjException.ACCESS
.Constructor and Description |
---|
RegPlugin(java.lang.String p_regKey,
java.lang.String p_regSubKey,
java.lang.String p_access)
Constructor called by
RegOpenPlugin . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the file position.
|
int |
extract(byte[] p_buffer,
int p_size,
byte[] p_key,
int p_keylen,
int p_keyNumber,
int p_timeout)
Extract from the key given.
|
int |
extract(byte[] p_buffer,
int p_size,
int p_timeout)
Extract from the current position.
|
int |
extract(byte[] p_buffer,
int p_size,
int p_keyNumber,
int p_timeout)
Extract from the current position.
|
int |
extract(byte[] p_buffer,
int p_size,
long p_index,
int p_timeout)
Extract from the index given.
|
byte[] |
getFIN(int p_index)
Base FIN function used by the interpreter to get
the FIN byte array.
|
java.lang.String |
getFINTemplate(int p_index)
Get template string for base FIN function.
|
int |
getFirstKey(byte[] p_buffer,
int p_keylen)
Get first key in current key number.
|
long |
getIndex()
Get current index -- this is not guaranteed to be useful for all file types.
|
int |
getKey(byte[] p_buffer,
int p_keylen)
Get key at the current position.
|
int |
getKey(byte[] p_buffer,
int p_keylen,
int p_keyNumber)
Get key at the current position.
|
int |
getKeySize()
Get logical key size (if applicable).
|
int |
getLastKey(byte[] p_buffer,
int p_keylen)
Get last key in current key number.
|
long |
getLength()
Get length of the file -- not valid for all file types.
|
int |
getMaxReadSize()
Maximum number of bytes that a user is able to read from
the file in a single read.
|
int |
getNextKey(byte[] p_buffer,
int p_keylen)
Get next key at the current position.
|
long |
getNumberOfRecords()
Get maximum number of records (if applicable).
|
int |
getPreviousKey(byte[] p_buffer,
int p_keylen)
Get previous key at the current position.
|
long |
getRecordCount()
Get the number of records actually in the file.
|
int |
getRecordSize()
Get record size (if applicable).
|
byte[] |
getXFIN(int p_index)
Base XFIN function used by the interpreter to get
the XFIN byte array.
|
java.lang.String |
getXFINTemplate(int p_index)
Get template string for base XFIN function.
|
boolean |
isRecordOriented()
Is the plugin file record oriented (i.e.
|
void |
lock()
Lock the file.
|
int |
read(byte[] p_buffer,
int p_size,
byte[] p_key,
int p_keylen,
int p_keyNumber,
boolean p_find,
long p_move,
int p_timeout)
Read from the key given and change the position either forwards or
backwards.
|
int |
read(byte[] p_buffer,
int p_size,
int p_keyNumber,
long p_move,
int p_timeout)
Read from the current position and change the position either forwards
or backwards.
|
int |
read(byte[] p_buffer,
int p_size,
long p_move,
int p_timeout)
Read from the current position and change the position either forwards
or backwards.
|
int |
read(byte[] p_buffer,
int p_size,
long p_index,
long p_move,
int p_timeout)
Read from the index given and change the position either forwards or
backwards.
|
void |
remove(byte[] p_key,
int p_keylen,
boolean p_dom)
Remove the record indicated by a key.
|
void |
remove(long p_index)
Remove the record indicated by an index.
|
void |
unlock()
Unlock the file.
|
void |
write(byte[] p_buffer,
int p_size,
byte[] p_key,
int p_keylen,
long p_move,
boolean p_dom,
int p_timeout)
Write a record at the position given by a key.
|
void |
write(byte[] p_buffer,
int p_size,
long p_move,
boolean p_dom,
int p_timeout)
Write a record at the current position except for multi keyed MKEYED
files where the key will be derived from the record.
|
void |
write(byte[] p_buffer,
int p_size,
long p_index,
long p_move,
boolean p_dom,
int p_timeout)
Write a record at the position given by an index.
|
public RegPlugin(java.lang.String p_regKey, java.lang.String p_regSubKey, java.lang.String p_access) throws BBjException
RegOpenPlugin
.p_regKey
- The registry key to open.p_regSubKey
- The registry subkey to open.p_access
- The disired access to the key.BBjException
- If a problem occurs.public boolean isRecordOriented()
public int read(byte[] p_buffer, int p_size, long p_move, int p_timeout) throws BBjException
p_buffer
- Buffer to fill with the bytes read.p_size
- Maximum number of bytes to read into the buffer.p_move
- Number of records (or bytes in STRING file) to
move the position after the read. If this is negative
the position will be moved backwards.p_timeout
- Timeout value in seconds for the read operation.BBjException
public int read(byte[] p_buffer, int p_size, int p_keyNumber, long p_move, int p_timeout) throws BBjException
p_buffer
- Buffer to fill with the bytes read.p_size
- Maximum number of bytes to read into the buffer.p_keyNumber
- Key number to use for iteration. If the key
number is different than the one currently being used the
iteration will start at the beginning of the key specified.p_move
- Number of records (or bytes in STRING file) to
move the position after the read. If this is negative
the position will be moved backwards.p_timeout
- Timeout value in seconds for the read operation.BBjException
public int read(byte[] p_buffer, int p_size, byte[] p_key, int p_keylen, int p_keyNumber, boolean p_find, long p_move, int p_timeout) throws BBjException
p_buffer
- Buffer to fill with the bytes read.p_size
- Maximum number of bytes to read into the buffer.p_key
- Key value to search for on the read.p_keylen
- Length of the actual key in the key byte array.p_keyNumber
- Number of the key chain to search.p_find
- true if the position should not be changed if the key is not
found.p_move
- Number of records (or bytes in STRING file) to
move the position after the read. If this is negative
the position will be moved backwards.p_timeout
- Timeout value in seconds for the read operation.BBjException
public int read(byte[] p_buffer, int p_size, long p_index, long p_move, int p_timeout) throws BBjException
p_buffer
- Buffer to fill with the bytes read.p_size
- Maximum number of bytes to read into the buffer.p_index
- Index to jump to for the read.p_move
- Number of records (or bytes in STRING file) to
move the position after the read. If this is negative
the position will be moved backwards.p_timeout
- Timeout value in seconds for the read operation.BBjException
- If a problem occurs.public int extract(byte[] p_buffer, int p_size, int p_timeout) throws BBjException
p_buffer
- Buffer to fill with the bytes read.p_size
- Maximum number of bytes to read into the buffer.p_timeout
- Timeout value in seconds for the read operation.BBjException
- If a problem occurs.public int extract(byte[] p_buffer, int p_size, int p_keyNumber, int p_timeout) throws BBjException
p_buffer
- Buffer to fill with the bytes read.p_size
- Maximum number of bytes to read into the buffer.p_keyNumber
- Key number to use for iteration. If the key
number is different than the one currently being used the
iteration will start at the beginning of the key specified.p_timeout
- Timeout value in seconds for the read operation.BBjException
- If a problem occurs.public int extract(byte[] p_buffer, int p_size, byte[] p_key, int p_keylen, int p_keyNumber, int p_timeout) throws BBjException
p_buffer
- Buffer to fill with the bytes read.p_size
- Maximum number of bytes to read into the buffer.p_key
- Key value to search for on the read.p_keylen
- Length of the actual key in the key byte array.p_keyNumber
- Number of the key chain to search.p_timeout
- Timeout value in seconds for the read operation.BBjException
- If a problem occurs.public int extract(byte[] p_buffer, int p_size, long p_index, int p_timeout) throws BBjException
p_buffer
- Buffer to fill with the bytes read.p_size
- Maximum number of bytes to read into the buffer.p_index
- Index to jump to for the read.p_timeout
- Timeout value in seconds for the read operation.BBjException
- If a problem occurs.public void write(byte[] p_buffer, int p_size, long p_move, boolean p_dom, int p_timeout) throws BBjException
p_buffer
- Record bytes.p_size
- Number of bytes to write from the buffer.p_move
- Number of records (or bytes in STRING file) to
move the position after the write. If this is negative
the position will be moved backwards. The move is relative to
the location of the record written.p_dom
- true if an error should be given for a duplicate key.p_timeout
- Timeout value in seconds for the write operation.BBjException
- If a problem occurs.public void write(byte[] p_buffer, int p_size, byte[] p_key, int p_keylen, long p_move, boolean p_dom, int p_timeout) throws BBjException
p_buffer
- Record bytes.p_size
- Number of bytes to write from the buffer.p_key
- Key to use in writing the record.p_keylen
- Length of the actual key in the key byte array.p_move
- Number of records (or bytes in STRING file) to
move the position after the write. If this is negative
the position will be moved backwards. The move is relative to
the location of the record written.p_dom
- true if an error should be given for a duplicate key.p_timeout
- Timeout value in seconds for the write operation.BBjException
- If a problem occurs.public void write(byte[] p_buffer, int p_size, long p_index, long p_move, boolean p_dom, int p_timeout) throws BBjException
p_buffer
- Record bytes.p_size
- Number of bytes to write from the buffer.p_index
- Index to use in writing the record.p_move
- Number of records (or bytes in STRING file) to
move the position after the write. If this is negative
the position will be moved backwards. The move is relative to
the location of the record written.p_dom
- true if an error should be given for a duplicate key.p_timeout
- Timeout value in seconds for the write operation.BBjException
- If a problem occurs.public void remove(byte[] p_key, int p_keylen, boolean p_dom) throws BBjException
p_key
- Key of the record to remove.p_keylen
- Length of the actual key in the key byte array.p_dom
- true if an error should be given for a missing key.BBjException
- If a problem occurs.public void lock() throws BBjException
BBjException
- If a problem occurs.public void unlock() throws BBjException
BBjException
- If a problem occurs.public void close() throws BBjException
BBjException
- If a problem occurs.public int getKey(byte[] p_buffer, int p_keylen) throws BBjException
p_buffer
- Buffer in which to place the key.p_keylen
- Length of the key buffer provided.BBjException
- If a problem occurs.public int getKey(byte[] p_buffer, int p_keylen, int p_keyNumber) throws BBjException
p_buffer
- Buffer in which to place the key.p_keylen
- Length of the key buffer provided.p_keyNumber
- Which key number to get the key for.BBjException
- If a problem occurs.public int getFirstKey(byte[] p_buffer, int p_keylen) throws BBjException
p_buffer
- Buffer in which to place the key.p_keylen
- Length of key buffer provided.BBjException
- If a problem occurs.public int getLastKey(byte[] p_buffer, int p_keylen) throws BBjException
p_buffer
- Buffer in which to place the key.p_keylen
- Length of key buffer provided.BBjException
- If a problem occurs.public int getNextKey(byte[] p_buffer, int p_keylen) throws BBjException
p_buffer
- Buffer in which to place the key.p_keylen
- Length of key buffer provided.BBjException
- If a problem occurs.public int getPreviousKey(byte[] p_buffer, int p_keylen) throws BBjException
p_buffer
- Buffer in which to place the key.p_keylen
- Length of key buffer provided.BBjException
- If a problem occurs.public int getKeySize() throws BBjException
BBjException
- If a problem occurs.public long getNumberOfRecords() throws BBjException
BBjException
- If a problem occurs.public int getRecordSize() throws BBjException
BBjException
- If a problem occurs.public byte[] getFIN(int p_index) throws BBjException
p_index
- Index of FIN to retrieve.BBjException
- If a problem occurs.public java.lang.String getFINTemplate(int p_index) throws BBjException
p_index
- Index of FIN to get template for.BBjException
- If a problem occurs.public byte[] getXFIN(int p_index) throws BBjException
p_index
- Index of FIN to retrieve.BBjException
- If a problem occurs.public java.lang.String getXFINTemplate(int p_index) throws BBjException
p_index
- Index of XFIN to get template for.BBjException
- If a problem occurs.public long getLength() throws BBjException
BBjException
- If a problem occurs.public long getIndex() throws BBjException
BBjException
- If a problem occurs.public int getMaxReadSize() throws BBjException
BBjException
- If a problem occurs.public long getRecordCount() throws BBjException
BBjException
- If a problem occurs.public void remove(long p_index) throws BBjException
p_index
- Index of the record to remove.BBjException
- If a problem occurs.