tigase.db
Interface UserAuthRepository

All Known Implementing Classes:
DrupalAuth, JDBCRepository, LibreSourceAuth, TigaseAuth, TigaseCustomAuth, UserAuthRepositoryImpl, XMLRepository

public interface UserAuthRepository

Describe interface UserAuthRepository here. Created: Sun Nov 5 21:15:46 2006

Version:
$Rev$
Author:
Artur Hefczyc

Field Summary
static String DATA_KEY
           
static String MACHANISM_KEY
           
static String PROTOCOL_KEY
           
static String PROTOCOL_VAL_NONSASL
           
static String PROTOCOL_VAL_SASL
           
static String REALM_KEY
           
static String RESULT_KEY
           
static String SERVER_NAME_KEY
           
static String USER_ID_KEY
           
 
Method Summary
 void addUser(String user, String password)
          Describe addUser method here.
 boolean digestAuth(String user, String digest, String id, String alg)
          digestAuth method performs non-sasl, digest authentication as described in non-sasl authentication XEP-0078 For now it is empty and always returns false as I don't have description for database with passwords.
 String getResourceUri()
          getResourceUri method returns database connection string.
 long getUsersCount()
          This method is only used by the server statistics component to report number of registered users.
 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 resource_uri, Map<String,String> params)
          initRepository method is doing initialization for database connection.
 void logout(String user)
          Describe logout method here.
 boolean otherAuth(Map<String,Object> authProps)
          Describe otherAuth method here.
 boolean plainAuth(String user, String password)
          plainAuth method performs non-sasl, plain authentication as described in non-sasl authentication XEP-0078.
 void queryAuth(Map<String,Object> authProps)
          queryAuth returns mechanisms available for authentication.
 void removeUser(String user)
          Describe removeUser method here.
 void updatePassword(String user, String password)
          Describe updatePassword method here.
 

Field Detail

PROTOCOL_KEY

static final String PROTOCOL_KEY
See Also:
Constant Field Values

PROTOCOL_VAL_SASL

static final String PROTOCOL_VAL_SASL
See Also:
Constant Field Values

PROTOCOL_VAL_NONSASL

static final String PROTOCOL_VAL_NONSASL
See Also:
Constant Field Values

RESULT_KEY

static final String RESULT_KEY
See Also:
Constant Field Values

MACHANISM_KEY

static final String MACHANISM_KEY
See Also:
Constant Field Values

REALM_KEY

static final String REALM_KEY
See Also:
Constant Field Values

SERVER_NAME_KEY

static final String SERVER_NAME_KEY
See Also:
Constant Field Values

DATA_KEY

static final String DATA_KEY
See Also:
Constant Field Values

USER_ID_KEY

static final String USER_ID_KEY
See Also:
Constant Field Values
Method Detail

getUsersCount

long getUsersCount()
This method is only used by the server statistics component to report number of registered users.

Returns:
a long number of registered users in the repository.

getUsersCount

long getUsersCount(String domain)
This method is only used by the server statistics component to report number of registered users for given domain.

Parameters:
domain -
Returns:
a long number of registered users in the repository.

queryAuth

void queryAuth(Map<String,Object> authProps)
queryAuth returns mechanisms available for authentication.

Parameters:
authProps - a Map value with parameters for authentication.

initRepository

void initRepository(String resource_uri,
                    Map<String,String> params)
                    throws DBInitException
initRepository method is doing initialization for database connection. It may also do lazy initialization with database. Connection to database might be established during the first authentication request.

Parameters:
resource_uri - a String value of database connection string. The string must also contain database user name and password if required for connection.
params -
Throws:
DBInitException - if an error occurs during access database. It won't happen however as in this method we do simple variable assigment.

getResourceUri

String getResourceUri()
getResourceUri method returns database connection string.

Returns:
a String value of database connection string.

plainAuth

boolean plainAuth(String user,
                  String password)
                  throws UserNotFoundException,
                         TigaseDBException,
                         AuthorizationException
plainAuth method performs non-sasl, plain authentication as described in non-sasl authentication XEP-0078.

Parameters:
user - a String value of user name
password - a String value of plain user password.
Returns:
a boolean value true on successful authentication, false on authentication failure.
Throws:
UserNotFoundException - if an given user name is not found in the authentication repository.
TigaseDBException - if an error occurs during during accessing database;
AuthorizationException - if an error occurs during authentication process.

digestAuth

boolean digestAuth(String user,
                   String digest,
                   String id,
                   String alg)
                   throws UserNotFoundException,
                          TigaseDBException,
                          AuthorizationException
digestAuth method performs non-sasl, digest authentication as described in non-sasl authentication XEP-0078 For now it is empty and always returns false as I don't have description for database with passwords.

Parameters:
user - a String value of user name
digest - a String value password digest sum
id - a String value session ID used for digest sum calculation.
alg - a String value of algorithm ID used for digest sum calculation.
Returns:
a boolean value true on successful authentication, false on authentication failure.
Throws:
UserNotFoundException - if an given user name is not found in the authentication repository.
TigaseDBException - if an error occurs during during accessing database;
AuthorizationException - if an error occurs during authentication process.

otherAuth

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

Parameters:
authProps - a Map value
Returns:
a boolean value
Throws:
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs
AuthorizationException - if an error occurs

addUser

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

Parameters:
user - a String value
password - a String value
Throws:
UserExistsException - if an error occurs
TigaseDBException - if an error occurs

updatePassword

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

Parameters:
user - a String value
password - a String value
Throws:
UserNotFoundException
TigaseDBException - if an error occurs

removeUser

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

Parameters:
user - a String value
Throws:
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs

logout

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

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.