Package tigase.db
Class AuthRepositoryMDImpl
java.lang.Object
tigase.db.beans.MDPoolBean<S,T>
tigase.db.beans.MDPoolBeanWithStatistics<AuthRepository,AuthRepositoryMDPoolBean.AuthRepositoryConfigBean>
tigase.db.AuthRepositoryMDImpl
- All Implemented Interfaces:
AuthRepository
,Repository
,RegistrarBean
,RegistrarBeanWithDefaultBeanClass
,ComponentStatisticsProvider
,StatisticsProviderIfc
- Direct Known Subclasses:
AuthRepositoryMDPoolBean
public abstract class AuthRepositoryMDImpl
extends MDPoolBeanWithStatistics<AuthRepository,AuthRepositoryMDPoolBean.AuthRepositoryConfigBean>
implements AuthRepository
Implementation of multi domain pool for authentication repositories. Created: Mar 27, 2010 9:10:21 PM
- 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 inherited from class tigase.db.beans.MDPoolBean
POOL_CLASS, POOL_SIZE, REPO_CLASS, REPO_URI
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getAccountStatus
(BareJID user) long
getActiveUsersCountIn
(Duration duration) getCredentialIds
(BareJID user) getCredentials
(BareJID user, String credentialId) getPassword
(BareJID user) getResourceUri
method returns database connection string.long
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) Method is deprecated and should not be user any more.boolean
isMechanismSupported
(String domain, String mechanism) boolean
isUserDisabled
(BareJID user) void
Do some actions on repository, when user logs in.void
boolean
void
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) void
updateCredential
(BareJID user, String credentialId, String password) void
updatePassword
(BareJID user, String password) Methods inherited from class tigase.db.beans.MDPoolBeanWithStatistics
addRepo, everyHour, everyMinute, everySecond, getDefaultRepository, getDomainsList, getRepo, getStatistics, removeRepo, repositoriesStream, setDefault, setStatisticsEnabled, wrapInProxy
Methods inherited from class tigase.db.beans.MDPoolBean
getConfigClass, getDefaultAlias, getName, register, registerConfigBean, unregister
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
getUsernames, setCredentialsCodecs
Methods inherited from interface tigase.stats.ComponentStatisticsProvider
belongsTo
Methods inherited from interface tigase.kernel.beans.RegistrarBeanWithDefaultBeanClass
getDefaultBeanClass
-
Constructor Details
-
AuthRepositoryMDImpl
public AuthRepositoryMDImpl()
-
-
Method Details
-
addUser
- Specified by:
addUser
in interfaceAuthRepository
- Throws:
TigaseDBException
-
getAccountStatus
- Specified by:
getAccountStatus
in interfaceAuthRepository
- Throws:
TigaseDBException
-
getCredentials
- Specified by:
getCredentials
in interfaceAuthRepository
- Throws:
TigaseDBException
-
getPassword
- Specified by:
getPassword
in interfaceAuthRepository
- Throws:
TigaseDBException
-
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.
-
getCredentialIds
- Specified by:
getCredentialIds
in interfaceAuthRepository
- Throws:
TigaseDBException
-
getActiveUsersCountIn
- Specified by:
getActiveUsersCountIn
in interfaceAuthRepository
- Parameters:
duration
- Time range within which active users should be counted. Method is only used by statistics.- Returns:
- number of active users in required range
-
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
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.
-
initRepository
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:
resource_uri
- 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.
-
isMechanismSupported
- Specified by:
isMechanismSupported
in interfaceAuthRepository
-
isUserDisabled
- Specified by:
isUserDisabled
in interfaceAuthRepository
- Throws:
TigaseDBException
-
loggedIn
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:
user
- JID of logged user.- Throws:
TigaseDBException
- if an error occurs
-
logout
- Specified by:
logout
in interfaceAuthRepository
- Throws:
TigaseDBException
-
otherAuth
public boolean otherAuth(Map<String, Object> authProps) throws TigaseDBException, AuthorizationException- Specified by:
otherAuth
in interfaceAuthRepository
- Throws:
TigaseDBException
AuthorizationException
-
queryAuth
Description copied from interface:AuthRepository
queryAuth
returns mechanisms available for authentication.- Specified by:
queryAuth
in interfaceAuthRepository
- Parameters:
authProps
- aMap
value with parameters for authentication.
-
removeCredential
- Specified by:
removeCredential
in interfaceAuthRepository
- Throws:
TigaseDBException
-
removeUser
- Specified by:
removeUser
in interfaceAuthRepository
- Throws:
TigaseDBException
-
setAccountStatus
public void setAccountStatus(BareJID user, AuthRepository.AccountStatus status) throws TigaseDBException - Specified by:
setAccountStatus
in interfaceAuthRepository
- Throws:
TigaseDBException
-
setUserDisabled
- Specified by:
setUserDisabled
in interfaceAuthRepository
- Throws:
TigaseDBException
-
updateCredential
public void updateCredential(BareJID user, String credentialId, String password) throws TigaseDBException - Specified by:
updateCredential
in interfaceAuthRepository
- Throws:
TigaseDBException
-
updatePassword
- Specified by:
updatePassword
in interfaceAuthRepository
- Throws:
TigaseDBException
-