org.xwiki.security.authorization.cache
Interface SecurityCache


@Role
public interface SecurityCache

A cache for fast access right rules checking.

Since:
4.0M2
Version:
$Id$

Method Summary
 void add(SecurityAccessEntry entry)
          Add an entry to this cache.
 void add(SecurityRuleEntry entry)
          Add an entry to this cache.
 void add(SecurityRuleEntry entry, Collection<GroupSecurityReference> groups)
          Add a user entry to this cache.
 SecurityRuleEntry get(SecurityReference entity)
          Get a cached entry.
 SecurityAccessEntry get(UserSecurityReference user, SecurityReference entity)
          Get a cached entry.
 void remove(SecurityReference entity)
          Remove an entry from this cache.
 void remove(UserSecurityReference user, SecurityReference entity)
          Remove an entry from this cache.
 

Method Detail

add

void add(SecurityRuleEntry entry)
         throws ParentEntryEvictedException,
                ConflictingInsertionException
Add an entry to this cache.

Parameters:
entry - The rule entry to add.
Throws:
ParentEntryEvictedException - when the parent entry of this entry was evicted before this insertion. Since all entries, except wiki-entries, must have a parent cached, the SecurityCacheLoader must restart its load attempt.
ConflictingInsertionException - when another thread have inserted this entry, but with a different content.

add

void add(SecurityAccessEntry entry)
         throws ParentEntryEvictedException,
                ConflictingInsertionException
Add an entry to this cache.

Parameters:
entry - The access entry to add.
Throws:
ParentEntryEvictedException - when the parent entry of this entry was evicted before this insertion. Since all entries, except wiki-entries, must have a parent cached, the SecurityCacheLoader must restart its load attempt.
ConflictingInsertionException - when another thread have inserted this entry, but with a different content.

add

void add(SecurityRuleEntry entry,
         Collection<GroupSecurityReference> groups)
         throws ParentEntryEvictedException,
                ConflictingInsertionException
Add a user entry to this cache.

Parameters:
entry - The user entry to insert.
groups - Groups references that this user is a member.
Throws:
ParentEntryEvictedException - when the parent entry of this entry was evicted before this insertion. Since all entries, except wiki-entries, must have a parent cached, the SecurityCacheLoader must restart its load attempt.
ConflictingInsertionException - when another thread have inserted this entry, but with a different content.

get

SecurityAccessEntry get(UserSecurityReference user,
                        SecurityReference entity)
Get a cached entry.

Parameters:
user - Entity representing the user.
entity - The entity which is the object of this cache entry.
Returns:
The cache entry, or null.

get

SecurityRuleEntry get(SecurityReference entity)
Get a cached entry.

Parameters:
entity - The entity which is the object of this cache entry.
Returns:
The cache entry, or null.

remove

void remove(UserSecurityReference user,
            SecurityReference entity)
Remove an entry from this cache. All child entries of this entry will also be removed.

Parameters:
user - Entity representing the user.
entity - The entity which is the object of this cache entry.

remove

void remove(SecurityReference entity)
Remove an entry from this cache. All child entries of this entry will also be removed.

Parameters:
entity - The entity which is the object of this cache entry.


Copyright © 2004-2012 XWiki. All Rights Reserved.