Package tigase.db.jdbc
Class DrupalWPAuth
- java.lang.Object
-
- tigase.db.jdbc.DrupalWPAuth
-
- All Implemented Interfaces:
AuthRepository
,DataSourceAware<DataRepository>
,Repository
public class DrupalWPAuth extends java.lang.Object implements AuthRepository, DataSourceAware<DataRepository>
Describe class DrupalWPAuth here.
Created: Sat Nov 11 22:22:04 2006- Author:
- Artur Hefczyc
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface tigase.db.AuthRepository
AuthRepository.AccountStatus, AuthRepository.DefaultCredentials, AuthRepository.SingleCredential
-
Nested classes/interfaces inherited from interface tigase.db.Repository
Repository.Meta, Repository.SchemaId
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DRUPAL_NAME_FLD
static int
DRUPAL_OK_STATUS_VAL
static java.lang.String
DRUPAL_PASS_FLD
static java.lang.String
DRUPAL_STATUS_FLD
static java.lang.String
DRUPAL_USERS_TBL
static java.lang.String
WP_NAME_FLD
static int
WP_OK_STATUS_VAL
static java.lang.String
WP_PASS_FLD
static java.lang.String
WP_STATUS_FLD
static java.lang.String
WP_USERS_TBL
-
Fields inherited from interface tigase.db.AuthRepository
DATA_KEY, DIGEST_ID_KEY, DIGEST_KEY, MACHANISM_KEY, PASSWORD_KEY, PROTOCOL_KEY, PROTOCOL_VAL_NONSASL, PROTOCOL_VAL_SASL, REALM_KEY, RESULT_KEY, SERVER_NAME_KEY, USER_ID_KEY
-
-
Constructor Summary
Constructors Constructor Description DrupalWPAuth()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addUser(BareJID user, java.lang.String password)
AuthRepository.AccountStatus
getAccountStatus(BareJID user)
java.lang.String
getPassword(BareJID user)
java.lang.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(java.lang.String domain)
This method is only used by the server statistics component to report number of registered users for given domain.void
initRepository(java.lang.String connection_str, java.util.Map<java.lang.String,java.lang.String> params)
Deprecated.boolean
isUserDisabled(BareJID user)
void
loggedIn(BareJID jid)
Do some actions on repository, when user logs in.void
logout(BareJID user)
boolean
otherAuth(java.util.Map<java.lang.String,java.lang.Object> props)
void
queryAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)
queryAuth
returns mechanisms available for authentication.void
removeUser(BareJID user)
void
setAccountStatus(BareJID user, AuthRepository.AccountStatus status)
void
setDataSource(DataRepository dataSource)
Method called to provide class with instance of a data source.void
setUserDisabled(BareJID user, java.lang.Boolean value)
void
updatePassword(BareJID user, java.lang.String password)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface tigase.db.AuthRepository
getCredentialIds, getCredentials, getUsernames, isMechanismSupported, removeCredential, setCredentialsCodecs, updateCredential
-
-
-
-
Field Detail
-
DRUPAL_USERS_TBL
public static final java.lang.String DRUPAL_USERS_TBL
- See Also:
- Constant Field Values
-
DRUPAL_NAME_FLD
public static final java.lang.String DRUPAL_NAME_FLD
- See Also:
- Constant Field Values
-
DRUPAL_PASS_FLD
public static final java.lang.String DRUPAL_PASS_FLD
- See Also:
- Constant Field Values
-
DRUPAL_STATUS_FLD
public static final java.lang.String DRUPAL_STATUS_FLD
- See Also:
- Constant Field Values
-
DRUPAL_OK_STATUS_VAL
public static final int DRUPAL_OK_STATUS_VAL
- See Also:
- Constant Field Values
-
WP_USERS_TBL
public static final java.lang.String WP_USERS_TBL
- See Also:
- Constant Field Values
-
WP_NAME_FLD
public static final java.lang.String WP_NAME_FLD
- See Also:
- Constant Field Values
-
WP_PASS_FLD
public static final java.lang.String WP_PASS_FLD
- See Also:
- Constant Field Values
-
WP_STATUS_FLD
public static final java.lang.String WP_STATUS_FLD
- See Also:
- Constant Field Values
-
WP_OK_STATUS_VAL
public static final int WP_OK_STATUS_VAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
addUser
public void addUser(BareJID user, java.lang.String password) throws UserExistsException, TigaseDBException
- Specified by:
addUser
in interfaceAuthRepository
- Throws:
UserExistsException
TigaseDBException
-
getResourceUri
public java.lang.String getResourceUri()
Description copied from interface:AuthRepository
getResourceUri
method returns database connection string.- Specified by:
getResourceUri
in interfaceAuthRepository
- Returns:
- a
String
value of database connection string.
-
getUsersCount
public long getUsersCount()
Description copied from interface:AuthRepository
This method is only used by the server statistics component to report number of registered users.- Specified by:
getUsersCount
in interfaceAuthRepository
- Returns:
- a
long
number of registered users in the repository.
-
getUsersCount
public long getUsersCount(java.lang.String domain)
Description copied from interface:AuthRepository
This method is only used by the server statistics component to report number of registered users for given domain.- Specified by:
getUsersCount
in interfaceAuthRepository
- Parameters:
domain
- for which get the statistics- Returns:
- a
long
number of registered users in the repository.
-
setDataSource
public void setDataSource(DataRepository dataSource) throws DBInitException
Description copied from interface:DataSourceAware
Method called to provide class with instance of a data source.- Specified by:
setDataSource
in interfaceDataSourceAware<DataRepository>
- Throws:
DBInitException
-
initRepository
@Deprecated public void initRepository(java.lang.String connection_str, java.util.Map<java.lang.String,java.lang.String> params) throws DBInitException
Deprecated.Description copied from interface:Repository
Method is deprecated and should not be user any more.
The method is called to initialize the data repository. Depending on the implementation all the initialization parameters can be passed either viaresource_uri
parameter as the database connection string or viaparams
map if the required repository parameters are more complex or both.- Specified by:
initRepository
in interfaceRepository
- Parameters:
connection_str
- value in most cases representing the database connection string.params
- is aMap
with repository properties necessary to initialize and perform all the functions. The initialization parameters are implementation dependent.- Throws:
DBInitException
- if there was an error during repository initialization. Some implementations, though, perform so called lazy initialization so even though there is a problem with the underlying repository it may not be signaled through this method call.
-
logout
public void logout(BareJID user) throws UserNotFoundException, TigaseDBException
- Specified by:
logout
in interfaceAuthRepository
- Throws:
UserNotFoundException
TigaseDBException
-
loggedIn
public void loggedIn(BareJID jid) throws TigaseDBException
Description copied from interface:AuthRepository
Do some actions on repository, when user logs in. (for example updatelast_login_time
)- Specified by:
loggedIn
in interfaceAuthRepository
- Parameters:
jid
- JID of logged user.- Throws:
TigaseDBException
- if an error occurs
-
otherAuth
public boolean otherAuth(java.util.Map<java.lang.String,java.lang.Object> props) throws UserNotFoundException, TigaseDBException, AuthorizationException
- Specified by:
otherAuth
in interfaceAuthRepository
- Throws:
UserNotFoundException
TigaseDBException
AuthorizationException
-
queryAuth
public void queryAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)
Description copied from interface:AuthRepository
queryAuth
returns mechanisms available for authentication.- Specified by:
queryAuth
in interfaceAuthRepository
- Parameters:
authProps
- aMap
value with parameters for authentication.
-
removeUser
public void removeUser(BareJID user) throws UserNotFoundException, TigaseDBException
- Specified by:
removeUser
in interfaceAuthRepository
- Throws:
UserNotFoundException
TigaseDBException
-
updatePassword
public void updatePassword(BareJID user, java.lang.String password) throws UserNotFoundException, TigaseDBException
- Specified by:
updatePassword
in interfaceAuthRepository
- Throws:
UserNotFoundException
TigaseDBException
-
getPassword
public java.lang.String getPassword(BareJID user) throws UserNotFoundException, TigaseDBException
- Specified by:
getPassword
in interfaceAuthRepository
- Throws:
UserNotFoundException
TigaseDBException
-
isUserDisabled
public boolean isUserDisabled(BareJID user) throws UserNotFoundException, TigaseDBException
- Specified by:
isUserDisabled
in interfaceAuthRepository
- Throws:
UserNotFoundException
TigaseDBException
-
setUserDisabled
public void setUserDisabled(BareJID user, java.lang.Boolean value) throws UserNotFoundException, TigaseDBException
- Specified by:
setUserDisabled
in interfaceAuthRepository
- Throws:
UserNotFoundException
TigaseDBException
-
setAccountStatus
public void setAccountStatus(BareJID user, AuthRepository.AccountStatus status) throws TigaseDBException
- Specified by:
setAccountStatus
in interfaceAuthRepository
- Throws:
TigaseDBException
-
getAccountStatus
public AuthRepository.AccountStatus getAccountStatus(BareJID user) throws TigaseDBException
- Specified by:
getAccountStatus
in interfaceAuthRepository
- Throws:
TigaseDBException
-
-