Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.acegisecurity.providers.dao
Interface UserCache  view UserCache download UserCache.java


public interface UserCache

Provides a cache of org.acegisecurity.userdetails.User objects.

Implementations should provide appropriate methods to set their cache parameters (eg time-to-live) and/or force removal of entities before their normal expiration. These are not part of the UserCache interface contract because they vary depending on the type of caching system used (eg in-memory vs disk vs cluster vs hybrid).

Version:
$Id: UserCache.java,v 1.6 2005/11/29 13:10:08 benalex Exp $

Method Summary
 org.acegisecurity.userdetails.UserDetails getUserFromCache(java.lang.String username)
          Obtains a org.acegisecurity.userdetails.UserDetails from the cache.
 void putUserInCache(org.acegisecurity.userdetails.UserDetails user)
          Places a org.acegisecurity.userdetails.UserDetails in the cache.
 void removeUserFromCache(java.lang.String username)
          Removes the specified user from the cache.
 

Method Detail

getUserFromCache

public org.acegisecurity.userdetails.UserDetails getUserFromCache(java.lang.String username)
Obtains a org.acegisecurity.userdetails.UserDetails from the cache.


putUserInCache

public void putUserInCache(org.acegisecurity.userdetails.UserDetails user)
Places a org.acegisecurity.userdetails.UserDetails in the cache. The username is the key used to subsequently retrieve the UserDetails.


removeUserFromCache

public void removeUserFromCache(java.lang.String username)
Removes the specified user from the cache. The username is the key used to remove the user. If the user is not found, the method should simply return (not thrown an exception).

Some cache implementations may not support eviction from the cache, in which case they should provide appropriate behaviour to alter the user in either its documentation, via an exception, or through a log message.