Top Fields Constructors Methods
liquibase.snapshot

public Class SnapshotGeneratorFactory

extends Object
Class Inheritance
Imports
liquibase.CatalogAndSchema, .Scope, liquibase.database.Database, .DatabaseConnection, .ObjectQuotingStrategy, .OfflineConnection, liquibase.database.core.PostgresDatabase, liquibase.diff.compare.DatabaseObjectComparatorFactory, liquibase.exception.DatabaseException, .UnexpectedLiquibaseException, liquibase.executor.ExecutorService, liquibase.statement.core.RawSqlStatement, liquibase.structure.DatabaseObject, liquibase.structure.core.Schema, .Table, java.util.*

Field Summary

Modifier and TypeField and Description
private final List<SnapshotGenerator>
private static SnapshotGeneratorFactory

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public DatabaseSnapshot
createSnapshot(CatalogAndSchema example, Database database, SnapshotControl snapshotControl)

public DatabaseSnapshot

Returns:

a database snapshot that includes all objects matching the specification
createSnapshot
(CatalogAndSchema[]
an array of CatalogAndSchema objects
examples
,
Database
the database to work on
database
,
SnapshotControl
the options/settings for snapshot generation
snapshotControl
)

Creates a database snapshot for a given array of catalog/schema combinations.

public DatabaseSnapshot

Returns:

a database snapshot that includes all objects matching the specification
createSnapshot
(DatabaseObject[]
an array of DatabaseObjects objects
examples
,
Database
the database to work on
database
,
SnapshotControl
the options/settings for snapshot generation
snapshotControl
)

Creates a database snapshot for a given array of DatabaseObjects

public <
the type of the object (must extend DatabaseObject)
T extends DatabaseObject
>
T

Returns:

the snapshot of the desired object
createSnapshot
(T
the object to snapshot
example
,
Database
the database to work on
database
)

Creates a DatabaseSnapshot for a single DatabaseObject.

public <
the type of the object (must extend DatabaseObject)
T extends DatabaseObject
>
T

Returns:

the snapshot of the desired object
createSnapshot
(T
the object to snapshot
example
,
Database
the database to work on
database
,
SnapshotControl
the options/settings for snapshot generation
snapshotControl
)

Creates a DatabaseSnapshot for a single DatabaseObject.

public Set<Class<? extends DatabaseObject>>
getContainerTypes(Class<? extends DatabaseObject> type, Database database)

private void
getContainerTypes(Class<? extends DatabaseObject> type, Database database, Set<Class<? extends DatabaseObject>> returnSet)

public Table
public Table
protected SortedSet<SnapshotGenerator>
getGenerators(Class<? extends DatabaseObject> generatorClass, Database database)

public static synchronized SnapshotGeneratorFactory
getInstance()

Return singleton SnapshotGeneratorFactory

public boolean

Returns:

true if object existence can be confirmed, false otherwise
has
(DatabaseObject
The DatabaseObject to check for existence
example
,
Database
The DBMS in which the object might exist
database
)

Checks if a specific object is present in a database

public boolean
public boolean
public void
public static synchronized void
public static synchronized void
public void
public void
unregister(Class<T> generatorClass)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

generatorsback to summary
private final List<SnapshotGenerator> generators
instanceback to summary
private static SnapshotGeneratorFactory instance

Constructor Detail

SnapshotGeneratorFactoryback to summary
protected SnapshotGeneratorFactory()

Method Detail

createSnapshotback to summary
public DatabaseSnapshot createSnapshot(CatalogAndSchema example, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException
createSnapshotback to summary
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:CatalogAndSchema[]

an array of CatalogAndSchema objects

database:Database

the database to work on

snapshotControl:SnapshotControl

the options/settings for snapshot generation

Returns:DatabaseSnapshot

a database snapshot that includes all objects matching the specification

Exceptions
DatabaseException:
if a problem occurs during snapshotting
InvalidExampleException:
if the given catalog/schema combinations are invalid (e.g. duplicates)
createSnapshotback to summary
public DatabaseSnapshot createSnapshot(DatabaseObject[] examples, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException

Creates a database snapshot for a given array of DatabaseObjects

Parameters
examples:DatabaseObject[]

an array of DatabaseObjects objects

database:Database

the database to work on

snapshotControl:SnapshotControl

the options/settings for snapshot generation

Returns:DatabaseSnapshot

a database snapshot that includes all objects matching the specification

Exceptions
DatabaseException:
if a problem occurs during snapshotting
InvalidExampleException:
if the given catalog/schema combinations are invalid (e.g. duplicates)
createSnapshotback to summary
public <T extends DatabaseObject> T createSnapshot(T example, Database database) throws DatabaseException, InvalidExampleException

Creates a DatabaseSnapshot for a single DatabaseObject.

Parameters
<T>
the type of the object (must extend DatabaseObject)
example:T

the object to snapshot

database:Database

the database to work on

Returns:T

the snapshot of the desired object

Exceptions
DatabaseException:
if a problem occurs during snapshotting
InvalidExampleException:
if the given catalog/schema combinations are invalid (e.g. duplicates)
createSnapshotback to summary
public <T extends DatabaseObject> T createSnapshot(T example, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException

Creates a DatabaseSnapshot for a single DatabaseObject.

Parameters
<T>
the type of the object (must extend DatabaseObject)
example:T

the object to snapshot

database:Database

the database to work on

snapshotControl:SnapshotControl

the options/settings for snapshot generation

Returns:T

the snapshot of the desired object

Exceptions
DatabaseException:
if a problem occurs during snapshotting
InvalidExampleException:
if the given catalog/schema combinations are invalid (e.g. duplicates)
getContainerTypesback to summary
public Set<Class<? extends DatabaseObject>> getContainerTypes(Class<? extends DatabaseObject> type, Database database)
getContainerTypesback to summary
private void getContainerTypes(Class<? extends DatabaseObject> type, Database database, Set<Class<? extends DatabaseObject>> returnSet)
getDatabaseChangeLogLockTableback to summary
public Table getDatabaseChangeLogLockTable(Database database) throws DatabaseException
getDatabaseChangeLogTableback to summary
public Table getDatabaseChangeLogTable(SnapshotControl snapshotControl, Database database) throws DatabaseException
getGeneratorsback to summary
protected SortedSet<SnapshotGenerator> getGenerators(Class<? extends DatabaseObject> generatorClass, Database database)
getInstanceback to summary
public static synchronized SnapshotGeneratorFactory getInstance()

Return singleton SnapshotGeneratorFactory

hasback to summary
public boolean has(DatabaseObject example, Database database) throws DatabaseException, InvalidExampleException

Checks if a specific object is present in a database

Parameters
example:DatabaseObject

The DatabaseObject to check for existence

database:Database

The DBMS in which the object might exist

Returns:boolean

true if object existence can be confirmed, false otherwise

Exceptions
DatabaseException:
If a problem occurs in the DBMS-specific code
InvalidExampleException:
If the object cannot be checked properly, e.g. if the object name is ambiguous
hasDatabaseChangeLogLockTableback to summary
public boolean hasDatabaseChangeLogLockTable(Database database) throws DatabaseException
hasDatabaseChangeLogTableback to summary
public boolean hasDatabaseChangeLogTable(Database database) throws DatabaseException
registerback to summary
public void register(SnapshotGenerator generator)
resetback to summary
public static synchronized void reset()
resetAllback to summary
public static synchronized void resetAll()
unregisterback to summary
public void unregister(SnapshotGenerator generator)
unregisterback to summary
public void unregister(Class<T> generatorClass)