org.deltava.security
Class ApacheSQLAuthenticator

java.lang.Object
  extended by org.deltava.security.ConnectionPoolAuthenticator
      extended by org.deltava.security.ApacheSQLAuthenticator
All Implemented Interfaces:
Authenticator, SQLAuthenticator

public class ApacheSQLAuthenticator
extends ConnectionPoolAuthenticator

An Authenticator to authenticate users against Apache2-style database tables. Unlike the JDBCAuthenticator class, this uses the existing JDBC Connection Pool. Since this implements SQLAuthenticator, this behavior can be overriden by providing a JDBC Connection to use.

Since:
1.0
Version:
3.1
Author:
Luke

Field Summary
 
Fields inherited from class org.deltava.security.ConnectionPoolAuthenticator
_props
 
Fields inherited from interface org.deltava.security.Authenticator
DEFAULT_PROPS_FILE
 
Constructor Summary
ApacheSQLAuthenticator()
           
 
Method Summary
 boolean accepts(Person usr)
          This Authenticator will accept all users.
 void add(Person usr, String pwd)
          Adds a user to the Directory.
 void authenticate(Person usr, String pwd)
          Authenticates a user by validating the password against the database.
 boolean contains(Person usr)
          Checks if a particular name exists in the Directory.
 void disable(Person usr)
          Disables a user's account.
 void remove(Person usr)
          Removes a user from the Directory.
 void rename(Person usr, String newName)
          Renames a user in the Directory.
 void updatePassword(Person usr, String pwd)
          Updates a User's password.
 
Methods inherited from class org.deltava.security.ConnectionPoolAuthenticator
clearConnection, closeConnection, getConnection, init, setConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApacheSQLAuthenticator

public ApacheSQLAuthenticator()
Method Detail

authenticate

public void authenticate(Person usr,
                         String pwd)
                  throws SecurityException
Authenticates a user by validating the password against the database.

Parameters:
usr - the User bean
pwd - the supplied password
Throws:
SecurityException - if a JDBC error occurs

accepts

public boolean accepts(Person usr)
This Authenticator will accept all users.

Parameters:
usr - the user bean
Returns:
TRUE if the user will be added to the Directory if requested, otherwise FALSE

contains

public boolean contains(Person usr)
                 throws SecurityException
Checks if a particular name exists in the Directory.

Parameters:
usr - the user bean
Returns:
TRUE if the user exists, otherwise FALSE
Throws:
SecurityException - if a JDBC error occurs

updatePassword

public void updatePassword(Person usr,
                           String pwd)
                    throws SecurityException
Updates a User's password.

Parameters:
usr - the User bean
pwd - the new password
Throws:
SecurityException - if a JDBC error occurs

add

public void add(Person usr,
                String pwd)
         throws SecurityException
Adds a user to the Directory.

Parameters:
usr - the User bean
pwd - the User's password
Throws:
SecurityException - if a JDBC error occurs

rename

public void rename(Person usr,
                   String newName)
            throws SecurityException
Renames a user in the Directory. Since the Apache Authenticator relies upon database IDs, this is not implemented.

Parameters:
usr - the user bean
newName - the new fully-qualified directory
Throws:
SecurityException - if an error occurs

disable

public void disable(Person usr)
             throws SecurityException
Disables a user's account.

Parameters:
usr - the user bean
Throws:
SecurityException - if an error occurs

remove

public void remove(Person usr)
            throws SecurityException
Removes a user from the Directory. This will fail silently if the user does not exist in the Directory.

Parameters:
usr - the user bean
Throws:
SecurityException - if a JDBC error occurs


Copyright © 2004-2009 Global Virtual Airlines Group. All Rights Reserved.