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 -
Method Summary
Modifier and TypeMethodDescriptiondefault Version
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
(Optional<Version> oldVersion, Version newVersion) Method used to update schema in the database from the (optional)oldVersion
tonewVersion
.
-
Method Details
-
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(Optional<Version> oldVersion, Version newVersion) throws Exception Method used to update schema in the database from the (optional)oldVersion
tonewVersion
. If the process was correct (i.e. returnSchemaLoader.Result.ok
) then new version will be stored in the database.- Parameters:
oldVersion
- optional version of the schema currently loaded in the databasenewVersion
- 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:
Exception
- when something unexpected happened
-