Package tigase.examples
Class SampleCustomAuthRepository
java.lang.Object
tigase.examples.SampleCustomAuthRepository
- All Implemented Interfaces:
AuthRepository,Repository
This is only and example, sample implementation of AuthRepository and should not be used!
-
Nested Class Summary
Nested classes/interfaces inherited from interface tigase.db.AuthRepository
AuthRepository.AccountStatus, AuthRepository.DefaultCredentials, AuthRepository.SingleCredentialNested classes/interfaces inherited from interface tigase.db.Repository
Repository.Meta, Repository.SchemaId -
Field Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidgetAccountStatus(BareJID user) longgetActiveUsersCountIn(Duration duration) getCredentials(BareJID user, String credentialId) getPassword(BareJID user) getResourceUrimethod returns database connection string.longThis method is only used by the server statistics component to report number of registered users.longgetUsersCount(String domain) This method is only used by the server statistics component to report number of registered users for given domain.voidDo some actions on repository, when user logs in.voidbooleanvoidqueryAuthreturns mechanisms available for authentication.voidremoveUser(BareJID user) voidsetAccountStatus(BareJID user, AuthRepository.AccountStatus status) voidupdatePassword(BareJID user, String password) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tigase.db.AuthRepository
getCredentialIds, getUsernames, isMechanismSupported, isUserDisabled, removeCredential, setCredentialsCodecs, setUserDisabled, updateCredential, updateCredentialMethods inherited from interface tigase.db.Repository
initRepository
-
Constructor Details
-
SampleCustomAuthRepository
public SampleCustomAuthRepository()
-
-
Method Details
-
getCredentials
- Specified by:
getCredentialsin interfaceAuthRepository- Throws:
TigaseDBException
-
getAccountStatus
- Specified by:
getAccountStatusin interfaceAuthRepository- Throws:
TigaseDBException
-
loggedIn
Description copied from interface:AuthRepositoryDo some actions on repository, when user logs in. (for example updatelast_login_time)- Specified by:
loggedInin interfaceAuthRepository- Parameters:
jid- JID of logged user.- Throws:
TigaseDBException- if an error occurs
-
logout
- Specified by:
logoutin interfaceAuthRepository- Throws:
TigaseDBException
-
addUser
- Specified by:
addUserin interfaceAuthRepository- Throws:
TigaseDBException
-
getPassword
- Specified by:
getPasswordin interfaceAuthRepository- Throws:
TigaseDBException
-
getResourceUri
Description copied from interface:AuthRepositorygetResourceUrimethod returns database connection string.- Specified by:
getResourceUriin interfaceAuthRepository- Returns:
- a
Stringvalue of database connection string.
-
getActiveUsersCountIn
- Specified by:
getActiveUsersCountInin 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: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
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.
-
otherAuth
public boolean otherAuth(Map<String, Object> authProps) throws TigaseDBException, AuthorizationException- Specified by:
otherAuthin interfaceAuthRepository- Throws:
TigaseDBExceptionAuthorizationException
-
queryAuth
Description copied from interface:AuthRepositoryqueryAuthreturns mechanisms available for authentication.- Specified by:
queryAuthin interfaceAuthRepository- Parameters:
authProps- aMapvalue with parameters for authentication.
-
removeUser
- Specified by:
removeUserin interfaceAuthRepository- Throws:
TigaseDBException
-
setAccountStatus
public void setAccountStatus(BareJID user, AuthRepository.AccountStatus status) throws TigaseDBException - Specified by:
setAccountStatusin interfaceAuthRepository- Throws:
TigaseDBException
-
updatePassword
- Specified by:
updatePasswordin interfaceAuthRepository- Throws:
TigaseDBException
-