jremote jbase5.2.1

com.jbase.jremote
Interface JFile

All Known Implementing Classes:
JFileImpl, WrappedJFile

public interface JFile

The JFile object is used to query, read, and write to jBASE files.

Author:
aphethean

Method Summary
 boolean clear()
          Delete all records from the file.
 boolean close()
          Closes this jBASE file.
 boolean delete(java.lang.String recordKey)
          Delete a record where the supplied recordKey is the key to the record.
 boolean exists(java.lang.String recordKey)
          This method returns true if the supplied record id exists.
 JCursor getCursor()
          Returns a cursor to this jBASE file.
 boolean hasLock(java.lang.String recordKey)
          Check if the specified key holds a lock.
 JDynArray read(java.lang.String recordKey)
          Read a record where the supplied recordKey is the key to the record.
 JDynArray readU(java.lang.String recordKey, boolean blockedRead)
          Read a record where the supplied recordKey is the key to the record and locks it for update.
 boolean releaseLock(java.lang.String recordKey)
          Release the update lock (if held) on the specified key.
 boolean releaseLocks()
          Releases all locks held by this file.
 JSelectList select()
          Returns a select list containing the record keys in this jBASE file.
 boolean write(java.lang.String recordKey, JDynArray record)
           Write the supplied record to the jBASE file.
 boolean writeU(java.lang.String recordKey, JDynArray record, boolean blockedWrite)
           Write the supplied record to the jBASE file.
 

Method Detail

exists

boolean exists(java.lang.String recordKey)
               throws JRemoteException

This method returns true if the supplied record id exists.

Parameters:
recordKey -
Returns:
record exists
Throws:
JRemoteException

read

JDynArray read(java.lang.String recordKey)
               throws JRecordNotFoundException,
                      JRemoteException

Read a record where the supplied recordKey is the key to the record.

Parameters:
recordKey -
Returns:
the record that was read
Throws:
JRecordNotFoundException
JRemoteException

readU

JDynArray readU(java.lang.String recordKey,
                boolean blockedRead)
                throws JRecordNotFoundException,
                       JRecordLockedException,
                       JRemoteException

Read a record where the supplied recordKey is the key to the record and locks it for update.

Parameters:
recordKey - The record key
blockedRead - Specifies whether this method call should block if the record is locked
Returns:
the record that was read and locked
Throws:
JRecordNotFoundException
JRemoteException
JRecordLockedException

write

boolean write(java.lang.String recordKey,
              JDynArray record)
              throws JRemoteException

Write the supplied record to the jBASE file. If an update lock was held against the supplied key, it will be released after the record has been written.

Parameters:
recordKey -
record -
Returns:
Returns true if the record did not exist prior to this write or false if the record was updated.
Throws:
JRemoteException

writeU

boolean writeU(java.lang.String recordKey,
               JDynArray record,
               boolean blockedWrite)
               throws JRecordLockedException,
                      JRemoteException

Write the supplied record to the jBASE file. If an update lock was held against the supplied key, it will NOT be released.

Parameters:
recordKey -
record -
blockedWrite - Specifies whether this method call should block if the record is already locked
Returns:
Returns true if the record did not exist prior to this write or false if the record was updated.
Throws:
JRemoteException
JRecordLockedException

releaseLock

boolean releaseLock(java.lang.String recordKey)
                    throws JRemoteException

Release the update lock (if held) on the specified key.

Parameters:
recordKey -
Returns:
Returns true if lock has been released successfully
Throws:
JRemoteException

releaseLocks

boolean releaseLocks()
                     throws JRemoteException

Releases all locks held by this file.

Returns:
Returns true if locks have been released successfully
Throws:
JRemoteException

hasLock

boolean hasLock(java.lang.String recordKey)
                throws JRemoteException

Check if the specified key holds a lock.

Parameters:
recordKey -
Returns:
Returns true if the record is locked
Throws:
JRemoteException

delete

boolean delete(java.lang.String recordKey)
               throws JRemoteException

Delete a record where the supplied recordKey is the key to the record.

Returns true if the delete was successful or false if the record was not found.
An exception will be thrown if an error occurs whilst deleting the record.

Parameters:
recordKey -
Returns:
delete successful
Throws:
JRemoteException

close

boolean close()
              throws JRemoteException

Closes this jBASE file.

Closing a JFile frees the associate remote system resources. Subsequent actions on this JFile object will reopen the file.

Returns:
close successful
Throws:
JRemoteException

select

JSelectList select()
                   throws JRemoteException

Returns a select list containing the record keys in this jBASE file.

Returns:
JSelectList all record keys
Throws:
JRemoteException

getCursor

JCursor getCursor()
                  throws JRemoteException

Returns a cursor to this jBASE file.

Returns:
JCursor cursor
Throws:
JRemoteException

clear

boolean clear()
              throws JRemoteException

Delete all records from the file.

Returns true if the operation was successful or false if the records could not be deleted.

Returns:
clear successful
Throws:
JRemoteException

jremote jbase5.2.1

Copyright © 2010 TEMENOS. All Rights Reserved.