org.alfresco.repo.domain.hibernate
Class AclDaoComponentImpl

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.alfresco.repo.domain.hibernate.AclDaoComponentImpl
All Implemented Interfaces:
AclDaoComponent, TransactionalDao, org.springframework.beans.factory.InitializingBean

public class AclDaoComponentImpl
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements AclDaoComponent

Hibernate DAO to manage ACL persistence


Nested Class Summary
static class AclDaoComponentImpl.Indirection
          Support to describe AVM indirections for permission performance improvements when permissions are set.
 
Constructor Summary
AclDaoComponentImpl()
           
 
Method Summary
 void beforeCommit()
          NO-OP
 java.lang.Long createAccessControlList(AccessControlListProperties properties)
          Create a new ACL with the given properties.
 java.lang.Long createAccessControlList(AccessControlListProperties properties, java.util.List aces, java.lang.Long inherited)
           
 void createAuthority(java.lang.String authority)
           
 DbAuthority createDbAuthority(java.lang.String authority)
           
 java.util.List deleteAccessControlEntries(java.lang.Long id, AccessControlEntry pattern)
          Delete some locally set ACLs according to the pattern
 java.util.List deleteAccessControlEntries(java.lang.String authority)
          Used when deleting a user.
 java.util.List deleteAccessControlList(java.lang.Long id)
          Delete an ACL
 java.util.List deleteInheritedAccessControlEntries(java.lang.Long id)
          Delete the ACEs in position > 0 (those not set directly on the ACL but inherited) No affect on any other acl
 java.util.List deleteLocalAccessControlEntries(java.lang.Long id)
          Delete the ACEs in position 0 (those set directly on the ACL and not inherited) Cleans up existing acls
 java.util.List disableInheritance(java.lang.Long id, boolean setInheritedOnAcl)
          Disable inheritance
 java.util.List enableInheritance(java.lang.Long id, java.lang.Long parent)
          Enable inheritance
 java.lang.Long[] findAccessControlList(AccessControlEntry pattern)
          Search for access control lists
 void flush()
          Allows the dao to flush any consuming resources.
 AccessControlList getAccessControlList(java.lang.Long id)
          Get an ACL id.
 AccessControlList getAccessControlListImpl(java.lang.Long id)
           
 AccessControlListProperties getAccessControlListProperties(java.lang.Long id)
          Get the ACL properties
 java.lang.Long getAVMHeadNodeCount()
          Get the total number of head nodes in the repository
 java.util.List getAvmIndirections()
           
 java.lang.Long getAVMNodeCountWithNewACLS(java.lang.Long above)
          Get the acl count canges so far for progress tracking
 java.util.List getAvmNodesByACL(java.lang.Long id)
           
 java.lang.Long getCopy(java.lang.Long toCopy, java.lang.Long toInheritFrom, ACLCopyMode mode)
           
 DbAccessControlList getDbAccessControlList(java.lang.Long id)
          Temp support to get a DBAccessControlList to wire up ...
 DbAccessControlList getDbAccessControlListCopy(java.lang.Long toCopy, java.lang.Long toInheritFrom, ACLCopyMode mode)
           
 java.lang.Long getDmNodeCount()
          How many DM nodes are there?
 java.lang.Long getDmNodeCountWithNewACLS(java.lang.Long above)
          How many DM nodes are three with new ACls (to track patch progress)
 java.lang.Long getInheritedAccessControlList(java.lang.Long id)
          Get the id of the ACL inherited from the one given May return null if there is nothing to inherit -> OLD world where nodes have thier own ACL and we wlak the parent chain
 java.util.List getLayeredDirectories()
          Find layered directories Used to improve performance during patching and cascading the effect of permission changes between layers
 java.util.List getLayeredFiles()
          Find layered files Used to improve performance during patching and cascading the effect of permission changes between layers
 java.lang.Long getMaxAclId()
          Get the max acl id
 java.lang.Long getNewInStore()
          How many nodes are noew in store (approximate)
 java.util.List invalidateAccessControlEntries(java.lang.String authority)
          Mark all ACEs that reference this authority as no longer valid - the authority has been deleted
 boolean isDirty()
          Does this Session contain any changes which must be synchronized with the store?
 java.util.List mergeInheritedAccessControlList(java.lang.Long inherited, java.lang.Long target)
          Merge inherited ACEs in to target - the merged ACEs will go in at thier current position +1
 void onDeleteAccessControlList(long id)
          hibernate lifecycle support
 java.util.List setAccessControlEntries(java.lang.Long id, java.util.List aces)
          Add an access control entry
 java.util.List setAccessControlEntry(java.lang.Long id, AccessControlEntry ace)
          Add an access control entry
 void setAclCache(SimpleCache aclCache)
          Set the ACL cache
 void setAvmNodeDAO(AVMNodeDAO avmNodeDAO)
           
 void setPatchDAO(PatchDAO patchDAO)
           
 void setQnameDAO(QNameDAO qnameDAO)
          Set the DAO for accessing QName entities
 boolean supportsProgressTracking()
          Does the underlyinf connection support isolation level 1 (dirty read)
 void updateAuthority(java.lang.String before, java.lang.String after)
           
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AclDaoComponentImpl

public AclDaoComponentImpl()
Method Detail

setQnameDAO

public void setQnameDAO(QNameDAO qnameDAO)
Set the DAO for accessing QName entities

Parameters:
qnameDAO -

setPatchDAO

public void setPatchDAO(PatchDAO patchDAO)

setAvmNodeDAO

public void setAvmNodeDAO(AVMNodeDAO avmNodeDAO)

setAclCache

public void setAclCache(SimpleCache aclCache)
Set the ACL cache

Parameters:
aclCache -

getDbAccessControlList

public DbAccessControlList getDbAccessControlList(java.lang.Long id)
Description copied from interface: AclDaoComponent
Temp support to get a DBAccessControlList to wire up ...

Specified by:
getDbAccessControlList in interface AclDaoComponent
Returns:

createAccessControlList

public java.lang.Long createAccessControlList(AccessControlListProperties properties)
Description copied from interface: AclDaoComponent
Create a new ACL with the given properties. Unset properties are assigned defaults.

Specified by:
createAccessControlList in interface AclDaoComponent
Returns:

deleteAccessControlEntries

public java.util.List deleteAccessControlEntries(java.lang.String authority)
Used when deleting a user. No ACL is updated - the user has gone the aces and all related info is deleted.

Specified by:
deleteAccessControlEntries in interface AclDaoComponent
Returns:
- the id of all ACLs affected

onDeleteAccessControlList

public void onDeleteAccessControlList(long id)
Description copied from interface: AclDaoComponent
hibernate lifecycle support

Specified by:
onDeleteAccessControlList in interface AclDaoComponent

deleteAccessControlList

public java.util.List deleteAccessControlList(java.lang.Long id)
Description copied from interface: AclDaoComponent
Delete an ACL

Specified by:
deleteAccessControlList in interface AclDaoComponent
Returns:
- the id of all ACLs affected

deleteLocalAccessControlEntries

public java.util.List deleteLocalAccessControlEntries(java.lang.Long id)
Description copied from interface: AclDaoComponent
Delete the ACEs in position 0 (those set directly on the ACL and not inherited) Cleans up existing acls

Specified by:
deleteLocalAccessControlEntries in interface AclDaoComponent
Returns:
- the id of all ACLs affected

deleteInheritedAccessControlEntries

public java.util.List deleteInheritedAccessControlEntries(java.lang.Long id)
Description copied from interface: AclDaoComponent
Delete the ACEs in position > 0 (those not set directly on the ACL but inherited) No affect on any other acl

Specified by:
deleteInheritedAccessControlEntries in interface AclDaoComponent
Returns:
- the id of all ACLs affected

deleteAccessControlEntries

public java.util.List deleteAccessControlEntries(java.lang.Long id,
                                                 AccessControlEntry pattern)
Description copied from interface: AclDaoComponent
Delete some locally set ACLs according to the pattern

Specified by:
deleteAccessControlEntries in interface AclDaoComponent
pattern - - non null elements are used for the match
Returns:
- the id of all ACLs affected

findAccessControlList

public java.lang.Long[] findAccessControlList(AccessControlEntry pattern)
Search for access control lists

Parameters:
pattern -
Returns:
the ids of the ACLs found

getAccessControlList

public AccessControlList getAccessControlList(java.lang.Long id)
Description copied from interface: AclDaoComponent
Get an ACL id.

Specified by:
getAccessControlList in interface AclDaoComponent
Returns:

getAccessControlListImpl

public AccessControlList getAccessControlListImpl(java.lang.Long id)
Parameters:
id -
Returns:
the access control list

getAccessControlListProperties

public AccessControlListProperties getAccessControlListProperties(java.lang.Long id)
Description copied from interface: AclDaoComponent
Get the ACL properties

Specified by:
getAccessControlListProperties in interface AclDaoComponent
Returns:
- the id of all ACLs affected

getInheritedAccessControlList

public java.lang.Long getInheritedAccessControlList(java.lang.Long id)
Description copied from interface: AclDaoComponent
Get the id of the ACL inherited from the one given May return null if there is nothing to inherit -> OLD world where nodes have thier own ACL and we wlak the parent chain

Specified by:
getInheritedAccessControlList in interface AclDaoComponent
Returns:

invalidateAccessControlEntries

public java.util.List invalidateAccessControlEntries(java.lang.String authority)
Description copied from interface: AclDaoComponent
Mark all ACEs that reference this authority as no longer valid - the authority has been deleted

Specified by:
invalidateAccessControlEntries in interface AclDaoComponent
Returns:
- the id of all ACLs affected

mergeInheritedAccessControlList

public java.util.List mergeInheritedAccessControlList(java.lang.Long inherited,
                                                      java.lang.Long target)
Description copied from interface: AclDaoComponent
Merge inherited ACEs in to target - the merged ACEs will go in at thier current position +1

Specified by:
mergeInheritedAccessControlList in interface AclDaoComponent
Returns:

setAccessControlEntry

public java.util.List setAccessControlEntry(java.lang.Long id,
                                            AccessControlEntry ace)
Description copied from interface: AclDaoComponent
Add an access control entry

Specified by:
setAccessControlEntry in interface AclDaoComponent
Returns:
- the id of all ACLs affected

enableInheritance

public java.util.List enableInheritance(java.lang.Long id,
                                        java.lang.Long parent)
Description copied from interface: AclDaoComponent
Enable inheritance

Specified by:
enableInheritance in interface AclDaoComponent
Returns:

disableInheritance

public java.util.List disableInheritance(java.lang.Long id,
                                         boolean setInheritedOnAcl)
Description copied from interface: AclDaoComponent
Disable inheritance

Specified by:
disableInheritance in interface AclDaoComponent
Returns:

getCopy

public java.lang.Long getCopy(java.lang.Long toCopy,
                              java.lang.Long toInheritFrom,
                              ACLCopyMode mode)
Specified by:
getCopy in interface AclDaoComponent

getDbAccessControlListCopy

public DbAccessControlList getDbAccessControlListCopy(java.lang.Long toCopy,
                                                      java.lang.Long toInheritFrom,
                                                      ACLCopyMode mode)
Specified by:
getDbAccessControlListCopy in interface AclDaoComponent

getAvmNodesByACL

public java.util.List getAvmNodesByACL(java.lang.Long id)
Specified by:
getAvmNodesByACL in interface AclDaoComponent

isDirty

public boolean isDirty()
Does this Session contain any changes which must be synchronized with the store?

Specified by:
isDirty in interface TransactionalDao
Returns:
true => changes are pending

beforeCommit

public void beforeCommit()
NO-OP

Specified by:
beforeCommit in interface TransactionalDao

getAVMHeadNodeCount

public java.lang.Long getAVMHeadNodeCount()
Get the total number of head nodes in the repository

Returns:
count

getMaxAclId

public java.lang.Long getMaxAclId()
Get the max acl id

Specified by:
getMaxAclId in interface AclDaoComponent
Returns:
- max acl id

supportsProgressTracking

public boolean supportsProgressTracking()
Does the underlyinf connection support isolation level 1 (dirty read)

Specified by:
supportsProgressTracking in interface AclDaoComponent
Returns:
true if we can do a dirty db read and so track changes (Oracle can not)

getAVMNodeCountWithNewACLS

public java.lang.Long getAVMNodeCountWithNewACLS(java.lang.Long above)
Get the acl count canges so far for progress tracking

Parameters:
above -
Returns:
- the count

getNewInStore

public java.lang.Long getNewInStore()
How many nodes are noew in store (approximate)

Specified by:
getNewInStore in interface AclDaoComponent
Returns:
- the number of new nodes - approximate

getLayeredDirectories

public java.util.List getLayeredDirectories()
Find layered directories Used to improve performance during patching and cascading the effect of permission changes between layers

Returns:
- layered directories

getLayeredFiles

public java.util.List getLayeredFiles()
Find layered files Used to improve performance during patching and cascading the effect of permission changes between layers

Returns:
- layered files

getAvmIndirections

public java.util.List getAvmIndirections()
Specified by:
getAvmIndirections in interface AclDaoComponent

flush

public void flush()
Description copied from interface: TransactionalDao
Allows the dao to flush any consuming resources. This mechanism is used primarily during long-lived transactions to ensure that system resources are not used up.

This method must not be used for implementing business logic.

Specified by:
flush in interface TransactionalDao

getDmNodeCount

public java.lang.Long getDmNodeCount()
How many DM nodes are there?

Specified by:
getDmNodeCount in interface AclDaoComponent
Returns:
- the count

getDmNodeCountWithNewACLS

public java.lang.Long getDmNodeCountWithNewACLS(java.lang.Long above)
How many DM nodes are three with new ACls (to track patch progress)

Specified by:
getDmNodeCountWithNewACLS in interface AclDaoComponent
Parameters:
above -
Returns:
- the count

updateAuthority

public void updateAuthority(java.lang.String before,
                            java.lang.String after)
Specified by:
updateAuthority in interface AclDaoComponent

createAuthority

public void createAuthority(java.lang.String authority)
Specified by:
createAuthority in interface AclDaoComponent

createDbAuthority

public DbAuthority createDbAuthority(java.lang.String authority)

setAccessControlEntries

public java.util.List setAccessControlEntries(java.lang.Long id,
                                              java.util.List aces)
Description copied from interface: AclDaoComponent
Add an access control entry

Specified by:
setAccessControlEntries in interface AclDaoComponent
Returns:
- the id of all ACLs affected

createAccessControlList

public java.lang.Long createAccessControlList(AccessControlListProperties properties,
                                              java.util.List aces,
                                              java.lang.Long inherited)
Specified by:
createAccessControlList in interface AclDaoComponent


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