tigase.db.jdbc
Class TigaseAuth

java.lang.Object
  extended by tigase.db.jdbc.TigaseAuth
All Implemented Interfaces:
UserAuthRepository

public class TigaseAuth
extends Object
implements UserAuthRepository

Describe class TigaseAuth here. Created: Sat Nov 11 22:22:04 2006

Version:
$Rev: 1998 $
Author:
Artur Hefczyc

Field Summary
static String DERBY_CONNVALID_QUERY
           
static String JDBC_CONNVALID_QUERY
           
 
Fields inherited from interface tigase.db.UserAuthRepository
DATA_KEY, MACHANISM_KEY, PROTOCOL_KEY, PROTOCOL_VAL_NONSASL, PROTOCOL_VAL_SASL, REALM_KEY, RESULT_KEY, SERVER_NAME_KEY, USER_ID_KEY
 
Constructor Summary
TigaseAuth()
           
 
Method Summary
 void addUser(String user, String password)
          Describe addUser method here.
 boolean digestAuth(String user, String digest, String id, String alg)
          Describe digestAuth method here.
 String getResourceUri()
          getResourceUri method returns database connection string.
 long getUsersCount()
          getUsersCount method is thread safe.
 long getUsersCount(String domain)
          This method is only used by the server statistics component to report number of registered users for given domain.
 void initRepository(String connection_str, Map<String,String> params)
          Describe initRepository method here.
 void logout(String user)
          Describe logout method here.
 boolean otherAuth(Map<String,Object> props)
          Describe otherAuth method here.
 boolean plainAuth(String user, String password)
          Describe plainAuth method here.
 void queryAuth(Map<String,Object> authProps)
          Describe queryAuth method here.
 void removeUser(String user)
          Describe removeUser method here.
 void updatePassword(String user, String password)
          Describe updatePassword method here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DERBY_CONNVALID_QUERY

public static final String DERBY_CONNVALID_QUERY
See Also:
Constant Field Values

JDBC_CONNVALID_QUERY

public static final String JDBC_CONNVALID_QUERY
See Also:
Constant Field Values
Constructor Detail

TigaseAuth

public TigaseAuth()
Method Detail

queryAuth

public void queryAuth(Map<String,Object> authProps)
Describe queryAuth method here.

Specified by:
queryAuth in interface UserAuthRepository
Parameters:
authProps - a Map value

initRepository

public void initRepository(String connection_str,
                           Map<String,String> params)
                    throws DBInitException
Describe initRepository method here.

Specified by:
initRepository in interface UserAuthRepository
Parameters:
connection_str - a String value
Throws:
DBInitException - if an error occurs

getResourceUri

public String getResourceUri()
Description copied from interface: UserAuthRepository
getResourceUri method returns database connection string.

Specified by:
getResourceUri in interface UserAuthRepository
Returns:
a String value of database connection string.

getUsersCount

public long getUsersCount()
getUsersCount method is thread safe. It uses local variable for storing Statement.

Specified by:
getUsersCount in interface UserAuthRepository
Returns:
a long number of user accounts in database.

getUsersCount

public long getUsersCount(String domain)
Description copied from interface: UserAuthRepository
This method is only used by the server statistics component to report number of registered users for given domain.

Specified by:
getUsersCount in interface UserAuthRepository
Returns:
a long number of registered users in the repository.

plainAuth

public boolean plainAuth(String user,
                         String password)
                  throws UserNotFoundException,
                         TigaseDBException,
                         AuthorizationException
Describe plainAuth method here.

Specified by:
plainAuth in interface UserAuthRepository
Parameters:
user - a String value
password - a String value
Returns:
a boolean value
Throws:
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs
AuthorizationException - if an error occurs during authentication process.

digestAuth

public boolean digestAuth(String user,
                          String digest,
                          String id,
                          String alg)
                   throws UserNotFoundException,
                          TigaseDBException,
                          AuthorizationException
Describe digestAuth method here.

Specified by:
digestAuth in interface UserAuthRepository
Parameters:
user - a String value
digest - a String value
id - a String value
alg - a String value
Returns:
a boolean value
Throws:
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs
AuthorizationException - if an error occurs

otherAuth

public boolean otherAuth(Map<String,Object> props)
                  throws UserNotFoundException,
                         TigaseDBException,
                         AuthorizationException
Describe otherAuth method here.

Specified by:
otherAuth in interface UserAuthRepository
Parameters:
props - a Map value
Returns:
a boolean value
Throws:
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs
AuthorizationException - if an error occurs

logout

public void logout(String user)
            throws UserNotFoundException,
                   TigaseDBException
Description copied from interface: UserAuthRepository
Describe logout method here.

Specified by:
logout in interface UserAuthRepository
Parameters:
user - a String value
Throws:
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs

addUser

public void addUser(String user,
                    String password)
             throws UserExistsException,
                    TigaseDBException
Describe addUser method here.

Specified by:
addUser in interface UserAuthRepository
Parameters:
user - a String value
password - a String value
Throws:
UserExistsException - if an error occurs
TigaseDBException - if an error occurs

updatePassword

public void updatePassword(String user,
                           String password)
                    throws UserNotFoundException,
                           TigaseDBException
Describe updatePassword method here.

Specified by:
updatePassword in interface UserAuthRepository
Parameters:
user - a String value
password - a String value
Throws:
UserExistsException - if an error occurs
TigaseDBException - if an error occurs
UserNotFoundException

removeUser

public void removeUser(String user)
                throws UserNotFoundException,
                       TigaseDBException
Describe removeUser method here.

Specified by:
removeUser in interface UserAuthRepository
Parameters:
user - a String value
Throws:
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs


Copyright © 2001-2006 Tigase Developers Team. All rights Reserved.