Package org.alfresco.repo.admin.registry
Class RegistryServiceImpl
- java.lang.Object
-
- org.alfresco.repo.admin.registry.RegistryServiceImpl
-
- All Implemented Interfaces:
RegistryService
public class RegistryServiceImpl extends java.lang.Object implements RegistryService
Implementation of registry service to provide generic storage and retrieval of system-related metadata.- Author:
- Derek Hulley
-
-
Constructor Summary
Constructors Constructor Description RegistryServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(RegistryKey key, java.io.Serializable value)Assign a value to the registry key, which must be of the form /a/b/c.voidcopy(RegistryKey sourceKey, RegistryKey targetKey)Copies the path or value from the source to the target location.voiddelete(RegistryKey key)Delete the path element or value described by the key.java.util.Collection<java.lang.String>getChildElements(RegistryKey key)Fetches all child elements for the given path.java.io.SerializablegetProperty(RegistryKey key)voidinit()voidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetRegistryRootPath(java.lang.String registryRootPath)A root path e.g.voidsetRegistryStore(java.lang.String registryStore)voidsetRegistryStoreRef(org.alfresco.service.cmr.repository.StoreRef registryStoreRef)voidsetSearchService(org.alfresco.service.cmr.search.SearchService searchService)
-
-
-
Method Detail
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
setSearchService
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
-
setRegistryStoreRef
public void setRegistryStoreRef(org.alfresco.service.cmr.repository.StoreRef registryStoreRef)
- Parameters:
registryStoreRef- the store in which the registry root is found
-
setRegistryStore
public void setRegistryStore(java.lang.String registryStore)
- See Also:
setRegistryStoreRef(StoreRef)
-
setRegistryRootPath
public void setRegistryRootPath(java.lang.String registryRootPath)
A root path e.g. /sys:systemRegistry- Parameters:
registryRootPath- the path to the root of the registry
-
init
public void init()
-
addProperty
public void addProperty(RegistryKey key, java.io.Serializable value)
Assign a value to the registry key, which must be of the form /a/b/c.- Specified by:
addPropertyin interfaceRegistryService- Parameters:
key- the registry key.value- any value that can be stored in the repository.
-
getProperty
public java.io.Serializable getProperty(RegistryKey key)
- Specified by:
getPropertyin interfaceRegistryService- 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:
RegistryService.addProperty(RegistryKey, Serializable)
-
getChildElements
public java.util.Collection<java.lang.String> getChildElements(RegistryKey key)
Description copied from interface:RegistryServiceFetches 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")); ...- Specified by:
getChildElementsin interfaceRegistryService- 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
public void copy(RegistryKey sourceKey, RegistryKey targetKey)
Description copied from interface:RegistryServiceCopies 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
deletefirst if the target must be cleaned.- Specified by:
copyin interfaceRegistryService- Parameters:
sourceKey- the source registry key to take values fromtargetKey- the target registyr key to move the path or value to
-
delete
public void delete(RegistryKey key)
Description copied from interface:RegistryServiceDelete 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.- Specified by:
deletein interfaceRegistryService- Parameters:
key- the path or value to delete
-
-