DbStorage.driver
Class ParentsNodeDriver

java.lang.Object
  extended byDbStorage.driver.ParentsNodeDriver

public final class ParentsNodeDriver
extends java.lang.Object

This class drives a content node for building contents of id collections, these correspond to parents' collections, this is stored in the PARENTS segment. A node is used to keep 2 data structures a linked list and an AA-tree.


Field Summary
static int HEIGHT_OFFSET
           
static int ID_OFFSET
           
static int LEFT_NODE_OFFSET
           
static int NEXT_NODE_OFFSET
           
static int PARENT_NODE_OFFSET
           
static int PREVIOUS_NODE_OFFSET
           
static int RIGHT_NODE_OFFSET
           
 
Constructor Summary
ParentsNodeDriver()
           
 
Method Summary
static void createParentsNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress newUnitAddress)
          Creates a parents node.
static byte getHeight(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress)
          Gets the height of the specified node in the tree.
static void getId(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, PhysicalID destiny)
          Gets the physical id in the specified node.
static void getLeftNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress destiny)
          Gets the left node's address of the specified node.
static void getNextNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress destiny)
          Gets the next node's address of the specified node.
static void getParentNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress destiny)
          Gets the parent node's address of the specified node.
static void getPreviousNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress destiny)
          Gets the previous node's address of the specified node.
static void getRightNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress destiny)
          Gets the right node's address of the specified node.
static void setHeight(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, byte source)
          Sets the height of the specified node in the tree.
static void setId(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, PhysicalID source)
          Sets the physical id in the specified node.
static void setLeftNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress source)
          Sets the left node's address of the specified node.
static void setNextNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress source)
          Sets the next node's address of the specified node.
static void setParentNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress source)
          Sets the previous node's address of the specified node.
static void setPreviousNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress source)
          Sets the previous node's address of the specified node.
static void setRightNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress unitAddress, DbUnitAddress source)
          Sets the right node's address of the specified node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREVIOUS_NODE_OFFSET

public static final int PREVIOUS_NODE_OFFSET
See Also:
Constant Field Values

NEXT_NODE_OFFSET

public static final int NEXT_NODE_OFFSET
See Also:
Constant Field Values

LEFT_NODE_OFFSET

public static final int LEFT_NODE_OFFSET
See Also:
Constant Field Values

RIGHT_NODE_OFFSET

public static final int RIGHT_NODE_OFFSET
See Also:
Constant Field Values

PARENT_NODE_OFFSET

public static final int PARENT_NODE_OFFSET
See Also:
Constant Field Values

HEIGHT_OFFSET

public static final int HEIGHT_OFFSET
See Also:
Constant Field Values

ID_OFFSET

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

ParentsNodeDriver

public ParentsNodeDriver()
Method Detail

createParentsNode

public static void createParentsNode(DbStorageManager dbsm,
                                     long transactionNumber,
                                     DbUnitAddress newUnitAddress)
                              throws storage.StorageException,
                                     java.io.IOException
Creates a parents node.

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 PARENTS segment.
Throws:
storage.StorageException
java.io.IOException

getPreviousNode

public static void getPreviousNode(DbStorageManager dbsm,
                                   long transactionNumber,
                                   DbUnitAddress unitAddress,
                                   DbUnitAddress destiny)
                            throws storage.StorageException,
                                   java.io.IOException
Gets the previous node's address of the specified node.

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

setPreviousNode

public static void setPreviousNode(DbStorageManager dbsm,
                                   long transactionNumber,
                                   DbUnitAddress unitAddress,
                                   DbUnitAddress source)
                            throws storage.StorageException,
                                   java.io.IOException
Sets the previous node's address of the specified node.

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

getNextNode

public static void getNextNode(DbStorageManager dbsm,
                               long transactionNumber,
                               DbUnitAddress unitAddress,
                               DbUnitAddress destiny)
                        throws storage.StorageException,
                               java.io.IOException
Gets the next node's address of the specified node.

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

setNextNode

public static void setNextNode(DbStorageManager dbsm,
                               long transactionNumber,
                               DbUnitAddress unitAddress,
                               DbUnitAddress source)
                        throws storage.StorageException,
                               java.io.IOException
Sets the next node's address of the specified node.

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

getLeftNode

public static void getLeftNode(DbStorageManager dbsm,
                               long transactionNumber,
                               DbUnitAddress unitAddress,
                               DbUnitAddress destiny)
                        throws storage.StorageException,
                               java.io.IOException
Gets the left node's address of the specified node.

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

setLeftNode

public static void setLeftNode(DbStorageManager dbsm,
                               long transactionNumber,
                               DbUnitAddress unitAddress,
                               DbUnitAddress source)
                        throws storage.StorageException,
                               java.io.IOException
Sets the left node's address of the specified node.

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

getRightNode

public static void getRightNode(DbStorageManager dbsm,
                                long transactionNumber,
                                DbUnitAddress unitAddress,
                                DbUnitAddress destiny)
                         throws storage.StorageException,
                                java.io.IOException
Gets the right node's address of the specified node.

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

setRightNode

public static void setRightNode(DbStorageManager dbsm,
                                long transactionNumber,
                                DbUnitAddress unitAddress,
                                DbUnitAddress source)
                         throws storage.StorageException,
                                java.io.IOException
Sets the right node's address of the specified node.

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

getParentNode

public static void getParentNode(DbStorageManager dbsm,
                                 long transactionNumber,
                                 DbUnitAddress unitAddress,
                                 DbUnitAddress destiny)
                          throws storage.StorageException,
                                 java.io.IOException
Gets the parent node's address of the specified node.

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

setParentNode

public static void setParentNode(DbStorageManager dbsm,
                                 long transactionNumber,
                                 DbUnitAddress unitAddress,
                                 DbUnitAddress source)
                          throws storage.StorageException,
                                 java.io.IOException
Sets the previous node's address of the specified node.

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

getHeight

public static byte getHeight(DbStorageManager dbsm,
                             long transactionNumber,
                             DbUnitAddress unitAddress)
                      throws storage.StorageException,
                             java.io.IOException
Gets the height of the specified node in the tree.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
unitAddress - The address of the content node.
Returns:
The height in the tree.
Throws:
storage.StorageException
java.io.IOException

setHeight

public static void setHeight(DbStorageManager dbsm,
                             long transactionNumber,
                             DbUnitAddress unitAddress,
                             byte source)
                      throws storage.StorageException,
                             java.io.IOException
Sets the height of the specified node in the tree.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
unitAddress - The address of the content node.
source - The height in the tree.
Throws:
storage.StorageException
java.io.IOException

getId

public static void getId(DbStorageManager dbsm,
                         long transactionNumber,
                         DbUnitAddress unitAddress,
                         PhysicalID destiny)
                  throws storage.StorageException,
                         java.io.IOException
Gets the physical id in the specified node.

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

setId

public static void setId(DbStorageManager dbsm,
                         long transactionNumber,
                         DbUnitAddress unitAddress,
                         PhysicalID source)
                  throws storage.StorageException,
                         java.io.IOException
Sets the physical id in the specified node.

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