org.outerj.daisy.authentication
Class CachingAuthenticationScheme

java.lang.Object
  extended byorg.outerj.daisy.authentication.CachingAuthenticationScheme
All Implemented Interfaces:
AuthenticationScheme

public class CachingAuthenticationScheme
extends java.lang.Object
implements AuthenticationScheme

A wrapper around an AuthenticationScheme that performs credential caching.


Constructor Summary
CachingAuthenticationScheme(AuthenticationScheme delegate, long maxCacheDuration, int maxCacheSize)
           
 
Method Summary
 boolean check(org.outerj.daisy.repository.Credentials credentials)
           
 void clearCaches()
          Clear caches maintained by this authentication scheme, if any.
 org.outerj.daisy.repository.user.User createUser(org.outerj.daisy.repository.Credentials crendentials, org.outerj.daisy.repository.user.UserManager userManager)
          If a user does not exist, the authentication scheme can be offered the possibility to create the user (this is defined in the configuration of the UserAuthenticator).
 java.lang.String getDescription()
           
 java.lang.String getName()
          A unique name for this authentication scheme (max.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingAuthenticationScheme

public CachingAuthenticationScheme(AuthenticationScheme delegate,
                                   long maxCacheDuration,
                                   int maxCacheSize)
Parameters:
maxCacheDuration - max time an entry can stay in the cache before becoming invalid, in millis
maxCacheSize - maximum size of the cache (should be large enough to handle max expected concurrent users for optimal performance)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: AuthenticationScheme
A unique name for this authentication scheme (max. 50 chars).

Specified by:
getName in interface AuthenticationScheme

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface AuthenticationScheme

clearCaches

public void clearCaches()
Description copied from interface: AuthenticationScheme
Clear caches maintained by this authentication scheme, if any.

Specified by:
clearCaches in interface AuthenticationScheme

check

public boolean check(org.outerj.daisy.repository.Credentials credentials)
              throws AuthenticationException
Specified by:
check in interface AuthenticationScheme
Returns:
true if authentication successful, false otherwise
Throws:
AuthenticationException - if an error occured while authenticating

createUser

public org.outerj.daisy.repository.user.User createUser(org.outerj.daisy.repository.Credentials crendentials,
                                                        org.outerj.daisy.repository.user.UserManager userManager)
                                                 throws AuthenticationException
Description copied from interface: AuthenticationScheme
If a user does not exist, the authentication scheme can be offered the possibility to create the user (this is defined in the configuration of the UserAuthenticator). It is up to the implementation of this method to check the credentials are ok.

Specified by:
createUser in interface AuthenticationScheme
Throws:
AuthenticationException


Copyright © -2005 . All Rights Reserved.