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 java.lang.Object
    implements tigase.db.DataRepository, tigase.db.DataSourcePool<tigase.db.DataRepository>
    • Nested Class Summary

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

        tigase.db.DataRepository.dbTypes
      • Nested classes/interfaces inherited from interface tigase.db.Repository

        tigase.db.Repository.Meta, tigase.db.Repository.SchemaId
    • Field Summary

      • Fields inherited from interface tigase.db.DataRepository

        UTC_CALENDAR
    • Constructor Summary

      Constructors 
      Constructor Description
      DataRepoPool()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRepo​(tigase.db.DataRepository repo)  
      boolean automaticSchemaManagement()  
      void checkConnectivity​(java.time.Duration watchdogTime)  
      boolean checkSchemaVersion​(tigase.db.DataSourceAware<? extends tigase.db.DataSource> datasource, boolean shutdownServer)  
      boolean checkTable​(java.lang.String tableName)  
      boolean checkTable​(java.lang.String tableName, java.lang.String createTableQuery)  
      void commit()  
      java.sql.Statement createStatement​(tigase.xmpp.jid.BareJID user_id)  
      void endTransaction()  
      tigase.db.DataRepository.dbTypes getDatabaseType()  
      int getPoolSize()  
      java.sql.PreparedStatement getPreparedStatement​(int hashCode, java.lang.String stIdKey)  
      java.sql.PreparedStatement getPreparedStatement​(tigase.xmpp.jid.BareJID user_id, java.lang.String stIdKey)  
      java.lang.String getResourceUri()  
      java.util.Optional<tigase.util.Version> getSchemaVersion​(java.lang.String component)  
      void initialize​(java.lang.String resource_uri)  
      void initPreparedStatement​(java.lang.String stIdKey, java.lang.String query)  
      void initPreparedStatement​(java.lang.String stIdKey, java.lang.String query, int autoGeneratedKeys)  
      void release​(java.sql.Statement stmt, java.sql.ResultSet rs)  
      void releaseRepoHandle​(tigase.db.DataRepository repo)  
      void rollback()  
      void startTransaction()  
      tigase.db.DataRepository takeRepoHandle​(tigase.xmpp.jid.BareJID user_id)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface tigase.db.DataRepository

        getTimestamp, getTimestamp, setTimestamp
      • Methods inherited from interface tigase.db.Repository

        initRepository
    • 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​(java.time.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 java.util.Optional<tigase.util.Version> getSchemaVersion​(java.lang.String component)
        Specified by:
        getSchemaVersion in interface tigase.db.DataSource
      • checkTable

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

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

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

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

        public java.sql.PreparedStatement getPreparedStatement​(int hashCode,
                                                               java.lang.String stIdKey)
                                                        throws java.sql.SQLException
        Specified by:
        getPreparedStatement in interface tigase.db.DataRepository
        Throws:
        java.sql.SQLException
      • getResourceUri

        public java.lang.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​(java.lang.String stIdKey,
                                          java.lang.String query)
                                   throws java.sql.SQLException
        Specified by:
        initPreparedStatement in interface tigase.db.DataRepository
        Throws:
        java.sql.SQLException
      • initPreparedStatement

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

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

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

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

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

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

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

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