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 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
    • Constructor Detail

      • MongoRepositoryOld

        public MongoRepositoryOld()
        Deprecated.
    • Method Detail

      • addDataList

        public void addDataList​(tigase.xmpp.jid.BareJID user,
                                String subnode,
                                String key,
                                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,
                            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​(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,
                                                                  String credentialId)
                                                           throws tigase.db.TigaseDBException
        Deprecated.
        Specified by:
        getCredentials in interface tigase.db.AuthRepository
        Throws:
        tigase.db.TigaseDBException
      • getData

        public String getData​(tigase.xmpp.jid.BareJID user,
                              String subnode,
                              String key,
                              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 String getData​(tigase.xmpp.jid.BareJID user,
                              String subnode,
                              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 String getData​(tigase.xmpp.jid.BareJID user,
                              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 String[] getDataList​(tigase.xmpp.jid.BareJID user,
                                    String subnode,
                                    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 String[] getKeys​(tigase.xmpp.jid.BareJID user,
                                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 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 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 String getResourceUri()
        Deprecated.
        Specified by:
        getResourceUri in interface tigase.db.AuthRepository
        Specified by:
        getResourceUri in interface tigase.db.UserRepository
      • getSubnodes

        public 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 String[] getSubnodes​(tigase.xmpp.jid.BareJID user,
                                    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 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​(String domain)
        Deprecated.
        Specified by:
        getUsersCount in interface tigase.db.AuthRepository
        Specified by:
        getUsersCount in interface tigase.db.UserRepository
      • initRepository

        @Deprecated
        public void initRepository​(String resource_uri,
                                   Map<String,​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​(Map<String,​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​(Map<String,​Object> authProps)
        Deprecated.
        Specified by:
        queryAuth in interface tigase.db.AuthRepository
      • readAllDistinctValuesForField

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

        public void removeCredential​(tigase.xmpp.jid.BareJID user,
                                     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,
                               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,
                               String subnode,
                               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,
                                  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,
                            String key,
                            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,
                            String subnode,
                            String key,
                            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,
                                String subnode,
                                String key,
                                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,
                                    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,
                                     String credentialId,
                                     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,
                                   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​(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