Fixed ALF-4551: DeletedNodeCleanupWorker will throw UnsupportedOperationException

- Included unit test to start NodeCleanupRegistry (sanity check only)
 - DAO call to 'purgeNodes'
 - Add job locking to cleanup tasks


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22255 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-09-03 22:55:23 +00:00
parent 10d8672fa9
commit 5f9da921d7
9 changed files with 201 additions and 170 deletions

View File

@@ -1526,13 +1526,10 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
}
}
public void purgeNode(Long nodeId)
@Override
public int purgeNodes(long maxTxnCommitTimeMs)
{
int count = deleteNodeById(nodeId, true);
if (count != 1)
{
throw new ConcurrencyFailureException("Failed to purge node: " + nodeId);
}
return deleteNodesByCommitTime(true, maxTxnCommitTimeMs);
}
/*
@@ -3046,15 +3043,6 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
return (txn == null ? null : txn.getId());
}
public void getNodesDeletedInOldTxns(
Long minNodeId,
long maxCommitTime,
int count,
NodeRefQueryCallback resultsCallback)
{
selectNodesDeletedInOldTxns(minNodeId, maxCommitTime, count, resultsCallback);
}
public int getTransactionCount()
{
return selectTransactionCount();
@@ -3170,6 +3158,7 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
Long optionalOldSharedAlcIdInAdditionToNull,
Long newSharedAlcId);
protected abstract int deleteNodeById(Long nodeId, boolean deletedOnly);
protected abstract int deleteNodesByCommitTime(boolean deletedOnly, long maxTxnCommitTimeMs);
protected abstract NodeEntity selectNodeById(Long id, Boolean deleted);
protected abstract NodeEntity selectNodeByNodeRef(NodeRef nodeRef, Boolean deleted);
protected abstract List<NodeEntity> selectNodesByUuids(Long storeId, SortedSet<String> uuids);
@@ -3267,11 +3256,6 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
String childNodeName);
protected abstract Transaction selectLastTxnBeforeCommitTime(Long maxCommitTime);
protected abstract void selectNodesDeletedInOldTxns(
Long minNodeId,
Long maxCommitTime,
Integer count,
NodeRefQueryCallback resultsCallback);
protected abstract int selectTransactionCount();
protected abstract Transaction selectTxnById(Long txnId);
protected abstract List<NodeEntity> selectTxnChanges(Long txnId, Long storeId);