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
Constructors Constructor Description AuthRepositoryMDImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUser(BareJID user, java.lang.String password)AuthRepository.AccountStatusgetAccountStatus(BareJID user)java.util.Collection<java.lang.String>getCredentialIds(BareJID user)CredentialsgetCredentials(BareJID user, java.lang.String credentialId)java.lang.StringgetPassword(BareJID user)java.lang.StringgetResourceUri()getResourceUrimethod returns database connection string.longgetUsersCount()This method is only used by the server statistics component to report number of registered users.longgetUsersCount(java.lang.String domain)This method is only used by the server statistics component to report number of registered users for given domain.voidinitRepository(java.lang.String resource_uri, java.util.Map<java.lang.String,java.lang.String> params)Method is deprecated and should not be user any more.booleanisMechanismSupported(java.lang.String domain, java.lang.String mechanism)booleanisUserDisabled(BareJID user)voidloggedIn(BareJID user)Do some actions on repository, when user logs in.voidlogout(BareJID user)booleanotherAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)voidqueryAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)queryAuthreturns mechanisms available for authentication.voidremoveCredential(BareJID user, java.lang.String credentialId)voidremoveUser(BareJID user)voidsetAccountStatus(BareJID user, AuthRepository.AccountStatus status)voidsetUserDisabled(BareJID user, java.lang.Boolean value)voidupdateCredential(BareJID user, java.lang.String credentialId, java.lang.String password)voidupdatePassword(BareJID user, java.lang.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
-
-
-
-
Method Detail
-
addUser
public void addUser(BareJID user, java.lang.String password) throws TigaseDBException
- Specified by:
addUserin interfaceAuthRepository- Throws:
TigaseDBException
-
getAccountStatus
public AuthRepository.AccountStatus getAccountStatus(BareJID user) throws TigaseDBException
- Specified by:
getAccountStatusin interfaceAuthRepository- Throws:
TigaseDBException
-
getCredentials
public Credentials getCredentials(BareJID user, java.lang.String credentialId) throws TigaseDBException
- Specified by:
getCredentialsin interfaceAuthRepository- Throws:
TigaseDBException
-
getPassword
public java.lang.String getPassword(BareJID user) throws TigaseDBException
- Specified by:
getPasswordin interfaceAuthRepository- Throws:
TigaseDBException
-
getResourceUri
public java.lang.String getResourceUri()
Description copied from interface:AuthRepositorygetResourceUrimethod returns database connection string.- Specified by:
getResourceUriin interfaceAuthRepository- Returns:
- a
Stringvalue of database connection string.
-
getCredentialIds
public java.util.Collection<java.lang.String> getCredentialIds(BareJID user) throws TigaseDBException
- Specified by:
getCredentialIdsin interfaceAuthRepository- Throws:
TigaseDBException
-
getUsersCount
public long getUsersCount()
Description copied from interface:AuthRepositoryThis method is only used by the server statistics component to report number of registered users.- Specified by:
getUsersCountin interfaceAuthRepository- Returns:
- a
longnumber of registered users in the repository.
-
getUsersCount
public long getUsersCount(java.lang.String domain)
Description copied from interface:AuthRepositoryThis method is only used by the server statistics component to report number of registered users for given domain.- Specified by:
getUsersCountin interfaceAuthRepository- Parameters:
domain- for which get the statistics- Returns:
- a
longnumber of registered users in the repository.
-
initRepository
public void initRepository(java.lang.String resource_uri, java.util.Map<java.lang.String,java.lang.String> params) throws DBInitExceptionDescription copied from interface:RepositoryMethod 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_uriparameter as the database connection string or viaparamsmap if the required repository parameters are more complex or both.- Specified by:
initRepositoryin interfaceRepository- Parameters:
resource_uri- value in most cases representing the database connection string.params- is aMapwith 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
public boolean isMechanismSupported(java.lang.String domain, java.lang.String mechanism)- Specified by:
isMechanismSupportedin interfaceAuthRepository
-
isUserDisabled
public boolean isUserDisabled(BareJID user) throws TigaseDBException
- Specified by:
isUserDisabledin interfaceAuthRepository- Throws:
TigaseDBException
-
loggedIn
public void loggedIn(BareJID user) throws TigaseDBException
Description copied from interface:AuthRepositoryDo some actions on repository, when user logs in. (for example updatelast_login_time)- Specified by:
loggedInin interfaceAuthRepository- Parameters:
user- JID of logged user.- Throws:
TigaseDBException- if an error occurs
-
logout
public void logout(BareJID user) throws TigaseDBException
- Specified by:
logoutin interfaceAuthRepository- Throws:
TigaseDBException
-
otherAuth
public boolean otherAuth(java.util.Map<java.lang.String,java.lang.Object> authProps) throws TigaseDBException, AuthorizationException- Specified by:
otherAuthin interfaceAuthRepository- Throws:
TigaseDBExceptionAuthorizationException
-
queryAuth
public void queryAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)
Description copied from interface:AuthRepositoryqueryAuthreturns mechanisms available for authentication.- Specified by:
queryAuthin interfaceAuthRepository- Parameters:
authProps- aMapvalue with parameters for authentication.
-
removeCredential
public void removeCredential(BareJID user, java.lang.String credentialId) throws TigaseDBException
- Specified by:
removeCredentialin interfaceAuthRepository- Throws:
TigaseDBException
-
removeUser
public void removeUser(BareJID user) throws TigaseDBException
- Specified by:
removeUserin interfaceAuthRepository- Throws:
TigaseDBException
-
setAccountStatus
public void setAccountStatus(BareJID user, AuthRepository.AccountStatus status) throws TigaseDBException
- Specified by:
setAccountStatusin interfaceAuthRepository- Throws:
TigaseDBException
-
setUserDisabled
public void setUserDisabled(BareJID user, java.lang.Boolean value) throws TigaseDBException
- Specified by:
setUserDisabledin interfaceAuthRepository- Throws:
TigaseDBException
-
updateCredential
public void updateCredential(BareJID user, java.lang.String credentialId, java.lang.String password) throws TigaseDBException
- Specified by:
updateCredentialin interfaceAuthRepository- Throws:
TigaseDBException
-
updatePassword
public void updatePassword(BareJID user, java.lang.String password) throws TigaseDBException
- Specified by:
updatePasswordin interfaceAuthRepository- Throws:
TigaseDBException
-
-