public class AuthRepositoryImpl extends Object implements AuthRepository
Repository.Meta| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
log
Field description
|
protected static String |
PASSWORD_KEY
Field description
|
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(tigase.xmpp.BareJID user,
String password)
Describe
addUser method here. |
boolean |
digestAuth(tigase.xmpp.BareJID user,
String digest,
String id,
String alg)
Deprecated.
|
String |
getPassword(tigase.xmpp.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)
The method is called to initialize the data repository.
|
void |
logout(tigase.xmpp.BareJID user)
Describe
logout method here. |
boolean |
otherAuth(Map<String,Object> props)
Describe
otherAuth method here. |
boolean |
plainAuth(tigase.xmpp.BareJID user,
String password)
Deprecated.
|
void |
queryAuth(Map<String,Object> authProps)
queryAuth returns mechanisms available for authentication. |
void |
removeUser(tigase.xmpp.BareJID user)
Describe
removeUser method here. |
void |
updatePassword(tigase.xmpp.BareJID user,
String password)
Describe
updatePassword method here. |
protected static final Logger log
protected static final String PASSWORD_KEY
public AuthRepositoryImpl(UserRepository repo)
AuthRepositoryImpl instance.repo - public void addUser(tigase.xmpp.BareJID user,
String password)
throws UserExistsException,
TigaseDBException
AuthRepositoryaddUser method here.addUser in interface AuthRepositoryuser - a BareJID valuepassword - a String valueUserExistsException - if an error occursTigaseDBException - if an error occurs@Deprecated public boolean digestAuth(tigase.xmpp.BareJID user, String digest, String id, String alg) throws UserNotFoundException, TigaseDBException, AuthorizationException
AuthRepositorydigestAuth method performs non-sasl, digest authentication
as described in non-sasl authentication
XEP-0078
For now it is empty and always returns false as I don't
have description for database with passwords.digestAuth in interface AuthRepositoryuser - a BareJID value of user namedigest - a String value password digest sumid - a String value session ID used for digest sum
calculation.alg - a String value of algorithm ID used for digest sum
calculation.boolean value true on successful
authentication, false on authentication failure.UserNotFoundException - if an given user name is not found in
the authentication repository.TigaseDBException - if an error occurs during during accessing
database;AuthorizationException - if an error occurs during authentication
process.public String getResourceUri()
AuthRepositorygetResourceUri method returns database connection string.getResourceUri in interface AuthRepositoryString value of database connection string.public long getUsersCount()
AuthRepositorygetUsersCount in interface AuthRepositorylong number of registered users in the repository.public long getUsersCount(String domain)
AuthRepositorygetUsersCount in interface AuthRepositorylong number of registered users in the repository.public void initRepository(String string, Map<String,String> params) throws DBInitException
Repositoryresource_uri
parameter as the database connection string or via params map if
the required repository parameters are more complex or both.initRepository in interface Repositorystring - 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(tigase.xmpp.BareJID user)
AuthRepositorylogout method here.logout in interface AuthRepositoryuser - a BareJID valuepublic boolean otherAuth(Map<String,Object> props) throws UserNotFoundException, TigaseDBException, AuthorizationException
AuthRepositoryotherAuth method here.otherAuth in interface AuthRepositoryprops - a Map valueboolean valueUserNotFoundException - if an error occursTigaseDBException - if an error occursAuthorizationException - if an error occurs@Deprecated public boolean plainAuth(tigase.xmpp.BareJID user, String password) throws UserNotFoundException, TigaseDBException
AuthRepositoryplainAuth method performs non-sasl, plain authentication
as described in non-sasl authentication
XEP-0078.plainAuth in interface AuthRepositoryuser - a BareJID value of user namepassword - a String value of plain user password.boolean value true on successful
authentication, false on authentication failure.UserNotFoundException - if an given user name is not found in
the authentication repository.TigaseDBException - if an error occurs during during accessing
database;public void queryAuth(Map<String,Object> authProps)
AuthRepositoryqueryAuth returns mechanisms available for authentication.queryAuth in interface AuthRepositoryauthProps - a Map value with parameters for authentication.public void removeUser(tigase.xmpp.BareJID user)
throws UserNotFoundException,
TigaseDBException
AuthRepositoryremoveUser method here.removeUser in interface AuthRepositoryuser - a BareJID valueUserNotFoundException - if an error occursTigaseDBException - if an error occurspublic void updatePassword(tigase.xmpp.BareJID user,
String password)
throws TigaseDBException
AuthRepositoryupdatePassword method here.updatePassword in interface AuthRepositoryuser - a BareJID valuepassword - a String valueUserNotFoundExceptionTigaseDBException - if an error occurspublic String getPassword(tigase.xmpp.BareJID user) throws UserNotFoundException, TigaseDBException
getPassword in interface AuthRepositoryUserNotFoundExceptionTigaseDBExceptionCopyright © 2016 "Tigase, Inc.". All rights reserved.