com.opensymphony.user.provider.jdbc
Class JDBCCredentialsProvider

java.lang.Object
  extended bycom.opensymphony.user.provider.jdbc.BaseJDBCProvider
      extended bycom.opensymphony.user.provider.jdbc.JDBCCredentialsProvider
All Implemented Interfaces:
CredentialsProvider, java.io.Serializable, UserProvider

public class JDBCCredentialsProvider
extends BaseJDBCProvider
implements CredentialsProvider

Credentials provider backed by a JDBC datastore. Allows modification of user data.

Version:
$Revision: 1.4 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.opensymphony.user.provider.jdbc.BaseJDBCProvider
closeConnWhenDone, ds, groupName, groupTable, membershipGroupName, membershipTable, membershipUserName, userName, userPassword, userTable
 
Constructor Summary
JDBCCredentialsProvider()
           
 
Method Summary
 boolean authenticate(java.lang.String name, java.lang.String password)
          Authenticate a user by checking to see if they exist in database and if their password matches.
 boolean changePassword(java.lang.String name, java.lang.String password)
          Changes a users password to a new password.
 boolean create(java.lang.String name)
          Create a new user by inserting a record into the users table.
protected  java.lang.String createHash(java.lang.String original)
           
 boolean handles(java.lang.String name)
          Returns whether a user exists or not.
 java.util.List list()
          Return all the users ordered by their username.
 boolean remove(java.lang.String name)
          Remove Entity with given name.
 
Methods inherited from class com.opensymphony.user.provider.jdbc.BaseJDBCProvider
cleanup, flushCaches, getConnection, init, load, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.opensymphony.user.provider.UserProvider
flushCaches, init, load, store
 

Constructor Detail

JDBCCredentialsProvider

public JDBCCredentialsProvider()
Method Detail

authenticate

public boolean authenticate(java.lang.String name,
                            java.lang.String password)
Authenticate a user by checking to see if they exist in database and if their password matches.

Specified by:
authenticate in interface CredentialsProvider

changePassword

public boolean changePassword(java.lang.String name,
                              java.lang.String password)
Changes a users password to a new password.

Specified by:
changePassword in interface CredentialsProvider

create

public boolean create(java.lang.String name)
Create a new user by inserting a record into the users table.

Specified by:
create in interface UserProvider
Overrides:
create in class BaseJDBCProvider

handles

public boolean handles(java.lang.String name)
Returns whether a user exists or not.

Specified by:
handles in interface UserProvider

list

public java.util.List list()
Return all the users ordered by their username.

Specified by:
list in interface UserProvider

remove

public boolean remove(java.lang.String name)
Description copied from interface: UserProvider
Remove Entity with given name.

Specified by:
remove in interface UserProvider
Overrides:
remove in class BaseJDBCProvider

createHash

protected java.lang.String createHash(java.lang.String original)

See www.opensymphony.com for more information.