jremote jbase5.2.1

com.jbase.jremote.jca
Class WrappedJFile

java.lang.Object
  extended by com.jbase.jremote.jca.WrappedJFile
All Implemented Interfaces:
JFile

public class WrappedJFile
extends java.lang.Object
implements JFile

Provide an interface to remote jBASE files and ensures connection validity.

Author:
aphethean

Constructor Summary
protected WrappedJFile(WrappedJConnection connection, JFile jfile)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrappedJFile

protected WrappedJFile(WrappedJConnection connection,
                       JFile jfile)
Method Detail

exists

public boolean exists(java.lang.String recordKey)
               throws JRemoteException
Description copied from interface: JFile

This method returns true if the supplied record id exists.

Specified by:
exists in interface JFile
Returns:
record exists
Throws:
JRemoteException

read

public JDynArray read(java.lang.String recordKey)
               throws JRecordNotFoundException,
                      JRemoteException
Description copied from interface: JFile

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

Specified by:
read in interface JFile
Returns:
the record that was read
Throws:
JRecordNotFoundException
JRemoteException

readU

public JDynArray readU(java.lang.String recordKey,
                       boolean blockedRead)
                throws JRecordNotFoundException,
                       JRemoteException
Description copied from interface: JFile

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

Specified by:
readU in interface JFile
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

write

public boolean write(java.lang.String recordKey,
                     JDynArray record)
              throws JRemoteException
Description copied from interface: JFile

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.

Specified by:
write in interface JFile
Returns:
Returns true if the record did not exist prior to this write or false if the record was updated.
Throws:
JRemoteException

writeU

public boolean writeU(java.lang.String recordKey,
                      JDynArray record,
                      boolean blockedWrite)
               throws JRemoteException
Description copied from interface: JFile

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

Specified by:
writeU in interface JFile
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

delete

public boolean delete(java.lang.String recordKey)
               throws JRemoteException
Description copied from interface: JFile

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.

Specified by:
delete in interface JFile
Returns:
delete successful
Throws:
JRemoteException

releaseLock

public boolean releaseLock(java.lang.String recordKey)
                    throws JRemoteException
Description copied from interface: JFile

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

Specified by:
releaseLock in interface JFile
Returns:
Returns true if lock has been released successfully
Throws:
JRemoteException

releaseLocks

public boolean releaseLocks()
                     throws JRemoteException
Description copied from interface: JFile

Releases all locks held by this file.

Specified by:
releaseLocks in interface JFile
Returns:
Returns true if locks have been released successfully
Throws:
JRemoteException

hasLock

public boolean hasLock(java.lang.String recordKey)
                throws JRemoteException
Description copied from interface: JFile

Check if the specified key holds a lock.

Specified by:
hasLock in interface JFile
Returns:
Returns true if the record is locked
Throws:
JRemoteException

close

public boolean close()
              throws JRemoteException
Description copied from interface: JFile

Closes this jBASE file.

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

Specified by:
close in interface JFile
Returns:
close successful
Throws:
JRemoteException

select

public JSelectList select()
                   throws JRemoteException
Description copied from interface: JFile

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

Specified by:
select in interface JFile
Returns:
JSelectList all record keys
Throws:
JRemoteException

getCursor

public JCursor getCursor()
                  throws JRemoteException
Description copied from interface: JFile

Returns a cursor to this jBASE file.

Specified by:
getCursor in interface JFile
Returns:
JCursor cursor
Throws:
JRemoteException

clear

public boolean clear()
              throws JRemoteException
Description copied from interface: JFile

Delete all records from the file.

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

Specified by:
clear in interface JFile
Returns:
clear successful
Throws:
JRemoteException

jremote jbase5.2.1

Copyright © 2010 TEMENOS. All Rights Reserved.