Class DataRepoPool

  • All Implemented Interfaces:
    tigase.db.DataRepository, tigase.db.DataSource, tigase.db.DataSourcePool<tigase.db.DataRepository>, tigase.db.Repository, tigase.db.RepositoryPool<tigase.db.DataRepository>

    public class DataRepoPool
    extends Object
    implements tigase.db.DataRepository, tigase.db.DataSourcePool<tigase.db.DataRepository>
    • Constructor Detail

      • DataRepoPool

        public DataRepoPool()
    • Method Detail

      • addRepo

        public void addRepo​(tigase.db.DataRepository repo)
        Specified by:
        addRepo in interface tigase.db.RepositoryPool<tigase.db.DataRepository>
      • takeRepoHandle

        public tigase.db.DataRepository takeRepoHandle​(tigase.xmpp.jid.BareJID user_id)
        Specified by:
        takeRepoHandle in interface tigase.db.DataRepository
      • releaseRepoHandle

        public void releaseRepoHandle​(tigase.db.DataRepository repo)
        Specified by:
        releaseRepoHandle in interface tigase.db.DataRepository
      • automaticSchemaManagement

        public boolean automaticSchemaManagement()
        Specified by:
        automaticSchemaManagement in interface tigase.db.DataSource
      • checkConnectivity

        public void checkConnectivity​(Duration watchdogTime)
        Specified by:
        checkConnectivity in interface tigase.db.DataSource
      • checkSchemaVersion

        public boolean checkSchemaVersion​(tigase.db.DataSourceAware<? extends tigase.db.DataSource> datasource,
                                          boolean shutdownServer)
        Specified by:
        checkSchemaVersion in interface tigase.db.DataSource
      • getSchemaVersion

        public Optional<tigase.util.Version> getSchemaVersion​(String component)
        Specified by:
        getSchemaVersion in interface tigase.db.DataSource
      • checkTable

        public boolean checkTable​(String tableName)
                           throws SQLException
        Specified by:
        checkTable in interface tigase.db.DataRepository
        Throws:
        SQLException
      • checkTable

        public boolean checkTable​(String tableName,
                                  String createTableQuery)
                           throws SQLException
        Specified by:
        checkTable in interface tigase.db.DataRepository
        Throws:
        SQLException
      • createStatement

        public Statement createStatement​(tigase.xmpp.jid.BareJID user_id)
                                  throws SQLException
        Specified by:
        createStatement in interface tigase.db.DataRepository
        Throws:
        SQLException
      • getPreparedStatement

        public PreparedStatement getPreparedStatement​(tigase.xmpp.jid.BareJID user_id,
                                                      String stIdKey)
                                               throws SQLException
        Specified by:
        getPreparedStatement in interface tigase.db.DataRepository
        Throws:
        SQLException
      • getResourceUri

        public String getResourceUri()
        Specified by:
        getResourceUri in interface tigase.db.DataRepository
        Specified by:
        getResourceUri in interface tigase.db.DataSource
      • getDatabaseType

        public tigase.db.DataRepository.dbTypes getDatabaseType()
        Specified by:
        getDatabaseType in interface tigase.db.DataRepository
      • initPreparedStatement

        public void initPreparedStatement​(String stIdKey,
                                          String query)
                                   throws SQLException
        Specified by:
        initPreparedStatement in interface tigase.db.DataRepository
        Throws:
        SQLException
      • initPreparedStatement

        public void initPreparedStatement​(String stIdKey,
                                          String query,
                                          int autoGeneratedKeys)
                                   throws SQLException
        Specified by:
        initPreparedStatement in interface tigase.db.DataRepository
        Throws:
        SQLException
      • initialize

        public void initialize​(String resource_uri)
                        throws tigase.db.DBInitException
        Specified by:
        initialize in interface tigase.db.DataSource
        Throws:
        tigase.db.DBInitException
      • release

        public void release​(Statement stmt,
                            ResultSet rs)
        Specified by:
        release in interface tigase.db.DataRepository
      • startTransaction

        public void startTransaction()
                              throws SQLException
        Specified by:
        startTransaction in interface tigase.db.DataRepository
        Throws:
        SQLException
      • commit

        public void commit()
                    throws SQLException
        Specified by:
        commit in interface tigase.db.DataRepository
        Throws:
        SQLException
      • rollback

        public void rollback()
                      throws SQLException
        Specified by:
        rollback in interface tigase.db.DataRepository
        Throws:
        SQLException
      • endTransaction

        public void endTransaction()
                            throws SQLException
        Specified by:
        endTransaction in interface tigase.db.DataRepository
        Throws:
        SQLException
      • getPoolSize

        public int getPoolSize()
        Specified by:
        getPoolSize in interface tigase.db.DataRepository