Package tigase.db

Interface DataSource

    • Field Detail

      • log

        static final java.util.logging.Logger log
    • Method Detail

      • checkConnectivity

        default void checkConnectivity​(java.time.Duration watchdogTime)
        This method is called by data source bean watchdog mechanism to ensure that there is proper connectivity to underlying data storage.
        watchdogTime - time which should pass between checks
      • checkSchemaVersion

        default boolean checkSchemaVersion​(DataSourceAware<? extends DataSource> datasource,
                                           boolean shutdownServer)
        Method checks version of the particular DataSource stored in the defined source.
        datasource - implementation of DataSourceAware interface
        shutdownServer - specifies whether server should be shutdown automatically if the version in the database doesn't match required version.
        a false when the version doesn't match or there is no version information in the repository. if shutdownServer is set to true and the component version is final it would force shutting down of the server, otherwise (for non-final version) only a warning would be printed.
      • automaticSchemaManagement

        default boolean automaticSchemaManagement()
      • getSchemaVersion

        java.util.Optional<Version> getSchemaVersion​(java.lang.String component)
        Method obtains version of the schema for particular component stored in the database.
        component - name of the component for which we want to get the schema version
        an optional value of the version.
      • getResourceUri

        java.lang.String getResourceUri()
        Returns a DB connection string or DB connection URI.
        a String value representing database connection string.
      • initialize

        void initialize​(java.lang.String resource_uri)
                 throws RepositoryException
        The method is called to initialize the data repository.
        resource_uri - value in most cases representing the database connection string.
        RepositoryException - if there was an error during initialization of data source. Some implementations, though, perform so called lazy initialization so even though there is a problem with the underlying data source it may not be signaled through this method call.