public class SnapshotControl extends Object implements LiquibaseSerializable
LiquibaseSerializable.SerializationType
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
Constructor and Description |
---|
SnapshotControl(Database database)
Create a SnapshotControl for a given database and mark the database's standard types for inclusion.
|
SnapshotControl(Database database,
boolean expandTypesIfNeeded,
Class<? extends DatabaseObject>... types) |
SnapshotControl(Database database,
Class<? extends DatabaseObject>... types)
Create a Snapshot control for a given database, but explicitly set the object types to be included in snapshots.
|
SnapshotControl(Database database,
ObjectChangeFilter objectChangeFilter,
Class<? extends DatabaseObject>... types) |
SnapshotControl(Database database,
String types)
Create a Snapshot control for a given database, but explicitly set the object types to be included in snapshots.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addType(Class<? extends DatabaseObject> type,
Database database)
Adds a new DatabaseObject type to the list of object types to be included in snapshots.
|
String |
getSerializableFieldNamespace(String field) |
Set<String> |
getSerializableFields() |
LiquibaseSerializable.SerializationType |
getSerializableFieldType(String field) |
Object |
getSerializableFieldValue(String field) |
String |
getSerializedObjectName() |
String |
getSerializedObjectNamespace() |
SnapshotListener |
getSnapshotListener() |
Set<Class<? extends DatabaseObject>> |
getTypesToInclude()
Return the types to be included in snapshots
|
boolean |
isWarnIfObjectNotFound()
Returns if the code should log a LogLevel.WARNING message if the object to be snapshotted could not be found.
|
void |
load(ParsedNode parsedNode,
ResourceAccessor resourceAccessor) |
ParsedNode |
serialize() |
void |
setSnapshotListener(SnapshotListener snapshotListener) |
SnapshotControl |
setWarnIfObjectNotFound(boolean warnIfObjectNotFound)
Configures the code to log a LogLevel.WARNING message if the object to be snapshotted could not be found.
|
boolean |
shouldInclude(Class<? extends DatabaseObject> type)
Queries the currently registered list of types to be included and returns true if the given type is in that list
|
<T extends DatabaseObject> |
shouldInclude(T example) |
public SnapshotControl(Database database)
database
- the DBMS for which snapshots should be generatedpublic SnapshotControl(Database database, Class<? extends DatabaseObject>... types)
database
- the DBMS for which snapshots should be generatedtypes
- the list of object types to be included in the snapshotpublic SnapshotControl(Database database, boolean expandTypesIfNeeded, Class<? extends DatabaseObject>... types)
public SnapshotControl(Database database, String types)
database
- the DBMS for which snapshots should be generatedtypes
- the list of object types to be included in the snapshot, separated by commaspublic SnapshotControl(Database database, ObjectChangeFilter objectChangeFilter, Class<? extends DatabaseObject>... types)
public SnapshotListener getSnapshotListener()
public void setSnapshotListener(SnapshotListener snapshotListener)
public String getSerializedObjectName()
getSerializedObjectName
in interface LiquibaseSerializable
public Set<String> getSerializableFields()
getSerializableFields
in interface LiquibaseSerializable
public Object getSerializableFieldValue(String field)
getSerializableFieldValue
in interface LiquibaseSerializable
public LiquibaseSerializable.SerializationType getSerializableFieldType(String field)
getSerializableFieldType
in interface LiquibaseSerializable
public String getSerializedObjectNamespace()
getSerializedObjectNamespace
in interface LiquibaseSerializable
public String getSerializableFieldNamespace(String field)
getSerializableFieldNamespace
in interface LiquibaseSerializable
public boolean addType(Class<? extends DatabaseObject> type, Database database)
type
- The type to be addeddatabase
- The database to check for any dependent types that need to be included as wellpublic Set<Class<? extends DatabaseObject>> getTypesToInclude()
public boolean shouldInclude(Class<? extends DatabaseObject> type)
type
- the DatabaseObject type to be checkedpublic void load(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException
load
in interface LiquibaseSerializable
ParsedNodeException
public ParsedNode serialize()
serialize
in interface LiquibaseSerializable
public boolean isWarnIfObjectNotFound()
public SnapshotControl setWarnIfObjectNotFound(boolean warnIfObjectNotFound)
warnIfObjectNotFound
- true if a warning should emitted (default value), false if not.public <T extends DatabaseObject> boolean shouldInclude(T example)
Copyright © 2023 Liquibase.org. All rights reserved.