public class AuthRepositoryPool extends Object implements AuthRepository, RepositoryPool<AuthRepository>
AuthRepository
uses connection pool or non blocking, concurrent access to authentication storage (ie.
DataSourcePool
), then this pool is not need.
AuthRepository.AccountStatus, AuthRepository.DefaultCredentials, AuthRepository.SingleCredential
Repository.Meta, Repository.SchemaId
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 |
---|
AuthRepositoryPool() |
Modifier and Type | Method and Description |
---|---|
void |
addRepo(AuthRepository repo)
Method called to add instance of a repository to the repository pool.
|
void |
addUser(BareJID user,
String password) |
AuthRepository.AccountStatus |
getAccountStatus(BareJID user) |
Collection<String> |
getCredentialIds(BareJID user) |
Credentials |
getCredentials(BareJID user,
String credentialId) |
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 resource_uri,
Map<String,String> params)
Deprecated.
|
boolean |
isMechanismSupported(String domain,
String mechanism) |
boolean |
isUserDisabled(BareJID user) |
void |
loggedIn(BareJID user)
Do some actions on repository, when user logs in.
|
void |
logout(BareJID user) |
boolean |
otherAuth(Map<String,Object> authProps) |
void |
queryAuth(Map<String,Object> authProps)
queryAuth returns mechanisms available for authentication. |
void |
removeCredential(BareJID user,
String credentialId) |
void |
removeUser(BareJID user) |
void |
setAccountStatus(BareJID user,
AuthRepository.AccountStatus status) |
void |
setUserDisabled(BareJID user,
Boolean value) |
AuthRepository |
takeRepo() |
void |
updateCredential(BareJID user,
String credentialId,
String password) |
void |
updatePassword(BareJID user,
String password) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUsernames, setCredentialsCodecs
public void addRepo(AuthRepository repo)
RepositoryPool
addRepo
in interface RepositoryPool<AuthRepository>
repo
- instance of a repositorypublic void addUser(BareJID user, String password) throws TigaseDBException
addUser
in interface AuthRepository
TigaseDBException
public AuthRepository.AccountStatus getAccountStatus(BareJID user) throws TigaseDBException
getAccountStatus
in interface AuthRepository
TigaseDBException
public Credentials getCredentials(BareJID user, String credentialId) throws TigaseDBException
getCredentials
in interface AuthRepository
TigaseDBException
public String getPassword(BareJID user) throws TigaseDBException
getPassword
in interface AuthRepository
TigaseDBException
public String getResourceUri()
AuthRepository
getResourceUri
method returns database connection string.getResourceUri
in interface AuthRepository
String
value of database connection string.public Collection<String> getCredentialIds(BareJID user) throws TigaseDBException
getCredentialIds
in interface AuthRepository
TigaseDBException
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 resource_uri, 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
resource_uri
- 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 boolean isMechanismSupported(String domain, String mechanism)
isMechanismSupported
in interface AuthRepository
public boolean isUserDisabled(BareJID user) throws TigaseDBException
isUserDisabled
in interface AuthRepository
TigaseDBException
public void loggedIn(BareJID user) throws TigaseDBException
AuthRepository
last_login_time
)loggedIn
in interface AuthRepository
user
- JID of logged user.TigaseDBException
- if an error occurspublic void logout(BareJID user) throws TigaseDBException
logout
in interface AuthRepository
TigaseDBException
public boolean otherAuth(Map<String,Object> authProps) throws TigaseDBException, AuthorizationException
otherAuth
in interface AuthRepository
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 removeCredential(BareJID user, String credentialId) throws TigaseDBException
removeCredential
in interface AuthRepository
TigaseDBException
public void removeUser(BareJID user) throws TigaseDBException
removeUser
in interface AuthRepository
TigaseDBException
public void setAccountStatus(BareJID user, AuthRepository.AccountStatus status) throws TigaseDBException
setAccountStatus
in interface AuthRepository
TigaseDBException
public void setUserDisabled(BareJID user, Boolean value) throws TigaseDBException
setUserDisabled
in interface AuthRepository
TigaseDBException
public AuthRepository takeRepo()
public void updateCredential(BareJID user, String credentialId, String password) throws TigaseDBException
updateCredential
in interface AuthRepository
TigaseDBException
public void updatePassword(BareJID user, String password) throws TigaseDBException
updatePassword
in interface AuthRepository
TigaseDBException
Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.