public class AuthRepositoryImpl extends Object implements AuthRepository
AuthRepository.AccountStatus, AuthRepository.DefaultCredentials, AuthRepository.SingleCredential
Repository.Meta, Repository.SchemaId
Modifier and Type | Field and Description |
---|---|
static String |
ACCOUNT_STATUS_KEY |
protected static String |
DISABLED_KEY |
protected static Logger |
log |
protected static String |
PASSWORD_KEY |
DATA_KEY, DIGEST_ID_KEY, DIGEST_KEY, MACHANISM_KEY, PROTOCOL_KEY, PROTOCOL_VAL_NONSASL, PROTOCOL_VAL_SASL, REALM_KEY, RESULT_KEY, SERVER_NAME_KEY, USER_ID_KEY, USERNAME_KEY
Constructor and Description |
---|
AuthRepositoryImpl(UserRepository repo)
Creates a new
AuthRepositoryImpl instance. |
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 string,
Map<String,String> params)
Deprecated.
|
boolean |
isMechanismSupported(String domain,
String mechanism) |
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 value) |
void |
setUserDisabled(BareJID user,
Boolean value) |
void |
updatePassword(BareJID user,
String password) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCredentials, getUsernames, removeCredential, setCredentialsCodecs, updateCredential
public static final String ACCOUNT_STATUS_KEY
protected static final Logger log
protected static final String DISABLED_KEY
protected static final String PASSWORD_KEY
public AuthRepositoryImpl(UserRepository repo)
AuthRepositoryImpl
instance.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 void addUser(BareJID user, String password) throws UserExistsException, TigaseDBException
addUser
in interface AuthRepository
UserExistsException
TigaseDBException
public boolean isMechanismSupported(String domain, String mechanism)
isMechanismSupported
in interface AuthRepository
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.@Deprecated public void initRepository(String string, 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
string
- 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)
logout
in interface AuthRepository
public 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 TigaseDBException
updatePassword
in interface AuthRepository
TigaseDBException
public String getPassword(BareJID user) throws UserNotFoundException, TigaseDBException
getPassword
in interface AuthRepository
UserNotFoundException
TigaseDBException
public AuthRepository.AccountStatus getAccountStatus(BareJID user) throws TigaseDBException
getAccountStatus
in interface AuthRepository
TigaseDBException
public boolean isUserDisabled(BareJID user) throws UserNotFoundException, TigaseDBException
isUserDisabled
in interface AuthRepository
UserNotFoundException
TigaseDBException
public void setAccountStatus(BareJID user, AuthRepository.AccountStatus value) throws TigaseDBException
setAccountStatus
in interface AuthRepository
TigaseDBException
public void setUserDisabled(BareJID user, Boolean value) throws UserNotFoundException, TigaseDBException
setUserDisabled
in interface AuthRepository
UserNotFoundException
TigaseDBException
Copyright © 2004–2019 "Tigase, Inc.". All rights reserved.