Class MongoRepositoryOld

  • All Implemented Interfaces:
    tigase.db.AuthRepository, tigase.db.DataSourceAware<MongoDataSource>, tigase.db.Repository, tigase.db.UserRepository, tigase.db.util.RepositoryVersionAware, MongoRepositoryVersionAware

    @Deprecated
    public class MongoRepositoryOld
    extends java.lang.Object
    implements tigase.db.AuthRepository, tigase.db.UserRepository, tigase.db.DataSourceAware<MongoDataSource>, MongoRepositoryVersionAware
    Deprecated.
    MongoRepository is implementation of UserRepository and AuthRepository which supports MongoDB data store.
    Author:
    andrzej
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface tigase.db.AuthRepository

        tigase.db.AuthRepository.AccountStatus, tigase.db.AuthRepository.DefaultCredentials, tigase.db.AuthRepository.SingleCredential
      • Nested classes/interfaces inherited from interface tigase.db.Repository

        tigase.db.Repository.Meta, tigase.db.Repository.SchemaId
      • Nested classes/interfaces inherited from interface tigase.db.util.RepositoryVersionAware

        tigase.db.util.RepositoryVersionAware.SchemaVersion
      • Nested classes/interfaces inherited from interface tigase.db.UserRepository

        tigase.db.UserRepository.UserRemovedEvent
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean autoCreateUser
      Deprecated.
       
      protected static java.lang.String DOMAIN_KEY
      Deprecated.
       
      protected static java.lang.String ID_KEY
      Deprecated.
       
      protected static java.lang.String NODES_COLLECTION
      Deprecated.
       
      protected static java.lang.String USERS_COLLECTION
      Deprecated.
       
      • 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
      MongoRepositoryOld()
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addDataList​(tigase.xmpp.jid.BareJID user, java.lang.String subnode, java.lang.String key, java.lang.String[] list)
      Deprecated.
       
      void addUser​(tigase.xmpp.jid.BareJID user)
      Deprecated.
       
      void addUser​(tigase.xmpp.jid.BareJID user, java.lang.String password)
      Deprecated.
       
      protected byte[] calculateHash​(java.lang.String user)
      Deprecated.
       
      protected byte[] generateId​(tigase.xmpp.jid.BareJID user)
      Deprecated.
       
      tigase.db.AuthRepository.AccountStatus getAccountStatus​(tigase.xmpp.jid.BareJID user)
      Deprecated.
       
      tigase.auth.credentials.Credentials getCredentials​(tigase.xmpp.jid.BareJID user, java.lang.String credentialId)
      Deprecated.
       
      java.lang.String getData​(tigase.xmpp.jid.BareJID user, java.lang.String key)
      Deprecated.
       
      java.lang.String getData​(tigase.xmpp.jid.BareJID user, java.lang.String subnode, java.lang.String key)
      Deprecated.
       
      java.lang.String getData​(tigase.xmpp.jid.BareJID user, java.lang.String subnode, java.lang.String key, java.lang.String def)
      Deprecated.
       
      java.lang.String[] getDataList​(tigase.xmpp.jid.BareJID user, java.lang.String subnode, java.lang.String key)
      Deprecated.
       
      java.lang.String[] getKeys​(tigase.xmpp.jid.BareJID user)
      Deprecated.
       
      java.lang.String[] getKeys​(tigase.xmpp.jid.BareJID user, java.lang.String subnode)
      Deprecated.
       
      java.lang.String getPassword​(tigase.xmpp.jid.BareJID user)
      Deprecated.
       
      java.lang.String getResourceUri()
      Deprecated.
       
      java.lang.String[] getSubnodes​(tigase.xmpp.jid.BareJID user)
      Deprecated.
       
      java.lang.String[] getSubnodes​(tigase.xmpp.jid.BareJID user, java.lang.String subnode)
      Deprecated.
       
      java.util.List<tigase.xmpp.jid.BareJID> getUsers()
      Deprecated.
       
      long getUsersCount()
      Deprecated.
       
      long getUsersCount​(java.lang.String domain)
      Deprecated.
       
      long getUserUID​(tigase.xmpp.jid.BareJID user)
      Deprecated.
      void initRepository​(java.lang.String resource_uri, java.util.Map<java.lang.String,​java.lang.String> params)
      Deprecated.
      boolean isUserDisabled​(tigase.xmpp.jid.BareJID user)
      Deprecated.
       
      void loggedIn​(tigase.xmpp.jid.BareJID jid)
      Deprecated.
       
      void logout​(tigase.xmpp.jid.BareJID user)
      Deprecated.
       
      boolean otherAuth​(java.util.Map<java.lang.String,​java.lang.Object> authProps)
      Deprecated.
       
      void queryAuth​(java.util.Map<java.lang.String,​java.lang.Object> authProps)
      Deprecated.
       
      protected <T> java.util.List<T> readAllDistinctValuesForField​(com.mongodb.client.MongoCollection<org.bson.Document> collection, java.lang.String field, org.bson.Document crit)
      Deprecated.
       
      void removeCredential​(tigase.xmpp.jid.BareJID user, java.lang.String credentialId)
      Deprecated.
       
      void removeData​(tigase.xmpp.jid.BareJID user, java.lang.String key)
      Deprecated.
       
      void removeData​(tigase.xmpp.jid.BareJID user, java.lang.String subnode, java.lang.String key)
      Deprecated.
       
      void removeSubnode​(tigase.xmpp.jid.BareJID user, java.lang.String subnode)
      Deprecated.
       
      void removeUser​(tigase.xmpp.jid.BareJID user)
      Deprecated.
       
      void setAccountStatus​(tigase.xmpp.jid.BareJID user, tigase.db.AuthRepository.AccountStatus status)
      Deprecated.
       
      void setData​(tigase.xmpp.jid.BareJID user, java.lang.String key, java.lang.String value)
      Deprecated.
       
      void setData​(tigase.xmpp.jid.BareJID user, java.lang.String subnode, java.lang.String key, java.lang.String value)
      Deprecated.
       
      void setDataList​(tigase.xmpp.jid.BareJID user, java.lang.String subnode, java.lang.String key, java.lang.String[] list)
      Deprecated.
       
      void setDataSource​(MongoDataSource dataSource)
      Deprecated.
       
      void setUserDisabled​(tigase.xmpp.jid.BareJID user, java.lang.Boolean value)
      Deprecated.
       
      void updateCredential​(tigase.xmpp.jid.BareJID user, java.lang.String credentialId, java.lang.String password)
      Deprecated.
       
      void updatePassword​(tigase.xmpp.jid.BareJID user, java.lang.String password)
      Deprecated.
       
      tigase.db.util.SchemaLoader.Result updateSchema​(java.util.Optional<tigase.util.Version> oldVersion, tigase.util.Version newVersion)
      Deprecated.
       
      boolean userExists​(tigase.xmpp.jid.BareJID user)
      Deprecated.
       
      • 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

        getCredentialIds, getUsernames, isMechanismSupported, setCredentialsCodecs
      • Methods inherited from interface tigase.db.UserRepository

        getDataMap, getDataMap
    • Field Detail

      • USERS_COLLECTION

        protected static final java.lang.String USERS_COLLECTION
        Deprecated.
        See Also:
        Constant Field Values
      • NODES_COLLECTION

        protected static final java.lang.String NODES_COLLECTION
        Deprecated.
        See Also:
        Constant Field Values
      • DOMAIN_KEY

        protected static final java.lang.String DOMAIN_KEY
        Deprecated.
        See Also:
        Constant Field Values
      • autoCreateUser

        @ConfigField(desc="Auto create user",
                     alias="autoCreateUser=")
        protected boolean autoCreateUser
        Deprecated.
    • Constructor Detail

      • MongoRepositoryOld

        public MongoRepositoryOld()
        Deprecated.
    • Method Detail

      • addDataList

        public void addDataList​(tigase.xmpp.jid.BareJID user,
                                java.lang.String subnode,
                                java.lang.String key,
                                java.lang.String[] list)
                         throws tigase.db.UserNotFoundException,
                                tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        addDataList in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • addUser

        public void addUser​(tigase.xmpp.jid.BareJID user)
                     throws tigase.db.UserExistsException,
                            tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        addUser in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserExistsException
        tigase.db.TigaseDBException
      • addUser

        public void addUser​(tigase.xmpp.jid.BareJID user,
                            java.lang.String password)
                     throws tigase.db.UserExistsException,
                            tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        addUser in interface tigase.db.AuthRepository
        Throws:
        tigase.db.UserExistsException
        tigase.db.TigaseDBException
      • calculateHash

        protected byte[] calculateHash​(java.lang.String user)
                                throws tigase.db.TigaseDBException
        Deprecated.
        Throws:
        tigase.db.TigaseDBException
      • generateId

        protected byte[] generateId​(tigase.xmpp.jid.BareJID user)
                             throws tigase.db.TigaseDBException
        Deprecated.
        Throws:
        tigase.db.TigaseDBException
      • getAccountStatus

        public tigase.db.AuthRepository.AccountStatus getAccountStatus​(tigase.xmpp.jid.BareJID user)
                                                                throws tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getAccountStatus in interface tigase.db.AuthRepository
        Throws:
        tigase.db.TigaseDBException
      • getCredentials

        public tigase.auth.credentials.Credentials getCredentials​(tigase.xmpp.jid.BareJID user,
                                                                  java.lang.String credentialId)
                                                           throws tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getCredentials in interface tigase.db.AuthRepository
        Throws:
        tigase.db.TigaseDBException
      • getData

        public java.lang.String getData​(tigase.xmpp.jid.BareJID user,
                                        java.lang.String subnode,
                                        java.lang.String key,
                                        java.lang.String def)
                                 throws tigase.db.UserNotFoundException,
                                        tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getData in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • getData

        public java.lang.String getData​(tigase.xmpp.jid.BareJID user,
                                        java.lang.String subnode,
                                        java.lang.String key)
                                 throws tigase.db.UserNotFoundException,
                                        tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getData in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • getData

        public java.lang.String getData​(tigase.xmpp.jid.BareJID user,
                                        java.lang.String key)
                                 throws tigase.db.UserNotFoundException,
                                        tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getData in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • getDataList

        public java.lang.String[] getDataList​(tigase.xmpp.jid.BareJID user,
                                              java.lang.String subnode,
                                              java.lang.String key)
                                       throws tigase.db.UserNotFoundException,
                                              tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getDataList in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • getKeys

        public java.lang.String[] getKeys​(tigase.xmpp.jid.BareJID user,
                                          java.lang.String subnode)
                                   throws tigase.db.UserNotFoundException,
                                          tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getKeys in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • getKeys

        public java.lang.String[] getKeys​(tigase.xmpp.jid.BareJID user)
                                   throws tigase.db.UserNotFoundException,
                                          tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getKeys in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • getPassword

        public java.lang.String getPassword​(tigase.xmpp.jid.BareJID user)
                                     throws tigase.db.UserNotFoundException,
                                            tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getPassword in interface tigase.db.AuthRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • getResourceUri

        public java.lang.String getResourceUri()
        Deprecated.
        Specified by:
        getResourceUri in interface tigase.db.AuthRepository
        Specified by:
        getResourceUri in interface tigase.db.UserRepository
      • getSubnodes

        public java.lang.String[] getSubnodes​(tigase.xmpp.jid.BareJID user)
                                       throws tigase.db.UserNotFoundException,
                                              tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getSubnodes in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • getSubnodes

        public java.lang.String[] getSubnodes​(tigase.xmpp.jid.BareJID user,
                                              java.lang.String subnode)
                                       throws tigase.db.UserNotFoundException,
                                              tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getSubnodes in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • getUserUID

        @Deprecated
        public long getUserUID​(tigase.xmpp.jid.BareJID user)
                        throws tigase.db.TigaseDBException
        Deprecated.
        Should be removed an only relational DB are using this and it is not required by any other code
        Specified by:
        getUserUID in interface tigase.db.UserRepository
        Throws:
        tigase.db.TigaseDBException
      • getUsers

        public java.util.List<tigase.xmpp.jid.BareJID> getUsers()
                                                         throws tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getUsers in interface tigase.db.UserRepository
        Throws:
        tigase.db.TigaseDBException
      • getUsersCount

        public long getUsersCount()
        Deprecated.
        Specified by:
        getUsersCount in interface tigase.db.AuthRepository
        Specified by:
        getUsersCount in interface tigase.db.UserRepository
      • getUsersCount

        public long getUsersCount​(java.lang.String domain)
        Deprecated.
        Specified by:
        getUsersCount in interface tigase.db.AuthRepository
        Specified by:
        getUsersCount in interface tigase.db.UserRepository
      • initRepository

        @Deprecated
        public void initRepository​(java.lang.String resource_uri,
                                   java.util.Map<java.lang.String,​java.lang.String> params)
                            throws tigase.db.DBInitException
        Deprecated.
        Specified by:
        initRepository in interface tigase.db.Repository
        Throws:
        tigase.db.DBInitException
      • isUserDisabled

        public boolean isUserDisabled​(tigase.xmpp.jid.BareJID user)
                               throws tigase.db.UserNotFoundException,
                                      tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        isUserDisabled in interface tigase.db.AuthRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • loggedIn

        public void loggedIn​(tigase.xmpp.jid.BareJID jid)
                      throws tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        loggedIn in interface tigase.db.AuthRepository
        Throws:
        tigase.db.TigaseDBException
      • logout

        public void logout​(tigase.xmpp.jid.BareJID user)
                    throws tigase.db.UserNotFoundException,
                           tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        logout in interface tigase.db.AuthRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • otherAuth

        public boolean otherAuth​(java.util.Map<java.lang.String,​java.lang.Object> authProps)
                          throws tigase.db.UserNotFoundException,
                                 tigase.db.TigaseDBException,
                                 tigase.db.AuthorizationException
        Deprecated.
        Specified by:
        otherAuth in interface tigase.db.AuthRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
        tigase.db.AuthorizationException
      • queryAuth

        public void queryAuth​(java.util.Map<java.lang.String,​java.lang.Object> authProps)
        Deprecated.
        Specified by:
        queryAuth in interface tigase.db.AuthRepository
      • readAllDistinctValuesForField

        protected <T> java.util.List<T> readAllDistinctValuesForField​(com.mongodb.client.MongoCollection<org.bson.Document> collection,
                                                                      java.lang.String field,
                                                                      org.bson.Document crit)
                                                               throws com.mongodb.MongoException
        Deprecated.
        Throws:
        com.mongodb.MongoException
      • removeCredential

        public void removeCredential​(tigase.xmpp.jid.BareJID user,
                                     java.lang.String credentialId)
                              throws tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        removeCredential in interface tigase.db.AuthRepository
        Throws:
        tigase.db.TigaseDBException
      • removeData

        public void removeData​(tigase.xmpp.jid.BareJID user,
                               java.lang.String key)
                        throws tigase.db.UserNotFoundException,
                               tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        removeData in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • removeData

        public void removeData​(tigase.xmpp.jid.BareJID user,
                               java.lang.String subnode,
                               java.lang.String key)
                        throws tigase.db.UserNotFoundException,
                               tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        removeData in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • removeSubnode

        public void removeSubnode​(tigase.xmpp.jid.BareJID user,
                                  java.lang.String subnode)
                           throws tigase.db.UserNotFoundException,
                                  tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        removeSubnode in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • removeUser

        public void removeUser​(tigase.xmpp.jid.BareJID user)
                        throws tigase.db.UserNotFoundException,
                               tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        removeUser in interface tigase.db.AuthRepository
        Specified by:
        removeUser in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • setAccountStatus

        public void setAccountStatus​(tigase.xmpp.jid.BareJID user,
                                     tigase.db.AuthRepository.AccountStatus status)
                              throws tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        setAccountStatus in interface tigase.db.AuthRepository
        Throws:
        tigase.db.TigaseDBException
      • setData

        public void setData​(tigase.xmpp.jid.BareJID user,
                            java.lang.String key,
                            java.lang.String value)
                     throws tigase.db.UserNotFoundException,
                            tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        setData in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • setData

        public void setData​(tigase.xmpp.jid.BareJID user,
                            java.lang.String subnode,
                            java.lang.String key,
                            java.lang.String value)
                     throws tigase.db.UserNotFoundException,
                            tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        setData in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • setDataList

        public void setDataList​(tigase.xmpp.jid.BareJID user,
                                java.lang.String subnode,
                                java.lang.String key,
                                java.lang.String[] list)
                         throws tigase.db.UserNotFoundException,
                                tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        setDataList in interface tigase.db.UserRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • setDataSource

        public void setDataSource​(MongoDataSource dataSource)
        Deprecated.
        Specified by:
        setDataSource in interface tigase.db.DataSourceAware<MongoDataSource>
      • setUserDisabled

        public void setUserDisabled​(tigase.xmpp.jid.BareJID user,
                                    java.lang.Boolean value)
                             throws tigase.db.UserNotFoundException,
                                    tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        setUserDisabled in interface tigase.db.AuthRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • updateCredential

        public void updateCredential​(tigase.xmpp.jid.BareJID user,
                                     java.lang.String credentialId,
                                     java.lang.String password)
                              throws tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        updateCredential in interface tigase.db.AuthRepository
        Throws:
        tigase.db.TigaseDBException
      • updatePassword

        public void updatePassword​(tigase.xmpp.jid.BareJID user,
                                   java.lang.String password)
                            throws tigase.db.UserNotFoundException,
                                   tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        updatePassword in interface tigase.db.AuthRepository
        Throws:
        tigase.db.UserNotFoundException
        tigase.db.TigaseDBException
      • updateSchema

        public tigase.db.util.SchemaLoader.Result updateSchema​(java.util.Optional<tigase.util.Version> oldVersion,
                                                               tigase.util.Version newVersion)
                                                        throws tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        updateSchema in interface tigase.db.util.RepositoryVersionAware
        Throws:
        tigase.db.TigaseDBException
      • userExists

        public boolean userExists​(tigase.xmpp.jid.BareJID user)
        Deprecated.
        Specified by:
        userExists in interface tigase.db.UserRepository