org.garret.consus
Class StdAuthenticator

java.lang.Object
  extended by org.garret.consus.StdAuthenticator
All Implemented Interfaces:
ConsusAuthenticator

public class StdAuthenticator
extends java.lang.Object
implements ConsusAuthenticator

Basic implementation of the authentication interface based on the user login name and password.


Constructor Summary
StdAuthenticator()
           
 
Method Summary
 boolean add(ConsusConnection conxn, java.util.Properties userInfo)
          Add a new user.
 boolean authenticate(ConsusConnection conxn, java.util.Properties userInfo)
          ConsusAuthenticator constructor.
 boolean change(ConsusConnection conxn, java.util.Properties userInfo)
          Change user properties.
 boolean remove(ConsusConnection conxn, java.util.Properties userInfo)
          Remove a user.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdAuthenticator

public StdAuthenticator()
Method Detail

add

public boolean add(ConsusConnection conxn,
                   java.util.Properties userInfo)
            throws java.sql.SQLException
Add a new user.

Specified by:
add in interface ConsusAuthenticator
Parameters:
conxn - connection with the database
userInfo - user properties
Returns:
true if the user is successfully added, false otherwise.
Throws:
java.sql.SQLException

authenticate

public boolean authenticate(ConsusConnection conxn,
                            java.util.Properties userInfo)
                     throws java.sql.SQLException
ConsusAuthenticator constructor.

Specified by:
authenticate in interface ConsusAuthenticator
Parameters:
conxn - dastabase conenction
userInfo - user properties (shoud contain at least "user" and "password" properties)
Returns:
true if client is authenticated (connection is accepted) or false if connection is refused.
Throws:
java.sql.SQLException

change

public boolean change(ConsusConnection conxn,
                      java.util.Properties userInfo)
               throws java.sql.SQLException
Change user properties.

Specified by:
change in interface ConsusAuthenticator
Parameters:
conxn - connection with the database
userInfo - users new properties (user name and other properties needed to identify user should not be changed.
Throws:
java.sql.SQLException

remove

public boolean remove(ConsusConnection conxn,
                      java.util.Properties userInfo)
               throws java.sql.SQLException
Remove a user.

Specified by:
remove in interface ConsusAuthenticator
Parameters:
conxn - connection with the database
userInfo - user properties
Returns:
true if the information about the user is removed, false if there is no such user.
Throws:
java.sql.SQLException