info.magnolia.cms.security
Class DelegatingUserManager

java.lang.Object
  extended by info.magnolia.cms.security.DelegatingUserManager
All Implemented Interfaces:
UserManager

public class DelegatingUserManager
extends Object
implements UserManager

A UserManager delegating to a set of user managers. The first user manager which does not through an UnsupportedOperationException will be used.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Field Summary
 
Fields inherited from interface info.magnolia.cms.security.UserManager
ANONYMOUS_USER, SYSTEM_PSWD, SYSTEM_USER
 
Constructor Summary
DelegatingUserManager(Map<String,UserManager> delegates)
           
 
Method Summary
 void changePassword(User user, String newPassword)
          Sets a new password.
 User createUser(String name, String pw)
          Creates a user without security restrictions.
 Collection<User> getAllUsers()
          Get all users.
 User getAnonymousUser()
          Get Anonymous user, this user must always exist in magnolia repository.
 long getLockTimePeriod()
          Gets a time in minutes for which account will be locked out in case of reaching maximum count of failed login attempts.
 int getMaxFailedLoginAttempts()
          Gets a number of failed attempts before locking account.
 User getSystemUser()
          Get system user, this user must always exist in magnolia repository.
 User getUser(String name)
          Find a specific user.
 User getUser(Subject subject)
          Initialize new user using JAAS authenticated/authorized subject.
 void setLockTimePeriod(long lockTimePeriod)
          Sets a time in minutes for which account will be locked out in case of reaching maximum count of failed login attempts.
 void setMaxFailedLoginAttempts(int maxFailedLoginAttempts)
          Sets a number of failed attempts before locking account.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingUserManager

public DelegatingUserManager(Map<String,UserManager> delegates)
Parameters:
delegates -
Method Detail

createUser

public User createUser(String name,
                       String pw)
                throws UnsupportedOperationException
Description copied from interface: UserManager
Creates a user without security restrictions.

Specified by:
createUser in interface UserManager
Throws:
UnsupportedOperationException - if the current implementation doesn't support this operation

changePassword

public void changePassword(User user,
                           String newPassword)
                    throws UnsupportedOperationException
Description copied from interface: UserManager
Sets a new password.

Specified by:
changePassword in interface UserManager
Throws:
UnsupportedOperationException - if the current implementation doesn't support this operation

getAnonymousUser

public User getAnonymousUser()
Description copied from interface: UserManager
Get Anonymous user, this user must always exist in magnolia repository.

Specified by:
getAnonymousUser in interface UserManager

getSystemUser

public User getSystemUser()
Description copied from interface: UserManager
Get system user, this user must always exist in magnolia repository.

Specified by:
getSystemUser in interface UserManager

getUser

public User getUser(String name)
             throws UnsupportedOperationException
Description copied from interface: UserManager
Find a specific user. Not all implementations will support this method.

Specified by:
getUser in interface UserManager
Parameters:
name - the name of the user
Returns:
the user object
Throws:
UnsupportedOperationException

getUser

public User getUser(Subject subject)
             throws UnsupportedOperationException
Description copied from interface: UserManager
Initialize new user using JAAS authenticated/authorized subject.

Specified by:
getUser in interface UserManager
Throws:
UnsupportedOperationException - if the current implementation doesn't support this operation

getAllUsers

public Collection<User> getAllUsers()
                             throws UnsupportedOperationException
Description copied from interface: UserManager
Get all users.

Specified by:
getAllUsers in interface UserManager
Returns:
collection of User objects
Throws:
UnsupportedOperationException - if the current implementation doesn't support this operation

getLockTimePeriod

public long getLockTimePeriod()
                       throws UnsupportedOperationException
Description copied from interface: UserManager
Gets a time in minutes for which account will be locked out in case of reaching maximum count of failed login attempts.

Specified by:
getLockTimePeriod in interface UserManager
Throws:
UnsupportedOperationException - if the current implementation doesn't support this operation

getMaxFailedLoginAttempts

public int getMaxFailedLoginAttempts()
                              throws UnsupportedOperationException
Description copied from interface: UserManager
Gets a number of failed attempts before locking account.

Specified by:
getMaxFailedLoginAttempts in interface UserManager
Throws:
UnsupportedOperationException - if the current implementation doesn't support this operation

setLockTimePeriod

public void setLockTimePeriod(long lockTimePeriod)
                       throws UnsupportedOperationException
Description copied from interface: UserManager
Sets a time in minutes for which account will be locked out in case of reaching maximum count of failed login attempts.

Specified by:
setLockTimePeriod in interface UserManager
Throws:
UnsupportedOperationException - if the current implementation doesn't support this operation

setMaxFailedLoginAttempts

public void setMaxFailedLoginAttempts(int maxFailedLoginAttempts)
                               throws UnsupportedOperationException
Description copied from interface: UserManager
Sets a number of failed attempts before locking account.

Specified by:
setMaxFailedLoginAttempts in interface UserManager
Throws:
UnsupportedOperationException - if the current implementation doesn't support this operation


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.