Package liquibase.database
Class OfflineConnection
- java.lang.Object
-
- liquibase.database.OfflineConnection
-
- All Implemented Interfaces:
AutoCloseable,DatabaseConnection,PrioritizedService
public class OfflineConnection extends Object implements DatabaseConnection
-
-
Field Summary
-
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description OfflineConnection()OfflineConnection(String url, ResourceAccessor resourceAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattached(Database database)voidclose()voidcommit()protected ChangeLogHistoryServicecreateChangeLogHistoryService(Database database)booleangetAutoCommit()StringgetCatalog()StringgetConnectionUserName()intgetDatabaseMajorVersion()intgetDatabaseMinorVersion()StringgetDatabaseProductName()StringgetDatabaseProductVersion()intgetPriority()StringgetSchema()booleangetSendsStringParametersAsUnicode()DatabaseSnapshotgetSnapshot(DatabaseObject[] examples)Returns a copy of the current simulated content of the database, filtered by the given array.StringgetURL()booleanisCaseSensitive()booleanisClosed()booleanisCorrectDatabaseImplementation(Database database)StringnativeSQL(String sql)voidopen(String url, Driver driverObject, Properties driverProperties)voidrollback()voidsetAutoCommit(boolean autoCommit)voidsetCaseSensitive(boolean caseSensitive)voidsetConnectionUserName(String connectionUserName)voidsetDatabaseMajorVersion(int databaseMajorVersion)voidsetDatabaseMinorVersion(int databaseMinorVersion)voidsetProductName(String productName)voidsetProductVersion(String productVersion)voidsetSendsStringParametersAsUnicode(boolean sendsStringParametersAsUnicode)voidsetSnapshot(DatabaseSnapshot snapshot)For debugging purposes: sets a DatabaseSnapshot object for this connection.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface liquibase.database.DatabaseConnection
supports
-
-
-
-
Constructor Detail
-
OfflineConnection
public OfflineConnection()
-
OfflineConnection
public OfflineConnection(String url, ResourceAccessor resourceAccessor)
-
-
Method Detail
-
getPriority
public int getPriority()
- Specified by:
getPriorityin interfacePrioritizedService
-
isCorrectDatabaseImplementation
public boolean isCorrectDatabaseImplementation(Database database)
-
open
public void open(String url, Driver driverObject, Properties driverProperties) throws DatabaseException
- Specified by:
openin interfaceDatabaseConnection- Throws:
DatabaseException
-
attached
public void attached(Database database)
- Specified by:
attachedin interfaceDatabaseConnection
-
createChangeLogHistoryService
protected ChangeLogHistoryService createChangeLogHistoryService(Database database)
-
getSnapshot
public DatabaseSnapshot getSnapshot(DatabaseObject[] examples)
Returns a copy of the current simulated content of the database, filtered by the given array.- Parameters:
examples- the list of objects to clone- Returns:
- a new DatabaseSnapshot object containing all objects matching examples. If none are found, an empty DatabaseSnapshot is returned.
-
setSnapshot
public void setSnapshot(DatabaseSnapshot snapshot)
For debugging purposes: sets a DatabaseSnapshot object for this connection. Effectively, this simulates the content of the database in this OfflineConnection.- Parameters:
snapshot- the snapshot with the simulated database content
-
close
public void close() throws DatabaseException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceDatabaseConnection- Throws:
DatabaseException
-
commit
public void commit() throws DatabaseException- Specified by:
commitin interfaceDatabaseConnection- Throws:
DatabaseException
-
getAutoCommit
public boolean getAutoCommit() throws DatabaseException- Specified by:
getAutoCommitin interfaceDatabaseConnection- Throws:
DatabaseException
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) throws DatabaseException- Specified by:
setAutoCommitin interfaceDatabaseConnection- Throws:
DatabaseException
-
getCatalog
public String getCatalog() throws DatabaseException
- Specified by:
getCatalogin interfaceDatabaseConnection- Throws:
DatabaseException
-
getSchema
public String getSchema()
-
nativeSQL
public String nativeSQL(String sql) throws DatabaseException
- Specified by:
nativeSQLin interfaceDatabaseConnection- Throws:
DatabaseException
-
rollback
public void rollback() throws DatabaseException- Specified by:
rollbackin interfaceDatabaseConnection- Throws:
DatabaseException
-
getDatabaseProductName
public String getDatabaseProductName() throws DatabaseException
- Specified by:
getDatabaseProductNamein interfaceDatabaseConnection- Throws:
DatabaseException
-
getDatabaseProductVersion
public String getDatabaseProductVersion() throws DatabaseException
- Specified by:
getDatabaseProductVersionin interfaceDatabaseConnection- Throws:
DatabaseException
-
getDatabaseMajorVersion
public int getDatabaseMajorVersion() throws DatabaseException- Specified by:
getDatabaseMajorVersionin interfaceDatabaseConnection- Throws:
DatabaseException
-
setDatabaseMajorVersion
public void setDatabaseMajorVersion(int databaseMajorVersion)
-
setProductVersion
public void setProductVersion(String productVersion)
-
setProductName
public void setProductName(String productName)
-
getDatabaseMinorVersion
public int getDatabaseMinorVersion() throws DatabaseException- Specified by:
getDatabaseMinorVersionin interfaceDatabaseConnection- Throws:
DatabaseException
-
setDatabaseMinorVersion
public void setDatabaseMinorVersion(int databaseMinorVersion)
-
getURL
public String getURL()
- Specified by:
getURLin interfaceDatabaseConnection
-
getConnectionUserName
public String getConnectionUserName()
- Specified by:
getConnectionUserNamein interfaceDatabaseConnection
-
setConnectionUserName
public void setConnectionUserName(String connectionUserName)
-
isClosed
public boolean isClosed() throws DatabaseException- Specified by:
isClosedin interfaceDatabaseConnection- Throws:
DatabaseException
-
getSendsStringParametersAsUnicode
public boolean getSendsStringParametersAsUnicode()
-
setSendsStringParametersAsUnicode
public void setSendsStringParametersAsUnicode(boolean sendsStringParametersAsUnicode)
-
isCaseSensitive
public boolean isCaseSensitive()
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive)
-
-