public class DrupalWPAuth extends Object implements AuthRepository, DataSourceAware<DataRepository>
AuthRepository.AccountStatus, AuthRepository.DefaultCredentials, AuthRepository.SingleCredential
Repository.Meta, Repository.SchemaId
Modifier and Type | Field and Description |
---|---|
static String |
DRUPAL_NAME_FLD |
static int |
DRUPAL_OK_STATUS_VAL |
static String |
DRUPAL_PASS_FLD |
static String |
DRUPAL_STATUS_FLD |
static String |
DRUPAL_USERS_TBL |
static String |
WP_NAME_FLD |
static int |
WP_OK_STATUS_VAL |
static String |
WP_PASS_FLD |
static String |
WP_STATUS_FLD |
static String |
WP_USERS_TBL |
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 and Description |
---|
DrupalWPAuth() |
Modifier and Type | Method and Description |
---|---|
void |
addUser(BareJID user,
String password) |
AuthRepository.AccountStatus |
getAccountStatus(BareJID user) |
String |
getPassword(BareJID user) |
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 connection_str,
Map<String,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(Map<String,Object> props) |
void |
queryAuth(Map<String,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,
Boolean value) |
void |
updatePassword(BareJID user,
String password) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCredentialIds, getCredentials, getUsernames, isMechanismSupported, removeCredential, setCredentialsCodecs, updateCredential
public static final String DRUPAL_USERS_TBL
public static final String DRUPAL_NAME_FLD
public static final String DRUPAL_PASS_FLD
public static final String DRUPAL_STATUS_FLD
public static final int DRUPAL_OK_STATUS_VAL
public static final String WP_USERS_TBL
public static final String WP_NAME_FLD
public static final String WP_PASS_FLD
public static final String WP_STATUS_FLD
public static final int WP_OK_STATUS_VAL
public void addUser(BareJID user, String password) throws UserExistsException, TigaseDBException
addUser
in interface AuthRepository
UserExistsException
TigaseDBException
public String getResourceUri()
AuthRepository
getResourceUri
method returns database connection string.getResourceUri
in interface AuthRepository
String
value of database connection string.public long getUsersCount()
AuthRepository
getUsersCount
in interface AuthRepository
long
number of registered users in the repository.public long getUsersCount(String domain)
AuthRepository
getUsersCount
in interface AuthRepository
domain
- for which get the statisticslong
number of registered users in the repository.public void setDataSource(DataRepository dataSource) throws DBInitException
DataSourceAware
setDataSource
in interface DataSourceAware<DataRepository>
DBInitException
@Deprecated public void initRepository(String connection_str, Map<String,String> params) throws DBInitException
Repository
resource_uri
parameter as the database connection string or via
params
map if the required repository parameters are more complex or both.initRepository
in interface Repository
connection_str
- value in most cases representing the database connection string.params
- is a Map
with repository properties necessary to initialize and perform all the
functions. The initialization parameters are implementation dependent.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.public void logout(BareJID user) throws UserNotFoundException, TigaseDBException
logout
in interface AuthRepository
UserNotFoundException
TigaseDBException
public void loggedIn(BareJID jid) throws TigaseDBException
AuthRepository
last_login_time
)loggedIn
in interface AuthRepository
jid
- JID of logged user.TigaseDBException
- if an error occurspublic boolean otherAuth(Map<String,Object> props) throws UserNotFoundException, TigaseDBException, AuthorizationException
otherAuth
in interface AuthRepository
UserNotFoundException
TigaseDBException
AuthorizationException
public void queryAuth(Map<String,Object> authProps)
AuthRepository
queryAuth
returns mechanisms available for authentication.queryAuth
in interface AuthRepository
authProps
- a Map
value with parameters for authentication.public void removeUser(BareJID user) throws UserNotFoundException, TigaseDBException
removeUser
in interface AuthRepository
UserNotFoundException
TigaseDBException
public void updatePassword(BareJID user, String password) throws UserNotFoundException, TigaseDBException
updatePassword
in interface AuthRepository
UserNotFoundException
TigaseDBException
public String getPassword(BareJID user) throws UserNotFoundException, TigaseDBException
getPassword
in interface AuthRepository
UserNotFoundException
TigaseDBException
public boolean isUserDisabled(BareJID user) throws UserNotFoundException, TigaseDBException
isUserDisabled
in interface AuthRepository
UserNotFoundException
TigaseDBException
public void setUserDisabled(BareJID user, Boolean value) throws UserNotFoundException, TigaseDBException
setUserDisabled
in interface AuthRepository
UserNotFoundException
TigaseDBException
public void setAccountStatus(BareJID user, AuthRepository.AccountStatus status) throws TigaseDBException
setAccountStatus
in interface AuthRepository
TigaseDBException
public AuthRepository.AccountStatus getAccountStatus(BareJID user) throws TigaseDBException
getAccountStatus
in interface AuthRepository
TigaseDBException
Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.