public abstract class AbstractNodeDAOImpl extends Object implements NodeDAO, org.alfresco.ibatis.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.
|
void |
setNodeIndexer(NodeIndexer nodeIndexer) |
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, wait
countChildAssocsByParent, deleteTxnsUnused, getMaxNodeId, getMinNodeId, getNodeIdsIntervalForType, getOneTxnsByCommitTimeDescending, selectChildAssocsWithoutNodeAssocsOfTypes, selectNodePropertiesByDataType, selectNodePropertiesByTypes
protected 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 setNodeIndexer(NodeIndexer nodeIndexer)
nodeIndexer
- used when making changes that affect indexespublic 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 NodeDAO
ensureNew
- 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)
NodeDAO
public List<org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.StoreRef>> getStores()
NodeDAO
public boolean exists(org.alfresco.service.cmr.repository.StoreRef storeRef)
NodeDAO
public org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> getRootNode(org.alfresco.service.cmr.repository.StoreRef storeRef)
getRootNode
in interface NodeDAO
public Set<org.alfresco.service.cmr.repository.NodeRef> getAllRootNodes(org.alfresco.service.cmr.repository.StoreRef storeRef)
getAllRootNodes
in interface NodeDAO
public org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> newStore(org.alfresco.service.cmr.repository.StoreRef storeRef)
NodeDAO
public void moveStore(org.alfresco.service.cmr.repository.StoreRef oldStoreRef, org.alfresco.service.cmr.repository.StoreRef newStoreRef)
NodeDAO
public boolean exists(Long nodeId)
NodeDAO
public boolean exists(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeDAO
public boolean isInCurrentTxn(Long nodeId)
isInCurrentTxn
in interface NodeDAO
public org.alfresco.service.cmr.repository.NodeRef.Status getNodeRefStatus(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeDAO
getNodeRefStatus
in interface NodeDAO
nodeRef
- the node referencepublic org.alfresco.service.cmr.repository.NodeRef.Status getNodeIdStatus(Long nodeId)
NodeDAO
getNodeIdStatus
in interface NodeDAO
nodeId
- 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 NodeDAO
public org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.NodeRef> getNodePair(Long nodeId)
getNodePair
in interface NodeDAO
public org.alfresco.service.namespace.QName getNodeType(Long nodeId)
getNodeType
in interface NodeDAO
public Long getNodeAclId(Long nodeId)
getNodeAclId
in interface NodeDAO
public 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
NodeDAO
newNode
in interface NodeDAO
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 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)
NodeDAO
moveNode
in interface NodeDAO
childNodeId
- 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 NodeDAO
nodeTypeQName
- 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)
NodeDAO
touchNodes
in interface NodeDAO
txnId
- - the tx id to setnodeIds
- - the nodes to updatepublic void setNodeAclId(Long nodeId, Long aclId)
setNodeAclId
in interface NodeDAO
public void setPrimaryChildrenSharedAclId(Long primaryParentNodeId, Long optionalOldSharedAlcIdInAdditionToNull, Long newSharedAclId)
setPrimaryChildrenSharedAclId
in interface NodeDAO
public void deleteNode(Long nodeId)
NodeDAO
deleteNode
in interface NodeDAO
public int purgeNodes(long fromTxnCommitTimeMs, long toTxnCommitTimeMs)
NodeDAO
purgeNodes
in interface NodeDAO
fromTxnCommitTimeMs
- from commit timetoTxnCommitTimeMs
- to commit timepublic Map<org.alfresco.service.namespace.QName,Serializable> getNodeProperties(Long nodeId)
getNodeProperties
in interface NodeDAO
public Serializable getNodeProperty(Long nodeId, org.alfresco.service.namespace.QName propertyQName)
getNodeProperty
in interface NodeDAO
public boolean setNodeProperties(Long nodeId, Map<org.alfresco.service.namespace.QName,Serializable> properties)
setNodeProperties
in interface NodeDAO
public boolean addNodeProperty(Long nodeId, org.alfresco.service.namespace.QName qname, Serializable value)
addNodeProperty
in interface NodeDAO
public boolean addNodeProperties(Long nodeId, Map<org.alfresco.service.namespace.QName,Serializable> properties)
addNodeProperties
in interface NodeDAO
public boolean removeNodeProperties(Long nodeId, Set<org.alfresco.service.namespace.QName> propertyQNames)
removeNodeProperties
in interface NodeDAO
public boolean setModifiedDate(Long nodeId, Date modifiedDate)
NodeDAO
setModifiedDate
in interface NodeDAO
nodeId
- the node to changemodifiedDate
- the date to set for cm:modifiedpublic boolean setModifiedProperties(Long nodeId, Date modifiedDate, String modifiedBy)
NodeDAO
setModifiedProperties
in interface NodeDAO
nodeId
- 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 NodeDAO
public boolean hasNodeAspect(Long nodeId, org.alfresco.service.namespace.QName aspectQName)
hasNodeAspect
in interface NodeDAO
public boolean addNodeAspects(Long nodeId, Set<org.alfresco.service.namespace.QName> aspectQNames)
addNodeAspects
in interface NodeDAO
public boolean removeNodeAspects(Long nodeId)
removeNodeAspects
in interface NodeDAO
public boolean removeNodeAspects(Long nodeId, Set<org.alfresco.service.namespace.QName> aspectQNames)
removeNodeAspects
in interface NodeDAO
public void getNodesWithAspects(Set<org.alfresco.service.namespace.QName> aspectQNames, Long minNodeId, Long maxNodeId, NodeDAO.NodeRefQueryCallback resultsCallback)
NodeDAO
getNodesWithAspects
in interface NodeDAO
aspectQNames
- 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)
NodeDAO
newNodeAssoc
in interface NodeDAO
sourceNodeId
- 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)
NodeDAO
setNodeAssocIndex
in interface NodeDAO
id
- the association IDassocIndex
- the new index (greater than 0)public int removeNodeAssoc(Long sourceNodeId, Long targetNodeId, org.alfresco.service.namespace.QName assocTypeQName)
NodeDAO
removeNodeAssoc
in interface NodeDAO
sourceNodeId
- the source node IDtargetNodeId
- the target node idassocTypeQName
- the node association QNamepublic int removeNodeAssocs(List<Long> ids)
NodeDAO
removeNodeAssocs
in interface NodeDAO
ids
- 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 NodeDAO
nodeId
- 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 NodeDAO
targetNodeId
- 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 NodeDAO
sourceNodeId
- 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)
NodeDAO
getTargetAssocsByPropertyValue
in interface NodeDAO
sourceNodeId
- 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 NodeDAO
public org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.AssociationRef> getNodeAssoc(Long assocId)
getNodeAssoc
in interface NodeDAO
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)
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)
NodeDAO
newChildAssoc
in interface NodeDAO
childNodeName
- the cm:name to apply to the associationpublic void deleteChildAssoc(Long assocId)
deleteChildAssoc
in interface NodeDAO
assocId
- 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)
NodeDAO
setChildAssocIndex
in interface NodeDAO
parentNodeId
- 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 NodeDAO
childNodeId
- 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)
NodeDAO
getChildAssoc
in interface NodeDAO
assocId
- the ID of the associationpublic List<NodeIdAndAclId> getPrimaryChildrenAcls(Long nodeId)
NodeDAO
getPrimaryChildrenAcls
in interface NodeDAO
nodeId
- 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)
NodeDAO
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.
getChildAssoc
in interface NodeDAO
public 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)
NodeDAO
getChildAssocs
in interface NodeDAO
parentNodeId
- 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)
NodeDAO
getChildAssocs
in interface NodeDAO
parentNodeId
- 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)
NodeDAO
getChildAssocs
in interface NodeDAO
parentNodeId
- 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 NodeDAO
parentNodeId
- 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)
NodeDAO
NOTE: This method only works if the association type fundamentally supports unique-name enforcement.
getChildAssocs
in interface NodeDAO
parentNodeId
- 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)
NodeDAO
getChildAssocsByPropertyValue
in interface NodeDAO
public void getChildAssocsByChildTypes(Long parentNodeId, Set<org.alfresco.service.namespace.QName> childNodeTypeQNames, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
getChildAssocsByChildTypes
in interface NodeDAO
public void getChildAssocsWithoutParentAssocsOfType(Long parentNodeId, org.alfresco.service.namespace.QName assocTypeQName, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
NodeDAO
getChildAssocsWithoutParentAssocsOfType
in interface NodeDAO
parentNodeId
- 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)
NodeDAO
getPrimaryParentAssoc
in interface NodeDAO
public void getParentAssocs(Long childNodeId, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, Boolean isPrimary, NodeDAO.ChildAssocRefQueryCallback resultsCallback)
NodeDAO
getParentAssocs
in interface NodeDAO
childNodeId
- 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 NodeDAO
nodeId
- 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
NodeDAO
primaryOnly == true
, checks that there is exactly
one path.public void setCheckNodeConsistency()
NodeBulkLoader
setCheckNodeConsistency
in interface NodeBulkLoader
public Set<Long> getCachedAncestors(List<Long> nodeIds)
NodeBulkLoader
getCachedAncestors
in interface NodeBulkLoader
nodeIds
- a list of node IDs to visitpublic void cacheNodesById(List<Long> nodeIds)
NodeBulkLoader
cacheNodesById
in interface NodeBulkLoader
nodeIds
- the nodes that will be cached.public void cacheNodes(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs)
cacheNodes
in interface NodeBulkLoader
nodeRefs
- the nodes that will be cached.public void clear()
clear
in interface NodeBulkLoader
public Long getMaxTxnIdByCommitTime(long maxCommitTime)
NodeDAO
getMaxTxnIdByCommitTime
in interface NodeDAO
maxCommitTime
- the max commit time (ms)public int getTransactionCount()
getTransactionCount
in interface NodeDAO
public Transaction getTxnById(Long txnId)
NodeDAO
getTxnById
in interface NodeDAO
txnId
- the unique transaction ID.public List<org.alfresco.service.cmr.repository.NodeRef.Status> getTxnChanges(Long txnId)
getTxnChanges
in interface NodeDAO
public List<org.alfresco.service.cmr.repository.NodeRef.Status> getTxnChangesForStore(org.alfresco.service.cmr.repository.StoreRef storeRef, Long txnId)
getTxnChangesForStore
in interface NodeDAO
public List<Transaction> getTxnsByCommitTimeAscending(Long fromTimeInclusive, Long toTimeExclusive, int count, List<Long> excludeTxnIds, boolean remoteOnly)
NodeDAO
getTxnsByCommitTimeAscending
in interface NodeDAO
excludeTxnIds
- 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)
NodeDAO
getTxnsByCommitTimeDescending
in interface NodeDAO
excludeTxnIds
- 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)
NodeDAO
getTxnsByCommitTimeAscending
in interface NodeDAO
includeTxnIds
- a list of transaction IDs to search forpublic List<Long> getTxnsUnused(Long minTxnId, long maxCommitTime, int count)
getTxnsUnused
in interface NodeDAO
public Long getMinTxnCommitTime()
getMinTxnCommitTime
in interface NodeDAO
public Long getMaxTxnCommitTime()
getMaxTxnCommitTime
in interface NodeDAO
public Long getMinTxnCommitTimeForDeletedNodes()
getMinTxnCommitTimeForDeletedNodes
in interface NodeDAO
public Long getMinTxnId()
getMinTxnId
in interface NodeDAO
public Long getMinUnusedTxnCommitTime()
getMinUnusedTxnCommitTime
in interface NodeDAO
public Long getMaxTxnId()
getMaxTxnId
in interface NodeDAO
protected 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–2017 Alfresco Software. All rights reserved.