More touch ups to AVM permissions stuff. ACLs are properly copied on write.

OrphanReaper cleans up ACLs.  Tests of same.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3710 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-09-06 20:53:38 +00:00
parent 920c487867
commit 17284e4dae
13 changed files with 111 additions and 10 deletions

View File

@@ -20,9 +20,12 @@ package org.alfresco.repo.avm;
import java.util.LinkedList;
import java.util.List;
import org.alfresco.repo.domain.DbAccessControlList;
import org.alfresco.repo.transaction.TransactionUtil;
import org.alfresco.service.transaction.TransactionService;
import org.apache.log4j.Logger;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateTemplate;
/**
* This is the background thread for reaping no longer referenced nodes
@@ -38,6 +41,11 @@ public class OrphanReaper implements Runnable
*/
private TransactionService fTransactionService;
/**
* The Session Factory
*/
private SessionFactory fSessionFactory;
/**
* Inactive base sleep interval.
*/
@@ -130,6 +138,15 @@ public class OrphanReaper implements Runnable
fTransactionService = transactionService;
}
/**
* Set the hibernate session factory. (For Spring.)
* @param sessionFactory
*/
public void setSessionFactory(SessionFactory sessionFactory)
{
fSessionFactory = sessionFactory;
}
/**
* Set the maximum size of the queue of purgeable nodes.
* @param queueLength The max length.
@@ -282,6 +299,14 @@ public class OrphanReaper implements Runnable
AVMContext.fgInstance.fAVMNodePropertyDAO.deleteAll(node);
// Get rid of all aspects belonging to this node.
AVMContext.fgInstance.fAVMAspectNameDAO.delete(node);
// Get rid of ACL.
DbAccessControlList acl = node.getAcl();
node.setAcl(null);
if (acl != null)
{
acl.deleteEntries();
(new HibernateTemplate(fSessionFactory)).delete(acl);
}
// Extra work for directories.
if (node.getType() == AVMNodeType.PLAIN_DIRECTORY ||
node.getType() == AVMNodeType.LAYERED_DIRECTORY)