DbStorage.manager
Class LabeledSsdCollectionManager

java.lang.Object
  extended byDbStorage.manager.LabeledSsdCollectionManager

public final class LabeledSsdCollectionManager
extends java.lang.Object

This class manages the content of a collection of labeled semistructured data. This collection is implemented using 4 data structures combined in one, 2 AA-trees and 2 double linked list are used, for ordering the collection by identificator and label.


Constructor Summary
LabeledSsdCollectionManager()
           
 
Method Summary
static boolean contains(DbStorageManager dbsm, long transactionNumber, PhysicalID id, PhysicalLabeledSSD lssd)
          Checks if a specified labeled semistructured datum belongs to the collection.
static boolean contains(DbStorageManager dbsm, long transactionNumber, PhysicalID id, java.lang.String lssdLabel, PhysicalID lssdID)
          Checks if a specified labeled semistructured datum belongs to the collection.
static boolean containsID(DbStorageManager dbsm, long transactionNumber, PhysicalID id, PhysicalID matchID)
          Checks if a specified identifier is in some labeled semistructured datum in the collection.
static boolean containsLabel(DbStorageManager dbsm, long transactionNumber, PhysicalID id, java.lang.String matchLabel)
          Checks if a specified labeled is in some labeled semistructured datum in the collection.
static void delete(DbStorageManager dbsm, long transactionNumber, PhysicalID id, PhysicalLabeledSSD lssd)
          Deletes a specified labeled semistructured datum from the collection.
static void delete(DbStorageManager dbsm, long transactionNumber, PhysicalID id, java.lang.String lssdLabel, PhysicalID lssdID)
          Deletes a specified labeled semistructured datum from the collection.
static void deleteID(DbStorageManager dbsm, long transactionNumber, PhysicalID id, PhysicalID deletedID)
          Deletes a specified labeled semistructured datum from the collection.
static void deleteLabel(DbStorageManager dbsm, long transactionNumber, PhysicalID id, java.lang.String deletedLabel)
          Deletes a specified labeled semistructured datum from the collection.
static void getFirstWithID(DbStorageManager dbsm, long transactionNumber, PhysicalID id, PhysicalID matchID, DbUnitAddress destiny)
          Finds the first node in the collection with the specified identifier.
static void getFirstWithLabel(DbStorageManager dbsm, long transactionNumber, PhysicalID id, java.lang.String matchLabel, DbUnitAddress destiny)
          Finds the first node in the collection with the specified label.
static java.lang.String getLabelFromNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress nodeAddress)
          Returns the label of a specified node of the collection.
static PhysicalLabeledSSD getPhysicalLabeledSsdFromNode(DbStorageManager dbsm, long transactionNumber, DbUnitAddress nodeAddress)
          Returns the labeled semistructured datum of a specified node of the collection.
static void insert(DbStorageManager dbsm, long transactionNumber, PhysicalID id, PhysicalLabeledSSD lssd)
          Inserts a specified labeled semistructured datum to the collection.
static void insert(DbStorageManager dbsm, long transactionNumber, PhysicalID id, java.lang.String lssdLabel, PhysicalID lssdID)
          Inserts a specified labeled semistructured datum to the collection.
static void remove(DbStorageManager dbsm, long transactionNumber, PhysicalID id, DbUnitAddress node)
          Deletes a specified node from the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabeledSsdCollectionManager

public LabeledSsdCollectionManager()
Method Detail

getLabelFromNode

public static java.lang.String getLabelFromNode(DbStorageManager dbsm,
                                                long transactionNumber,
                                                DbUnitAddress nodeAddress)
                                         throws storage.StorageException,
                                                java.io.IOException
Returns the label of a specified node of the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
nodeAddress - The addres of the node in the CONTENT segment.
Returns:
The label in a String object.
Throws:
storage.StorageException
java.io.IOException

getPhysicalLabeledSsdFromNode

public static PhysicalLabeledSSD getPhysicalLabeledSsdFromNode(DbStorageManager dbsm,
                                                               long transactionNumber,
                                                               DbUnitAddress nodeAddress)
                                                        throws storage.StorageException,
                                                               java.io.IOException
Returns the labeled semistructured datum of a specified node of the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
nodeAddress - The addres of the node in the CONTENT segment.
Returns:
The labeled semistructured datum in a PhysicalLabeledSSD onject.
Throws:
storage.StorageException
java.io.IOException

remove

public static void remove(DbStorageManager dbsm,
                          long transactionNumber,
                          PhysicalID id,
                          DbUnitAddress node)
                   throws storage.StorageException,
                          java.io.IOException
Deletes a specified node from the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
node - The node to delete.
Throws:
storage.StorageException
java.io.IOException

contains

public static boolean contains(DbStorageManager dbsm,
                               long transactionNumber,
                               PhysicalID id,
                               PhysicalLabeledSSD lssd)
                        throws storage.StorageException,
                               java.io.IOException
Checks if a specified labeled semistructured datum belongs to the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
lssd - The labeled semistructured datum.
Returns:
true if the labeled semistructured datum is in the collection, false otherwise.
Throws:
storage.StorageException
java.io.IOException

contains

public static boolean contains(DbStorageManager dbsm,
                               long transactionNumber,
                               PhysicalID id,
                               java.lang.String lssdLabel,
                               PhysicalID lssdID)
                        throws storage.StorageException,
                               java.io.IOException
Checks if a specified labeled semistructured datum belongs to the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
lssdLabel - The label of the labeled semistructured datum.
lssdID - The identifier of the labeled semistructured datum.
Returns:
true if the labeled semistructured datum is in the collection, false otherwise.
Throws:
storage.StorageException
java.io.IOException

insert

public static void insert(DbStorageManager dbsm,
                          long transactionNumber,
                          PhysicalID id,
                          PhysicalLabeledSSD lssd)
                   throws storage.StorageException,
                          java.io.IOException,
                          UnavailableUnitException,
                          AlreadyExistingException
Inserts a specified labeled semistructured datum to the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
lssd - The labeled semistructured datum.
Throws:
storage.StorageException
java.io.IOException
UnavailableUnitException
AlreadyExistingException

insert

public static void insert(DbStorageManager dbsm,
                          long transactionNumber,
                          PhysicalID id,
                          java.lang.String lssdLabel,
                          PhysicalID lssdID)
                   throws storage.StorageException,
                          java.io.IOException,
                          UnavailableUnitException,
                          AlreadyExistingException
Inserts a specified labeled semistructured datum to the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
lssdLabel - The label of the labeled semistructured datum.
lssdID - The identifier of the labeled semistructured datum.
Throws:
storage.StorageException
java.io.IOException
UnavailableUnitException
AlreadyExistingException

getFirstWithID

public static void getFirstWithID(DbStorageManager dbsm,
                                  long transactionNumber,
                                  PhysicalID id,
                                  PhysicalID matchID,
                                  DbUnitAddress destiny)
                           throws storage.StorageException,
                                  java.io.IOException
Finds the first node in the collection with the specified identifier.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
matchID - The identifier to find.
destiny - Where the node's address is stored, it will be a null address if the identifier is not found.
Throws:
storage.StorageException
java.io.IOException

containsID

public static boolean containsID(DbStorageManager dbsm,
                                 long transactionNumber,
                                 PhysicalID id,
                                 PhysicalID matchID)
                          throws storage.StorageException,
                                 java.io.IOException
Checks if a specified identifier is in some labeled semistructured datum in the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
matchID - The identifier to find.
Returns:
true if the identifier is in the collection, false otherwise.
Throws:
storage.StorageException
java.io.IOException

getFirstWithLabel

public static void getFirstWithLabel(DbStorageManager dbsm,
                                     long transactionNumber,
                                     PhysicalID id,
                                     java.lang.String matchLabel,
                                     DbUnitAddress destiny)
                              throws storage.StorageException,
                                     java.io.IOException
Finds the first node in the collection with the specified label.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
matchLabel - The label to find.
destiny - Where the node's address is stored, it will be a null address if the identifier is not found.
Throws:
storage.StorageException
java.io.IOException

containsLabel

public static boolean containsLabel(DbStorageManager dbsm,
                                    long transactionNumber,
                                    PhysicalID id,
                                    java.lang.String matchLabel)
                             throws storage.StorageException,
                                    java.io.IOException
Checks if a specified labeled is in some labeled semistructured datum in the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
matchLabel - The labe to find.
Returns:
true if the label is in the collection, false otherwise.
Throws:
storage.StorageException
java.io.IOException

delete

public static void delete(DbStorageManager dbsm,
                          long transactionNumber,
                          PhysicalID id,
                          PhysicalLabeledSSD lssd)
                   throws storage.StorageException,
                          java.io.IOException,
                          NotExistingException
Deletes a specified labeled semistructured datum from the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
lssd - The labeled semistructured datum.
Throws:
storage.StorageException
java.io.IOException
NotExistingException

delete

public static void delete(DbStorageManager dbsm,
                          long transactionNumber,
                          PhysicalID id,
                          java.lang.String lssdLabel,
                          PhysicalID lssdID)
                   throws storage.StorageException,
                          java.io.IOException,
                          NotExistingException
Deletes a specified labeled semistructured datum from the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
lssdLabel - The label of the labeled semistructured datum.
lssdID - The identifier of the labeled semistructured datum.
Throws:
storage.StorageException
java.io.IOException
NotExistingException

deleteID

public static void deleteID(DbStorageManager dbsm,
                            long transactionNumber,
                            PhysicalID id,
                            PhysicalID deletedID)
                     throws storage.StorageException,
                            java.io.IOException
Deletes a specified labeled semistructured datum from the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
deletedID - The identifier of the labeled semistructured data to delete.
Throws:
storage.StorageException
java.io.IOException

deleteLabel

public static void deleteLabel(DbStorageManager dbsm,
                               long transactionNumber,
                               PhysicalID id,
                               java.lang.String deletedLabel)
                        throws storage.StorageException,
                               java.io.IOException
Deletes a specified labeled semistructured datum from the collection.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the non primitive datum that represents the collection.
deletedLabel - The label of the labeled semistructured data to delete.
Throws:
storage.StorageException
java.io.IOException