org.alfresco.repo.domain.node
Interface NodeDAO

All Superinterfaces:
NodeBulkLoader
All Known Implementing Classes:
AbstractNodeDAOImpl, NodeDAOImpl, NodeDAOImpl.MSSQL

public interface NodeDAO
extends NodeBulkLoader

DAO services for alf_node and related tables

Since:
3.4

Nested Class Summary
static interface NodeDAO.ChildAssocRefQueryCallback
          Interface used to iterate over results from child association queries
static interface NodeDAO.NodeRefQueryCallback
          Interface used to iterate over pure node results
 
Method Summary
 boolean addNodeAspects(java.lang.Long nodeId, java.util.Set aspectQNames)
           
 boolean addNodeProperties(java.lang.Long nodeId, java.util.Map properties)
           
 boolean addNodeProperty(java.lang.Long nodeId, org.alfresco.service.namespace.QName qname, java.io.Serializable value)
           
 void cycleCheck(org.alfresco.util.Pair nodePair)
          Potentially cheaper than evaluating all of a node's paths to check for child association cycles.
 void deleteChildAssoc(java.lang.Long assocId)
           
 void deleteNode(java.lang.Long nodeId)
          Deletes the node and all entities.
 boolean exists(java.lang.Long nodeId)
           
 boolean exists(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Find out if a node exists.
 boolean exists(org.alfresco.service.cmr.repository.StoreRef storeRef)
          Find out if a store exists or not
 java.util.Set getAllRootNodes(org.alfresco.service.cmr.repository.StoreRef storeRef)
           
 org.alfresco.util.Pair getChildAssoc(java.lang.Long assocId)
          Get a specific association
 org.alfresco.util.Pair getChildAssoc(java.lang.Long parentNodeId, java.lang.Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
          Get a specific child association given all the determining data.
 org.alfresco.util.Pair getChildAssoc(java.lang.Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, java.lang.String childName)
          Get a child association for given parent node, association type and child node name (cm:name).
 void getChildAssocs(java.lang.Long parentNodeId, java.lang.Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, java.lang.Boolean isPrimary, java.lang.Boolean sameStore, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
          Get the child associations of a given parent node, optionally filtering on association QName and association type QName.
 void getChildAssocs(java.lang.Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, java.util.Collection childNames, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
          Get the child associations of a given parent node, filtering on type QName and the cm:name of the child nodes.
 java.util.List getChildAssocs(java.lang.Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, int maxResults, boolean preload)
          Gets the first n child associations of a given parent node, optionally filtering on association QName and association type QName.
 void getChildAssocs(java.lang.Long parentNodeId, java.util.Set assocTypeQNames, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
          Get the child associations of a given parent node, optionally filtering on type QName.
 void getChildAssocsByChildTypes(java.lang.Long parentNodeId, java.util.Set childNodeTypeQNames, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
           
 void getChildAssocsByPropertyValue(java.lang.Long parentNodeId, org.alfresco.service.namespace.QName propertyQName, java.io.Serializable nodeValue, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
           
 void getChildAssocsWithoutParentAssocsOfType(java.lang.Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
          Gets the set of child associations of a certain parent node without parent associations of a certain type to other nodes with the same parent! In effect the 'orphans' with respect to a certain association type.
 java.lang.Long getCurrentTransactionId()
           
 java.lang.Long getMaxTxnCommitTime()
           
 java.lang.Long getMaxTxnIdByCommitTime(long maxCommitTime)
          Retrieves the maximum transaction ID for which the commit time is less than the given time.
 java.lang.Long getMinTxnCommitTime()
           
 java.lang.Long getNodeAclId(java.lang.Long nodeId)
           
 java.util.Set getNodeAspects(java.lang.Long nodeId)
           
 org.alfresco.util.Pair getNodeAssoc(java.lang.Long assocId)
           
 org.alfresco.util.Pair getNodeAssocOrNull(java.lang.Long assocId)
           
 org.alfresco.util.Pair getNodePair(java.lang.Long nodeId)
           
 org.alfresco.util.Pair getNodePair(org.alfresco.service.cmr.repository.NodeRef nodeRef)
           
 java.util.Map getNodeProperties(java.lang.Long nodeId)
           
 java.io.Serializable getNodeProperty(java.lang.Long nodeId, org.alfresco.service.namespace.QName propertyQName)
           
 org.alfresco.service.cmr.repository.NodeRef.Status getNodeRefStatus(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Get the current status of the node, including deleted nodes.
 void getNodesWithAspects(java.util.Set aspectQNames, java.lang.Long minNodeId, java.lang.Long maxNodeId, NodeDAO.NodeRefQueryCallback resultsCallback)
          Get nodes with aspects between the given ranges
 org.alfresco.service.namespace.QName getNodeType(java.lang.Long nodeId)
           
 void getParentAssocs(java.lang.Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, java.lang.Boolean isPrimary, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
          Get the parent association of a given parent node, optionally filtering on association QName and association type QName.
 java.util.List getPaths(org.alfresco.util.Pair nodePair, boolean primaryOnly)
          Build the paths for a node.
 java.util.List getPrimaryChildrenAcls(java.lang.Long nodeId)
          Fetch all primary child node IDs and corresponding ACL IDs.
 org.alfresco.util.Pair getPrimaryParentAssoc(java.lang.Long childNodeId)
          Finds the association between the node's primary parent and the node itself
 org.alfresco.util.Pair getRootNode(org.alfresco.service.cmr.repository.StoreRef storeRef)
           
 java.util.Collection getSourceNodeAssocs(java.lang.Long targetNodeId, org.alfresco.service.namespace.QName typeQName)
           
 java.util.List getStores()
          Fetch a list of all stores in the repository
 java.util.Collection getTargetNodeAssocs(java.lang.Long sourceNodeId, org.alfresco.service.namespace.QName typeQName)
           
 int getTransactionCount()
           
 Transaction getTxnById(java.lang.Long txnId)
          Retrieves a specific transaction.
 java.util.List getTxnChanges(java.lang.Long txnId)
           
 java.util.List getTxnChangesForStore(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.Long txnId)
           
 int getTxnDeleteCount(java.lang.Long txnId)
           
 java.util.List getTxnsByCommitTimeAscending(java.util.List includeTxnIds)
          Get a specific list of transactions ordered by commit time.
 java.util.List getTxnsByCommitTimeAscending(java.lang.Long fromTimeInclusive, java.lang.Long toTimeExclusive, int count, java.util.List excludeTxnIds, boolean remoteOnly)
          Get all transactions in a given time range.
 java.util.List getTxnsByCommitTimeDescending(java.lang.Long fromTimeInclusive, java.lang.Long toTimeExclusive, int count, java.util.List excludeTxnIds, boolean remoteOnly)
          Get all transactions in a given time range.
 java.util.List getTxnsUnused(java.lang.Long minTxnId, long maxCommitTime, int count)
           
 int getTxnUpdateCount(java.lang.Long txnId)
           
 boolean hasNodeAspect(java.lang.Long nodeId, org.alfresco.service.namespace.QName aspectQName)
           
 boolean isInCurrentTxn(java.lang.Long nodeId)
           
 org.alfresco.util.Pair moveNode(java.lang.Long childNodeId, java.lang.Long newParentNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
          Update a node's primary association, giving it a new parent and new association parameters.
 void moveStore(org.alfresco.service.cmr.repository.StoreRef oldStoreRef, org.alfresco.service.cmr.repository.StoreRef newStoreRef)
          Changes the old store reference to the new store reference.
 org.alfresco.util.Pair newChildAssoc(java.lang.Long parentNodeId, java.lang.Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, java.lang.String childNodeName)
          Create a new child association.
 ChildAssocEntity newNode(java.lang.Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String uuid, org.alfresco.service.namespace.QName nodeTypeQName, java.util.Locale nodeLocale, java.lang.String childNodeName, java.util.Map auditableProperties)
          Create a new node.
 java.lang.Long newNodeAssoc(java.lang.Long sourceNodeId, java.lang.Long targetNodeId, org.alfresco.service.namespace.QName assocTypeQName, int assocIndex)
          Create a new association
 org.alfresco.util.Pair newStore(org.alfresco.service.cmr.repository.StoreRef storeRef)
          Creates a unique store for the given protocol and identifier combination.
 int purgeNodes(long maxTxnCommitTimeMs)
          Purge deleted nodes where their participating transactions are older than a given time.
 void purgeTxn(java.lang.Long txnId)
           
 boolean removeNodeAspects(java.lang.Long nodeId)
           
 boolean removeNodeAspects(java.lang.Long nodeId, java.util.Set aspectQNames)
           
 int removeNodeAssoc(java.lang.Long sourceNodeId, java.lang.Long targetNodeId, org.alfresco.service.namespace.QName assocTypeQName)
          Remove a specific node association
 int removeNodeAssocs(java.util.List ids)
          Remove all node associations of given IDs
 int removeNodeAssocsToAndFrom(java.lang.Long nodeId)
          Remove all node associations that share the given node.
 int removeNodeAssocsToAndFrom(java.lang.Long nodeId, java.util.Set assocTypeQNames)
          Remove all node associations of given types that share the given node.
 boolean removeNodeProperties(java.lang.Long nodeId, java.util.Set propertyQNames)
           
 java.util.List selectProperties(java.util.Collection propertyDefs)
          Used by the re-encryptor to re-encrypt encryptable properties with a new encryption key.
 int setChildAssocIndex(java.lang.Long parentNodeId, java.lang.Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, int index)
          Sets the association index ordering.
 void setChildAssocsUniqueName(java.lang.Long childNodeId, java.lang.String childName)
          Bulk-update all unique name (cm:name) index for parent associations of a given node.
 boolean setModifiedDate(java.lang.Long nodeId, java.util.Date date)
          Pull the cm:modified up to the current time without changing any other cm:auditable properties.
 void setNodeAclId(java.lang.Long nodeId, java.lang.Long aclId)
           
 void setNodeAssocIndex(java.lang.Long id, int assocIndex)
          Update an existing assoc's index.
 void setNodeDefiningAclId(java.lang.Long nodeId, long id)
          Used in ACL upgrade only to set the acl id with mimimal overhead
 boolean setNodeProperties(java.lang.Long nodeId, java.util.Map properties)
           
 void setPrimaryChildrenSharedAclId(java.lang.Long primaryParentNodeId, java.lang.Long optionalOldSharedAlcIdInAdditionToNull, java.lang.Long newSharedAclId)
           
 boolean updateNode(java.lang.Long nodeId, org.alfresco.service.namespace.QName nodeTypeQName, java.util.Locale nodeLocale)
           
 
Methods inherited from interface org.alfresco.repo.node.NodeBulkLoader
cacheNodes, cacheNodesById, clear
 

Method Detail

getCurrentTransactionId

java.lang.Long getCurrentTransactionId()
Returns:
Returns the ID of the current transaction entry or null if there have not been any modifications to nodes registered in the transaction

getStores

java.util.List getStores()
Fetch a list of all stores in the repository

Returns:
Returns a list of stores

exists

boolean exists(org.alfresco.service.cmr.repository.StoreRef storeRef)
Find out if a store exists or not

Parameters:
storeRef - the store
Returns:
Returns true if the store exists otherwise false

newStore

org.alfresco.util.Pair newStore(org.alfresco.service.cmr.repository.StoreRef storeRef)
Creates a unique store for the given protocol and identifier combination. The root node is created with the "root" aspect.

Returns:
Returns the root node, which is added automatically.
Throws:
org.alfresco.service.cmr.repository.StoreExistsException - if the store already exists

moveStore

void moveStore(org.alfresco.service.cmr.repository.StoreRef oldStoreRef,
               org.alfresco.service.cmr.repository.StoreRef newStoreRef)
Changes the old store reference to the new store reference.

Parameters:
oldStoreRef - the existing store
newStoreRef - the new store

getRootNode

org.alfresco.util.Pair getRootNode(org.alfresco.service.cmr.repository.StoreRef storeRef)

getAllRootNodes

java.util.Set getAllRootNodes(org.alfresco.service.cmr.repository.StoreRef storeRef)

exists

boolean exists(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Find out if a node exists. Unpurged deleted nodes do not count as they are the DAO's concern only.

Parameters:
nodeRef - the potentially valid node reference
Returns:
Returns true if the node is present and undeleted

exists

boolean exists(java.lang.Long nodeId)

isInCurrentTxn

boolean isInCurrentTxn(java.lang.Long nodeId)
Returns:
Returns true if the node was last modified in the current transaction, otherwise false.
Throws:
org.alfresco.service.cmr.repository.InvalidNodeRefException - if there is no record of the node, past or present

getNodeRefStatus

org.alfresco.service.cmr.repository.NodeRef.Status getNodeRefStatus(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get the current status of the node, including deleted nodes.

Parameters:
nodeRef - the node reference
Returns:
Returns the current status of the reference. This will only be null if the node never existed or has been purged following deletion.

getNodePair

org.alfresco.util.Pair getNodePair(org.alfresco.service.cmr.repository.NodeRef nodeRef)

getNodePair

org.alfresco.util.Pair getNodePair(java.lang.Long nodeId)

getNodeType

org.alfresco.service.namespace.QName getNodeType(java.lang.Long nodeId)

getNodeAclId

java.lang.Long getNodeAclId(java.lang.Long nodeId)

newNode

ChildAssocEntity newNode(java.lang.Long parentNodeId,
                         org.alfresco.service.namespace.QName assocTypeQName,
                         org.alfresco.service.namespace.QName assocQName,
                         org.alfresco.service.cmr.repository.StoreRef storeRef,
                         java.lang.String uuid,
                         org.alfresco.service.namespace.QName nodeTypeQName,
                         java.util.Locale nodeLocale,
                         java.lang.String childNodeName,
                         java.util.Map auditableProperties)
                         throws org.alfresco.service.cmr.dictionary.InvalidTypeException
Create a new node. Note that allowing the uuid to be assigned by passing in a null is more efficient.

Parameters:
parentNodeId - the ID of the parent node (may not be null)
assocTypeQName - the primary association (may not be null)
assocQName - the association path (may not be null)
storeRef - the store to which the node must belong
uuid - the node store-unique identifier, or null to assign a GUID
nodeTypeQName - the type of the node
childNodeName - the cm:name of the child node or null to use the node's UUID
auditableProperties - a map containing any cm:auditable properties for the node
Returns:
Returns the details of the child association created
Throws:
org.alfresco.service.cmr.dictionary.InvalidTypeException - if the node type is invalid or if the node type is not a valid real node
NodeExistsException - if the target reference is already taken by a live node

moveNode

org.alfresco.util.Pair moveNode(java.lang.Long childNodeId,
                                java.lang.Long newParentNodeId,
                                org.alfresco.service.namespace.QName assocTypeQName,
                                org.alfresco.service.namespace.QName assocQName)
Update a node's primary association, giving it a new parent and new association parameters.

**NEW**: If the parent node's store differs from the child node's store, then a new child node's is created.

Parameters:
childNodeId - the child node that is moving
newParentNodeId - the new parent node (may not be null)
assocTypeQName - the new association type or null to keep the existing type
assocQName - the new association qname or null to keep the existing name
Returns:
Returns the (first) new association reference and new child reference (second)
Throws:
NodeExistsException - if the target UUID of the move (in case of a store move) already exists

updateNode

boolean updateNode(java.lang.Long nodeId,
                   org.alfresco.service.namespace.QName nodeTypeQName,
                   java.util.Locale nodeLocale)
Parameters:
nodeTypeQName - the new type QName for the node or null to keep the existing one
nodeLocale - the new locale for the node or null to keep the existing one
Returns:
true if any changes were made

setNodeAclId

void setNodeAclId(java.lang.Long nodeId,
                  java.lang.Long aclId)

setPrimaryChildrenSharedAclId

void setPrimaryChildrenSharedAclId(java.lang.Long primaryParentNodeId,
                                   java.lang.Long optionalOldSharedAlcIdInAdditionToNull,
                                   java.lang.Long newSharedAclId)

deleteNode

void deleteNode(java.lang.Long nodeId)
Deletes the node and all entities. Note that the node entry will still exist and be associated with a live transaction.


purgeNodes

int purgeNodes(long maxTxnCommitTimeMs)
Purge deleted nodes where their participating transactions are older than a given time.

Parameters:
maxTxnCommitTimeMs - ignore transactions created after this time
Returns:
Returns the number of deleted nodes purged

getNodeProperty

java.io.Serializable getNodeProperty(java.lang.Long nodeId,
                                     org.alfresco.service.namespace.QName propertyQName)

getNodeProperties

java.util.Map getNodeProperties(java.lang.Long nodeId)

setNodeProperties

boolean setNodeProperties(java.lang.Long nodeId,
                          java.util.Map properties)

addNodeProperty

boolean addNodeProperty(java.lang.Long nodeId,
                        org.alfresco.service.namespace.QName qname,
                        java.io.Serializable value)

addNodeProperties

boolean addNodeProperties(java.lang.Long nodeId,
                          java.util.Map properties)

removeNodeProperties

boolean removeNodeProperties(java.lang.Long nodeId,
                             java.util.Set propertyQNames)

setModifiedDate

boolean setModifiedDate(java.lang.Long nodeId,
                        java.util.Date date)
Pull the cm:modified up to the current time without changing any other cm:auditable properties. The change may be done in the current transaction or in a later transaction.

Parameters:
nodeId - the node to change
modifiedDate - the date to set for cm:modified
Returns:
Returns true if the cm:modified property was actually set

getNodeAspects

java.util.Set getNodeAspects(java.lang.Long nodeId)

hasNodeAspect

boolean hasNodeAspect(java.lang.Long nodeId,
                      org.alfresco.service.namespace.QName aspectQName)

addNodeAspects

boolean addNodeAspects(java.lang.Long nodeId,
                       java.util.Set aspectQNames)

removeNodeAspects

boolean removeNodeAspects(java.lang.Long nodeId)

removeNodeAspects

boolean removeNodeAspects(java.lang.Long nodeId,
                          java.util.Set aspectQNames)

getNodesWithAspects

void getNodesWithAspects(java.util.Set aspectQNames,
                         java.lang.Long minNodeId,
                         java.lang.Long maxNodeId,
                         NodeDAO.NodeRefQueryCallback resultsCallback)
Get nodes with aspects between the given ranges

Parameters:
aspectQNames - the aspects that must be on the nodes
minNodeId - the minimum node ID (inclusive)
maxNodeId - the maximum node ID (exclusive)
resultsCallback - callback to process results

newNodeAssoc

java.lang.Long newNodeAssoc(java.lang.Long sourceNodeId,
                            java.lang.Long targetNodeId,
                            org.alfresco.service.namespace.QName assocTypeQName,
                            int assocIndex)
Create a new association

Parameters:
sourceNodeId - the association source
targetNodeId - the association target
assocTypeQName - the type of the association (will be resolved to an ID)
assocIndex - the index of the new association (-1 indicates next value)

setNodeAssocIndex

void setNodeAssocIndex(java.lang.Long id,
                       int assocIndex)
Update an existing assoc's index.

Parameters:
id - the association ID
assocIndex - the new index (greater than 0)

removeNodeAssoc

int removeNodeAssoc(java.lang.Long sourceNodeId,
                    java.lang.Long targetNodeId,
                    org.alfresco.service.namespace.QName assocTypeQName)
Remove a specific node association

Parameters:
assocId - the node association ID to remove
Returns:
Returns the number of associations removed

removeNodeAssocsToAndFrom

int removeNodeAssocsToAndFrom(java.lang.Long nodeId)
Remove all node associations that share the given node.

Parameters:
nodeId - the source or target of the associations
Returns:
Returns the number of associations removed

removeNodeAssocsToAndFrom

int removeNodeAssocsToAndFrom(java.lang.Long nodeId,
                              java.util.Set assocTypeQNames)
Remove all node associations of given types that share the given node.

Parameters:
nodeId - the source or target of the associations
assocTypeQNames - the types that should be deleted
Returns:
Returns the number of associations removed

removeNodeAssocs

int removeNodeAssocs(java.util.List ids)
Remove all node associations of given IDs

Parameters:
ids - the IDs of the associations to remove
Returns:
Returns the number of associations removed

getSourceNodeAssocs

java.util.Collection getSourceNodeAssocs(java.lang.Long targetNodeId,
                                         org.alfresco.service.namespace.QName typeQName)
Parameters:
targetNodeId - the target of the association
typeQName - the type of the association (optional)
Returns:
Returns all the node associations where the node is the target

getTargetNodeAssocs

java.util.Collection getTargetNodeAssocs(java.lang.Long sourceNodeId,
                                         org.alfresco.service.namespace.QName typeQName)
Parameters:
sourceNodeId - the source of the association
typeQName - the type of the association (optional)
Returns:
Returns all the node associations where the node is the source

getNodeAssocOrNull

org.alfresco.util.Pair getNodeAssocOrNull(java.lang.Long assocId)
Returns:
Returns a specific node association with the given ID or null if it doesn't exist

getNodeAssoc

org.alfresco.util.Pair getNodeAssoc(java.lang.Long assocId)
Returns:
Returns a specific node association with the given ID
Throws:
org.springframework.dao.ConcurrencyFailureException - if the association ID is invalid

newChildAssoc

org.alfresco.util.Pair newChildAssoc(java.lang.Long parentNodeId,
                                     java.lang.Long childNodeId,
                                     org.alfresco.service.namespace.QName assocTypeQName,
                                     org.alfresco.service.namespace.QName assocQName,
                                     java.lang.String childNodeName)
Create a new child association. The unique enforcement for cm:name will be done as part of the association creation i.e. there is no need to update it after the fact.

Parameters:
childNodeName - the cm:name to apply to the association
Returns:
Returns the persisted and filled association's ID

deleteChildAssoc

void deleteChildAssoc(java.lang.Long assocId)
Parameters:
assocId - the ID of the child association to delete

setChildAssocIndex

int setChildAssocIndex(java.lang.Long parentNodeId,
                       java.lang.Long childNodeId,
                       org.alfresco.service.namespace.QName assocTypeQName,
                       org.alfresco.service.namespace.QName assocQName,
                       int index)
Sets the association index ordering.

Parameters:
parentNodeId - the parent node ID
childNodeId - the child node ID
assocTypeQName - the association type
assocQName - the association path qualified name
newIndex - the new index
Returns:
Returns the number of associations modified

setChildAssocsUniqueName

void setChildAssocsUniqueName(java.lang.Long childNodeId,
                              java.lang.String childName)
Bulk-update all unique name (cm:name) index for parent associations of a given node.

Parameters:
childNodeId - the child node who's name is changing
childName - the new cm:name value

getChildAssoc

org.alfresco.util.Pair getChildAssoc(java.lang.Long assocId)
Get a specific association

Parameters:
assocId - the ID of the association
Returns:
Returns the association reference or null if it doesn't exist

getChildAssoc

org.alfresco.util.Pair getChildAssoc(java.lang.Long parentNodeId,
                                     java.lang.Long childNodeId,
                                     org.alfresco.service.namespace.QName assocTypeQName,
                                     org.alfresco.service.namespace.QName assocQName)
Get a specific child association given all the determining data.

The implementation may find multiple entries (there is no constraint to prevent it) although the cm:name constraint will normally prevent the association from being created twice. The lowest ID association will always be returned and the others will be cleaned up if the transaction is read-write.

Returns:
Returns a matching association or null if one was not found.

getChildAssocs

void getChildAssocs(java.lang.Long parentNodeId,
                    java.lang.Long childNodeId,
                    org.alfresco.service.namespace.QName assocTypeQName,
                    org.alfresco.service.namespace.QName assocQName,
                    java.lang.Boolean isPrimary,
                    java.lang.Boolean sameStore,
                    NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Get the child associations of a given parent node, optionally filtering on association QName and association type QName.

This is an efficient query for node paths.

Parameters:
parentNodeId - the parent node ID
childNodeId - the child node ID to filter on; null for no filtering
assocTypeQName - the association type qname to filter on; null for no filtering
assocQName - the association qname to filter on; null for no filtering
isPrimary - filter for primary (true) or secondary associations; null for no filtering.
sameStore - null to ignore, true to only get children that are in the same store as the parent, or false to only get children that are in a different store from the parent.
resultsCallback - the callback that will be called with the results

getChildAssocs

java.util.List getChildAssocs(java.lang.Long parentNodeId,
                              org.alfresco.service.namespace.QName assocTypeQName,
                              org.alfresco.service.namespace.QName assocQName,
                              int maxResults,
                              boolean preload)
Gets the first n child associations of a given parent node, optionally filtering on association QName and association type QName.

This is an efficient query for node paths.

Parameters:
parentNodeId - the parent node ID
assocTypeQName - the association type qname to filter on; null for no filtering
assocQName - the association qname to filter on; null for no filtering
maxResults - the maximum number of results to return. The query will be terminated efficiently after that number of results
preload - should the child nodes be batch loaded?
Returns:
a list of child associations

getChildAssocs

void getChildAssocs(java.lang.Long parentNodeId,
                    java.util.Set assocTypeQNames,
                    NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Get the child associations of a given parent node, optionally filtering on type QName.

Parameters:
parentNodeId - the parent node ID
assocTypeQNames - the association type qnames to filter on; null for no filtering
resultsCallback - the callback that will be called with the results

getChildAssoc

org.alfresco.util.Pair getChildAssoc(java.lang.Long parentNodeId,
                                     org.alfresco.service.namespace.QName assocTypeQName,
                                     java.lang.String childName)
Get a child association for given parent node, association type and child node name (cm:name).

Parameters:
parentNodeId - the parent Node ID
assocTypeQName - the association type to filter on
childName - the cm:name value to filter on
Returns:
Returns an association matching the given parent, type and child name (cm:name) - or null if not found

getChildAssocs

void getChildAssocs(java.lang.Long parentNodeId,
                    org.alfresco.service.namespace.QName assocTypeQName,
                    java.util.Collection childNames,
                    NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Get the child associations of a given parent node, filtering on type QName and the cm:name of the child nodes.

NOTE: This method only works if the association type fundamentally supports unique-name enforcement.

Parameters:
parentNodeId - the parent node
assocTypeQName - the type of the association to check; or null for no filtering. If the association type is not specified, then the same child node may be included several times.
childNames - the names of the child nodes (cm:name). These will be matched exactly.
resultsCallback - the callback that will be called with the results

getChildAssocsByChildTypes

void getChildAssocsByChildTypes(java.lang.Long parentNodeId,
                                java.util.Set childNodeTypeQNames,
                                NodeDAO.ChildAssocRefQueryCallback resultsCallback)

getChildAssocsWithoutParentAssocsOfType

void getChildAssocsWithoutParentAssocsOfType(java.lang.Long parentNodeId,
                                             org.alfresco.service.namespace.QName assocTypeQName,
                                             NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Gets the set of child associations of a certain parent node without parent associations of a certain type to other nodes with the same parent! In effect the 'orphans' with respect to a certain association type.

Parameters:
parentNodeId - the parent node ID
assocTypeQName - the association type QName
resultsCallback - the callback that will be called with the results

getPrimaryParentAssoc

org.alfresco.util.Pair getPrimaryParentAssoc(java.lang.Long childNodeId)
Finds the association between the node's primary parent and the node itself

Returns:
Returns the primary (defining) association or null if it is a root node

getParentAssocs

void getParentAssocs(java.lang.Long childNodeId,
                     org.alfresco.service.namespace.QName assocTypeQName,
                     org.alfresco.service.namespace.QName assocQName,
                     java.lang.Boolean isPrimary,
                     NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Get the parent association of a given parent node, optionally filtering on association QName and association type QName.

This is an efficient query for node paths.

Parameters:
childNodeId - the child node ID
assocTypeQName - the association type qname to filter on; null for no filtering
assocQName - the association qname to filter on; null for no filtering
isPrimary - filter for primary (true) or secondary associations; null for no filtering.
resultsCallback - the callback that will be called with the results

getPrimaryChildrenAcls

java.util.List getPrimaryChildrenAcls(java.lang.Long nodeId)
Fetch all primary child node IDs and corresponding ACL IDs.

Parameters:
nodeId - the parent node ID
Returns:
Returns a list of Node ID - ACL ID pairs

getPaths

java.util.List getPaths(org.alfresco.util.Pair nodePair,
                        boolean primaryOnly)
                        throws org.alfresco.service.cmr.repository.InvalidNodeRefException
Build the paths for a node. When searching for primaryOnly == true, checks that there is exactly one path.

Parameters:
currentNodePair - the leave or child node to start with
primaryOnly - true to follow only primary parent associations
Throws:
org.alfresco.service.cmr.repository.InvalidNodeRefException

cycleCheck

void cycleCheck(org.alfresco.util.Pair nodePair)
Potentially cheaper than evaluating all of a node's paths to check for child association cycles.

Parameters:
nodePair - the node to check

getMaxTxnIdByCommitTime

java.lang.Long getMaxTxnIdByCommitTime(long maxCommitTime)
Retrieves the maximum transaction ID for which the commit time is less than the given time.

Parameters:
maxCommitTime - the max commit time (ms)
Returns:
the last transaction on or before the given time

getTxnById

Transaction getTxnById(java.lang.Long txnId)
Retrieves a specific transaction.

Parameters:
txnId - the unique transaction ID.
Returns:
the requested transaction or null

getTxnsByCommitTimeAscending

java.util.List getTxnsByCommitTimeAscending(java.lang.Long fromTimeInclusive,
                                            java.lang.Long toTimeExclusive,
                                            int count,
                                            java.util.List excludeTxnIds,
                                            boolean remoteOnly)
Get all transactions in a given time range. Since time-based retrieval doesn't guarantee uniqueness for any given millisecond, a list of optional exclusions may be provided.

Parameters:
excludeTxnIds - a list of txn IDs to ignore. null is allowed.
remoteOnly - true if locally-written transactions must be ignored

getTxnsByCommitTimeDescending

java.util.List getTxnsByCommitTimeDescending(java.lang.Long fromTimeInclusive,
                                             java.lang.Long toTimeExclusive,
                                             int count,
                                             java.util.List excludeTxnIds,
                                             boolean remoteOnly)
Get all transactions in a given time range. Since time-based retrieval doesn't guarantee uniqueness for any given millisecond, a list of optional exclusions may be provided.

Parameters:
excludeTxnIds - a list of txn IDs to ignore. null is allowed.
remoteOnly - true if locally-written transactions must be ignored

getTxnsByCommitTimeAscending

java.util.List getTxnsByCommitTimeAscending(java.util.List includeTxnIds)
Get a specific list of transactions ordered by commit time.

Parameters:
includeTxnIds - a list of transaction IDs to search for
Returns:
Returns the transactions by commit time for the given IDs

getTxnUpdateCount

int getTxnUpdateCount(java.lang.Long txnId)

getTxnDeleteCount

int getTxnDeleteCount(java.lang.Long txnId)

getTransactionCount

int getTransactionCount()

getTxnChangesForStore

java.util.List getTxnChangesForStore(org.alfresco.service.cmr.repository.StoreRef storeRef,
                                     java.lang.Long txnId)
Returns:
Returns the node statuses for a transaction, limited to the store

getTxnChanges

java.util.List getTxnChanges(java.lang.Long txnId)
Returns:
Returns the node statuses for a transaction, regardless of store

getTxnsUnused

java.util.List getTxnsUnused(java.lang.Long minTxnId,
                             long maxCommitTime,
                             int count)

purgeTxn

void purgeTxn(java.lang.Long txnId)

getMinTxnCommitTime

java.lang.Long getMinTxnCommitTime()
Returns:
Returns the minimum commit time or null if there are no transactions

getMaxTxnCommitTime

java.lang.Long getMaxTxnCommitTime()
Returns:
Returns the maximum commit time or null if there are no transactions

getChildAssocsByPropertyValue

void getChildAssocsByPropertyValue(java.lang.Long parentNodeId,
                                   org.alfresco.service.namespace.QName propertyQName,
                                   java.io.Serializable nodeValue,
                                   NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Parameters:
parentNodeId -
childNodeTypeQNames -
value -
resultsCallback -

setNodeDefiningAclId

void setNodeDefiningAclId(java.lang.Long nodeId,
                          long id)
Used in ACL upgrade only to set the acl id with mimimal overhead

Parameters:
nodeId -
id -

selectProperties

java.util.List selectProperties(java.util.Collection propertyDefs)
Used by the re-encryptor to re-encrypt encryptable properties with a new encryption key.

Parameters:
propertyDefs -
Returns:


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