Package org.springframework.security.acls.jdbc

# Class JdbcAclService

java.lang.Object
org.springframework.security.acls.jdbc.JdbcAclService

All Implemented Interfaces:
  `AclService`

Direct Known Subclasses:
  `JdbcMutableAclService`

public class JdbcAclService extends Object implements AclService
Simple JDBC-based implementation of `AclService`.

Requires the "dirty" flags in `AclImpl` and `AccessControlEntryImpl` to be set, so that the implementation can detect changed parameters easily.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final org.springframework.jdbc.core.JdbcOperations`
`jdbcOperations`
`protected static final org.apache.commons.logging.Log`
`log`

## Constructor Summary

Constructors
Constructor
Description
`JdbcAclService(DataSource dataSource, LookupStrategy lookupStrategy)`
`JdbcAclService(org.springframework.jdbc.core.JdbcOperations jdbcOperations, LookupStrategy lookupStrategy)`

## Method Summary

Modifier and Type
Method
Description
`List<ObjectIdentity>`
`findChildren(ObjectIdentity parentIdentity)`
Locates all object identities that use the specified parent.
`protected boolean`
`isAclClassIdSupported()`
`Acl`
`readAclById(ObjectIdentity object)`
Same as `AclService.readAclsById(List)` except it returns only a single Acl.
`Acl`
`readAclById(ObjectIdentity object, List<Sid> sids)`
Same as `AclService.readAclsById(List, List)` except it returns only a single Acl.
`Map<ObjectIdentity,Acl>`
`readAclsById(List<ObjectIdentity> objects)`
Obtains all the `Acl`s that apply for the passed `Object`s.
`Map<ObjectIdentity,Acl>`
`readAclsById(List<ObjectIdentity> objects, List<Sid> sids)`
Obtains all the `Acl`s that apply for the passed `Object`s, but only for the security identifies passed.
`void`
`setAclClassIdSupported(boolean aclClassIdSupported)`
`void`
`setConversionService(org.springframework.core.convert.ConversionService conversionService)`
`void`
`setFindChildrenQuery(String findChildrenSql)`
Allows customization of the SQL query used to find child object identities.
`void`
`setObjectIdentityGenerator(ObjectIdentityGenerator objectIdentityGenerator)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

protected static final org.apache.commons.logging.Log log

### jdbcOperations

protected final org.springframework.jdbc.core.JdbcOperations jdbcOperations

## Constructor Details

### JdbcAclService

public JdbcAclService(DataSource dataSource, LookupStrategy lookupStrategy)

### JdbcAclService

public JdbcAclService(org.springframework.jdbc.core.JdbcOperations jdbcOperations, LookupStrategy lookupStrategy)

## Method Details

### findChildren

public List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity)
Description copied from interface: `AclService`
Locates all object identities that use the specified parent. This is useful for administration tools.

Specified by:
  `findChildren` in interface `AclService`
Parameters:
  `parentIdentity` - to locate children of
Returns:
  the children (or `null` if none were found)

### readAclById

public Acl readAclById(ObjectIdentity object, List<Sid> sids) throws NotFoundException
Description copied from interface: `AclService`
Same as `AclService.readAclsById(List, List)` except it returns only a single Acl.

Specified by:
  `readAclById` in interface `AclService`
Parameters:
  `object` - to locate an `Acl` for
  `sids` - the security identities for which `Acl` information is required (may be `null` to denote all entries)
Returns:
  the `Acl` for the requested `ObjectIdentity` (never `null`)
Throws:
  `NotFoundException` - if an `Acl` was not found for the requested `ObjectIdentity`

### readAclById

public Acl readAclById(ObjectIdentity object) throws NotFoundException
Description copied from interface: `AclService`
Same as `AclService.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 `Sid` parameter.

Specified by:
  `readAclById` in interface `AclService`
Parameters:
  `object` - to locate an `Acl` for
Returns:
  the `Acl` for the requested `ObjectIdentity` (never `null`)
Throws:
  `NotFoundException` - if an `Acl` was not found for the requested `ObjectIdentity`

### readAclsById

public Map<ObjectIdentity,Acl> readAclsById(List<ObjectIdentity> objects) throws NotFoundException
Description copied from interface: `AclService`
Obtains all the `Acl`s that apply for the passed `Object`s.

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:
  `readAclsById` in interface `AclService`
Parameters:
  `objects` - the objects to find `Acl` information for
Returns:
  a map with exactly one element for each `ObjectIdentity` passed as an argument (never `null`)
Throws:
  `NotFoundException` - if an `Acl` was not found for each requested `ObjectIdentity`

### readAclsById

public Map<ObjectIdentity,Acl> readAclsById(List<ObjectIdentity> objects, List<Sid> sids) throws NotFoundException
Description copied from interface: `AclService`
Obtains all the `Acl`s that apply for the passed `Object`s, 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 `Sid`s do not have entries) will not have a map key.

Specified by:
  `readAclsById` in interface `AclService`
Parameters:
  `objects` - the objects to find `Acl` information for
  `sids` - the security identities for which `Acl` information is required (may be `null` to denote all entries)
Returns:
  a map with exactly one element for each `ObjectIdentity` passed as an argument (never `null`)
Throws:
  `NotFoundException` - if an `Acl` was not found for each requested `ObjectIdentity`

### setFindChildrenQuery

public void setFindChildrenQuery(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()