Package liquibase.snapshot
Class SnapshotGeneratorFactory
- java.lang.Object
-
- liquibase.snapshot.SnapshotGeneratorFactory
-
public class SnapshotGeneratorFactory extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SnapshotGeneratorFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DatabaseSnapshot
createSnapshot(CatalogAndSchema[] examples, Database database, SnapshotControl snapshotControl)
Creates a database snapshot for a given array of catalog/schema combinations.DatabaseSnapshot
createSnapshot(CatalogAndSchema example, Database database, SnapshotControl snapshotControl)
DatabaseSnapshot
createSnapshot(DatabaseObject[] examples, Database database, SnapshotControl snapshotControl)
Creates a database snapshot for a given array of DatabaseObjects<T extends DatabaseObject>
TcreateSnapshot(T example, Database database)
Creates a DatabaseSnapshot for a single DatabaseObject.<T extends DatabaseObject>
TcreateSnapshot(T example, Database database, SnapshotControl snapshotControl)
Creates a DatabaseSnapshot for a single DatabaseObject.Set<Class<? extends DatabaseObject>>
getContainerTypes(Class<? extends DatabaseObject> type, Database database)
Table
getDatabaseChangeLogLockTable(Database database)
Table
getDatabaseChangeLogTable(SnapshotControl snapshotControl, Database database)
protected SortedSet<SnapshotGenerator>
getGenerators(Class<? extends DatabaseObject> generatorClass, Database database)
static SnapshotGeneratorFactory
getInstance()
Return singleton SnapshotGeneratorFactoryboolean
has(DatabaseObject example, Database database)
Checks if a specific object is present in a databaseboolean
hasDatabaseChangeLogLockTable(Database database)
boolean
hasDatabaseChangeLogTable(Database database)
void
register(SnapshotGenerator generator)
static void
reset()
static void
resetAll()
void
unregister(Class generatorClass)
void
unregister(SnapshotGenerator generator)
-
-
-
Method Detail
-
getInstance
public static SnapshotGeneratorFactory getInstance()
Return singleton SnapshotGeneratorFactory
-
reset
public static void reset()
-
resetAll
public static void resetAll()
-
register
public void register(SnapshotGenerator generator)
-
unregister
public void unregister(SnapshotGenerator generator)
-
unregister
public void unregister(Class generatorClass)
-
getGenerators
protected SortedSet<SnapshotGenerator> getGenerators(Class<? extends DatabaseObject> generatorClass, Database database)
-
has
public boolean has(DatabaseObject example, Database database) throws DatabaseException, InvalidExampleException
Checks if a specific object is present in a database- Parameters:
example
- The DatabaseObject to check for existencedatabase
- The DBMS in which the object might exist- Returns:
- true if object existence can be confirmed, false otherwise
- Throws:
DatabaseException
- If a problem occurs in the DBMS-specific codeInvalidExampleException
- If the object cannot be checked properly, e.g. if the object name is ambiguous
-
createSnapshot
public DatabaseSnapshot createSnapshot(CatalogAndSchema example, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException
-
createSnapshot
public DatabaseSnapshot createSnapshot(CatalogAndSchema[] examples, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException
Creates a database snapshot for a given array of catalog/schema combinations.- Parameters:
examples
- an array of CatalogAndSchema objectsdatabase
- the database to work onsnapshotControl
- the options/settings for snapshot generation- Returns:
- a database snapshot that includes all objects matching the specification
- Throws:
DatabaseException
- if a problem occurs during snapshottingInvalidExampleException
- if the given catalog/schema combinations are invalid (e.g. duplicates)
-
createSnapshot
public DatabaseSnapshot createSnapshot(DatabaseObject[] examples, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException
Creates a database snapshot for a given array of DatabaseObjects- Parameters:
examples
- an array of DatabaseObjects objectsdatabase
- the database to work onsnapshotControl
- the options/settings for snapshot generation- Returns:
- a database snapshot that includes all objects matching the specification
- Throws:
DatabaseException
- if a problem occurs during snapshottingInvalidExampleException
- if the given catalog/schema combinations are invalid (e.g. duplicates)
-
createSnapshot
public <T extends DatabaseObject> T createSnapshot(T example, Database database) throws DatabaseException, InvalidExampleException
Creates a DatabaseSnapshot for a single DatabaseObject.- Type Parameters:
T
- the type of the object (must extend DatabaseObject)- Parameters:
example
- the object to snapshotdatabase
- the database to work on- Returns:
- the snapshot of the desired object
- Throws:
DatabaseException
- if a problem occurs during snapshottingInvalidExampleException
- if the given catalog/schema combinations are invalid (e.g. duplicates)
-
createSnapshot
public <T extends DatabaseObject> T createSnapshot(T example, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException
Creates a DatabaseSnapshot for a single DatabaseObject.- Type Parameters:
T
- the type of the object (must extend DatabaseObject)- Parameters:
example
- the object to snapshotdatabase
- the database to work onsnapshotControl
- the options/settings for snapshot generation- Returns:
- the snapshot of the desired object
- Throws:
DatabaseException
- if a problem occurs during snapshottingInvalidExampleException
- if the given catalog/schema combinations are invalid (e.g. duplicates)
-
getDatabaseChangeLogTable
public Table getDatabaseChangeLogTable(SnapshotControl snapshotControl, Database database) throws DatabaseException
- Throws:
DatabaseException
-
getDatabaseChangeLogLockTable
public Table getDatabaseChangeLogLockTable(Database database) throws DatabaseException
- Throws:
DatabaseException
-
hasDatabaseChangeLogTable
public boolean hasDatabaseChangeLogTable(Database database) throws DatabaseException
- Throws:
DatabaseException
-
hasDatabaseChangeLogLockTable
public boolean hasDatabaseChangeLogLockTable(Database database) throws DatabaseException
- Throws:
DatabaseException
-
getContainerTypes
public Set<Class<? extends DatabaseObject>> getContainerTypes(Class<? extends DatabaseObject> type, Database database)
-
-