Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

JFile (jremote API)


Interface JFile

All Known Implementing Classes:
JFileImpl, WrappedJFile


public interface JFile

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


Method Summary

Modifier and Type
Method and Description
boolean
clear()
Delete all records from the file.
boolean
close()
Closes this jBASE file.
boolean
delete(String recordKey)
Delete a record where the supplied recordKey is the key to the record.
boolean
exists(String recordKey)
This method returns true if the supplied record id exists.
JCursor
getCursor()
Returns a cursor to this jBASE file.
boolean
hasLock(String recordKey)
Check if the specified key holds a lock.
JDynArray
read(String recordKey)
Read a record where the supplied recordKey is the key to the record.
JDynArray
readU(String recordKey, boolean blockedRead)
Read a record where the supplied recordKey is the key to the record and locks it for update.
boolean
releaseLock(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(String recordKey, JDynArray record)
Write the supplied record to the jBASE file.
boolean
writeU(String recordKey, JDynArray record, boolean blockedWrite)
Write the supplied record to the jBASE file.


Method Detail


exists

boolean exists(String recordKey)
        throws JRemoteException

This method returns true if the supplied record id exists.

Parameters:
recordKey -
Returns:
record exists
Throws:
JRemoteException

read

JDynArray read(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(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(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(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(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(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(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


Back to jREMOTE API

Was this article helpful?