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

Quick Search    Search Deep

org.apache.turbine.services.security.passive
Class PassiveUserManager  view PassiveUserManager download PassiveUserManager.java

java.lang.Object
  extended byorg.apache.turbine.services.security.passive.PassiveUserManager
All Implemented Interfaces:
org.apache.turbine.services.security.UserManager

public class PassiveUserManager
extends java.lang.Object
implements org.apache.turbine.services.security.UserManager

Void user manager can be used where no data storage is needed by the application. It's methods don't provide any useful functionality except throwing DataBackendExceptions. Security service will be still able to create anonymous User objects when this UserManager is used.

Version:
$Id: PassiveUserManager.java 264148 2005-08-29 14:21:04Z henning $

Constructor Summary
PassiveUserManager()
           
 
Method Summary
 boolean accountExists(java.lang.String userName)
          Check whether a specified user's account exists.
 boolean accountExists(org.apache.turbine.om.security.User user)
          Check whether a specified user's account exists.
 void authenticate(org.apache.turbine.om.security.User user, java.lang.String password)
          Authenticate an User with the specified password.
 void changePassword(org.apache.turbine.om.security.User user, java.lang.String oldPassword, java.lang.String newPassword)
          Change the password for an User.
 void createAccount(org.apache.turbine.om.security.User user, java.lang.String initialPassword)
          Creates new user account with specified attributes.
 void forcePassword(org.apache.turbine.om.security.User user, java.lang.String password)
          Forcibly sets new password for an User.
 void init(org.apache.commons.configuration.Configuration conf)
          Initializes the UserManager
 void removeAccount(org.apache.turbine.om.security.User user)
          Removes an user account from the system.
 org.apache.turbine.om.security.User[] retrieve(org.apache.torque.util.Criteria criteria)
          Deprecated. Use retrieveList instead.
 org.apache.turbine.om.security.User retrieve(java.lang.String username)
          Retrieve a user from persistent storage using username as the key.
 org.apache.turbine.om.security.User retrieve(java.lang.String username, java.lang.String password)
          Retrieve a user from persistent storage using username as the key, and authenticate the user.
 org.apache.turbine.om.security.User retrieveById(java.lang.Object key)
          Retrieve a user from persistent storage using the primary key
 java.util.List retrieveList(org.apache.torque.util.Criteria criteria)
          Retrieve a set of users that meet the specified criteria.
 void saveOnSessionUnbind(org.apache.turbine.om.security.User user)
          Saves User data when the session is unbound.
 void store(org.apache.turbine.om.security.User user)
          Save an User object to persistent storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassiveUserManager

public PassiveUserManager()
Method Detail

init

public void init(org.apache.commons.configuration.Configuration conf)
Initializes the UserManager

Specified by:
init in interface org.apache.turbine.services.security.UserManager

accountExists

public boolean accountExists(org.apache.turbine.om.security.User user)
                      throws org.apache.turbine.util.security.DataBackendException
Check whether a specified user's account exists. The login name is used for looking up the account.

Specified by:
accountExists in interface org.apache.turbine.services.security.UserManager

accountExists

public boolean accountExists(java.lang.String userName)
                      throws org.apache.turbine.util.security.DataBackendException
Check whether a specified user's account exists. The login name is used for looking up the account.

Specified by:
accountExists in interface org.apache.turbine.services.security.UserManager

retrieve

public org.apache.turbine.om.security.User retrieve(java.lang.String username)
                                             throws org.apache.turbine.util.security.UnknownEntityException,
                                                    org.apache.turbine.util.security.DataBackendException
Retrieve a user from persistent storage using username as the key.

Specified by:
retrieve in interface org.apache.turbine.services.security.UserManager

retrieveById

public org.apache.turbine.om.security.User retrieveById(java.lang.Object key)
                                                 throws org.apache.turbine.util.security.UnknownEntityException,
                                                        org.apache.turbine.util.security.DataBackendException
Retrieve a user from persistent storage using the primary key

Specified by:
retrieveById in interface org.apache.turbine.services.security.UserManager

retrieve

public org.apache.turbine.om.security.User[] retrieve(org.apache.torque.util.Criteria criteria)
                                               throws org.apache.turbine.util.security.DataBackendException
Deprecated. Use retrieveList instead.

Retrieve a set of users that meet the specified criteria. As the keys for the criteria, you should use the constants that are defined in org.apache.turbine.om.security.User interface, plus the names of the custom attributes you added to your user representation in the data storage. Use verbatim names of the attributes - without table name prefix in case of DB implementation.

Specified by:
retrieve in interface org.apache.turbine.services.security.UserManager

retrieveList

public java.util.List retrieveList(org.apache.torque.util.Criteria criteria)
                            throws org.apache.turbine.util.security.DataBackendException
Retrieve a set of users that meet the specified criteria. As the keys for the criteria, you should use the constants that are defined in org.apache.turbine.om.security.User interface, plus the names of the custom attributes you added to your user representation in the data storage. Use verbatim names of the attributes - without table name prefix in case of DB implementation.

Specified by:
retrieveList in interface org.apache.turbine.services.security.UserManager

retrieve

public org.apache.turbine.om.security.User retrieve(java.lang.String username,
                                                    java.lang.String password)
                                             throws org.apache.turbine.util.security.PasswordMismatchException,
                                                    org.apache.turbine.util.security.UnknownEntityException,
                                                    org.apache.turbine.util.security.DataBackendException
Retrieve a user from persistent storage using username as the key, and authenticate the user. The implementation may chose to authenticate to the server as the user whose data is being retrieved.

Specified by:
retrieve in interface org.apache.turbine.services.security.UserManager

store

public void store(org.apache.turbine.om.security.User user)
           throws org.apache.turbine.util.security.UnknownEntityException,
                  org.apache.turbine.util.security.DataBackendException
Save an User object to persistent storage. User's record is required to exist in the storage.

Specified by:
store in interface org.apache.turbine.services.security.UserManager

saveOnSessionUnbind

public void saveOnSessionUnbind(org.apache.turbine.om.security.User user)
                         throws org.apache.turbine.util.security.UnknownEntityException,
                                org.apache.turbine.util.security.DataBackendException
Saves User data when the session is unbound. The user account is required to exist in the storage. LastLogin, AccessCounter, persistent pull tools, and any data stored in the permData hashtable that is not mapped to a column will be saved.

Specified by:
saveOnSessionUnbind in interface org.apache.turbine.services.security.UserManager

authenticate

public void authenticate(org.apache.turbine.om.security.User user,
                         java.lang.String password)
                  throws org.apache.turbine.util.security.PasswordMismatchException,
                         org.apache.turbine.util.security.UnknownEntityException,
                         org.apache.turbine.util.security.DataBackendException
Authenticate an User with the specified password. If authentication is successful the method returns nothing. If there are any problems, exception was thrown.

Specified by:
authenticate in interface org.apache.turbine.services.security.UserManager

createAccount

public void createAccount(org.apache.turbine.om.security.User user,
                          java.lang.String initialPassword)
                   throws org.apache.turbine.util.security.EntityExistsException,
                          org.apache.turbine.util.security.DataBackendException
Creates new user account with specified attributes.

Specified by:
createAccount in interface org.apache.turbine.services.security.UserManager

removeAccount

public void removeAccount(org.apache.turbine.om.security.User user)
                   throws org.apache.turbine.util.security.UnknownEntityException,
                          org.apache.turbine.util.security.DataBackendException
Removes an user account from the system.

Specified by:
removeAccount in interface org.apache.turbine.services.security.UserManager

changePassword

public void changePassword(org.apache.turbine.om.security.User user,
                           java.lang.String oldPassword,
                           java.lang.String newPassword)
                    throws org.apache.turbine.util.security.PasswordMismatchException,
                           org.apache.turbine.util.security.UnknownEntityException,
                           org.apache.turbine.util.security.DataBackendException
Change the password for an User.

Specified by:
changePassword in interface org.apache.turbine.services.security.UserManager

forcePassword

public void forcePassword(org.apache.turbine.om.security.User user,
                          java.lang.String password)
                   throws org.apache.turbine.util.security.UnknownEntityException,
                          org.apache.turbine.util.security.DataBackendException
Forcibly sets new password for an User. This is supposed by the administrator to change the forgotten or compromised passwords. Certain implementatations of this feature would require administrative level access to the authenticating server / program.

Specified by:
forcePassword in interface org.apache.turbine.services.security.UserManager