com.tibbo.aggregate.common.dao

## Interface PropertyDao

- All Superinterfaces:
    Dao

      public interface PropertyDao
      extends Dao

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `changeEncryptionKey(byte[] oldEncryptionKey, byte[] newEncryptionKey, boolean encryptionDryRun)`
    `void` | `checkIfContextCanBeMoved(java.lang.String oldPath, java.lang.String newPath)`
    `void` | `checkMoveDataTablesIsPossible(java.lang.String oldContext, java.lang.String newContext)` Checks whether moveDataTables() operation is allowed.
    `long` | `deleteDataTables(java.lang.String context)` Delete persistent variable values that match a certain context path.
    `DataTable` | `getDataTable(EntityReference key)` Load a previously stored value of a variable.
    `DataTable` | `getStatistics()` Returns usage statistics table.
    `void` | `migrateResource(java.lang.String sourceServerId, java.lang.String targetServerId, java.lang.String resourceName)` Migrate a resource from one node of a cluster to another
    `long` | `moveDataTables(java.lang.String oldContext, java.lang.String newContext)` Reassociate a set of persistent variable values with a different context path.
    `void` | `removeDataTable(EntityReference key, DataTable value, boolean shouldProcessDataBlocks)` Delete persistent value of a variable.
    `void` | `renameDataTable(java.lang.String context, java.lang.String oldName, java.lang.String newName)` Reassociate a persistent value with a differently names variable.
    `void` | `saveDataTable(EntityReference key, DataTable table)` Persistently save value of a variable.
    `void` | `saveDataTable(EntityReference key, DataTable table, DataTable oldTable)` Persistently save value of a variable.

    - ### Methods inherited from interface com.tibbo.aggregate.common.dao.Dao

      `isManaged, shutdown`

- - ### Method Detail

    - #### saveDataTable

          void saveDataTable(EntityReference key,
                             DataTable table)
                      throws DaoException,
                             ContextException

      Persistently save value of a variable.
      Parameters:
        `key` - Reference to a variable represented by context path and variable name
        `table` - Variable value to be stored persistently
      Throws:
        `DaoException` - If storage has failed
        `ContextException` - If other error occurred

    - #### saveDataTable

          void saveDataTable(EntityReference key,
                             DataTable table,
                             DataTable oldTable)
                      throws DaoException,
                             ContextException

      Persistently save value of a variable.
      Parameters:
        `key` - Reference to a variable represented by context path and variable name
        `table` - Variable value to be stored persistently
        `oldTable` - Previous value of the variable or null if not available
      Throws:
        `DaoException` - If storage has failed
        `ContextException` - If other error occurred

    - #### getDataTable

          DataTable getDataTable(EntityReference key)
                          throws DaoException,
                                 ContextException

      Load a previously stored value of a variable.
      Parameters:
        `key` - Reference to a variable represented by context path and variable name
      Returns:
        Variable's value or null if this value does not exist in the storage
      Throws:
        `DaoException` - If loading has failed
        `ContextException` - If value was corrupted and cannot be properly converted to a DataTable

    - #### deleteDataTables

          long deleteDataTables(java.lang.String context)
                         throws DaoException,
                                ContextException

      Delete persistent variable values that match a certain context path.
      Parameters:
        `context` - Path of context those persistent variable values must be deleted
      Returns:
        Number of data tables deleted
      Throws:
        `DaoException` - If removal has failed
        `ContextException` - If any other error occurred

    - #### removeDataTable

          void removeDataTable(EntityReference key,
                               DataTable value,
                               boolean shouldProcessDataBlocks)
                        throws DaoException,
                               ContextException

      Delete persistent value of a variable. Removing a variable's value assumes removing referred data blocks. Therefore, a previous value of this variable is normally provided for this method by the system. If previous value is not provided, the DAO implementation should normally read the previous value via `getDataTable(EntityReference)`.
      Parameters:
        `key` - Reference to a variable represented by context path and variable name
        `value` - Current value of a variable to use for finding and deleting referred data blocks
      Throws:
        `DaoException` - If removal of variable's value or referred data blocks has failed
        `ContextException` - If any other error occurred

    - #### moveDataTables

          long moveDataTables(java.lang.String oldContext,
                              java.lang.String newContext)
                       throws DaoException

      Reassociate a set of persistent variable values with a different context path.
      Parameters:
        `oldContext` - Context path of persistent value to reassociate
        `newContext` - New context path for selected values
      Returns:
        Number of data tables moved
      Throws:
        `DaoException` - If reassociation process has failed

    - #### checkMoveDataTablesIsPossible

          void checkMoveDataTablesIsPossible(java.lang.String oldContext,
                                             java.lang.String newContext)
                                      throws ContextException

      Checks whether moveDataTables() operation is allowed.
      Parameters:
        `oldContext` - Source context pack
        `newContext` - Target context path
      Throws:
        `ContextException` - If move operation is not currently allowed for provided paths

    - #### renameDataTable

          void renameDataTable(java.lang.String context,
                               java.lang.String oldName,
                               java.lang.String newName)
                        throws DaoException

      Reassociate a persistent value with a differently names variable.
      Parameters:
        `context` - Context path of persistent value to reassociate
        `oldName` - Old name of a variable pointing to the persistent value
        `newName` - New name of a variable pointing to the persistent value
      Throws:
        `DaoException` - If reassociation has failed

    - #### getStatistics

          DataTable getStatistics()

      Returns usage statistics table.

    - #### changeEncryptionKey

          long changeEncryptionKey(byte[] oldEncryptionKey,
                                   byte[] newEncryptionKey,
                                   boolean encryptionDryRun)

    - #### migrateResource

          void migrateResource(java.lang.String sourceServerId,
                               java.lang.String targetServerId,
                               java.lang.String resourceName)
                        throws DaoException

      Migrate a resource from one node of a cluster to another
      Parameters:
        `sourceServerId` - ID of server to migrate resource from
        `targetServerId` - ID of server to migrate resource to
        `resourceName` - Path of the resource to be migrated
      Throws:
        `DaoException` - If migration has failed

    - #### checkIfContextCanBeMoved

          void checkIfContextCanBeMoved(java.lang.String oldPath,
                                        java.lang.String newPath)
                                 throws ContextException

      Throws:
        `ContextException`