public class MongoRepository extends tigase.db.AbstractAuthRepositoryWithCredentials implements tigase.db.UserRepository, tigase.db.DataSourceAware<MongoDataSource>, MongoRepositoryVersionAware
tigase.db.UserRepository.UserRemovedEventtigase.db.Repository.Meta, tigase.db.Repository.SchemaId| Modifier and Type | Field and Description |
|---|---|
protected boolean |
autoCreateUser |
protected static String |
DOMAIN_KEY |
protected static String |
ID_KEY |
protected static String |
NODES_COLLECTION |
protected static String |
USER_CREDENTIALS_COLLECTION |
protected static String |
USERS_COLLECTION |
| Constructor and Description |
|---|
MongoRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDataList(tigase.xmpp.jid.BareJID user,
String subnode,
String key,
String[] list) |
void |
addUser(tigase.xmpp.jid.BareJID user) |
void |
addUser(tigase.xmpp.jid.BareJID user,
String password) |
protected byte[] |
calculateHash(String user) |
protected byte[] |
generateId(tigase.xmpp.jid.BareJID user) |
tigase.db.AuthRepository.AccountStatus |
getAccountStatus(tigase.xmpp.jid.BareJID user) |
tigase.auth.credentials.Credentials |
getCredentials(tigase.xmpp.jid.BareJID user,
String username) |
String |
getData(tigase.xmpp.jid.BareJID user,
String key) |
String |
getData(tigase.xmpp.jid.BareJID user,
String subnode,
String key) |
String |
getData(tigase.xmpp.jid.BareJID user,
String subnode,
String key,
String def) |
String[] |
getDataList(tigase.xmpp.jid.BareJID user,
String subnode,
String key) |
String[] |
getKeys(tigase.xmpp.jid.BareJID user) |
String[] |
getKeys(tigase.xmpp.jid.BareJID user,
String subnode) |
String |
getResourceUri() |
String[] |
getSubnodes(tigase.xmpp.jid.BareJID user) |
String[] |
getSubnodes(tigase.xmpp.jid.BareJID user,
String subnode) |
Collection<String> |
getUsernames(tigase.xmpp.jid.BareJID user) |
List<tigase.xmpp.jid.BareJID> |
getUsers() |
long |
getUsersCount() |
long |
getUsersCount(String domain) |
long |
getUserUID(tigase.xmpp.jid.BareJID user)
Deprecated.
|
void |
initRepository(String resource_uri,
Map<String,String> params)
Deprecated.
|
void |
loggedIn(tigase.xmpp.jid.BareJID jid) |
void |
logout(tigase.xmpp.jid.BareJID user) |
boolean |
otherAuth(Map<String,Object> authProps) |
void |
queryAuth(Map<String,Object> authProps) |
protected <T> List<T> |
readAllDistinctValuesForField(com.mongodb.client.MongoCollection<org.bson.Document> collection,
String field,
org.bson.Document crit) |
void |
removeCredential(tigase.xmpp.jid.BareJID user,
String username) |
void |
removeData(tigase.xmpp.jid.BareJID user,
String key) |
void |
removeData(tigase.xmpp.jid.BareJID user,
String subnode,
String key) |
void |
removeSubnode(tigase.xmpp.jid.BareJID user,
String subnode) |
void |
removeUser(tigase.xmpp.jid.BareJID user) |
void |
setAccountStatus(tigase.xmpp.jid.BareJID user,
tigase.db.AuthRepository.AccountStatus status) |
void |
setData(tigase.xmpp.jid.BareJID user,
String key,
String value) |
void |
setData(tigase.xmpp.jid.BareJID user,
String subnode,
String key,
String value) |
void |
setDataList(tigase.xmpp.jid.BareJID user,
String subnode,
String key,
String[] list) |
void |
setDataSource(MongoDataSource dataSource) |
void |
updateCredential(tigase.xmpp.jid.BareJID user,
String username,
String password) |
void |
updatePassword(tigase.xmpp.jid.BareJID user,
String password) |
tigase.db.util.SchemaLoader.Result |
updateSchema(Optional<tigase.util.Version> oldVersion,
tigase.util.Version newVersion) |
boolean |
userExists(tigase.xmpp.jid.BareJID user) |
getCredentialsDecoder, getCredentialsEncoder, getPassword, isMechanismSupported, setCredentialsCodecsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetVersionprotected static final String USERS_COLLECTION
protected static final String USER_CREDENTIALS_COLLECTION
protected static final String NODES_COLLECTION
protected static final String ID_KEY
protected static final String DOMAIN_KEY
@ConfigField(desc="Auto create user",
alias="autoCreateUser=")
protected boolean autoCreateUser
public void addDataList(tigase.xmpp.jid.BareJID user,
String subnode,
String key,
String[] list)
throws tigase.db.UserNotFoundException,
tigase.db.TigaseDBException
addDataList in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic void addUser(tigase.xmpp.jid.BareJID user)
throws tigase.db.UserExistsException,
tigase.db.TigaseDBException
addUser in interface tigase.db.UserRepositorytigase.db.UserExistsExceptiontigase.db.TigaseDBExceptionpublic void addUser(tigase.xmpp.jid.BareJID user,
String password)
throws tigase.db.UserExistsException,
tigase.db.TigaseDBException
addUser in interface tigase.db.AuthRepositorytigase.db.UserExistsExceptiontigase.db.TigaseDBExceptionprotected byte[] calculateHash(String user) throws tigase.db.TigaseDBException
tigase.db.TigaseDBExceptionprotected byte[] generateId(tigase.xmpp.jid.BareJID user)
throws tigase.db.TigaseDBException
tigase.db.TigaseDBExceptionpublic tigase.db.AuthRepository.AccountStatus getAccountStatus(tigase.xmpp.jid.BareJID user)
throws tigase.db.TigaseDBException
getAccountStatus in interface tigase.db.AuthRepositorytigase.db.TigaseDBExceptionpublic tigase.auth.credentials.Credentials getCredentials(tigase.xmpp.jid.BareJID user,
String username)
throws tigase.db.TigaseDBException
getCredentials in interface tigase.db.AuthRepositorytigase.db.TigaseDBExceptionpublic String getData(tigase.xmpp.jid.BareJID user, String subnode, String key, String def) throws tigase.db.UserNotFoundException, tigase.db.TigaseDBException
getData in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic String getData(tigase.xmpp.jid.BareJID user, String subnode, String key) throws tigase.db.UserNotFoundException, tigase.db.TigaseDBException
getData in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic String getData(tigase.xmpp.jid.BareJID user, String key) throws tigase.db.UserNotFoundException, tigase.db.TigaseDBException
getData in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic String[] getDataList(tigase.xmpp.jid.BareJID user, String subnode, String key) throws tigase.db.UserNotFoundException, tigase.db.TigaseDBException
getDataList in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic String[] getKeys(tigase.xmpp.jid.BareJID user, String subnode) throws tigase.db.UserNotFoundException, tigase.db.TigaseDBException
getKeys in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic String[] getKeys(tigase.xmpp.jid.BareJID user) throws tigase.db.UserNotFoundException, tigase.db.TigaseDBException
getKeys in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic String getResourceUri()
getResourceUri in interface tigase.db.AuthRepositorygetResourceUri in interface tigase.db.UserRepositorypublic String[] getSubnodes(tigase.xmpp.jid.BareJID user) throws tigase.db.UserNotFoundException, tigase.db.TigaseDBException
getSubnodes in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic String[] getSubnodes(tigase.xmpp.jid.BareJID user, String subnode) throws tigase.db.UserNotFoundException, tigase.db.TigaseDBException
getSubnodes in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic Collection<String> getUsernames(tigase.xmpp.jid.BareJID user) throws tigase.db.TigaseDBException
getUsernames in interface tigase.db.AuthRepositorytigase.db.TigaseDBException@Deprecated public long getUserUID(tigase.xmpp.jid.BareJID user) throws tigase.db.TigaseDBException
getUserUID in interface tigase.db.UserRepositorytigase.db.TigaseDBExceptionpublic List<tigase.xmpp.jid.BareJID> getUsers() throws tigase.db.TigaseDBException
getUsers in interface tigase.db.UserRepositorytigase.db.TigaseDBExceptionpublic long getUsersCount()
getUsersCount in interface tigase.db.AuthRepositorygetUsersCount in interface tigase.db.UserRepositorypublic long getUsersCount(String domain)
getUsersCount in interface tigase.db.AuthRepositorygetUsersCount in interface tigase.db.UserRepository@Deprecated public void initRepository(String resource_uri, Map<String,String> params) throws tigase.db.DBInitException
initRepository in interface tigase.db.Repositorytigase.db.DBInitExceptionpublic void loggedIn(tigase.xmpp.jid.BareJID jid)
throws tigase.db.TigaseDBException
loggedIn in interface tigase.db.AuthRepositorytigase.db.TigaseDBExceptionpublic void logout(tigase.xmpp.jid.BareJID user)
throws tigase.db.UserNotFoundException,
tigase.db.TigaseDBException
logout in interface tigase.db.AuthRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic boolean otherAuth(Map<String,Object> authProps) throws tigase.db.UserNotFoundException, tigase.db.TigaseDBException, tigase.db.AuthorizationException
otherAuth in interface tigase.db.AuthRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptiontigase.db.AuthorizationExceptionpublic void queryAuth(Map<String,Object> authProps)
queryAuth in interface tigase.db.AuthRepositoryprotected <T> List<T> readAllDistinctValuesForField(com.mongodb.client.MongoCollection<org.bson.Document> collection, String field, org.bson.Document crit) throws com.mongodb.MongoException
com.mongodb.MongoExceptionpublic void removeCredential(tigase.xmpp.jid.BareJID user,
String username)
throws tigase.db.TigaseDBException
removeCredential in interface tigase.db.AuthRepositorytigase.db.TigaseDBExceptionpublic void removeData(tigase.xmpp.jid.BareJID user,
String key)
throws tigase.db.UserNotFoundException,
tigase.db.TigaseDBException
removeData in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic void removeData(tigase.xmpp.jid.BareJID user,
String subnode,
String key)
throws tigase.db.UserNotFoundException,
tigase.db.TigaseDBException
removeData in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic void removeSubnode(tigase.xmpp.jid.BareJID user,
String subnode)
throws tigase.db.UserNotFoundException,
tigase.db.TigaseDBException
removeSubnode in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic void removeUser(tigase.xmpp.jid.BareJID user)
throws tigase.db.UserNotFoundException,
tigase.db.TigaseDBException
removeUser in interface tigase.db.AuthRepositoryremoveUser in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic void setAccountStatus(tigase.xmpp.jid.BareJID user,
tigase.db.AuthRepository.AccountStatus status)
throws tigase.db.TigaseDBException
setAccountStatus in interface tigase.db.AuthRepositorytigase.db.TigaseDBExceptionpublic void setData(tigase.xmpp.jid.BareJID user,
String key,
String value)
throws tigase.db.UserNotFoundException,
tigase.db.TigaseDBException
setData in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic void setData(tigase.xmpp.jid.BareJID user,
String subnode,
String key,
String value)
throws tigase.db.UserNotFoundException,
tigase.db.TigaseDBException
setData in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic void setDataList(tigase.xmpp.jid.BareJID user,
String subnode,
String key,
String[] list)
throws tigase.db.UserNotFoundException,
tigase.db.TigaseDBException
setDataList in interface tigase.db.UserRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic void setDataSource(MongoDataSource dataSource)
setDataSource in interface tigase.db.DataSourceAware<MongoDataSource>public void updateCredential(tigase.xmpp.jid.BareJID user,
String username,
String password)
throws tigase.db.TigaseDBException
updateCredential in interface tigase.db.AuthRepositorytigase.db.TigaseDBExceptionpublic void updatePassword(tigase.xmpp.jid.BareJID user,
String password)
throws tigase.db.UserNotFoundException,
tigase.db.TigaseDBException
updatePassword in interface tigase.db.AuthRepositorytigase.db.UserNotFoundExceptiontigase.db.TigaseDBExceptionpublic tigase.db.util.SchemaLoader.Result updateSchema(Optional<tigase.util.Version> oldVersion, tigase.util.Version newVersion) throws tigase.db.TigaseDBException
updateSchema in interface tigase.db.util.RepositoryVersionAwaretigase.db.TigaseDBExceptionpublic boolean userExists(tigase.xmpp.jid.BareJID user)
userExists in interface tigase.db.UserRepositoryCopyright © 2014–2019 "Tigase, Inc.". All rights reserved.