# JFile (jremote API)

Updated: 11/30/2021, 7:00:45 PM
Created: 11/30/2021, 7:00:45 PM
Last Updated By: Jake Tuttle
Read Time: 4 minute(s)

# Interface JFile

All Known Implementing Classes:JFileImpl, WrappedJFile


public interface JFile
1

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
1
2

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
1
2
3

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
1
2
3
4
5

Read a record where the supplied recordKey is the key to the record and locks it for update. Parameters:recordKey - The record keyblockedRead - 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
1
2
3

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 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
1
2
3
4
5

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 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
1
2

Release the update lock (if held) on the specified key.
Parameters:recordKey
Returns true if lock has been released successfully
Throws:JRemoteException

# releaseLocks

boolean releaseLocks()
              throws JRemoteException
1
2

Releases all locks held by this file.
Returns true if locks have been released successfully
Throws:JRemoteException

# hasLock

boolean hasLock(String recordKey)
         throws JRemoteException
1
2

Check if the specified key holds a lock.
Parameters:recordKey
Returns true if the record is locked
Throws:JRemoteException

# delete

boolean delete(String recordKey)
        throws JRemoteException
1
2

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
1
2

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
1
2

Returns a select list containing the record keys in this jBASE file.
Returns:JSelectList all record keys
Throws:JRemoteException

# getCursor

JCursor getCursor()
           throws JRemoteException
1
2

Returns a cursor to this jBASE file.
Returns:JCursor cursor
Throws:JRemoteException

# clear

boolean clear()
       throws JRemoteException
1
2

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