Package com.documentum.registry
Class DfRemoteRegistry
java.lang.Object
com.documentum.registry.DfRegistry
com.documentum.registry.DfRemoteRegistry
- All Implemented Interfaces:
IDfRegistry
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
FieldsFields 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintAcquires the inter-process lock.protected voidassertFunc(String param) Used to check for valid parameters to functions.voidcloseKey()Closes an open key freeing system resources.voidprotected voidprotected StringconstructNewKeyStack(String subKey, Stack subKeyStack) voidvoiddeleteSubKey(String subKey) Deletes a sub-key of the open key.voidDeletes the sub-keys under the open key.voiddeleteValue(String name) Deletes a value and the value's data under the open key.getBinaryValue(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.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.getStringValue(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.protected IDfListintgetValuesSize(String name) Returns the number of elements in a key with an array of values.booleanReturns a flag specifying if the given sub-key is a sub-key of the open key.booleanisValueNamePresent(String name) voidSet the open key.voidprotected voidintReleases the inter-process lock.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.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.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 voidsetStringValues(RegistryEntriesHolder holder) voidsetStringValues(String name, IDfList data) Sets the data field of the given value with String values.protected voidvoidsetValuesSize(String name, int size) Set the size of an array name.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
finalize, flush, getInterprocessLockCount, resetMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.documentum.registry.IDfRegistry
flush, reset
-
Field Details
-
m_registryInfo
-
m_openKey
-
m_rootKey
-
-
Constructor Details
-
DfRemoteRegistry
-
-
Method Details
-
openRegistry
public void openRegistry() -
closeRegistry
public void closeRegistry() -
createKey
- Specified by:
createKeyin interfaceIDfRegistry- Specified by:
createKeyin classDfRegistry- Throws:
DfException
-
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.
-
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 open key. The open key is not deleted.- Specified by:
deleteSubKeysin interfaceIDfRegistry- Specified by:
deleteSubKeysin classDfRegistry- Throws:
DfException- if the operation failed.
-
closeKey
Closes an open key freeing system resources.- Specified by:
closeKeyin interfaceIDfRegistry- Specified by:
closeKeyin 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.
-
getIntValues
Returns an integer array of the data at the given value.- Specified by:
getIntValuesin interfaceIDfRegistry- Overrides:
getIntValuesin classDfRegistry- 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- Overrides:
setIntValuesin classDfRegistry- 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- Overrides:
getIntValueAtin classDfRegistry- 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- Overrides:
setIntValueAtin classDfRegistry- 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- Overrides:
getStringValuesin classDfRegistry- 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- Overrides:
setStringValuesin classDfRegistry- 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- Overrides:
getStringValueAtin classDfRegistry- 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- Overrides:
setStringValueAtin classDfRegistry- 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- Overrides:
getBinaryValuesin classDfRegistry- 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- Overrides:
setBinaryValuesin classDfRegistry- 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- Overrides:
getBinaryValueAtin classDfRegistry- 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- Overrides:
setBinaryValueAtin classDfRegistry- 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- Overrides:
getValuesSizein classDfRegistry- 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- Overrides:
setValuesSizein classDfRegistry- Parameters:
name- the array name to set the size of.size- the new size to set.- Throws:
DfException- if the operation failed.
-
isValueNamePresent
- Specified by:
isValueNamePresentin interfaceIDfRegistry- Throws:
DfException
-
assertFunc
Used to check for valid parameters to functions.- Overrides:
assertFuncin classDfRegistry- Parameters:
param- the string to test.- Throws:
DfException- if the parameter is invalid.
-
constructNewKeyStack
- Throws:
DfException
-
getValues
- Throws:
DfException
-
setValues
- Throws:
DfException
-
recursiveRemoveSubKeys
- Throws:
DfException
-
acquireInterProcessLock
public int acquireInterProcessLock()Description copied from class:DfRegistryAcquires the inter-process lock. Inter-process lock will be acquired only if the OS in not Windows.- Overrides:
acquireInterProcessLockin classDfRegistry
-
releaseInterProcessLock
public int releaseInterProcessLock()Description copied from class:DfRegistryReleases the inter-process lock. Inter-process lock will be released only if the OS in not Windows.- Overrides:
releaseInterProcessLockin classDfRegistry
-
closeRootKey
- Specified by:
closeRootKeyin classDfRegistry- Throws:
DfException
-