public abstract class AbstractNodeDAOImpl extends Object implements NodeDAO, BatchingDAO
This provides basic services such as caching, but defers to the underlying implementation for CRUD operations.
NodeDAO.ChildAssocRefQueryCallback, NodeDAO.NodeRefQueryCallback, NodeDAO.NodeView| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isDebugEnabled |
protected org.apache.commons.logging.Log |
logger |
static Long |
LONG_ZERO |
| Constructor and Description |
|---|
AbstractNodeDAOImpl()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addNodeAspects(Long nodeId,
Set<org.alfresco.service.namespace.QName> aspectQNames) |
boolean |
addNodeProperties(Long nodeId,
Map<org.alfresco.service.namespace.QName,Serializable> properties) |
boolean |
addNodeProperty(Long nodeId,
org.alfresco.service.namespace.QName qname,
Serializable value) |
void |
cacheNodes(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs)
Pre-cache data relevant to the given nodes.
|
void |
cacheNodesById(List<Long> nodeIds)
Pre-cache data relevant to the given nodes.
|
void |
clear()
FOR TESTING ONLY: Clears out node cache data
|
void |
cycleCheck(Long nodeId)
Potentially cheaper than evaluating all of a node's paths to check for child association cycles
TODO: When is it cheaper to go up and when is it cheaper to go down?
Look at using direct queries to pass through layers both up and down.
|
void |
deleteChildAssoc(Long assocId) |
protected abstract int |
deleteChildAssocs(List<Long> ids) |
void |
deleteNode(Long nodeId)
Deletes the node and all entities.
|
protected abstract int |
deleteNodeAspects(Long nodeId,
Set<Long> qnameIds) |
protected abstract int |
deleteNodeAssoc(Long sourceNodeId,
Long targetNodeId,
Long assocTypeQNameId) |
protected abstract int |
deleteNodeAssocs(List<Long> ids) |
protected abstract int |
deleteNodeById(Long nodeId) |
protected abstract int |
deleteNodeProperties(Long nodeId,
List<NodePropertyKey> propKeys) |
protected abstract int |
deleteNodeProperties(Long nodeId,
Set<Long> qnameIds) |
protected abstract int |
deleteNodesByCommitTime(long fromTxnCommitTimeMs,
long toTxnCommitTimeMs) |
protected abstract void |
deleteSubscriptions(Long nodeId) |
protected abstract int |
deleteTransaction(Long txnId) |
boolean |
exists(Long nodeId)
Find out if a node exists.
|
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
|
Set<org.alfresco.service.cmr.repository.NodeRef> |
getAllRootNodes(org.alfresco.service.cmr.repository.StoreRef storeRef) |
Set<Long> |
getCachedAncestors(List<Long> nodeIds)
Gets the current set of cached ancestors of the given list of nodes.
|
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ChildAssociationRef> |
getChildAssoc(Long assocId)
Get a specific association
|
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ChildAssociationRef> |
getChildAssoc(Long parentNodeId,
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<Long,org.alfresco.service.cmr.repository.ChildAssociationRef> |
getChildAssoc(Long parentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
String childName)
Checks a cache and then queries.
|
void |
getChildAssocs(Long parentNodeId,
Long childNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
Boolean isPrimary,
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(Long parentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
Collection<String> 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(Long parentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
int maxResults,
NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Gets the first n child associations of a given parent node, optionally filtering on association QName
and association type QName.
|
void |
getChildAssocs(Long parentNodeId,
Set<org.alfresco.service.namespace.QName> assocTypeQNames,
NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Get the child associations of a given parent node, optionally filtering on type QName.
|
void |
getChildAssocsByChildTypes(Long parentNodeId,
Set<org.alfresco.service.namespace.QName> childNodeTypeQNames,
NodeDAO.ChildAssocRefQueryCallback resultsCallback) |
void |
getChildAssocsByPropertyValue(Long parentNodeId,
org.alfresco.service.namespace.QName propertyQName,
Serializable value,
NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Select children by property values
|
void |
getChildAssocsWithoutParentAssocsOfType(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.
|
Long |
getCurrentTransactionId(boolean ensureNew) |
Long |
getMaxTxnCommitTime() |
Long |
getMaxTxnId() |
Long |
getMaxTxnIdByCommitTime(long maxCommitTime)
Retrieves the maximum transaction ID for which the commit time is less than the given time.
|
Long |
getMinTxnCommitTime() |
Long |
getMinTxnCommitTimeForDeletedNodes() |
Long |
getMinTxnId() |
Long |
getMinUnusedTxnCommitTime() |
Long |
getNodeAclId(Long nodeId) |
Set<org.alfresco.service.namespace.QName> |
getNodeAspects(Long nodeId) |
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef> |
getNodeAssoc(Long assocId) |
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef> |
getNodeAssocOrNull(Long assocId) |
Collection<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef>> |
getNodeAssocsToAndFrom(Long nodeId) |
org.alfresco.service.cmr.repository.NodeRef.Status |
getNodeIdStatus(Long nodeId)
Get the current status of the node, including deleted nodes.
|
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> |
getNodePair(Long nodeId) |
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> |
getNodePair(org.alfresco.service.cmr.repository.NodeRef nodeRef) |
Map<org.alfresco.service.namespace.QName,Serializable> |
getNodeProperties(Long nodeId) |
Serializable |
getNodeProperty(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(Set<org.alfresco.service.namespace.QName> aspectQNames,
Long minNodeId,
Long maxNodeId,
NodeDAO.NodeRefQueryCallback resultsCallback)
Get nodes with aspects between the given ranges
|
org.alfresco.service.namespace.QName |
getNodeType(Long nodeId) |
void |
getParentAssocs(Long childNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
Boolean isPrimary,
NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Get the parent association of a given parent node, optionally filtering on association QName
and association type QName.
|
List<org.alfresco.service.cmr.repository.Path> |
getPaths(org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> nodePair,
boolean primaryOnly)
Build the paths for a node.
|
List<NodeIdAndAclId> |
getPrimaryChildrenAcls(Long nodeId)
Fetch all primary child node IDs and corresponding ACL IDs.
|
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ChildAssociationRef> |
getPrimaryParentAssoc(Long childNodeId)
Finds the association between the node's primary parent and the node itself
|
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> |
getRootNode(org.alfresco.service.cmr.repository.StoreRef storeRef) |
protected Long |
getServerId()
Get the ID of the current server, or null if there is no ID for the current
server and one can't be created.
|
Collection<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef>> |
getSourceNodeAssocs(Long targetNodeId,
org.alfresco.service.namespace.QName typeQName) |
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.StoreRef> |
getStore(org.alfresco.service.cmr.repository.StoreRef storeRef)
Get the ID-ref pair for a store
|
List<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.StoreRef>> |
getStores()
Fetch a list of all stores in the repository
|
Collection<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef>> |
getTargetAssocsByPropertyValue(Long sourceNodeId,
org.alfresco.service.namespace.QName typeQName,
org.alfresco.service.namespace.QName propertyQName,
Serializable propertyValue)
Get target associations by type of the association, property name and value.
|
Collection<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef>> |
getTargetNodeAssocs(Long sourceNodeId,
org.alfresco.service.namespace.QName typeQName) |
int |
getTransactionCount() |
Transaction |
getTxnById(Long txnId)
Retrieves a specific transaction.
|
List<org.alfresco.service.cmr.repository.NodeRef.Status> |
getTxnChanges(Long txnId) |
List<org.alfresco.service.cmr.repository.NodeRef.Status> |
getTxnChangesForStore(org.alfresco.service.cmr.repository.StoreRef storeRef,
Long txnId) |
List<Transaction> |
getTxnsByCommitTimeAscending(List<Long> includeTxnIds)
Get a specific list of transactions ordered by commit time.
|
List<Transaction> |
getTxnsByCommitTimeAscending(Long fromTimeInclusive,
Long toTimeExclusive,
int count,
List<Long> excludeTxnIds,
boolean remoteOnly)
Get all transactions in a given time range.
|
List<Transaction> |
getTxnsByCommitTimeDescending(Long fromTimeInclusive,
Long toTimeExclusive,
int count,
List<Long> excludeTxnIds,
boolean remoteOnly)
Get all transactions in a given time range.
|
List<Long> |
getTxnsUnused(Long minTxnId,
long maxCommitTime,
int count) |
boolean |
hasNodeAspect(Long nodeId,
org.alfresco.service.namespace.QName aspectQName) |
void |
init() |
protected abstract Long |
insertChildAssoc(ChildAssocEntity assoc) |
protected abstract Long |
insertNode(NodeEntity node) |
protected abstract void |
insertNodeAspect(Long nodeId,
Long qnameId) |
protected abstract Long |
insertNodeAssoc(Long sourceNodeId,
Long targetNodeId,
Long assocTypeQNameId,
int assocIndex) |
protected abstract void |
insertNodeProperties(Long nodeId,
Map<NodePropertyKey,NodePropertyValue> persistableProps) |
protected abstract Long |
insertServer(String ipAddress) |
protected abstract Long |
insertStore(StoreEntity store) |
protected abstract Long |
insertTransaction(Long serverId,
String changeTxnId,
Long commit_time_ms) |
boolean |
isInCurrentTxn(Long nodeId) |
org.alfresco.util.Pair<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ChildAssociationRef>,org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef>> |
moveNode(Long childNodeId,
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.
|
protected abstract void |
moveNodeData(Long fromNodeId,
Long toNodeId)
Moves all node-linked data from one node to another.
|
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<Long,org.alfresco.service.cmr.repository.ChildAssociationRef> |
newChildAssoc(Long parentNodeId,
Long childNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
String childNodeName)
Create a new child association.
|
protected Long |
newChildAssocInsert(ChildAssocEntity assoc,
org.alfresco.service.namespace.QName assocTypeQName,
String childNodeName) |
protected Long |
newChildAssocInsertImpl(ChildAssocEntity assoc,
org.alfresco.service.namespace.QName assocTypeQName,
String childNodeName) |
ChildAssocEntity |
newNode(Long parentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
org.alfresco.service.cmr.repository.StoreRef storeRef,
String uuid,
org.alfresco.service.namespace.QName nodeTypeQName,
Locale nodeLocale,
String childNodeName,
Map<org.alfresco.service.namespace.QName,Serializable> auditableProperties)
Create a new node.
|
Long |
newNodeAssoc(Long sourceNodeId,
Long targetNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
int assocIndex)
Create a new association
|
protected Long |
newNodeImplInsert(NodeEntity node) |
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> |
newStore(org.alfresco.service.cmr.repository.StoreRef storeRef)
Creates a unique store for the given protocol and identifier combination.
|
int |
purgeNodes(long fromTxnCommitTimeMs,
long toTxnCommitTimeMs)
Purge deleted nodes where their participating transactions are in-between the given time interval.
|
void |
purgeTxn(Long txnId) |
boolean |
removeNodeAspects(Long nodeId) |
boolean |
removeNodeAspects(Long nodeId,
Set<org.alfresco.service.namespace.QName> aspectQNames) |
int |
removeNodeAssoc(Long sourceNodeId,
Long targetNodeId,
org.alfresco.service.namespace.QName assocTypeQName)
Remove a specific node association
|
int |
removeNodeAssocs(List<Long> ids)
Remove all node associations of given IDs
|
boolean |
removeNodeProperties(Long nodeId,
Set<org.alfresco.service.namespace.QName> propertyQNames) |
protected abstract List<StoreEntity> |
selectAllStores() |
protected abstract ChildAssocEntity |
selectChildAssoc(Long assocId) |
protected abstract List<ChildAssocEntity> |
selectChildAssoc(Long parentNodeId,
Long childNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName) |
protected abstract ChildAssocEntity |
selectChildAssoc(Long parentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
String childName) |
protected abstract void |
selectChildAssocs(Long parentNodeId,
Long childNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
Boolean isPrimary,
Boolean sameStore,
NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Parameters are all optional except the parent node ID and the callback
|
protected abstract void |
selectChildAssocs(Long parentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
Collection<String> childNames,
NodeDAO.ChildAssocRefQueryCallback resultsCallback) |
protected abstract void |
selectChildAssocs(Long parentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
int maxResults,
NodeDAO.ChildAssocRefQueryCallback resultsCallback) |
protected abstract void |
selectChildAssocs(Long parentNodeId,
Set<org.alfresco.service.namespace.QName> assocTypeQNames,
NodeDAO.ChildAssocRefQueryCallback resultsCallback) |
protected abstract void |
selectChildAssocsByChildTypes(Long parentNodeId,
Set<org.alfresco.service.namespace.QName> childNodeTypeQNames,
NodeDAO.ChildAssocRefQueryCallback resultsCallback) |
protected abstract void |
selectChildAssocsByPropertyValue(Long parentNodeId,
org.alfresco.service.namespace.QName propertyQName,
NodePropertyValue nodeValue,
NodeDAO.ChildAssocRefQueryCallback resultsCallback) |
protected abstract void |
selectChildAssocsWithoutParentAssocsOfType(Long parentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
NodeDAO.ChildAssocRefQueryCallback resultsCallback) |
protected abstract List<ChildAssocEntity> |
selectChildNodeIds(Long nodeId,
Boolean isPrimary,
Long minAssocIdInclusive,
int maxResults) |
protected abstract Transaction |
selectLastTxnBeforeCommitTime(Long maxCommitTime) |
protected abstract Long |
selectMaxTxnCommitTime() |
protected abstract Long |
selectMaxTxnId() |
protected abstract Long |
selectMinTxnCommitTime() |
protected abstract Long |
selectMinTxnCommitTimeForDeletedNodes() |
protected abstract Long |
selectMinTxnId() |
protected abstract Long |
selectMinUnusedTxnCommitTime() |
protected abstract Map<NodeVersionKey,Set<org.alfresco.service.namespace.QName>> |
selectNodeAspects(Set<Long> nodeIds) |
protected abstract NodeAssocEntity |
selectNodeAssocById(Long assocId) |
protected abstract int |
selectNodeAssocMaxIndex(Long sourceNodeId,
Long assocTypeQNameId) |
protected abstract List<NodeAssocEntity> |
selectNodeAssocs(Long nodeId) |
protected abstract List<NodeAssocEntity> |
selectNodeAssocsBySource(Long sourceNodeId,
Long typeQNameId) |
protected abstract List<NodeAssocEntity> |
selectNodeAssocsBySourceAndPropertyValue(Long sourceNodeId,
Long typeQNameId,
Long propertyQNameId,
NodePropertyValue nodeValue) |
protected abstract List<NodeAssocEntity> |
selectNodeAssocsByTarget(Long targetNodeId,
Long typeQNameId) |
protected abstract NodeEntity |
selectNodeById(Long id) |
protected abstract NodeEntity |
selectNodeByNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef) |
protected abstract Map<NodeVersionKey,Map<NodePropertyKey,NodePropertyValue>> |
selectNodeProperties(Long nodeId) |
protected abstract Map<NodeVersionKey,Map<NodePropertyKey,NodePropertyValue>> |
selectNodeProperties(Long nodeId,
Set<Long> qnameIds) |
protected abstract Map<NodeVersionKey,Map<NodePropertyKey,NodePropertyValue>> |
selectNodeProperties(Set<Long> nodeIds) |
protected abstract List<Node> |
selectNodesByIds(SortedSet<Long> ids) |
protected abstract List<Node> |
selectNodesByUuids(Long storeId,
SortedSet<String> uuids) |
protected abstract void |
selectNodesWithAspects(List<Long> qnameIds,
Long minNodeId,
Long maxNodeId,
NodeDAO.NodeRefQueryCallback resultsCallback) |
protected abstract List<ChildAssocEntity> |
selectParentAssocs(Long childNodeId) |
protected abstract void |
selectParentAssocs(Long childNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
Boolean isPrimary,
NodeDAO.ChildAssocRefQueryCallback resultsCallback)
Parameters are all optional except the parent node ID and the callback
|
protected abstract List<NodeIdAndAclId> |
selectPrimaryChildAcls(Long nodeId) |
protected abstract List<ChildAssocEntity> |
selectPrimaryParentAssocs(Long childNodeId)
No DB constraint, so multiple returned
|
protected abstract ServerEntity |
selectServer(String ipAddress) |
protected abstract StoreEntity |
selectStore(org.alfresco.service.cmr.repository.StoreRef storeRef) |
protected abstract NodeEntity |
selectStoreRootNode(org.alfresco.service.cmr.repository.StoreRef storeRef) |
protected abstract int |
selectTransactionCount() |
protected abstract Transaction |
selectTxnById(Long txnId) |
protected abstract List<NodeEntity> |
selectTxnChanges(Long txnId,
Long storeId) |
protected abstract List<Transaction> |
selectTxns(Long fromTimeInclusive,
Long toTimeExclusive,
Integer count,
List<Long> includeTxnIds,
List<Long> excludeTxnIds,
Long excludeServerId,
Boolean ascending) |
protected abstract List<Long> |
selectTxnsUnused(Long minTxnId,
Long maxCommitTime,
Integer count) |
void |
setAccessControlListDAO(AccessControlListDAO accessControlListDAO) |
void |
setAclDAO(AclDAO aclDAO) |
void |
setAllRootNodesCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.service.cmr.repository.StoreRef,Set<org.alfresco.service.cmr.repository.NodeRef>> allRootNodesCache)
Set the cache that maintains the extended Store root node data
|
void |
setAspectsCache(org.alfresco.repo.cache.SimpleCache<NodeVersionKey,Set<org.alfresco.service.namespace.QName>> aspectsCache)
Set the cache that maintains the Node QName IDs
|
void |
setCachingThreshold(int cachingThreshold) |
void |
setCheckNodeConsistency()
Transaction-scope setting to make the Node loader to guarantee the validity of all
caches: some cache data will be reloaded; some cache data will be considered safe.
|
int |
setChildAssocIndex(Long parentNodeId,
Long childNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
int index)
Sets the association index ordering.
|
void |
setChildAssocsUniqueName(Long childNodeId,
String childName)
TODO: See about pulling automatic cm:name update logic into this DAO
|
protected int |
setChildAssocsUniqueNameImpl(Long childNodeId,
String childName) |
void |
setChildByNameCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.repo.domain.node.ChildByNameKey,ChildAssocEntity> childByNameCache)
Set the cache that maintains lookups by child cm:name
|
void |
setContentDataDAO(ContentDataDAO contentDataDAO) |
void |
setControlDAO(ControlDAO controlDAO) |
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) |
void |
setLocaleDAO(LocaleDAO localeDAO) |
boolean |
setModifiedDate(Long nodeId,
Date modifiedDate)
Pull the cm:modified up to the current time without changing any other
cm:auditable properties.
|
boolean |
setModifiedProperties(Long nodeId,
Date modifiedDate,
String modifiedBy)
Pull the cm:modified up to the current time without changing any other
cm:auditable properties.
|
void |
setNodeAclId(Long nodeId,
Long aclId) |
void |
setNodeAssocIndex(Long id,
int assocIndex)
Update an existing assoc's index.
|
boolean |
setNodeProperties(Long nodeId,
Map<org.alfresco.service.namespace.QName,Serializable> properties) |
void |
setNodesCache(org.alfresco.repo.cache.SimpleCache<Serializable,Serializable> cache)
Set the cache that maintains node ID-NodeRef cross referencing data
|
void |
setParentAssocsCacheLimitFactor(int parentAssocsCacheLimitFactor)
Sets the average number of parents expected per cache entry.
|
void |
setParentAssocsCacheSize(int parentAssocsCacheSize)
Sets the maximum capacity of the parent assocs cache
|
void |
setPolicyBehaviourFilter(BehaviourFilter policyBehaviourFilter) |
void |
setPrimaryChildrenSharedAclId(Long primaryParentNodeId,
Long optionalOldSharedAlcIdInAdditionToNull,
Long newSharedAclId) |
void |
setPropertiesCache(org.alfresco.repo.cache.SimpleCache<NodeVersionKey,Map<org.alfresco.service.namespace.QName,Serializable>> propertiesCache)
Set the cache that maintains the Node property values
|
void |
setQnameDAO(QNameDAO qnameDAO) |
void |
setRootNodesCache(org.alfresco.repo.cache.SimpleCache<Serializable,Serializable> cache)
Set the cache that maintains the Store root node data
|
void |
setTransactionService(TransactionService transactionService) |
void |
setUsageDAO(UsageDAO usageDAO) |
int |
touchNodes(Long txnId,
List<Long> nodeIds)
Update the transaction associated with a lust of nodes
|
protected abstract int |
updateChildAssocIndex(Long parentNodeId,
Long childNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
int index) |
protected abstract int |
updateChildAssocUniqueName(Long assocId,
String name) |
protected int |
updateChildAssocUniqueNameImpl(Long childNodeId,
String childName) |
boolean |
updateNode(Long nodeId,
org.alfresco.service.namespace.QName nodeTypeQName,
Locale nodeLocale) |
protected abstract int |
updateNode(NodeUpdateEntity nodeUpdate) |
protected abstract int |
updateNodeAssoc(Long id,
int assocIndex) |
protected abstract int |
updateNodes(Long txnId,
List<Long> nodeIds) |
protected abstract int |
updateNodesInStore(Long txnId,
Long storeId) |
protected abstract void |
updatePrimaryChildrenSharedAclId(Long txnId,
Long primaryParentNodeId,
Long optionalOldSharedAlcIdInAdditionToNull,
Long newSharedAlcId) |
protected void |
updatePrimaryParentAssocs(ChildAssocEntity primaryParentAssoc,
Node newParentNode,
Node childNode,
Long newChildNodeId,
String childNodeName,
Long oldParentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName) |
protected abstract int |
updatePrimaryParentAssocs(Long childNodeId,
Long parentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
String childNodeName) |
protected int |
updatePrimaryParentAssocsImpl(ChildAssocEntity primaryParentAssoc,
Node newParentNode,
Node childNode,
Long newChildNodeId,
String childNodeName,
Long oldParentNodeId,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName) |
protected abstract int |
updateStore(StoreEntity store) |
protected abstract int |
updateStoreRoot(StoreEntity store) |
protected abstract int |
updateTransaction(Long txnId,
Long commit_time_ms) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcountChildAssocsByParent, deleteTxnsUnused, getMaxNodeId, getMinNodeId, getNodeIdsIntervalForType, getOneTxnsByCommitTimeDescending, selectChildAssocsWithoutNodeAssocsOfTypes, selectNodePropertiesByDataType, selectNodePropertiesByTypesexecuteBatch, startBatchprotected org.apache.commons.logging.Log logger
protected final boolean isDebugEnabled
public static final Long LONG_ZERO
public AbstractNodeDAOImpl()
public void setTransactionService(TransactionService transactionService)
transactionService - the service to start post-txn processespublic void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService - the service help determine cm:auditable characteristicspublic void setCachingThreshold(int cachingThreshold)
public void setPolicyBehaviourFilter(BehaviourFilter policyBehaviourFilter)
policyBehaviourFilter - the service to determine the behaviour for cm:auditable and
other inherent capabilities.public void setAclDAO(AclDAO aclDAO)
aclDAO - used to update permissions during certain operationspublic void setAccessControlListDAO(AccessControlListDAO accessControlListDAO)
accessControlListDAO - used to update ACL inheritance during node movespublic void setControlDAO(ControlDAO controlDAO)
controlDAO - create Savepointspublic void setQnameDAO(QNameDAO qnameDAO)
qnameDAO - translates QName IDs into QName instances and vice-versapublic void setContentDataDAO(ContentDataDAO contentDataDAO)
contentDataDAO - used to create and delete content referencespublic void setLocaleDAO(LocaleDAO localeDAO)
localeDAO - used to handle MLText propertiespublic void setUsageDAO(UsageDAO usageDAO)
usageDAO - used to keep content usage calculations in linepublic void setRootNodesCache(org.alfresco.repo.cache.SimpleCache<Serializable,Serializable> cache)
cache - the cachepublic void setAllRootNodesCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.service.cmr.repository.StoreRef,Set<org.alfresco.service.cmr.repository.NodeRef>> allRootNodesCache)
allRootNodesCache - the cachepublic void setNodesCache(org.alfresco.repo.cache.SimpleCache<Serializable,Serializable> cache)
cache - the cachepublic void setAspectsCache(org.alfresco.repo.cache.SimpleCache<NodeVersionKey,Set<org.alfresco.service.namespace.QName>> aspectsCache)
aspectsCache - the cachepublic void setPropertiesCache(org.alfresco.repo.cache.SimpleCache<NodeVersionKey,Map<org.alfresco.service.namespace.QName,Serializable>> propertiesCache)
propertiesCache - the cachepublic void setParentAssocsCacheSize(int parentAssocsCacheSize)
parentAssocsCacheSize - the cache sizepublic void setParentAssocsCacheLimitFactor(int parentAssocsCacheLimitFactor)
setParentAssocsCacheSize(int) parameter to compute a limit on the total number of cached parents, which
will be proportional to the cache's memory usage. The cache will be pruned when this limit is exceeded to avoid
excessive memory usage.parentAssocsCacheLimitFactor - the parentAssocsCacheLimitFactor to setpublic void setChildByNameCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.repo.domain.node.ChildByNameKey,ChildAssocEntity> childByNameCache)
childByNameCache - the cachepublic void init()
protected Long getServerId()
public Long getCurrentTransactionId(boolean ensureNew)
getCurrentTransactionId in interface NodeDAOensureNew - true to ensure that a new transaction entry is created
if the current transaction does not have one.public org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.StoreRef> getStore(org.alfresco.service.cmr.repository.StoreRef storeRef)
NodeDAOpublic List<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.StoreRef>> getStores()
NodeDAOpublic boolean exists(org.alfresco.service.cmr.repository.StoreRef storeRef)
NodeDAOpublic org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> getRootNode(org.alfresco.service.cmr.repository.StoreRef storeRef)
getRootNode in interface NodeDAOpublic Set<org.alfresco.service.cmr.repository.NodeRef> getAllRootNodes(org.alfresco.service.cmr.repository.StoreRef storeRef)
getAllRootNodes in interface NodeDAOpublic org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> newStore(org.alfresco.service.cmr.repository.StoreRef storeRef)
NodeDAOpublic void moveStore(org.alfresco.service.cmr.repository.StoreRef oldStoreRef,
org.alfresco.service.cmr.repository.StoreRef newStoreRef)
NodeDAOpublic boolean exists(Long nodeId)
NodeDAOpublic boolean exists(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeDAOpublic boolean isInCurrentTxn(Long nodeId)
isInCurrentTxn in interface NodeDAOpublic org.alfresco.service.cmr.repository.NodeRef.Status getNodeRefStatus(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeDAOgetNodeRefStatus in interface NodeDAOnodeRef - the node referencepublic org.alfresco.service.cmr.repository.NodeRef.Status getNodeIdStatus(Long nodeId)
NodeDAOgetNodeIdStatus in interface NodeDAOnodeId - the node idpublic org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> getNodePair(org.alfresco.service.cmr.repository.NodeRef nodeRef)
getNodePair in interface NodeDAOpublic org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> getNodePair(Long nodeId)
getNodePair in interface NodeDAOpublic org.alfresco.service.namespace.QName getNodeType(Long nodeId)
getNodeType in interface NodeDAOpublic Long getNodeAclId(Long nodeId)
getNodeAclId in interface NodeDAOpublic ChildAssocEntity newNode(Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, org.alfresco.service.cmr.repository.StoreRef storeRef, String uuid, org.alfresco.service.namespace.QName nodeTypeQName, Locale nodeLocale, String childNodeName, Map<org.alfresco.service.namespace.QName,Serializable> auditableProperties) throws org.alfresco.service.cmr.dictionary.InvalidTypeException
NodeDAOnewNode in interface NodeDAOparentNodeId - 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 belonguuid - the node store-unique identifier, or null to assign a GUIDnodeTypeQName - the type of the nodenodeLocale - the locale of the nodechildNodeName - the cm:name of the child node or null to use the node's UUIDauditableProperties - a map containing any cm:auditable properties for the nodeorg.alfresco.service.cmr.dictionary.InvalidTypeException - if the node type is invalid or if the node type
is not a valid real nodeprotected Long newNodeImplInsert(NodeEntity node)
public org.alfresco.util.Pair<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ChildAssociationRef>,org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef>> moveNode(Long childNodeId, Long newParentNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
NodeDAOmoveNode in interface NodeDAOchildNodeId - the child node that is movingnewParentNodeId - the new parent node (may not be null)assocTypeQName - the new association type or null to keep the existing typeassocQName - the new association qname or null to keep the existing nameprotected void updatePrimaryParentAssocs(ChildAssocEntity primaryParentAssoc, Node newParentNode, Node childNode, Long newChildNodeId, String childNodeName, Long oldParentNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
protected int updatePrimaryParentAssocsImpl(ChildAssocEntity primaryParentAssoc, Node newParentNode, Node childNode, Long newChildNodeId, String childNodeName, Long oldParentNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
public boolean updateNode(Long nodeId, org.alfresco.service.namespace.QName nodeTypeQName, Locale nodeLocale)
updateNode in interface NodeDAOnodeTypeQName - the new type QName for the node or null to keep the existing onenodeLocale - the new locale for the node or null to keep the existing onepublic int touchNodes(Long txnId, List<Long> nodeIds)
NodeDAOtouchNodes in interface NodeDAOtxnId - - the tx id to setnodeIds - - the nodes to updatepublic void setNodeAclId(Long nodeId, Long aclId)
setNodeAclId in interface NodeDAOpublic void setPrimaryChildrenSharedAclId(Long primaryParentNodeId, Long optionalOldSharedAlcIdInAdditionToNull, Long newSharedAclId)
setPrimaryChildrenSharedAclId in interface NodeDAOpublic void deleteNode(Long nodeId)
NodeDAOdeleteNode in interface NodeDAOpublic int purgeNodes(long fromTxnCommitTimeMs,
long toTxnCommitTimeMs)
NodeDAOpurgeNodes in interface NodeDAOfromTxnCommitTimeMs - from commit timetoTxnCommitTimeMs - to commit timepublic Map<org.alfresco.service.namespace.QName,Serializable> getNodeProperties(Long nodeId)
getNodeProperties in interface NodeDAOpublic Serializable getNodeProperty(Long nodeId, org.alfresco.service.namespace.QName propertyQName)
getNodeProperty in interface NodeDAOpublic boolean setNodeProperties(Long nodeId, Map<org.alfresco.service.namespace.QName,Serializable> properties)
setNodeProperties in interface NodeDAOpublic boolean addNodeProperty(Long nodeId, org.alfresco.service.namespace.QName qname, Serializable value)
addNodeProperty in interface NodeDAOpublic boolean addNodeProperties(Long nodeId, Map<org.alfresco.service.namespace.QName,Serializable> properties)
addNodeProperties in interface NodeDAOpublic boolean removeNodeProperties(Long nodeId, Set<org.alfresco.service.namespace.QName> propertyQNames)
removeNodeProperties in interface NodeDAOpublic boolean setModifiedDate(Long nodeId, Date modifiedDate)
NodeDAOsetModifiedDate in interface NodeDAOnodeId - the node to changemodifiedDate - the date to set for cm:modifiedpublic boolean setModifiedProperties(Long nodeId, Date modifiedDate, String modifiedBy)
NodeDAOsetModifiedProperties in interface NodeDAOnodeId - the node to changemodifiedDate - the date to set for cm:modifiedmodifiedBy - the name to set for cm:modifierpublic Set<org.alfresco.service.namespace.QName> getNodeAspects(Long nodeId)
getNodeAspects in interface NodeDAOpublic boolean hasNodeAspect(Long nodeId, org.alfresco.service.namespace.QName aspectQName)
hasNodeAspect in interface NodeDAOpublic boolean addNodeAspects(Long nodeId, Set<org.alfresco.service.namespace.QName> aspectQNames)
addNodeAspects in interface NodeDAOpublic boolean removeNodeAspects(Long nodeId)
removeNodeAspects in interface NodeDAOpublic boolean removeNodeAspects(Long nodeId, Set<org.alfresco.service.namespace.QName> aspectQNames)
removeNodeAspects in interface NodeDAOpublic void getNodesWithAspects(Set<org.alfresco.service.namespace.QName> aspectQNames, Long minNodeId, Long maxNodeId, NodeDAO.NodeRefQueryCallback resultsCallback)
NodeDAOgetNodesWithAspects in interface NodeDAOaspectQNames - the aspects that must be on the nodesminNodeId - the minimum node ID (inclusive)maxNodeId - the maximum node ID (exclusive)resultsCallback - callback to process resultspublic Long newNodeAssoc(Long sourceNodeId, Long targetNodeId, org.alfresco.service.namespace.QName assocTypeQName, int assocIndex)
NodeDAOnewNodeAssoc in interface NodeDAOsourceNodeId - the association sourcetargetNodeId - the association targetassocTypeQName - the type of the association (will be resolved to an ID)assocIndex - the index of the new association (-1 indicates next value)public void setNodeAssocIndex(Long id, int assocIndex)
NodeDAOsetNodeAssocIndex in interface NodeDAOid - the association IDassocIndex - the new index (greater than 0)public int removeNodeAssoc(Long sourceNodeId, Long targetNodeId, org.alfresco.service.namespace.QName assocTypeQName)
NodeDAOremoveNodeAssoc in interface NodeDAOsourceNodeId - the source node IDtargetNodeId - the target node idassocTypeQName - the node association QNamepublic int removeNodeAssocs(List<Long> ids)
NodeDAOremoveNodeAssocs in interface NodeDAOids - the IDs of the associations to removepublic Collection<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef>> getNodeAssocsToAndFrom(Long nodeId)
getNodeAssocsToAndFrom in interface NodeDAOnodeId - the source or target of the associationspublic Collection<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef>> getSourceNodeAssocs(Long targetNodeId, org.alfresco.service.namespace.QName typeQName)
getSourceNodeAssocs in interface NodeDAOtargetNodeId - the target of the associationtypeQName - the type of the association (optional)public Collection<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef>> getTargetNodeAssocs(Long sourceNodeId, org.alfresco.service.namespace.QName typeQName)
getTargetNodeAssocs in interface NodeDAOsourceNodeId - the source of the associationtypeQName - the type of the association (optional)public Collection<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef>> getTargetAssocsByPropertyValue(Long sourceNodeId, org.alfresco.service.namespace.QName typeQName, org.alfresco.service.namespace.QName propertyQName, Serializable propertyValue)
NodeDAOgetTargetAssocsByPropertyValue in interface NodeDAOsourceNodeId - the source of the associationtypeQName - the type of the association (null allowed)propertyQName - property QName (null allowed)propertyValue - property value (null allowed only if the propertyQName is null)public org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef> getNodeAssocOrNull(Long assocId)
getNodeAssocOrNull in interface NodeDAOpublic org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef> getNodeAssoc(Long assocId)
getNodeAssoc in interface NodeDAOprotected Long newChildAssocInsert(ChildAssocEntity assoc, org.alfresco.service.namespace.QName assocTypeQName, String childNodeName)
protected Long newChildAssocInsertImpl(ChildAssocEntity assoc, org.alfresco.service.namespace.QName assocTypeQName, String childNodeName)
public org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ChildAssociationRef> newChildAssoc(Long parentNodeId, Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, String childNodeName)
NodeDAOnewChildAssoc in interface NodeDAOchildNodeName - the cm:name to apply to the associationpublic void deleteChildAssoc(Long assocId)
deleteChildAssoc in interface NodeDAOassocId - the ID of the child association to deletepublic int setChildAssocIndex(Long parentNodeId, Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, int index)
NodeDAOsetChildAssocIndex in interface NodeDAOparentNodeId - the parent node IDchildNodeId - the child node IDassocTypeQName - the association typeassocQName - the association path qualified nameindex - the new indexpublic void setChildAssocsUniqueName(Long childNodeId, String childName)
setChildAssocsUniqueName in interface NodeDAOchildNodeId - the child node who's name is changingchildName - the new cm:name valueprotected int setChildAssocsUniqueNameImpl(Long childNodeId, String childName)
protected int updateChildAssocUniqueNameImpl(Long childNodeId, String childName)
public org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssoc(Long assocId)
NodeDAOgetChildAssoc in interface NodeDAOassocId - the ID of the associationpublic List<NodeIdAndAclId> getPrimaryChildrenAcls(Long nodeId)
NodeDAOgetPrimaryChildrenAcls in interface NodeDAOnodeId - the parent node IDpublic org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssoc(Long parentNodeId, Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
NodeDAOThe 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.
getChildAssoc in interface NodeDAOpublic void getChildAssocs(Long parentNodeId, Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, Boolean isPrimary, Boolean sameStore, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
NodeDAOgetChildAssocs in interface NodeDAOparentNodeId - the parent node IDchildNodeId - the child node ID to filter on; null for no filteringassocTypeQName - the association type qname to filter on; null for no filteringassocQName - the association qname to filter on; null for no filteringisPrimary - 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 resultspublic void getChildAssocs(Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, int maxResults, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
NodeDAOgetChildAssocs in interface NodeDAOparentNodeId - the parent node IDassocTypeQName - the association type qname to filter on; null for no filteringassocQName - the association qname to filter on; null for no filteringmaxResults - the maximum number of results to return. The query will be terminated efficiently
after that number of resultsresultsCallback - the callback that will be called with the resultspublic void getChildAssocs(Long parentNodeId, Set<org.alfresco.service.namespace.QName> assocTypeQNames, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
NodeDAOgetChildAssocs in interface NodeDAOparentNodeId - the parent node IDassocTypeQNames - the association type qnames to filter on; null for no filteringresultsCallback - the callback that will be called with the resultspublic org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssoc(Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, String childName)
getChildAssoc in interface NodeDAOparentNodeId - the parent Node IDassocTypeQName - the association type to filter onchildName - the cm:name value to filter onpublic void getChildAssocs(Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, Collection<String> childNames, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
NodeDAONOTE: This method only works if the association type fundamentally supports unique-name enforcement.
getChildAssocs in interface NodeDAOparentNodeId - the parent nodeassocTypeQName - 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 resultspublic void getChildAssocsByPropertyValue(Long parentNodeId, org.alfresco.service.namespace.QName propertyQName, Serializable value, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
NodeDAOgetChildAssocsByPropertyValue in interface NodeDAOpublic void getChildAssocsByChildTypes(Long parentNodeId, Set<org.alfresco.service.namespace.QName> childNodeTypeQNames, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
getChildAssocsByChildTypes in interface NodeDAOpublic void getChildAssocsWithoutParentAssocsOfType(Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
NodeDAOgetChildAssocsWithoutParentAssocsOfType in interface NodeDAOparentNodeId - the parent node IDassocTypeQName - the association type QNameresultsCallback - the callback that will be called with the resultspublic org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ChildAssociationRef> getPrimaryParentAssoc(Long childNodeId)
NodeDAOgetPrimaryParentAssoc in interface NodeDAOpublic void getParentAssocs(Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, Boolean isPrimary, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
NodeDAOgetParentAssocs in interface NodeDAOchildNodeId - the child node IDassocTypeQName - the association type qname to filter on; null for no filteringassocQName - the association qname to filter on; null for no filteringisPrimary - filter for primary (true) or secondary associations;
null for no filtering.resultsCallback - the callback that will be called with the resultspublic void cycleCheck(Long nodeId)
cycleCheck in interface NodeDAOnodeId - the node to start withpublic List<org.alfresco.service.cmr.repository.Path> getPaths(org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> nodePair, boolean primaryOnly) throws org.alfresco.service.cmr.repository.InvalidNodeRefException
NodeDAOprimaryOnly == true, checks that there is exactly
one path.public void setCheckNodeConsistency()
NodeBulkLoadersetCheckNodeConsistency in interface NodeBulkLoaderpublic Set<Long> getCachedAncestors(List<Long> nodeIds)
NodeBulkLoadergetCachedAncestors in interface NodeBulkLoadernodeIds - a list of node IDs to visitpublic void cacheNodesById(List<Long> nodeIds)
NodeBulkLoadercacheNodesById in interface NodeBulkLoadernodeIds - the nodes that will be cached.public void cacheNodes(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs)
cacheNodes in interface NodeBulkLoadernodeRefs - the nodes that will be cached.public void clear()
clear in interface NodeBulkLoaderpublic Long getMaxTxnIdByCommitTime(long maxCommitTime)
NodeDAOgetMaxTxnIdByCommitTime in interface NodeDAOmaxCommitTime - the max commit time (ms)public int getTransactionCount()
getTransactionCount in interface NodeDAOpublic Transaction getTxnById(Long txnId)
NodeDAOgetTxnById in interface NodeDAOtxnId - the unique transaction ID.public List<org.alfresco.service.cmr.repository.NodeRef.Status> getTxnChanges(Long txnId)
getTxnChanges in interface NodeDAOpublic List<org.alfresco.service.cmr.repository.NodeRef.Status> getTxnChangesForStore(org.alfresco.service.cmr.repository.StoreRef storeRef, Long txnId)
getTxnChangesForStore in interface NodeDAOpublic List<Transaction> getTxnsByCommitTimeAscending(Long fromTimeInclusive, Long toTimeExclusive, int count, List<Long> excludeTxnIds, boolean remoteOnly)
NodeDAOgetTxnsByCommitTimeAscending in interface NodeDAOexcludeTxnIds - a list of txn IDs to ignore. null is allowed.remoteOnly - true if locally-written transactions must be ignoredpublic List<Transaction> getTxnsByCommitTimeDescending(Long fromTimeInclusive, Long toTimeExclusive, int count, List<Long> excludeTxnIds, boolean remoteOnly)
NodeDAOgetTxnsByCommitTimeDescending in interface NodeDAOexcludeTxnIds - a list of txn IDs to ignore. null is allowed.remoteOnly - true if locally-written transactions must be ignoredpublic List<Transaction> getTxnsByCommitTimeAscending(List<Long> includeTxnIds)
NodeDAOgetTxnsByCommitTimeAscending in interface NodeDAOincludeTxnIds - a list of transaction IDs to search forpublic List<Long> getTxnsUnused(Long minTxnId, long maxCommitTime, int count)
getTxnsUnused in interface NodeDAOpublic Long getMinTxnCommitTime()
getMinTxnCommitTime in interface NodeDAOpublic Long getMaxTxnCommitTime()
getMaxTxnCommitTime in interface NodeDAOpublic Long getMinTxnCommitTimeForDeletedNodes()
getMinTxnCommitTimeForDeletedNodes in interface NodeDAOpublic Long getMinTxnId()
getMinTxnId in interface NodeDAOpublic Long getMinUnusedTxnCommitTime()
getMinUnusedTxnCommitTime in interface NodeDAOpublic Long getMaxTxnId()
getMaxTxnId in interface NodeDAOprotected abstract ServerEntity selectServer(String ipAddress)
protected abstract Long insertTransaction(Long serverId, String changeTxnId, Long commit_time_ms)
protected abstract int deleteTransaction(Long txnId)
protected abstract List<StoreEntity> selectAllStores()
protected abstract StoreEntity selectStore(org.alfresco.service.cmr.repository.StoreRef storeRef)
protected abstract NodeEntity selectStoreRootNode(org.alfresco.service.cmr.repository.StoreRef storeRef)
protected abstract Long insertStore(StoreEntity store)
protected abstract int updateStoreRoot(StoreEntity store)
protected abstract int updateStore(StoreEntity store)
protected abstract Long insertNode(NodeEntity node)
protected abstract int updateNode(NodeUpdateEntity nodeUpdate)
protected abstract void updatePrimaryChildrenSharedAclId(Long txnId, Long primaryParentNodeId, Long optionalOldSharedAlcIdInAdditionToNull, Long newSharedAlcId)
protected abstract int deleteNodeById(Long nodeId)
protected abstract int deleteNodesByCommitTime(long fromTxnCommitTimeMs,
long toTxnCommitTimeMs)
protected abstract NodeEntity selectNodeById(Long id)
protected abstract NodeEntity selectNodeByNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
protected abstract List<Node> selectNodesByUuids(Long storeId, SortedSet<String> uuids)
protected abstract Map<NodeVersionKey,Map<NodePropertyKey,NodePropertyValue>> selectNodeProperties(Set<Long> nodeIds)
protected abstract Map<NodeVersionKey,Map<NodePropertyKey,NodePropertyValue>> selectNodeProperties(Long nodeId)
protected abstract Map<NodeVersionKey,Map<NodePropertyKey,NodePropertyValue>> selectNodeProperties(Long nodeId, Set<Long> qnameIds)
protected abstract int deleteNodeProperties(Long nodeId, List<NodePropertyKey> propKeys)
protected abstract void insertNodeProperties(Long nodeId, Map<NodePropertyKey,NodePropertyValue> persistableProps)
protected abstract Map<NodeVersionKey,Set<org.alfresco.service.namespace.QName>> selectNodeAspects(Set<Long> nodeIds)
protected abstract void selectNodesWithAspects(List<Long> qnameIds, Long minNodeId, Long maxNodeId, NodeDAO.NodeRefQueryCallback resultsCallback)
protected abstract Long insertNodeAssoc(Long sourceNodeId, Long targetNodeId, Long assocTypeQNameId, int assocIndex)
protected abstract int updateNodeAssoc(Long id, int assocIndex)
protected abstract int deleteNodeAssoc(Long sourceNodeId, Long targetNodeId, Long assocTypeQNameId)
protected abstract List<NodeAssocEntity> selectNodeAssocs(Long nodeId)
protected abstract List<NodeAssocEntity> selectNodeAssocsBySource(Long sourceNodeId, Long typeQNameId)
protected abstract List<NodeAssocEntity> selectNodeAssocsBySourceAndPropertyValue(Long sourceNodeId, Long typeQNameId, Long propertyQNameId, NodePropertyValue nodeValue)
protected abstract List<NodeAssocEntity> selectNodeAssocsByTarget(Long targetNodeId, Long typeQNameId)
protected abstract NodeAssocEntity selectNodeAssocById(Long assocId)
protected abstract int selectNodeAssocMaxIndex(Long sourceNodeId, Long assocTypeQNameId)
protected abstract Long insertChildAssoc(ChildAssocEntity assoc)
protected abstract int updateChildAssocIndex(Long parentNodeId, Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, int index)
protected abstract int updateChildAssocUniqueName(Long assocId, String name)
protected abstract ChildAssocEntity selectChildAssoc(Long assocId)
protected abstract List<ChildAssocEntity> selectChildNodeIds(Long nodeId, Boolean isPrimary, Long minAssocIdInclusive, int maxResults)
protected abstract List<NodeIdAndAclId> selectPrimaryChildAcls(Long nodeId)
protected abstract List<ChildAssocEntity> selectChildAssoc(Long parentNodeId, Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
protected abstract void selectChildAssocs(Long parentNodeId, Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, Boolean isPrimary, Boolean sameStore, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
protected abstract void selectChildAssocs(Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, int maxResults, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
protected abstract void selectChildAssocs(Long parentNodeId, Set<org.alfresco.service.namespace.QName> assocTypeQNames, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
protected abstract ChildAssocEntity selectChildAssoc(Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, String childName)
protected abstract void selectChildAssocs(Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, Collection<String> childNames, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
protected abstract void selectChildAssocsByPropertyValue(Long parentNodeId, org.alfresco.service.namespace.QName propertyQName, NodePropertyValue nodeValue, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
protected abstract void selectChildAssocsByChildTypes(Long parentNodeId, Set<org.alfresco.service.namespace.QName> childNodeTypeQNames, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
protected abstract void selectChildAssocsWithoutParentAssocsOfType(Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
protected abstract void selectParentAssocs(Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, Boolean isPrimary, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
protected abstract List<ChildAssocEntity> selectParentAssocs(Long childNodeId)
protected abstract List<ChildAssocEntity> selectPrimaryParentAssocs(Long childNodeId)
protected abstract int updatePrimaryParentAssocs(Long childNodeId, Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, String childNodeName)
protected abstract void moveNodeData(Long fromNodeId, Long toNodeId)
fromNodeId - the source nodetoNodeId - the target nodeprotected abstract void deleteSubscriptions(Long nodeId)
protected abstract Transaction selectLastTxnBeforeCommitTime(Long maxCommitTime)
protected abstract int selectTransactionCount()
protected abstract Transaction selectTxnById(Long txnId)
protected abstract List<NodeEntity> selectTxnChanges(Long txnId, Long storeId)
protected abstract List<Transaction> selectTxns(Long fromTimeInclusive, Long toTimeExclusive, Integer count, List<Long> includeTxnIds, List<Long> excludeTxnIds, Long excludeServerId, Boolean ascending)
protected abstract List<Long> selectTxnsUnused(Long minTxnId, Long maxCommitTime, Integer count)
protected abstract Long selectMinTxnCommitTime()
protected abstract Long selectMaxTxnCommitTime()
protected abstract Long selectMinTxnCommitTimeForDeletedNodes()
protected abstract Long selectMinTxnId()
protected abstract Long selectMaxTxnId()
protected abstract Long selectMinUnusedTxnCommitTime()
Copyright © 2005–2018 Alfresco Software. All rights reserved.