Class JdbcAclService
- java.lang.Object
-
- org.springframework.security.acls.jdbc.JdbcAclService
-
- All Implemented Interfaces:
AclService
- Direct Known Subclasses:
JdbcMutableAclService
public class JdbcAclService extends java.lang.Object implements AclService
Simple JDBC-based implementation ofAclService.Requires the "dirty" flags in
AclImplandAccessControlEntryImplto be set, so that the implementation can detect changed parameters easily.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.jdbc.core.JdbcOperationsjdbcOperationsprotected static org.apache.commons.logging.Loglog
-
Constructor Summary
Constructors Constructor Description JdbcAclService(javax.sql.DataSource dataSource, LookupStrategy lookupStrategy)JdbcAclService(org.springframework.jdbc.core.JdbcOperations jdbcOperations, LookupStrategy lookupStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ObjectIdentity>findChildren(ObjectIdentity parentIdentity)Locates all object identities that use the specified parent.protected booleanisAclClassIdSupported()AclreadAclById(ObjectIdentity object)Same asAclService.readAclsById(List)except it returns only a single Acl.AclreadAclById(ObjectIdentity object, java.util.List<Sid> sids)Same asAclService.readAclsById(List, List)except it returns only a single Acl.java.util.Map<ObjectIdentity,Acl>readAclsById(java.util.List<ObjectIdentity> objects)Obtains all the Acls that apply for the passed Objects.java.util.Map<ObjectIdentity,Acl>readAclsById(java.util.List<ObjectIdentity> objects, java.util.List<Sid> sids)Obtains all the Acls that apply for the passed Objects, but only for the security identifies passed.voidsetAclClassIdSupported(boolean aclClassIdSupported)voidsetConversionService(org.springframework.core.convert.ConversionService conversionService)voidsetFindChildrenQuery(java.lang.String findChildrenSql)Allows customization of the SQL query used to find child object identities.voidsetObjectIdentityGenerator(ObjectIdentityGenerator objectIdentityGenerator)
-
-
-
Constructor Detail
-
JdbcAclService
public JdbcAclService(javax.sql.DataSource dataSource, LookupStrategy lookupStrategy)
-
JdbcAclService
public JdbcAclService(org.springframework.jdbc.core.JdbcOperations jdbcOperations, LookupStrategy lookupStrategy)
-
-
Method Detail
-
findChildren
public java.util.List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity)
Description copied from interface:AclServiceLocates all object identities that use the specified parent. This is useful for administration tools.- Specified by:
findChildrenin interfaceAclService- Parameters:
parentIdentity- to locate children of- Returns:
- the children (or null if none were found)
-
readAclById
public Acl readAclById(ObjectIdentity object, java.util.List<Sid> sids) throws NotFoundException
Description copied from interface:AclServiceSame asAclService.readAclsById(List, List)except it returns only a single Acl.- Specified by:
readAclByIdin interfaceAclService- Parameters:
object- to locate anAclforsids- the security identities for whichAclinformation is required (may be null to denote all entries)- Returns:
- the
Aclfor the requestedObjectIdentity(never null) - Throws:
NotFoundException- if anAclwas not found for the requestedObjectIdentity
-
readAclById
public Acl readAclById(ObjectIdentity object) throws NotFoundException
Description copied from interface:AclServiceSame asAclService.readAclsById(List)except it returns only a single Acl.This method should not be called as it does not leverage the underlying implementation's potential ability to filter Acl entries based on a
Sidparameter.- Specified by:
readAclByIdin interfaceAclService- Parameters:
object- to locate anAclfor- Returns:
- the
Aclfor the requestedObjectIdentity(never null) - Throws:
NotFoundException- if anAclwas not found for the requestedObjectIdentity
-
readAclsById
public java.util.Map<ObjectIdentity,Acl> readAclsById(java.util.List<ObjectIdentity> objects) throws NotFoundException
Description copied from interface:AclServiceObtains all the Acls that apply for the passed Objects.The returned map is keyed on the passed objects, with the values being the Acl instances. Any unknown objects will not have a map key.
- Specified by:
readAclsByIdin interfaceAclService- Parameters:
objects- the objects to findAclinformation for- Returns:
- a map with exactly one element for each
ObjectIdentitypassed as an argument (never null) - Throws:
NotFoundException- if anAclwas not found for each requestedObjectIdentity
-
readAclsById
public java.util.Map<ObjectIdentity,Acl> readAclsById(java.util.List<ObjectIdentity> objects, java.util.List<Sid> sids) throws NotFoundException
Description copied from interface:AclServiceObtains all the Acls that apply for the passed Objects, but only for the security identifies passed.Implementations MAY provide a subset of the ACLs via this method although this is NOT a requirement. This is intended to allow performance optimisations within implementations. Callers should therefore use this method in preference to the alternative overloaded version which does not have performance optimisation opportunities.
The returned map is keyed on the passed objects, with the values being the Acl instances. Any unknown objects (or objects for which the interested Sids do not have entries) will not have a map key.
- Specified by:
readAclsByIdin interfaceAclService- Parameters:
objects- the objects to findAclinformation forsids- the security identities for whichAclinformation is required (may be null to denote all entries)- Returns:
- a map with exactly one element for each
ObjectIdentitypassed as an argument (never null) - Throws:
NotFoundException- if anAclwas not found for each requestedObjectIdentity
-
setFindChildrenQuery
public void setFindChildrenQuery(java.lang.String findChildrenSql)
Allows customization of the SQL query used to find child object identities.- Parameters:
findChildrenSql-
-
setAclClassIdSupported
public void setAclClassIdSupported(boolean aclClassIdSupported)
-
setConversionService
public void setConversionService(org.springframework.core.convert.ConversionService conversionService)
-
setObjectIdentityGenerator
public void setObjectIdentityGenerator(ObjectIdentityGenerator objectIdentityGenerator)
-
isAclClassIdSupported
protected boolean isAclClassIdSupported()
-
-