Package com.documentum.registry
Class DfRegistryIniFile
java.lang.Object
com.documentum.registry.DfRegistry
com.documentum.registry.DfRegistryIniFile
- All Implemented Interfaces:
IDfRegistry,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
FieldsModifier and TypeFieldDescriptionprotected static final StringThe suffix for backup registry files.protected StringThe INI file path.protected static final StringThe suffix for new temporary active registry files.protected static final Stringprotected static final StringFields inherited from class com.documentum.registry.DfRegistry
ARRAY_INDEX, ARRAY_SIZE_INDEXFields 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 TypeMethodDescriptionstatic DfRegistryvoidcloseKey()Closes an open key freeing system resources.voidClean up resources before going to the bit bucket.protected voidvoidvoiddeleteSubKey(String subKey) Deletes a sub-key of the open key.voidDeletes the sub-keys under the key.voiddeleteValue(String name) Deletes a value and the value's data under the open key.voidflush()getBinaryValue(String name) Returns a binary representation of the data at the given value.intgetIntValue(String name) Returns an integer representation of the data at the given value.getStringValue(String name) Returns a String representation of the data at the given value.booleanReturns a flag specifying if the given sub-key is a sub-key of the open key.booleanisValueNamePresent(String name) voidSet the open key.voidvoidreset()voidsetBinaryValue(String name, IDfList data) Sets the data field of the given value with binary data.voidsetIntValue(String name, int data) Sets the data field of the given value with integer data.voidsetStringValue(String name, String data) Sets the data field of the given value with String data.protected voidsetStringValues(RegistryEntriesHolder holder) subKeys()Returns the sub-keys of the open key.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, setValuesSizeMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
The suffix for new temporary active registry files.- See Also:
-
BACKUPFILE_EXTENSION
The suffix for backup registry files.- See Also:
-
m_filePath
The INI file path. -
s_defaultIniFile
- See Also:
-
s_lockName
- See Also:
-
-
Method Details
-
access
- Throws:
DfException
-
reset
- Specified by:
resetin interfaceIDfRegistry- Overrides:
resetin classDfRegistry- Throws:
IOExceptionDfException
-
flush
- Specified by:
flushin interfaceIDfRegistry- Overrides:
flushin classDfRegistry- Throws:
IOExceptionDfException
-
openRegistry
- Throws:
DfException
-
closeRegistry
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
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:
openKeyin interfaceIDfRegistry- Specified by:
openKeyin classDfRegistry- Parameters:
subKey- a new or existing key in the registry storage.- Throws:
DfException- if the operation failed.
-
createKey
- Specified by:
createKeyin interfaceIDfRegistry- Specified by:
createKeyin classDfRegistry- Throws:
DfException
-
closeKey
Closes an open key freeing system resources. Actually this call set current key to root value- Specified by:
closeKeyin interfaceIDfRegistry- Specified by:
closeKeyin classDfRegistry- Throws:
DfException- if the operation failed.
-
isSubKey
Returns a flag specifying if the given sub-key is a sub-key of the open key.- Specified by:
isSubKeyin interfaceIDfRegistry- Specified by:
isSubKeyin classDfRegistry- 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
Deletes a value and the value's data under the open key.- Specified by:
deleteValuein interfaceIDfRegistry- Specified by:
deleteValuein classDfRegistry- Parameters:
name- the value to be deleted.- Throws:
DfException- if the operation failed.
-
deleteSubKey
Deletes a sub-key of the open key.- Specified by:
deleteSubKeyin interfaceIDfRegistry- Specified by:
deleteSubKeyin classDfRegistry- Parameters:
subKey- the key to be deleted.- Throws:
DfException- if the operation failed.
-
deleteSubKeys
Deletes the sub-keys under the key. The open key is not deleted.- Specified by:
deleteSubKeysin interfaceIDfRegistry- Specified by:
deleteSubKeysin classDfRegistry- Throws:
DfException- if the operation failed.
-
values
Returns the value names of the open key. To get the value's data, call get[TYPE]Value( ).- Specified by:
valuesin interfaceIDfRegistry- Specified by:
valuesin classDfRegistry- Returns:
- a list of String value names of the top-level key.
- Throws:
DfException- if the operation failed.
-
subKeys
Returns the sub-keys of the open key.- Specified by:
subKeysin interfaceIDfRegistry- Specified by:
subKeysin classDfRegistry- Returns:
- a list of String sub-key names of the top-level key.
- Throws:
DfException- if the operation failed.
-
getIntValue
Returns an integer representation of the data at the given value.- Specified by:
getIntValuein interfaceIDfRegistry- Specified by:
getIntValuein classDfRegistry- Parameters:
name- the value to lookup.- Returns:
- an integer representation of the data at the given value.
- Throws:
DfException- if the operation failed.
-
setIntValue
Sets the data field of the given value with integer data.- Specified by:
setIntValuein interfaceIDfRegistry- Specified by:
setIntValuein classDfRegistry- Parameters:
name- the value whose data is to be set.data- the data to set.- Throws:
DfException- if the operation failed.
-
getStringValue
Returns a String representation of the data at the given value.- Specified by:
getStringValuein interfaceIDfRegistry- Specified by:
getStringValuein classDfRegistry- Parameters:
name- the value to lookup.- Returns:
- a String representation of the data at the given value.
- Throws:
DfException- if the operation failed.
-
setStringValue
Sets the data field of the given value with String data.- Specified by:
setStringValuein interfaceIDfRegistry- Specified by:
setStringValuein classDfRegistry- Parameters:
name- the value whose data is to be set.data- the data to set.- Throws:
DfException- if the operation failed.
-
setStringValues
- Specified by:
setStringValuesin classDfRegistry- Throws:
DfException
-
getBinaryValue
Returns a binary representation of the data at the given value.- Specified by:
getBinaryValuein interfaceIDfRegistry- Specified by:
getBinaryValuein classDfRegistry- 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
Sets the data field of the given value with binary data.- Specified by:
setBinaryValuein interfaceIDfRegistry- Specified by:
setBinaryValuein classDfRegistry- 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
- Specified by:
isValueNamePresentin interfaceIDfRegistry- Throws:
DfException
-
closeRootKey
- Specified by:
closeRootKeyin classDfRegistry- Throws:
DfException
-