Package tigase.db.util

## Interface RepositoryVersionAware

- All Known Implementing Classes:
    `ClConSQLRepository`, `CounterDataLoggerRepository`, `DataRepositoryImpl`, `JDBCMsgBroadcastRepository`, `JDBCMsgRepository`, `JDBCRepository`, `TigaseAuth`, `TigaseCustomAuth`, `TigaseSPAuth`

      public interface RepositoryVersionAware

  Interface indicates that the implementation is aware of the version, can specify required version of the schema that should be present in the database and perform update from current version in the database to the required version

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static interface` | `RepositoryVersionAware.SchemaVersion` |

  - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default Version` | `getVersion()` | Returns current required version of the repository implementing this interface (If we are version aware then we have to specify the version)
    `default SchemaLoader.Result` | `updateSchema​(java.util.Optional<Version> oldVersion, Version newVersion)` | Method used to update schema in the database from the (optional) `oldVersion` to `newVersion`.

- - ### Method Detail

    - #### getVersion

          default Version getVersion()

      Returns current required version of the repository implementing this interface (If we are version aware then we have to specify the version)
      Returns:
        current required version of the schema for the

    - #### updateSchema

          default SchemaLoader.Result updateSchema​(java.util.Optional<Version> oldVersion,
                                                   Version newVersion)
                                            throws java.lang.Exception

      Method used to update schema in the database from the (optional) `oldVersion` to `newVersion`. If the process was correct (i.e. return `SchemaLoader.Result.ok`) then new version will be stored in the database.
      Parameters:
        `oldVersion` - optional version of the schema currently loaded in the database
        `newVersion` - version to which component schema should be updated
      Returns:
        result of the update process - if the process was correct then `SchemaLoader.Result.ok` should be returned
      Throws:
        `java.lang.Exception` - when something unexpected happened