public final class BasicLookupStrategy extends java.lang.Object implements LookupStrategy
NB: This implementation does attempt to provide
reasonably optimised lookups - within the constraints of a normalised database and standard ANSI SQL features. If
you are willing to sacrifice either of these constraints (eg use a particular database feature such as hierarchical
queries or materalized views, or reduce normalisation) you are likely to achieve better performance. In such
situations you will need to provide your own custom LookupStrategy
. This class does not support
subclassing, as it is likely to change in future releases and therefore subclassing is unsupported.
Constructor and Description |
---|
BasicLookupStrategy(javax.sql.DataSource dataSource,
AclCache aclCache,
AclAuthorizationStrategy aclAuthorizationStrategy,
AuditLogger auditLogger)
Constructor accepting mandatory arguments
|
Modifier and Type | Method and Description |
---|---|
protected Permission |
convertMaskIntoPermission(int mask) |
java.util.Map |
readAclsById(ObjectIdentity[] objects,
Sid[] sids)
The main method.
|
void |
setBatchSize(int batchSize) |
public BasicLookupStrategy(javax.sql.DataSource dataSource, AclCache aclCache, AclAuthorizationStrategy aclAuthorizationStrategy, AuditLogger auditLogger)
dataSource
- to access the databaseaclCache
- the cache where fully-loaded elements can be storedaclAuthorizationStrategy
- authorization strategy (required)protected Permission convertMaskIntoPermission(int mask)
public java.util.Map readAclsById(ObjectIdentity[] objects, Sid[] sids)
WARNING: This implementation completely disregards the "sids" argument! Every item
in the cache is expected to contain all SIDs. If you have serious performance needs (eg a very large number of
SIDs per object identity), you'll probably want to develop a custom LookupStrategy
implementation
instead.
The implementation works in batch sizes specfied by batchSize
.
readAclsById
in interface LookupStrategy
objects
- the identities to lookup (required)sids
- the SIDs for which identities are required (ignored by this implementation)ObjectIdentity
of the located Acl
and values
are the located Acl
(never null although some entries may be missing; this method
should not throw NotFoundException
, as a chain of LookupStrategy
s may be used
to automatically create entries if required)public void setBatchSize(int batchSize)