DbStorage.driver
Class ContentExtensionDriver

java.lang.Object
  extended byDbStorage.driver.ContentExtensionDriver

public final class ContentExtensionDriver
extends java.lang.Object

This class drives a content extension, this is stored in the CONTENT segment. A content extension is used when the datum's content can be fully stored in one unit.


Field Summary
static int CONTENT_EXTENSION_OFFSET
           
static int CONTENT_OFFSET
           
 
Constructor Summary
ContentExtensionDriver()
           
 
Method Summary
static void createContentExtension(DbStorageManager dbsm, long transactionNumber, DbUnitAddress newUnitAddress)
          Creates a content extension.
static int getContent(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, int maxLength, byte[] b, int off)
          Gets the extension's content.
static void getContentExtension(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress destiny)
          Gets the content extension's address (in the CONTENT segment) of the specified extension.
static int setContent(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, int maxLength, byte[] b, int off)
          Sets the extension's content.
static void setContentExtension(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress source)
          Sets the content extension's address (in the CONTENT segment) of the specified extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_EXTENSION_OFFSET

public static final int CONTENT_EXTENSION_OFFSET
See Also:
Constant Field Values

CONTENT_OFFSET

public static final int CONTENT_OFFSET
See Also:
Constant Field Values
Constructor Detail

ContentExtensionDriver

public ContentExtensionDriver()
Method Detail

createContentExtension

public static void createContentExtension(DbStorageManager dbsm,
                                          long transactionNumber,
                                          DbUnitAddress newUnitAddress)
                                   throws storage.StorageException,
                                          java.io.IOException
Creates a content extension.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
newUnitAddress - The address of the created structure in the CONTENT segment.
Throws:
storage.StorageException
java.io.IOException

getContentExtension

public static void getContentExtension(DbStorageManager dbsm,
                                       long transactionNumber,
                                       DbUnitAddress unitAddress,
                                       DbUnitAddress destiny)
                                throws storage.StorageException,
                                       java.io.IOException
Gets the content extension's address (in the CONTENT segment) of the specified extension.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
unitAddress - The address of the content extension.
destiny - Where the retrieved unit address will be stored.
Throws:
storage.StorageException
java.io.IOException

setContentExtension

public static void setContentExtension(DbStorageManager dbsm,
                                       long transactionNumber,
                                       DbUnitAddress unitAddress,
                                       DbUnitAddress source)
                                throws storage.StorageException,
                                       java.io.IOException
Sets the content extension's address (in the CONTENT segment) of the specified extension.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
unitAddress - The address of the content extension.
source - Where the unit address is stored.
Throws:
storage.StorageException
java.io.IOException

getContent

public static int getContent(DbStorageManager dbsm,
                             long transactionNumber,
                             DbUnitAddress unitAddress,
                             int maxLength,
                             byte[] b,
                             int off)
                      throws storage.StorageException,
                             java.io.IOException
Gets the extension's content.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
unitAddress - The address of the content extension.
maxLength - The maximun number of bytes to be got.
b - Where the content will be stored.
off - The begining position of b where the content will be stored.
Throws:
storage.StorageException
java.io.IOException

setContent

public static int setContent(DbStorageManager dbsm,
                             long transactionNumber,
                             DbUnitAddress unitAddress,
                             int maxLength,
                             byte[] b,
                             int off)
                      throws storage.StorageException,
                             java.io.IOException
Sets the extension's content.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
unitAddress - The address of the content extension.
maxLength - The maximun number of bytes to be setted.
b - Where the content is stored.
off - The begining position of b where the content is stored.
Throws:
storage.StorageException
java.io.IOException