org.alfresco.repo.domain.node
Interface NodeDAO

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

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 deleteChildAssoc(java.lang.Long assocId)
           
 void deleteNode(java.lang.Long nodeId)
          Deletes the node and all entities.
 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
 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.
 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 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 getNodesWithAspect(org.alfresco.service.namespace.QName aspectQName, java.lang.Long minNodeId, int count, NodeDAO.NodeRefQueryCallback resultsCallback)
           
 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)
           
 java.util.List getStores()
          Fetch a list of all stores in the repository
 java.util.Collection getTargetNodeAssocs(java.lang.Long sourceNodeId)
           
 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)
           
 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.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)
           
 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 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)
           
 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.
 void setNodeAclId(java.lang.Long nodeId, java.lang.Long aclId)
           
 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)
           
 void updateNode(java.lang.Long nodeId, org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String uuid, org.alfresco.service.namespace.QName nodeTypeQName)
           
 
Methods inherited from interface org.alfresco.repo.node.NodeBulkLoader
cacheNodes, clear
 

Method Detail

getCurrentTransactionId

java.lang.Long getCurrentTransactionId()
Returns:
Returns the ID of the current transaction entry

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)

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

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.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

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 the child node's store is updated. Store move conflicts are automatically handled by assigning new UUIDs to the existing target node.

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 new association reference

updateNode

void updateNode(java.lang.Long nodeId,
                org.alfresco.service.cmr.repository.StoreRef storeRef,
                java.lang.String uuid,
                org.alfresco.service.namespace.QName nodeTypeQName)
Parameters:
storeRef - the new store or null to keep the existing one
uuid - the new UUID for the node or null to keep it the same
nodeTypeQName - the new type QName for the node or null to keep the existing one

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)

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)

getNodesWithAspect

void getNodesWithAspect(org.alfresco.service.namespace.QName aspectQName,
                        java.lang.Long minNodeId,
                        int count,
                        NodeDAO.NodeRefQueryCallback resultsCallback)

newNodeAssoc

java.lang.Long newNodeAssoc(java.lang.Long sourceNodeId,
                            java.lang.Long targetNodeId,
                            org.alfresco.service.namespace.QName assocTypeQName)

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

getSourceNodeAssocs

java.util.Collection getSourceNodeAssocs(java.lang.Long targetNodeId)
Returns:
Returns all the node associations where the node is the target

getTargetNodeAssocs

java.util.Collection getTargetNodeAssocs(java.lang.Long sourceNodeId)
Returns:
Returns all the node associations where the node is the source

getNodeAssoc

org.alfresco.util.Pair getNodeAssoc(java.lang.Long assocId)
Returns:
Returns a specific node association with the given ID
Throws:
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

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

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 -


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