Package org.alfresco.repo.node.db
Class DbNodeServiceImpl
java.lang.Object
org.alfresco.repo.node.AbstractNodeServiceImpl
org.alfresco.repo.node.db.DbNodeServiceImpl
- All Implemented Interfaces:
NodeService,Extensible
Node service using database persistence layer to fulfill functionality
- Author:
- Derek Hulley
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.repository.NodeService
NodeService.FindNodeParameters -
Field Summary
FieldsFields inherited from class org.alfresco.repo.node.AbstractNodeServiceImpl
dictionaryService, storesToIgnorePolicies, tenantService, transactionService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddProperties(NodeRef nodeRef, Map<QName, Serializable> properties) intcountChildAssocs(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) Defers to the typed servicevoiddeleteNode(NodeRef nodeRef) Delete NodevoiddeleteStore(StoreRef storeRef) booleanbooleangetAllRootNodes(StoreRef storeRef) getAspects(NodeRef nodeRef) getChildAssocs(NodeRef nodeRef) Defers to the pattern matching overloadgetChildAssocs(NodeRef nodeRef, Set<QName> childNodeTypeQNames) getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) Filters out any associations if their qname is not a match to the given pattern.getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, boolean preload) Filters out any associations if their qname is not a match to the given pattern.getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, int maxResults, boolean preload) Fetches the first n child associations in an efficient mannergetChildAssocsByPropertyValue(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) getNodeRef(Long nodeId) getNodeStatus(NodeRef nodeRef) getParentAssocs(NodeRef nodeRef) Defers to the pattern matching overloadgetParentAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) Filters out any associations if their qname is not a match to the given pattern.getParents(NodeRef nodeRef) When searching forprimaryOnly == true, checks that there is exactly one path.getPrimaryParent(NodeRef nodeRef) getProperties(NodeRef nodeRef) getProperty(NodeRef nodeRef, QName qname) getRootNode(StoreRef storeRef) getSourceAssocs(NodeRef targetRef, QNamePattern qnamePattern) getStoreArchiveNode(StoreRef storeRef) getTargetAssocs(NodeRef sourceRef, QNamePattern qnamePattern) getTargetAssocsByPropertyValue(NodeRef sourceRef, QNamePattern qnamePattern, QName propertyQName, Serializable propertyValue) <M extends Trait>
ExtendedTrait<M>booleanPerforms a check on the set of node aspectsMove Node Drops the old primary association and creates a new onevoidremoveAspect(NodeRef nodeRef, QName aspectTypeQName) voidremoveAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName) voidremoveChild(NodeRef parentRef, NodeRef childRef) booleanremoveChildAssociation(ChildAssociationRef childAssocRef) voidremoveProperty(NodeRef nodeRef, QName qname) booleanremoveSecondaryChildAssociation(ChildAssociationRef childAssocRef) restoreNode(NodeRef archivedNodeRef, NodeRef destinationParentNodeRef, QName assocTypeQName, QName assocQName) Archives the node without the cm:auditable aspect behaviourvoidsetAssociations(NodeRef sourceRef, QName assocTypeQName, List<NodeRef> targetRefs) voidsetChildAssociationIndex(ChildAssociationRef childAssocRef, int index) voidsetEnableTimestampPropagation(boolean enableTimestampPropagation) Set whether cm:auditable timestamps should be propagated to parent nodes where the parent-child relationship has been marked using propagateTimestamps.voidsetNodeDAO(NodeDAO nodeDAO) voidsetPermissionService(PermissionService permissionService) voidsetPolicyBehaviourFilter(BehaviourFilter policyBehaviourFilter) voidsetProperties(NodeRef nodeRef, Map<QName, Serializable> properties) Ensures that all required properties are present on the node and copies the property values to theNode.voidsetProperty(NodeRef nodeRef, QName qname, Serializable value) Gets the properties map, sets the value (null is allowed) and checks that the new set of properties is valid.voidsetQnameDAO(QNameDAO qnameDAO) voidsetStoreArchiveMap(StoreArchiveMap storeArchiveMap) voidMethods inherited from class org.alfresco.repo.node.AbstractNodeServiceImpl
equals, generateGuid, getDefaultProperties, getDefaultProperties, getTypeAndAspectQNames, hashCode, init, invokeBeforeAddAspect, invokeBeforeArchiveNode, invokeBeforeCreateNode, invokeBeforeCreateStore, invokeBeforeDeleteAssociation, invokeBeforeDeleteChildAssociation, invokeBeforeDeleteNode, invokeBeforeMoveNode, invokeBeforeRemoveAspect, invokeBeforeSetType, invokeBeforeUpdateNode, invokeOnAddAspect, invokeOnCreateAssociation, invokeOnCreateChildAssociation, invokeOnCreateNode, invokeOnCreateStore, invokeOnDeleteAssociation, invokeOnDeleteChildAssociation, invokeOnDeleteNode, invokeOnMoveNode, invokeOnRemoveAspect, invokeOnRestoreNode, invokeOnSetType, invokeOnUpdateNode, invokeOnUpdateProperties, removeSeconaryChildAssociation, setDictionaryService, setPolicyComponent, setStoresToIgnorePolicies, setTenantService, setTransactionServiceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.alfresco.service.cmr.repository.NodeService
removeSeconaryChildAssociation
-
Field Details
-
KEY_PENDING_DELETE_NODES
- See Also:
-
-
Constructor Details
-
DbNodeServiceImpl
public DbNodeServiceImpl()
-
-
Method Details
-
setQnameDAO
-
setNodeDAO
-
setPermissionService
-
setStoreArchiveMap
-
setPolicyBehaviourFilter
- Parameters:
policyBehaviourFilter- component used to enable and disable behaviours
-
setEnableTimestampPropagation
public void setEnableTimestampPropagation(boolean enableTimestampPropagation) Set whether cm:auditable timestamps should be propagated to parent nodes where the parent-child relationship has been marked using propagateTimestamps.- Parameters:
enableTimestampPropagation- true to propagate timestamps to the parent node where appropriate
-
exists
- Specified by:
existsin interfaceNodeService
-
exists
- Specified by:
existsin interfaceNodeService
-
getNodeStatus
- Specified by:
getNodeStatusin interfaceNodeService
-
getNodeRef
- Specified by:
getNodeRefin interfaceNodeService
-
getStores
- Specified by:
getStoresin interfaceNodeService
-
createStore
Defers to the typed service- Specified by:
createStorein interfaceNodeService
-
deleteStore
- Specified by:
deleteStorein interfaceNodeService- Throws:
UnsupportedOperationException- AlwaysInvalidStoreRefException
-
getRootNode
- Specified by:
getRootNodein interfaceNodeService- Throws:
InvalidStoreRefException
-
getAllRootNodes
- Specified by:
getAllRootNodesin interfaceNodeService
-
createNode
public ChildAssociationRef createNode(NodeRef parentRef, QName assocTypeQName, QName assocQName, QName nodeTypeQName) - Specified by:
createNodein interfaceNodeService- See Also:
-
getChildAssocs
Description copied from class:AbstractNodeServiceImplDefers to the pattern matching overload- Specified by:
getChildAssocsin interfaceNodeService- Overrides:
getChildAssocsin classAbstractNodeServiceImpl- Throws:
InvalidNodeRefException- See Also:
-
findNodes
- Specified by:
findNodesin interfaceNodeService- Overrides:
findNodesin classAbstractNodeServiceImpl
-
createNode
public ChildAssociationRef createNode(NodeRef parentRef, QName assocTypeQName, QName assocQName, QName nodeTypeQName, Map<QName, Serializable> properties) - Specified by:
createNodein interfaceNodeService
-
setChildAssociationIndex
- Specified by:
setChildAssociationIndexin interfaceNodeService
-
getType
- Specified by:
getTypein interfaceNodeService- Throws:
InvalidNodeRefException
-
setType
- Specified by:
setTypein interfaceNodeService- Throws:
InvalidNodeRefException- See Also:
-
addAspect
public void addAspect(NodeRef nodeRef, QName aspectTypeQName, Map<QName, Serializable> aspectProperties) throws InvalidNodeRefException, InvalidAspectException- Specified by:
addAspectin interfaceNodeService- Throws:
InvalidNodeRefExceptionInvalidAspectException
-
countChildAssocs
- Specified by:
countChildAssocsin interfaceNodeService- Throws:
InvalidNodeRefException
-
removeAspect
public void removeAspect(NodeRef nodeRef, QName aspectTypeQName) throws InvalidNodeRefException, InvalidAspectException - Specified by:
removeAspectin interfaceNodeService- Throws:
InvalidNodeRefExceptionInvalidAspectException
-
hasAspect
public boolean hasAspect(NodeRef nodeRef, QName aspectQName) throws InvalidNodeRefException, InvalidAspectException Performs a check on the set of node aspects- Specified by:
hasAspectin interfaceNodeService- Throws:
InvalidNodeRefExceptionInvalidAspectException
-
getAspects
- Specified by:
getAspectsin interfaceNodeService- Throws:
InvalidNodeRefException
-
deleteNode
Delete Node- Specified by:
deleteNodein interfaceNodeService
-
addChild
public ChildAssociationRef addChild(NodeRef parentRef, NodeRef childRef, QName assocTypeQName, QName assocQName) - Specified by:
addChildin interfaceNodeService
-
addChild
public List<ChildAssociationRef> addChild(Collection<NodeRef> parentRefs, NodeRef childRef, QName assocTypeQName, QName assocQName) - Specified by:
addChildin interfaceNodeService
-
removeChild
- Specified by:
removeChildin interfaceNodeService- Throws:
InvalidNodeRefException
-
removeChildAssociation
- Specified by:
removeChildAssociationin interfaceNodeService
-
removeSecondaryChildAssociation
- Specified by:
removeSecondaryChildAssociationin interfaceNodeService
-
getProperty
- Specified by:
getPropertyin interfaceNodeService- Throws:
InvalidNodeRefException
-
getProperties
- Specified by:
getPropertiesin interfaceNodeService- Throws:
InvalidNodeRefException
-
getNodeAclId
- Specified by:
getNodeAclIdin interfaceNodeService- Throws:
InvalidNodeRefException
-
setProperty
public void setProperty(NodeRef nodeRef, QName qname, Serializable value) throws InvalidNodeRefException Gets the properties map, sets the value (null is allowed) and checks that the new set of properties is valid.- Specified by:
setPropertyin interfaceNodeService- Throws:
InvalidNodeRefException
-
setProperties
public void setProperties(NodeRef nodeRef, Map<QName, Serializable> properties) throws InvalidNodeRefExceptionEnsures that all required properties are present on the node and copies the property values to theNode.To remove a property, remove it from the map before calling this method. Null-valued properties are allowed.
If any of the values are null, a marker object is put in to mimic nulls. They will be turned back into a real nulls when the properties are requested again.
- Specified by:
setPropertiesin interfaceNodeService- Throws:
InvalidNodeRefException
-
addProperties
public void addProperties(NodeRef nodeRef, Map<QName, Serializable> properties) throws InvalidNodeRefException- Specified by:
addPropertiesin interfaceNodeService- Throws:
InvalidNodeRefException
-
removeProperty
- Specified by:
removePropertyin interfaceNodeService- Throws:
InvalidNodeRefException
-
getParents
- Throws:
InvalidNodeRefException
-
getParentAssocs
public List<ChildAssociationRef> getParentAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) Filters out any associations if their qname is not a match to the given pattern.- Specified by:
getParentAssocsin interfaceNodeService
-
getParentAssocs
Description copied from class:AbstractNodeServiceImplDefers to the pattern matching overload- Specified by:
getParentAssocsin interfaceNodeService- Overrides:
getParentAssocsin classAbstractNodeServiceImpl- Throws:
InvalidNodeRefException- See Also:
-
getChildAssocs
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) Filters out any associations if their qname is not a match to the given pattern.- Specified by:
getChildAssocsin interfaceNodeService
-
getChildAssocs
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, boolean preload) Filters out any associations if their qname is not a match to the given pattern.- Specified by:
getChildAssocsin interfaceNodeService
-
getChildAssocs
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, int maxResults, boolean preload) Fetches the first n child associations in an efficient manner- Specified by:
getChildAssocsin interfaceNodeService
-
getChildAssocs
- Specified by:
getChildAssocsin interfaceNodeService
-
getChildByName
- Specified by:
getChildByNamein interfaceNodeService
-
getChildrenByName
public List<ChildAssociationRef> getChildrenByName(NodeRef nodeRef, QName assocTypeQName, Collection<String> childNames) - Specified by:
getChildrenByNamein interfaceNodeService
-
getPrimaryParent
- Specified by:
getPrimaryParentin interfaceNodeService- Throws:
InvalidNodeRefException
-
createAssociation
public AssociationRef createAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName) throws InvalidNodeRefException, AssociationExistsException - Specified by:
createAssociationin interfaceNodeService- Throws:
InvalidNodeRefExceptionAssociationExistsException
-
setAssociations
- Specified by:
setAssociationsin interfaceNodeService
-
getChildAssocsWithoutParentAssocsOfType
public Collection<ChildAssociationRef> getChildAssocsWithoutParentAssocsOfType(NodeRef parent, QName assocTypeQName) - Specified by:
getChildAssocsWithoutParentAssocsOfTypein interfaceNodeService
-
findAssocsNotLinkedByTwoOtherAssocs
- Specified by:
findAssocsNotLinkedByTwoOtherAssocsin interfaceNodeService
-
getChildAssocsByPropertyValue
public List<ChildAssociationRef> getChildAssocsByPropertyValue(NodeRef nodeRef, QName propertyQName, Serializable value) - Specified by:
getChildAssocsByPropertyValuein interfaceNodeService
-
removeAssociation
public void removeAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName) throws InvalidNodeRefException - Specified by:
removeAssociationin interfaceNodeService- Throws:
InvalidNodeRefException
-
getAssoc
- Specified by:
getAssocin interfaceNodeService
-
getTargetAssocs
- Specified by:
getTargetAssocsin interfaceNodeService
-
getTargetAssocsByPropertyValue
public List<AssociationRef> getTargetAssocsByPropertyValue(NodeRef sourceRef, QNamePattern qnamePattern, QName propertyQName, Serializable propertyValue) - Specified by:
getTargetAssocsByPropertyValuein interfaceNodeService
-
getSourceAssocs
- Specified by:
getSourceAssocsin interfaceNodeService
-
getPath
- Specified by:
getPathin interfaceNodeService- Throws:
InvalidNodeRefException- See Also:
-
getPaths
When searching forprimaryOnly == true, checks that there is exactly one path.- Specified by:
getPathsin interfaceNodeService- Throws:
InvalidNodeRefException
-
restoreNode
public NodeRef restoreNode(NodeRef archivedNodeRef, NodeRef destinationParentNodeRef, QName assocTypeQName, QName assocQName) Archives the node without the cm:auditable aspect behaviour- Specified by:
restoreNodein interfaceNodeService
-
moveNode
public ChildAssociationRef moveNode(NodeRef nodeToMoveRef, NodeRef newParentRef, QName assocTypeQName, QName assocQName) Move Node Drops the old primary association and creates a new one- Specified by:
moveNodein interfaceNodeService
-
getStoreArchiveNode
- Specified by:
getStoreArchiveNodein interfaceNodeService
-
getTrait
- Specified by:
getTraitin interfaceExtensible
-