Package org.alfresco.repo.version
Class NodeServiceImpl
java.lang.Object
org.alfresco.repo.version.NodeServiceImpl
- All Implemented Interfaces:
VersionBaseModel,VersionModel,NodeService
- Direct Known Subclasses:
Node2ServiceImpl
The light weight version store node service implementation.
- Author:
- Roy Wetherall
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.repository.NodeService
NodeService.FindNodeParameters -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentDataDAOprotected NodeServiceprotected DictionaryServiceprotected static final StringError messagesFields inherited from interface org.alfresco.repo.version.VersionBaseModel
ASPECT_LOCALNAME_VERSION_STORE_ROOT, ASSOC_LOCALNAME_ROOT_VERSION, CHILD_VERSION_HISTORIES, CHILD_VERSIONED_ASSOCS, CHILD_VERSIONS, PROP_CREATED_DATE, PROP_CREATOR, PROP_DESCRIPTION, PROP_TRANSLATION_VERSIONS, PROP_VERSION_DESCRIPTION, PROP_VERSION_LABEL, PROP_VERSION_NUMBER, PROP_VERSION_TYPE, PROP_VERSIONED_NODE_ID, STORE_PROTOCOL, TYPE_VERSION_HISTORY, TYPE_VERSIONED_ASSOCFields inherited from interface org.alfresco.repo.version.VersionModel
ASPECT_VERSION_STORE_ROOT, ASSOC_ROOT_VERSION, ASSOC_SUCCESSOR, CHILD_QNAME_VERSION_HISTORIES, CHILD_QNAME_VERSION_META_DATA, CHILD_QNAME_VERSIONED_ASSOCS, CHILD_QNAME_VERSIONED_ATTRIBUTES, CHILD_QNAME_VERSIONED_CHILD_ASSOCS, CHILD_QNAME_VERSIONS, CHILD_VERSION_META_DATA, CHILD_VERSIONED_ATTRIBUTES, CHILD_VERSIONED_CHILD_ASSOCS, NAMESPACE_URI, PROP_ASSOC_QNAME, PROP_ASSOC_TYPE_QNAME, PROP_FROZEN_ASPECTS, PROP_FROZEN_NODE_ID, PROP_FROZEN_NODE_STORE_ID, PROP_FROZEN_NODE_STORE_PROTOCOL, PROP_FROZEN_NODE_TYPE, PROP_IS_MULTI_VALUE, PROP_IS_PRIMARY, PROP_META_DATA_NAME, PROP_META_DATA_VALUE, PROP_MULTI_VALUE, PROP_NTH_SIBLING, PROP_QNAME, PROP_QNAME_ASSOC_QNAME, PROP_QNAME_ASSOC_TYPE_QNAME, PROP_QNAME_FROZEN_ASPECTS, PROP_QNAME_FROZEN_NODE_ID, PROP_QNAME_FROZEN_NODE_STORE_ID, PROP_QNAME_FROZEN_NODE_STORE_PROTOCOL, PROP_QNAME_FROZEN_NODE_TYPE, PROP_QNAME_IS_MULTI_VALUE, PROP_QNAME_IS_PRIMARY, PROP_QNAME_META_DATA_NAME, PROP_QNAME_META_DATA_VALUE, PROP_QNAME_MULTI_VALUE, PROP_QNAME_NTH_SIBLING, PROP_QNAME_QNAME, PROP_QNAME_TRANSLATION_VERSIONS, PROP_QNAME_VALUE, PROP_QNAME_VERSION_LABEL, PROP_QNAME_VERSION_NUMBER, PROP_QNAME_VERSIONED_NODE_ID, PROP_VALUE, STORE_ID, TYPE_QNAME_VERSION, TYPE_QNAME_VERSION_HISTORY, TYPE_QNAME_VERSION_META_DATA_VALUE, TYPE_QNAME_VERSIONED_ASSOC, TYPE_QNAME_VERSIONED_CHILD_ASSOC, TYPE_QNAME_VERSIONED_PROPERTY, TYPE_VERSION, TYPE_VERSION_META_DATA_VALUE, TYPE_VERSIONED_CHILD_ASSOC, TYPE_VERSIONED_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddProperties(NodeRef nodeRef, Map<QName, Serializable> properties) cleanup()No-opintcountChildAssocs(NodeRef nodeRef, boolean isPrimary) createAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName) createNode(NodeRef parentRef, QName assocTypeQName, QName assocQName, QName nodeTypeQName) createNode(NodeRef parentRef, QName assocTypeQName, QName assocQName, QName nodeTypeQName, Map<QName, Serializable> properties) createStore(String protocol, String identifier) Delegates to theNodeServiceused as the version store implementationvoiddeleteNode(NodeRef nodeRef) voiddeleteStore(StoreRef storeRef) booleanDelegates to theNodeServiceused as the version store implementationbooleanDelegates to theNodeServiceused as the version store implementationgetAllRootNodes(StoreRef storeRef) Delegates to theNodeServiceused as the version store implementationgetAspects(NodeRef nodeRef) Translation for version storeGets an association by ID.getChildAssocs(NodeRef nodeRef) getChildAssocs(NodeRef nodeRef, Set<QName> childNodeTypes) getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) Performs conversion from version store properties to real associationsgetChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, boolean preload) getChildAssocs(NodeRef nodeRef, QNamePattern typeQName, QNamePattern qname, int maxResults, boolean preload) getChildAssocsByPropertyValue(NodeRef nodeRef, QName propertyQName, Serializable value) getChildAssocsWithoutParentAssocsOfType(NodeRef parent, QName assocTypeQName) getChildByName(NodeRef nodeRef, QName assocTypeQName, String childName) getChildrenByName(NodeRef nodeRef, QName assocTypeQName, Collection<String> childNames) getNodeAclId(NodeRef nodeRef) Gets, converts and adds the intrinsic properties to the current node's propertiesgetNodeRef(Long nodeId) Delegates to theNodeServiceused as the version store implementationgetNodeStatus(NodeRef nodeRef) Delegates to theNodeServiceused as the version store implementationgetParentAssocs(NodeRef nodeRef) The node will appear to be attached to the root of the version storegetParentAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) The node will apprear to be attached to the root of the version storegetPrimaryParent(NodeRef nodeRef) Simulates the node begin attached ot the root node of the version store.getProperties(NodeRef nodeRef) Property translation for version storegetProperty(NodeRef nodeRef, QName qname) Property translation for version storegetRootNode(StoreRef storeRef) Delegates to theNodeServiceused as the version store implementationgetSourceAssocs(NodeRef sourceRef, QNamePattern qnamePattern) getStoreArchiveNode(StoreRef storeRef) Delegates to theNodeServiceused as the version store implementationgetTargetAssocs(NodeRef sourceRef, QNamePattern qnamePattern) getTargetAssocsByPropertyValue(NodeRef sourceRef, QNamePattern qnamePattern, QName propertyQName, Serializable propertyValue) Type translation for version storebooleanTranslation for version storevoidremoveAspect(NodeRef nodeRef, QName aspectRef) voidremoveAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName) voidremoveChild(NodeRef parentRef, NodeRef childRef) booleanremoveChildAssociation(ChildAssociationRef childAssocRef) voidremoveProperty(NodeRef nodeRef, QName qname) booleanremoveSeconaryChildAssociation(ChildAssociationRef childAssocRef) booleanremoveSecondaryChildAssociation(ChildAssociationRef childAssocRef) restoreNode(NodeRef archivedNodeRef, NodeRef targetParentNodeRef, QName assocTypeQName, QName assocQName) voidsetAssociations(NodeRef sourceRef, QName assocTypeQName, List<NodeRef> targetRefs) voidsetChildAssociationIndex(ChildAssociationRef childAssocRef, int index) voidsetContentDataDAO(ContentDataDAO contentDataDAO) Set the DAO to resolved content data reference IDs into ContentData instancesvoidsetDbNodeService(NodeService nodeService) Sets the db node service, used as the version store implementationvoidsetDictionaryService(DictionaryService dictionaryService) Sets the dictionary servicevoidsetProperties(NodeRef nodeRef, Map<QName, Serializable> properties) voidsetProperty(NodeRef nodeRef, QName qame, Serializable value) voidsetSearcher(SearchService searcher) Sets the searchervoid
-
Field Details
-
MSG_UNSUPPORTED
Error messages- See Also:
-
dbNodeService
-
dicitionaryService
-
contentDataDAO
-
-
Constructor Details
-
NodeServiceImpl
public NodeServiceImpl()
-
-
Method Details
-
setDbNodeService
Sets the db node service, used as the version store implementation- Parameters:
nodeService- the node service
-
setSearcher
Sets the searcher -
setDictionaryService
Sets the dictionary service -
setContentDataDAO
Set the DAO to resolved content data reference IDs into ContentData instances -
cleanup
No-op -
getStores
Delegates to theNodeServiceused as the version store implementation- Specified by:
getStoresin interfaceNodeService
-
createStore
Delegates to theNodeServiceused as the version store implementation- Specified by:
createStorein interfaceNodeService
-
deleteStore
- Specified by:
deleteStorein interfaceNodeService- Throws:
UnsupportedOperationException- always
-
exists
Delegates to theNodeServiceused as the version store implementation- Specified by:
existsin interfaceNodeService
-
exists
Delegates to theNodeServiceused as the version store implementation- Specified by:
existsin interfaceNodeService
-
getNodeStatus
Delegates to theNodeServiceused as the version store implementation- Specified by:
getNodeStatusin interfaceNodeService
-
getNodeRef
Delegates to theNodeServiceused as the version store implementation- Specified by:
getNodeRefin interfaceNodeService
-
getRootNode
Delegates to theNodeServiceused as the version store implementation- Specified by:
getRootNodein interfaceNodeService
-
getAllRootNodes
Delegates to theNodeServiceused as the version store implementation- Specified by:
getAllRootNodesin interfaceNodeService
-
createNode
public ChildAssociationRef createNode(NodeRef parentRef, QName assocTypeQName, QName assocQName, QName nodeTypeQName) throws InvalidNodeRefException - Specified by:
createNodein interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
createNode
public ChildAssociationRef createNode(NodeRef parentRef, QName assocTypeQName, QName assocQName, QName nodeTypeQName, Map<QName, Serializable> properties) throws InvalidNodeRefException- Specified by:
createNodein interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
deleteNode
- Specified by:
deleteNodein interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
addChild
public ChildAssociationRef addChild(NodeRef parentRef, NodeRef childRef, QName assocTypeQName, QName qname) throws InvalidNodeRefException - Specified by:
addChildin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
addChild
public List<ChildAssociationRef> addChild(Collection<NodeRef> parentRefs, NodeRef childRef, QName assocTypeQName, QName qname) throws InvalidNodeRefException - Specified by:
addChildin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
removeChild
- Specified by:
removeChildin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
removeChildAssociation
- Specified by:
removeChildAssociationin interfaceNodeService- Throws:
UnsupportedOperationException- always
-
removeSeconaryChildAssociation
- Specified by:
removeSeconaryChildAssociationin interfaceNodeService- Throws:
UnsupportedOperationException- always
-
removeSecondaryChildAssociation
- Specified by:
removeSecondaryChildAssociationin interfaceNodeService- Throws:
UnsupportedOperationException- always
-
moveNode
public ChildAssociationRef moveNode(NodeRef nodeToMoveRef, NodeRef newParentRef, QName assocTypeQName, QName assocQName) throws InvalidNodeRefException - Specified by:
moveNodein interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
setChildAssociationIndex
public void setChildAssociationIndex(ChildAssociationRef childAssocRef, int index) throws InvalidChildAssociationRefException - Specified by:
setChildAssociationIndexin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidChildAssociationRefException
-
getType
Type translation for version store- Specified by:
getTypein interfaceNodeService- Throws:
InvalidNodeRefException
-
setType
- Specified by:
setTypein interfaceNodeService- Throws:
InvalidNodeRefException- See Also:
-
addAspect
public void addAspect(NodeRef nodeRef, QName aspectRef, Map<QName, Serializable> aspectProperties) throws InvalidNodeRefException, InvalidAspectException- Specified by:
addAspectin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefExceptionInvalidAspectException
-
hasAspect
public boolean hasAspect(NodeRef nodeRef, QName aspectRef) throws InvalidNodeRefException, InvalidAspectException Translation for version store- Specified by:
hasAspectin interfaceNodeService- Throws:
InvalidNodeRefExceptionInvalidAspectException
-
removeAspect
public void removeAspect(NodeRef nodeRef, QName aspectRef) throws InvalidNodeRefException, InvalidAspectException - Specified by:
removeAspectin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefExceptionInvalidAspectException
-
getAspects
Translation for version store- Specified by:
getAspectsin interfaceNodeService- Throws:
InvalidNodeRefException
-
getProperties
Property translation for version store- Specified by:
getPropertiesin interfaceNodeService- Throws:
InvalidNodeRefException
-
getProperty
Property translation for version store- Specified by:
getPropertyin interfaceNodeService- Throws:
InvalidNodeRefException
-
setProperties
public void setProperties(NodeRef nodeRef, Map<QName, Serializable> properties) throws InvalidNodeRefException- Specified by:
setPropertiesin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
addProperties
public void addProperties(NodeRef nodeRef, Map<QName, Serializable> properties) throws InvalidNodeRefException- Specified by:
addPropertiesin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
setProperty
public void setProperty(NodeRef nodeRef, QName qame, Serializable value) throws InvalidNodeRefException - Specified by:
setPropertyin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
removeProperty
- Specified by:
removePropertyin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
getParentAssocs
The node will appear to be attached to the root of the version store- Specified by:
getParentAssocsin interfaceNodeService- See Also:
-
getParentAssocs
public List<ChildAssociationRef> getParentAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) The node will apprear to be attached to the root of the version store- Specified by:
getParentAssocsin interfaceNodeService- See Also:
-
getChildAssocs
- Specified by:
getChildAssocsin interfaceNodeService- Throws:
InvalidNodeRefException- See Also:
-
getChildAssocs
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, boolean preload) throws InvalidNodeRefException - Specified by:
getChildAssocsin interfaceNodeService- Throws:
InvalidNodeRefException
-
getChildAssocs
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) throws InvalidNodeRefException Performs conversion from version store properties to real associations- Specified by:
getChildAssocsin interfaceNodeService- Throws:
InvalidNodeRefException
-
getChildAssocs
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQName, QNamePattern qname, int maxResults, boolean preload) throws InvalidNodeRefException - Specified by:
getChildAssocsin interfaceNodeService- Throws:
InvalidNodeRefException
-
getChildAssocs
- Specified by:
getChildAssocsin interfaceNodeService- Throws:
UnsupportedOperationException- always
-
getChildrenByName
public List<ChildAssociationRef> getChildrenByName(NodeRef nodeRef, QName assocTypeQName, Collection<String> childNames) - Specified by:
getChildrenByNamein interfaceNodeService- Throws:
UnsupportedOperationException- always
-
getChildByName
- Specified by:
getChildByNamein interfaceNodeService- Throws:
UnsupportedOperationException- always
-
getPrimaryParent
Simulates the node begin attached ot the root node of the version store.- Specified by:
getPrimaryParentin interfaceNodeService- Throws:
InvalidNodeRefException
-
createAssociation
public AssociationRef createAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName) throws InvalidNodeRefException, AssociationExistsException - Specified by:
createAssociationin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefExceptionAssociationExistsException
-
setAssociations
- Specified by:
setAssociationsin interfaceNodeService- Throws:
UnsupportedOperationException- always
-
removeAssociation
- Specified by:
removeAssociationin interfaceNodeService- Throws:
UnsupportedOperationException- always
-
getAssoc
Gets an association by ID.- Specified by:
getAssocin interfaceNodeService- Parameters:
id- the association id- Returns:
- the association, or
nullif it does not exist
-
getTargetAssocs
- Specified by:
getTargetAssocsin interfaceNodeService- Throws:
UnsupportedOperationException- always
-
getTargetAssocsByPropertyValue
public List<AssociationRef> getTargetAssocsByPropertyValue(NodeRef sourceRef, QNamePattern qnamePattern, QName propertyQName, Serializable propertyValue) - Specified by:
getTargetAssocsByPropertyValuein interfaceNodeService- Throws:
UnsupportedOperationException- always
-
getSourceAssocs
- Specified by:
getSourceAssocsin interfaceNodeService- Throws:
UnsupportedOperationException- always
-
getPath
- Specified by:
getPathin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
getPaths
- Specified by:
getPathsin interfaceNodeService- Throws:
UnsupportedOperationException- alwaysInvalidNodeRefException
-
getStoreArchiveNode
- Specified by:
getStoreArchiveNodein interfaceNodeService- Throws:
UnsupportedOperationException- always
-
restoreNode
public NodeRef restoreNode(NodeRef archivedNodeRef, NodeRef targetParentNodeRef, QName assocTypeQName, QName assocQName) - Specified by:
restoreNodein interfaceNodeService- Throws:
UnsupportedOperationException- always
-
getChildAssocsWithoutParentAssocsOfType
public Collection<ChildAssociationRef> getChildAssocsWithoutParentAssocsOfType(NodeRef parent, QName assocTypeQName) - Specified by:
getChildAssocsWithoutParentAssocsOfTypein interfaceNodeService- Throws:
UnsupportedOperationException- always
-
findAssocsNotLinkedByTwoOtherAssocs
- Specified by:
findAssocsNotLinkedByTwoOtherAssocsin interfaceNodeService- Throws:
UnsupportedOperationException- always
-
getNodeAclId
Gets, converts and adds the intrinsic properties to the current node's properties- Specified by:
getNodeAclIdin interfaceNodeService- Throws:
InvalidNodeRefException
-
getChildAssocsByPropertyValue
public List<ChildAssociationRef> getChildAssocsByPropertyValue(NodeRef nodeRef, QName propertyQName, Serializable value) - Specified by:
getChildAssocsByPropertyValuein interfaceNodeService
-
findNodes
- Specified by:
findNodesin interfaceNodeService
-
countChildAssocs
- Specified by:
countChildAssocsin interfaceNodeService- Throws:
InvalidNodeRefException
-