Package com.documentum.registry
Class DfRegistry
java.lang.Object
com.documentum.registry.DfRegistry
- All Implemented Interfaces:
IDfRegistry
- Direct Known Subclasses:
DfRegistryIniFile,DfRegistryWin32,DfRemoteRegistry
This class provides basic functionality for a platform independent registry
storage and retrieval mechanisms. This class provides an array of values abstraction
on top of the subclass simple (key,value) mechanism.
The basic structure of the registry framework is a nested heirarchy of keys with values. A key can have sub-keys or children keys. Each key has values which consist of pairs of names and data. Each value can have an associated type (e.g. String, binary, or integer) but it is not enforced directly.
This class is not exposed via COM since DfRegistryIniFile is not exposed via COM. Please see DfRegistryIniFile for more details.
Notes:
- All functions, except openKey( ) and isValidKey( ), operate on the current open key. It can be set by calling openKey( ). All names and sub-keys are relative to the open key.
- To set the open key to the root key, call openKey( "" ).
- All values and sub-keys are case insensitive and whitespace characters are allowed. The registry delimiter is not allowed as a valid key name character. Here is an example of setting data with beginning and trailing whitespace: setStringValue( "somevalue", "\" this is some data \"")
- Binary value operations use integer lists (arrays) instead of byte arrays due to the Java/COM data type mappings. When used each integer element will be truncated to the size of a byte.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringName for deliminating an array index.protected static final StringName for deliminating an array size.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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintAcquires the inter-process lock.protected voidassertFunc(String param) Used to check for valid parameters to functions.abstract voidcloseKey()Closes an open key freeing system resources.protected abstract voidabstract voidabstract voiddeleteSubKey(String subKey) Deletes a sub-key of the open key.abstract voidDeletes the sub-keys under the open key.abstract voiddeleteValue(String name) Deletes a value and the value's data under the open key.protected voidfinalize()voidflush()abstract IDfListgetBinaryValue(String name) Returns a binary representation of the data at the given value.getBinaryValueAt(String name, int index) Gets a binary value at a given index of a given key.getBinaryValues(String name) Returns a binary array of the data at the given value.intabstract intgetIntValue(String name) Returns an integer representation of the data at the given value.intgetIntValueAt(String name, int index) Gets an integer value at a given index of a given key.getIntValues(String name) Returns an integer array of the data at the given value.abstract StringgetStringValue(String name) Returns a String representation of the data at the given value.getStringValueAt(String name, int index) Gets a String value at a given index of a given key.getStringValues(String name) Returns a String array of the data at the given value.intgetValuesSize(String name) Returns the number of elements in a key with an array of values.abstract booleanReturns a flag specifying if the given sub-key is a sub-key of the open key.abstract voidSet the open key.intReleases the inter-process lock.voidreset()abstract voidsetBinaryValue(String name, IDfList data) Sets the data field of the given value with binary data.voidsetBinaryValueAt(String name, int index, IDfList data) Sets a binary value at a given index of a given key.voidsetBinaryValues(String name, IDfList data) Sets the data field of the given value with binary values.abstract voidsetIntValue(String name, int data) Sets the data field of the given value with integer data.voidsetIntValueAt(String name, int index, int data) Sets an integer value at a given index of a given key.voidsetIntValues(String name, IDfList data) Sets the data field of the given value with integer values.abstract voidsetStringValue(String name, String data) Sets the data field of the given value with String data.voidsetStringValueAt(String name, int index, String data) Sets a String value at a given index of a given key.protected abstract voidsetStringValues(RegistryEntriesHolder holder) voidsetStringValues(String name, IDfList data) Sets the data field of the given value with String values.voidsetValuesSize(String name, int size) Set the size of an array name.abstract IDfListsubKeys()Returns the sub-keys of the open key.abstract IDfListvalues()Returns the value names of the open key.Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.documentum.registry.IDfRegistry
isValueNamePresent
-
Field Details
-
ARRAY_INDEX
Name for deliminating an array index.- See Also:
-
ARRAY_SIZE_INDEX
Name for deliminating an array size.- See Also:
-
-
Constructor Details
-
DfRegistry
public DfRegistry()
-
-
Method Details
-
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- Parameters:
subKey- a new or existing key in the registry storage.- 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- 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- 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- Parameters:
subKey- the key to be deleted.- Throws:
DfException- if the operation failed.
-
deleteSubKeys
Deletes the sub-keys under the open key. The open key is not deleted.- Specified by:
deleteSubKeysin interfaceIDfRegistry- Throws:
DfException- if the operation failed.
-
closeKey
Closes an open key freeing system resources.- Specified by:
closeKeyin interfaceIDfRegistry- 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- 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- 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- 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- 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- 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- Parameters:
name- the value whose data is to be set.data- the data to set.- Throws:
DfException- if the operation failed.
-
setStringValues
- Throws:
DfException
-
getBinaryValue
Returns a binary representation of the data at the given value.- Specified by:
getBinaryValuein interfaceIDfRegistry- 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- 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.
-
reset
- Specified by:
resetin interfaceIDfRegistry- Throws:
IOExceptionDfException
-
flush
- Specified by:
flushin interfaceIDfRegistry- Throws:
IOExceptionDfException
-
createKey
- Specified by:
createKeyin interfaceIDfRegistry- Throws:
DfException
-
getIntValues
Returns an integer array of the data at the given value.- Specified by:
getIntValuesin interfaceIDfRegistry- Parameters:
name- the value to lookup.- Returns:
- an integer list of the data at the given value.
- Throws:
DfException- if the operation failed.
-
setIntValues
Sets the data field of the given value with integer values. The value can be previously a non-array value or non-existent.- Specified by:
setIntValuesin interfaceIDfRegistry- Parameters:
name- the value whose data is to be set.data- the data to be set. This must be a list of integers.- Throws:
DfException- if the operation failed.
-
getIntValueAt
Gets an integer value at a given index of a given key.- Specified by:
getIntValueAtin interfaceIDfRegistry- Parameters:
name- the key to look up into.index- zero-based index into the values array.- Returns:
- the integer value at the given index.
- Throws:
DfException- if the index is out of range or the operation failed.
-
setIntValueAt
Sets an integer value at a given index of a given key. The index must be 0 if the value is not an array or does not exist. The index may be 1 + the current array size of the value causing this function to act as an append.- Specified by:
setIntValueAtin interfaceIDfRegistry- Parameters:
name- the value to set.index- zero-based index into the values array.data- the data to be set.- Throws:
DfException- if the index is out of range or the operation failed.
-
getStringValues
Returns a String array of the data at the given value.- Specified by:
getStringValuesin interfaceIDfRegistry- Parameters:
name- the value to lookup.- Returns:
- a String list of the data at the given value.
- Throws:
DfException- if the operation failed.
-
setStringValues
Sets the data field of the given value with String values.- Specified by:
setStringValuesin interfaceIDfRegistry- Parameters:
name- the value whose data is to be set.data- the data to be set. This must be a list of Strings.- Throws:
DfException- if the operation failed.
-
getStringValueAt
Gets a String value at a given index of a given key.- Specified by:
getStringValueAtin interfaceIDfRegistry- Parameters:
name- the key to look up into.index- zero-based index into the values array.- Returns:
- the String value at the given index.
- Throws:
DfException- if the index is out of range or the operation failed.
-
setStringValueAt
Sets a String value at a given index of a given key. The index must be 0 if the value is not an array or does not exist. The index may be 1 + the current array size of the value causing this function to act as an append.- Specified by:
setStringValueAtin interfaceIDfRegistry- Parameters:
name- the value to set.index- zero-based index into the values array.data- the data to be set.- Throws:
DfException- if the index is out of range or the operation failed.
-
getBinaryValues
Returns a binary array of the data at the given value.- Specified by:
getBinaryValuesin interfaceIDfRegistry- Parameters:
name- the value to lookup.- Returns:
- an integer list of integer lists each of which represent the binary data at the given value.
- Throws:
DfException- if the operation failed.
-
setBinaryValues
Sets the data field of the given value with binary values.- Specified by:
setBinaryValuesin interfaceIDfRegistry- Parameters:
name- the value whose data is to be set.data- the data to be set. This must be a list of lists of integers.- Throws:
DfException- if the operation failed.
-
getBinaryValueAt
Gets a binary value at a given index of a given key.- Specified by:
getBinaryValueAtin interfaceIDfRegistry- Parameters:
name- the key to look up into.index- zero-based index into the values array.- Returns:
- a list representing the binary (byte) value at the given index.
- Throws:
DfException- if the index is out of range or the operation failed.
-
setBinaryValueAt
Sets a binary value at a given index of a given key. The index must be 0 if the value is not an array or does not exist. The index may be 1 + the current array size of the value causing this function to act as an append.- Specified by:
setBinaryValueAtin interfaceIDfRegistry- Parameters:
name- the value to set.index- zero-based index into the values array.data- the data to be set. This must be a list of integers each of which will be truncated to a byte.- Throws:
DfException- if the index is out of range or the operation failed.
-
getValuesSize
Returns the number of elements in a key with an array of values.- Specified by:
getValuesSizein interfaceIDfRegistry- Parameters:
name- the array name to get the size of.- Returns:
- the number of elements in an array.
- Throws:
DfException- if the name is not an array.
-
setValuesSize
Set the size of an array name.- Specified by:
setValuesSizein interfaceIDfRegistry- Parameters:
name- the array name to set the size of.size- the new size to set.- Throws:
DfException- if the operation failed.
-
acquireInterProcessLock
Acquires the inter-process lock. Inter-process lock will be acquired only if the OS in not Windows.- Throws:
DfException
-
releaseInterProcessLock
public int releaseInterProcessLock()Releases the inter-process lock. Inter-process lock will be released only if the OS in not Windows. -
getInterprocessLockCount
public int getInterprocessLockCount() -
assertFunc
Used to check for valid parameters to functions.- Parameters:
param- the string to test.- Throws:
DfException- if the parameter is invalid.
-
closeRootKey
- Throws:
DfException
-
finalize
protected void finalize()
-