Package com.documentum.registry

# Class DfRegistryIniFile

java.lang.Object
com.documentum.registry.DfRegistry
com.documentum.registry.DfRegistryIniFile

All Implemented Interfaces:
  `IDfRegistry`, `IDfRegistryIniFile`

public class DfRegistryIniFile extends DfRegistry implements IDfRegistryIniFile
This class implements the registry storage mechanism with a INI (.ini) file basis. The general structure of the INI file is that of the Microsoft INI file layout. There is, however, no ordering of the sections in the file. Each sections' values MUST be found directly after the section name declaration.

The general strategy of this class is for each change of the existing registry file a new file is generated with the changes. After the change is completed, the existing file is renamed to a backup file and the new file is renamed to the registry file.

This class is not exposed via COM since it is meant for non-Windows platforms. DfRegistry cannot be exposed as well since this class inherits from it.

Notes:

- The root key is not relative to anything and must be absolute upon class initialization. It may be null but no values can be set for it; only keys be set for it.
- closeKey( ) should be called when this object is no longer needed.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final String`
  `BACKUPFILE_EXTENSION`
  The suffix for backup registry files.
  `protected String`
  `m_filePath`
  The INI file path.
  `protected static final String`
  `NEWFILE_EXTENSION`
  The suffix for new temporary active registry files.
  `protected static final String`
  `s_defaultIniFile`
  `protected static final String`
  `s_lockName`

  ### Fields inherited from class com.documentum.registry.DfRegistry

  `ARRAY_INDEX, ARRAY_SIZE_INDEX`

  ### Fields inherited from interface com.documentum.registry.IDfRegistry

  `ALL_ACCESS, ALTERNATE_FILEPATHS, DCTM_ROOT, HKEY_CLASSES_ROOT, HKEY_PERFORMANCE_DATA, HKEY_USERS, KEY_DELIMITER, LOCALMACHINE_ROOT, READ_ACCESS, USER_ROOT`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static DfRegistry`
  `access(String rootKey)`
  `void`
  `closeKey()`
  Closes an open key freeing system resources.
  `void`
  `closeRegistry()`
  Clean up resources before going to the bit bucket.
  `protected void`
  `closeRootKey()`
  `void`
  `createKey()`
  `void`
  `deleteSubKey(String subKey)`
  Deletes a sub-key of the open key.
  `void`
  `deleteSubKeys()`
  Deletes the sub-keys under the key.
  `void`
  `deleteValue(String name)`
  Deletes a value and the value's data under the open key.
  `void`
  `flush()`
  `IDfList`
  `getBinaryValue(String name)`
  Returns a binary representation of the data at the given value.
  `int`
  `getIntValue(String name)`
  Returns an integer representation of the data at the given value.
  `String`
  `getStringValue(String name)`
  Returns a String representation of the data at the given value.
  `boolean`
  `isSubKey(String subKey)`
  Returns a flag specifying if the given sub-key is a sub-key of the open key.
  `boolean`
  `isValueNamePresent(String name)`
  `void`
  `openKey(String subKey)`
  Set the open key.
  `void`
  `openRegistry()`
  `void`
  `reset()`
  `void`
  `setBinaryValue(String name, IDfList data)`
  Sets the data field of the given value with binary data.
  `void`
  `setIntValue(String name, int data)`
  Sets the data field of the given value with integer data.
  `void`
  `setStringValue(String name, String data)`
  Sets the data field of the given value with String data.
  `protected void`
  `setStringValues(RegistryEntriesHolder holder)`
  `IDfList`
  `subKeys()`
  Returns the sub-keys of the open key.
  `IDfList`
  `values()`
  Returns the value names of the open key.

  ### Methods inherited from class com.documentum.registry.DfRegistry

  `acquireInterProcessLock, assertFunc, finalize, getBinaryValueAt, getBinaryValues, getInterprocessLockCount, getIntValueAt, getIntValues, getStringValueAt, getStringValues, getValuesSize, releaseInterProcessLock, setBinaryValueAt, setBinaryValues, setIntValueAt, setIntValues, setStringValueAt, setStringValues, setValuesSize`

  ### Methods inherited from class java.lang.Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.documentum.registry.IDfRegistry

  `getBinaryValueAt, getBinaryValues, getIntValueAt, getIntValues, getStringValueAt, getStringValues, getValuesSize, setBinaryValueAt, setBinaryValues, setIntValueAt, setIntValues, setStringValueAt, setStringValues, setValuesSize`

- ## Field Details

  - ### NEWFILE_EXTENSION

    protected static final String NEWFILE_EXTENSION
    The suffix for new temporary active registry files.
    See Also:
      - Constant Field Values

  - ### BACKUPFILE_EXTENSION

    protected static final String BACKUPFILE_EXTENSION
    The suffix for backup registry files.
    See Also:
      - Constant Field Values

  - ### m_filePath

    protected String m_filePath
    The INI file path.

  - ### s_defaultIniFile

    protected static final String s_defaultIniFile
    See Also:
      - Constant Field Values

  - ### s_lockName

    protected static final String s_lockName
    See Also:
      - Constant Field Values

- ## Method Details

  - ### access

    public static DfRegistry access(String rootKey) throws DfException
    Throws:
      `DfException`

  - ### reset

    public void reset() throws IOException, DfException
    Specified by:
      `reset` in interface `IDfRegistry`
    Overrides:
      `reset` in class `DfRegistry`
    Throws:
      `IOException`
      `DfException`

  - ### flush

    public void flush() throws IOException, DfException
    Specified by:
      `flush` in interface `IDfRegistry`
    Overrides:
      `flush` in class `DfRegistry`
    Throws:
      `IOException`
      `DfException`

  - ### openRegistry

    public void openRegistry() throws DfException
    Throws:
      `DfException`

  - ### closeRegistry

    public void closeRegistry() throws DfException
    Clean up resources before going to the bit bucket. This should be called whenever this object is no longer needed.
    Throws:
      `DfException` - If the operation failed.

  - ### openKey

    public void openKey(String subKey) throws DfException
    Set the open key. The key is created if it does not exist. If there is an open key it is closed prior to opening a the new key.
    Specified by:
      `openKey` in interface `IDfRegistry`
    Specified by:
      `openKey` in class `DfRegistry`
    Parameters:
      `subKey` - a new or existing key in the registry storage.
    Throws:
      `DfException` - if the operation failed.

  - ### createKey

    public void createKey() throws DfException
    Specified by:
      `createKey` in interface `IDfRegistry`
    Specified by:
      `createKey` in class `DfRegistry`
    Throws:
      `DfException`

  - ### closeKey

    public void closeKey() throws DfException
    Closes an open key freeing system resources. Actually this call set current key to root value
    Specified by:
      `closeKey` in interface `IDfRegistry`
    Specified by:
      `closeKey` in class `DfRegistry`
    Throws:
      `DfException` - if the operation failed.

  - ### isSubKey

    public boolean isSubKey(String subKey) throws DfException
    Returns a flag specifying if the given sub-key is a sub-key of the open key.
    Specified by:
      `isSubKey` in interface `IDfRegistry`
    Specified by:
      `isSubKey` in class `DfRegistry`
    Parameters:
      `subKey` - the key to be found.
    Returns:
      a flag specifying if the given sub-key is an actual sub-key.
    Throws:
      `DfException` - if the operation failed.

  - ### deleteValue

    public void deleteValue(String name) throws DfException
    Deletes a value and the value's data under the open key.
    Specified by:
      `deleteValue` in interface `IDfRegistry`
    Specified by:
      `deleteValue` in class `DfRegistry`
    Parameters:
      `name` - the value to be deleted.
    Throws:
      `DfException` - if the operation failed.

  - ### deleteSubKey

    public void deleteSubKey(String subKey) throws DfException
    Deletes a sub-key of the open key.
    Specified by:
      `deleteSubKey` in interface `IDfRegistry`
    Specified by:
      `deleteSubKey` in class `DfRegistry`
    Parameters:
      `subKey` - the key to be deleted.
    Throws:
      `DfException` - if the operation failed.

  - ### deleteSubKeys

    public void deleteSubKeys() throws DfException
    Deletes the sub-keys under the key. The open key is not deleted.
    Specified by:
      `deleteSubKeys` in interface `IDfRegistry`
    Specified by:
      `deleteSubKeys` in class `DfRegistry`
    Throws:
      `DfException` - if the operation failed.

  - ### values

    public IDfList values() throws DfException
    Returns the value names of the open key. To get the value's data, call get[TYPE]Value( ).
    Specified by:
      `values` in interface `IDfRegistry`
    Specified by:
      `values` in class `DfRegistry`
    Returns:
      a list of String value names of the top-level key.
    Throws:
      `DfException` - if the operation failed.

  - ### subKeys

    public IDfList subKeys() throws DfException
    Returns the sub-keys of the open key.
    Specified by:
      `subKeys` in interface `IDfRegistry`
    Specified by:
      `subKeys` in class `DfRegistry`
    Returns:
      a list of String sub-key names of the top-level key.
    Throws:
      `DfException` - if the operation failed.

  - ### getIntValue

    public int getIntValue(String name) throws DfException
    Returns an integer representation of the data at the given value.
    Specified by:
      `getIntValue` in interface `IDfRegistry`
    Specified by:
      `getIntValue` in class `DfRegistry`
    Parameters:
      `name` - the value to lookup.
    Returns:
      an integer representation of the data at the given value.
    Throws:
      `DfException` - if the operation failed.

  - ### setIntValue

    public void setIntValue(String name, int data) throws DfException
    Sets the data field of the given value with integer data.
    Specified by:
      `setIntValue` in interface `IDfRegistry`
    Specified by:
      `setIntValue` in class `DfRegistry`
    Parameters:
      `name` - the value whose data is to be set.
      `data` - the data to set.
    Throws:
      `DfException` - if the operation failed.

  - ### getStringValue

    public String getStringValue(String name) throws DfException
    Returns a String representation of the data at the given value.
    Specified by:
      `getStringValue` in interface `IDfRegistry`
    Specified by:
      `getStringValue` in class `DfRegistry`
    Parameters:
      `name` - the value to lookup.
    Returns:
      a String representation of the data at the given value.
    Throws:
      `DfException` - if the operation failed.

  - ### setStringValue

    public void setStringValue(String name, String data) throws DfException
    Sets the data field of the given value with String data.
    Specified by:
      `setStringValue` in interface `IDfRegistry`
    Specified by:
      `setStringValue` in class `DfRegistry`
    Parameters:
      `name` - the value whose data is to be set.
      `data` - the data to set.
    Throws:
      `DfException` - if the operation failed.

  - ### setStringValues

    protected void setStringValues(RegistryEntriesHolder holder) throws DfException
    Specified by:
      `setStringValues` in class `DfRegistry`
    Throws:
      `DfException`

  - ### getBinaryValue

    public IDfList getBinaryValue(String name) throws DfException
    Returns a binary representation of the data at the given value.
    Specified by:
      `getBinaryValue` in interface `IDfRegistry`
    Specified by:
      `getBinaryValue` in class `DfRegistry`
    Parameters:
      `name` - the value to lookup.
    Returns:
      a list with a binary representation of the data at the given value.
    Throws:
      `DfException` - if the operation failed.

  - ### setBinaryValue

    public void setBinaryValue(String name, IDfList data) throws DfException
    Sets the data field of the given value with binary data.
    Specified by:
      `setBinaryValue` in interface `IDfRegistry`
    Specified by:
      `setBinaryValue` in class `DfRegistry`
    Parameters:
      `name` - the value whose data is to be set.
      `data` - the data to set. This must be a list of integers of which each will be truncated to byte size.
    Throws:
      `DfException` - if the operation failed.

  - ### isValueNamePresent

    public boolean isValueNamePresent(String name) throws DfException
    Specified by:
      `isValueNamePresent` in interface `IDfRegistry`
    Throws:
      `DfException`

  - ### closeRootKey

    protected void closeRootKey() throws DfException
    Specified by:
      `closeRootKey` in class `DfRegistry`
    Throws:
      `DfException`