|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.platform.security.authorization.cache.AuthorizationCache
public class AuthorizationCache
This class represents a local cache of access information, decreasing the time required to determine a particular user's access privileges for specific resources by maximizing the in-memory access and minimizing the calls to the service provider's persistent store.
Constructor Summary | |
---|---|
AuthorizationCache(Cache policyCache,
Cache principalCache,
java.util.Properties env)
Construct with cache properties. |
Method Summary | |
---|---|
void |
cachePoliciesWithIDs(java.util.Collection policies)
Cache the policies that have the specified IDs. |
void |
cachePolicyIDsForPrincipal(MetaMatrixPrincipalName userName,
SessionToken session,
java.util.Collection policyIDs)
Load the principal and the policyIDs that apply to him. |
void |
cachePolicyWithID(AuthorizationPolicy policy)
Cache the policy with the specified ID. |
void |
clearCaches()
Clear both Authorization caches (principal cache and policy cache). |
void |
clearPoliciesFromCache()
Remove from the cache all policies. |
void |
clearPrincipalsFromCache()
Remove from the cache all accounts and the policyIDs they reference. |
java.util.Collection |
findPolicies(java.util.Collection policyIDs)
Find the policies with the given IDs. |
AuthorizationPolicy |
findPolicy(AuthorizationPolicyID policyID)
Find the policy with the given ID. |
java.util.Collection |
findPolicyIDs(MetaMatrixPrincipalName user,
SessionToken session)
Find the policyIDs associated with the given principal. |
java.util.Collection |
getPolicyIDsNotCached(java.util.Collection policyIDs)
Get the collection of policy IDs that are part of this collection but are not found in the cache. |
int |
policyCacheSize()
Return the size of the policy cache. |
int |
principalCacheSize()
Return the size of the Principal cache. |
void |
removePolicyFromCache(AuthorizationPolicyID policyID)
Remove from the cache the policy with the specified ID. |
void |
removePolicysFromCache(java.util.Collection policyIDs)
Remove from the cache the policies with the specified IDs. |
void |
removePrincipalFromCache(MetaMatrixPrincipalName user)
Remove from the cache any policy IDs referenced by the specified principal. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AuthorizationCache(Cache policyCache, Cache principalCache, java.util.Properties env)
policyCacheName
- The name that will be assigned to the policy cache for this
Authorization service instance.principalCacheName
- The name that will be assigned to the principal cache for this
Authorization service instance.env
- The cache properties - may be null.
ObjectCacheException
- if cache properties are incorrect.Method Detail |
---|
public AuthorizationPolicy findPolicy(AuthorizationPolicyID policyID)
policyID
- The ID of the policy looking for.
null
if none with given ID has been cached.public java.util.Collection findPolicies(java.util.Collection policyIDs)
policyIDs
- The collection of poilicyIDs for the policies looking for.
public java.util.Collection findPolicyIDs(MetaMatrixPrincipalName user, SessionToken session)
userName
- The user name of the principal.
public void removePrincipalFromCache(MetaMatrixPrincipalName user)
userName
- The user name of the principal.public void clearPrincipalsFromCache()
public int principalCacheSize()
public void removePolicyFromCache(AuthorizationPolicyID policyID)
policyID
- the ID of the policypublic void removePolicysFromCache(java.util.Collection policyIDs)
policyID
- the ID of the policypublic void clearPoliciesFromCache()
public int policyCacheSize()
public java.util.Collection getPolicyIDsNotCached(java.util.Collection policyIDs)
sessionToken
- The session token of the principal.
public void clearCaches()
Since the authorization cache is distributed, a clear event will be broadcast to all AuthorizationCaches in the system.
public void cachePolicyIDsForPrincipal(MetaMatrixPrincipalName userName, SessionToken session, java.util.Collection policyIDs)
Note: Any policyIDs for this user that were previously in the cache are not removed - the new policyIDs are added to them.
userName
- the user name principal for which the applicable policyIDs
are to be loaded.public void cachePoliciesWithIDs(java.util.Collection policies)
policies
- The policies that are to be loaded.public void cachePolicyWithID(AuthorizationPolicy policy)
policyIDs
- The IDs of the policies that are to be loaded.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |