org.alfresco.repo.admin.registry
Interface RegistryService

All Known Implementing Classes:
RegistryServiceImpl

public interface RegistryService

Interface for service providing access to key-value pairs for storage of system-controlled metadata.


Method Summary
 void addProperty(RegistryKey key, java.io.Serializable value)
          Assign a value to the registry key, which must be of the form /a/b/c.
 void copy(RegistryKey sourceKey, RegistryKey targetKey)
          Copies the path or value from the source to the target location.
 void delete(RegistryKey key)
          Delete the path element or value described by the key.
 java.util.Collection getChildElements(RegistryKey key)
          Fetches all child elements for the given path.
 java.io.Serializable getProperty(RegistryKey key)
           
 

Method Detail

addProperty

void addProperty(RegistryKey key,
                 java.io.Serializable value)
Assign a value to the registry key, which must be of the form /a/b/c.

Parameters:
key - the registry key.
value - any value that can be stored in the repository.

getProperty

java.io.Serializable getProperty(RegistryKey key)
Parameters:
key - the registry key.
Returns:
Returns the value stored in the key or null if no value exists at the path and name provided
See Also:
#addProperty(String, Serializable)

getChildElements

java.util.Collection getChildElements(RegistryKey key)
Fetches all child elements for the given path. The key's property should be null as it is completely ignored.
    ...
    registryService.addValue(KEY_A_B_C_1, VALUE_ONE);
    registryService.addValue(KEY_A_B_C_2, VALUE_TWO);
    ...
    assertTrue(registryService.getChildElements(KEY_A_B_null).contains("C"));
    ...
 

Parameters:
key - the registry key with the path. The last element in the path will be ignored, and can be any acceptable value localname or null.
Returns:
Returns all child elements (not values) for the given key, ignoring the last element in the key.
See Also:
RegistryKey.getPath()

copy

void copy(RegistryKey sourceKey,
          RegistryKey targetKey)
Copies the path or value from the source to the target location. The source and target keys must be both either path-specific or property-specific. If the source doesn't exist, then nothing will be done; there is no guarantee that the target will exist after the call.

This is essentially a merge operation. Use delete first if the target must be cleaned.

Parameters:
sourceKey - the source registry key to take values from
targetKey - the target registyr key to move the path or value to

delete

void delete(RegistryKey key)
Delete the path element or value described by the key. If the key points to nothing, then nothing is done. delete(/a/b/c) will remove value c from path /a/b.
delete(/a/b/null) will remove node /a/b along with all values and child elements.

Parameters:
key - the path or value to delete


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.