public class JdbcMutableAclService extends JdbcAclService implements MutableAclService
MutableAclService
.jdbcTemplate, log
Constructor and Description |
---|
JdbcMutableAclService(DataSource dataSource,
LookupStrategy lookupStrategy,
AclCache aclCache) |
Modifier and Type | Method and Description |
---|---|
MutableAcl |
createAcl(ObjectIdentity objectIdentity)
Creates an empty
Acl object in the database. |
protected void |
createEntries(MutableAcl acl)
Creates a new row in acl_entry for every ACE defined in the passed MutableAcl object.
|
protected void |
createObjectIdentity(ObjectIdentity object,
Sid owner)
Creates an entry in the acl_object_identity table for the passed ObjectIdentity.
|
protected Long |
createOrRetrieveClassPrimaryKey(Class clazz,
boolean allowCreate)
Retrieves the primary key from acl_class, creating a new row if needed and the allowCreate property is
true.
|
protected Long |
createOrRetrieveSidPrimaryKey(Sid sid,
boolean allowCreate)
Retrieves the primary key from acl_sid, creating a new row if needed and the allowCreate property is
true.
|
void |
deleteAcl(ObjectIdentity objectIdentity,
boolean deleteChildren)
Removes the specified entry from the database.
|
protected void |
deleteEntries(ObjectIdentity oid)
Deletes all ACEs defined in the acl_entry table belonging to the presented ObjectIdentity
|
protected void |
deleteObjectIdentityAndOptionallyClass(ObjectIdentity oid)
Deletes a single row from acl_object_identity that is associated with the presented ObjectIdentity.
|
protected Long |
retrieveObjectIdentityPrimaryKey(ObjectIdentity oid)
Retrieves the primary key from the acl_object_identity table for the passed ObjectIdentity.
|
MutableAcl |
updateAcl(MutableAcl acl)
This implementation will simply delete all ACEs in the database and recreate them on each invocation of
this method.
|
protected void |
updateObjectIdentity(MutableAcl acl)
Updates an existing acl_object_identity row, with new information presented in the passed MutableAcl
object.
|
findChildren, readAclById, readAclById, readAclsById, readAclsById
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findChildren, readAclById, readAclById, readAclsById, readAclsById
public JdbcMutableAclService(DataSource dataSource, LookupStrategy lookupStrategy, AclCache aclCache)
public MutableAcl createAcl(ObjectIdentity objectIdentity) throws AlreadyExistsException
MutableAclService
Acl
object in the database. It will have no entries. The returned object
will then be used to add entries.createAcl
in interface MutableAclService
objectIdentity
- the object identity to createAlreadyExistsException
- if the passed object identity already has a recordprotected void createEntries(MutableAcl acl)
acl
- containing the ACEs to insertprotected void createObjectIdentity(ObjectIdentity object, Sid owner)
object
- to represent an acl_object_identity forowner
- for the SID column (will be created if there is no acl_sid entry for this particular Sid already)protected Long createOrRetrieveClassPrimaryKey(Class clazz, boolean allowCreate)
clazz
- to find or create an entry for (this implementation uses the fully-qualified class name String)allowCreate
- true if creation is permitted if not foundprotected Long createOrRetrieveSidPrimaryKey(Sid sid, boolean allowCreate)
sid
- to find or createallowCreate
- true if creation is permitted if not foundIllegalArgumentException
- DOCUMENT ME!public void deleteAcl(ObjectIdentity objectIdentity, boolean deleteChildren) throws ChildrenExistException
MutableAclService
deleteAcl
in interface MutableAclService
objectIdentity
- the object identity to removedeleteChildren
- whether to cascade the delete to childrenChildrenExistException
- if the deleteChildren argument was false
but children existprotected void deleteEntries(ObjectIdentity oid)
oid
- the rows in acl_entry to deleteprotected void deleteObjectIdentityAndOptionallyClass(ObjectIdentity oid)
oid
- to delete the acl_object_identity (and clean up acl_class for that class name if appropriate)protected Long retrieveObjectIdentityPrimaryKey(ObjectIdentity oid)
createObjectIdentity(ObjectIdentity, Sid)
instead).oid
- to findpublic MutableAcl updateAcl(MutableAcl acl) throws NotFoundException
MutableAcl
.updateAcl
in interface MutableAclService
acl
- DOCUMENT ME!NotFoundException
- DOCUMENT ME!protected void updateObjectIdentity(MutableAcl acl)
acl
- to modify (a row must already exist in acl_object_identity)NotFoundException
- DOCUMENT ME!Copyright © 2014. All rights reserved.