R
- the type of report for this contextpublic class MigrationContextImpl<R extends MigrationReport> extends Object implements MigrationContext
The export process will generate a zip file. At the root of the zip file will be included
metadata files used by the configuration migration manager (e.g. export.json) and folders. Each
folder will correspond to a specific Migratable
instance used to export configurations
where the folder name will correspond to the identifier of the migratable. Underneath these
folders, the structure will be specific to each migratables. By convention files should be in a
path corresponding to where they were originally located underneath DDF_HOME.
The metadata used by the framework will be located in the root of the zip in a file named export.json and follow the following format:
{ "version": "1.0", "product.branding": "ddf", "product.version": "2.11.0-SNAPSHOT", "date": "Tue Aug 01 12:39:21 MST 2017" "migratables": { "platform-id": { "version": "1.0", "title": "", "description": "", "organization": "", "files": [ { "name": "etc/startup.properties" }, { "name": "etc/system.properties" } ], "folders": [ { "name": "etc/ws-security", "filtered": false, "files": [ "etc/ws-security/issuer/encryption.properties", "etc/ws-security/issuer/signature.properties" ], "last-modified" : 123456 } ], "externals": [ { "name": "/tmp/some.txt", "folder": false, "checksum": "a234f" }, { "name": "etc/ws-security/some.link", "checksum": "123a234f", "softlink": true }, { "name": "../tmp/bob.txt", "checksum": "bcda234f" }, { "name": "../tmp", "folder": false } ], "system.properties": [ { "property": "javax.net.ssl.keyStore", "reference": "etc/keystores/serverKeystore.jks" } ] "java.properties": [ { "name": "etc/ws-security/server/encryption.properties", "property": "org.apache.ws.security.crypto.merlin.x509crl.file", "reference": "etc/certs/demoCA/crl/crl.pem" } ], } } }
where:
true
or if all files in the directory were exported if false
or if not
provided
true
or a file
if false
or if not provided
Modifier and Type | Field and Description |
---|---|
protected static String |
CURRENT_VERSION
Holds the current export version.
|
protected String |
id
Holds the current migratable identifier or
null if representing the system
context. |
static String |
METADATA_DATE |
static String |
METADATA_DDF_HOME |
static String |
METADATA_DESCRIPTION |
static String |
METADATA_EXTERNALS |
protected static Path |
METADATA_FILENAME |
static String |
METADATA_FILES |
static String |
METADATA_FOLDERS |
static String |
METADATA_JAVA_PROPERTIES |
static String |
METADATA_MIGRATABLES |
static String |
METADATA_ORGANIZATION |
static String |
METADATA_PRODUCT_BRANDING |
static String |
METADATA_PRODUCT_VERSION |
static String |
METADATA_SYSTEM_PROPERTIES |
static String |
METADATA_TITLE |
static String |
METADATA_VERSION |
protected Migratable |
migratable |
protected R |
report |
Modifier | Constructor and Description |
---|---|
protected |
MigrationContextImpl(R report)
Creates a new migration context.
|
protected |
MigrationContextImpl(R report,
Migratable migratable)
Creates a new migration context with no version.
|
protected |
MigrationContextImpl(R report,
Migratable migratable,
String version)
Creates a new migration context.
|
protected |
MigrationContextImpl(R report,
String id)
Creates a new migration context with no version.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getId()
Gets the current migratable identifier.
|
R |
getReport()
Retrieves the report associated with the current migration operation
|
Optional<String> |
getVersion() |
int |
hashCode() |
protected void |
processMetadata(Map<String,Object> metadata) |
public static final String METADATA_PRODUCT_BRANDING
public static final String METADATA_PRODUCT_VERSION
public static final String METADATA_DATE
public static final String METADATA_DDF_HOME
public static final String METADATA_MIGRATABLES
public static final String METADATA_VERSION
public static final String METADATA_TITLE
public static final String METADATA_DESCRIPTION
public static final String METADATA_ORGANIZATION
public static final String METADATA_FILES
public static final String METADATA_FOLDERS
public static final String METADATA_EXTERNALS
public static final String METADATA_SYSTEM_PROPERTIES
public static final String METADATA_JAVA_PROPERTIES
protected static final String CURRENT_VERSION
1.0 - initial version
protected static final Path METADATA_FILENAME
protected final R extends MigrationReport report
@Nullable protected final Migratable migratable
protected MigrationContextImpl(R report)
report
- the migration report where to record warnings and errorsIllegalArgumentException
- if report
is null
IOError
- if unable to determine ${ddf.home}protected MigrationContextImpl(R report, String id)
report
- the migration report where to record warnings and errorsid
- the migratable idIllegalArgumentException
- if report
or id
is null
IOError
- if unable to determine ${ddf.home}protected MigrationContextImpl(R report, Migratable migratable)
report
- the migration report where to record warnings and errorsmigratable
- the migratable this context is forIllegalArgumentException
- if report
or migratable
is
null
IOError
- if unable to determine ${ddf.home}protected MigrationContextImpl(R report, Migratable migratable, String version)
report
- the migration report where to record warnings and errorsmigratable
- the migratable this context is forversion
- the migratable versionIllegalArgumentException
- if report
, migratable
, or
version
is null
IOError
- if unable to determine ${ddf.home}public R getReport()
MigrationContext
getReport
in interface MigrationContext
@Nullable public String getId()
MigrationContext
getId
in interface MigrationContext
This work is licensed under a Creative Commons Attribution 4.0 International License.