public class ConfigurationMigrationManager extends Object implements ConfigurationMigrationService
ConfigurationMigrationService that allows migration of Configuration objects as well as any other configuration files needed.| Constructor and Description |
|---|
ConfigurationMigrationManager(List<Migratable> migratables,
org.apache.karaf.system.SystemService system)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
MigrationReport |
doDecrypt(Path exportDirectory)
Decrypts an exported file from the specified path.
|
MigrationReport |
doDecrypt(Path exportDirectory,
Consumer<MigrationMessage> consumer)
Decrypts an exported file from the specified path.
|
MigrationReport |
doExport(Path exportDirectory)
Exports configurations to the specified path.
|
MigrationReport |
doExport(Path exportDirectory,
Consumer<MigrationMessage> consumer)
Exports configurations to the specified path.
|
MigrationReport |
doImport(Path exportDirectory)
Imports configurations from the specified path.
|
MigrationReport |
doImport(Path exportDirectory,
Consumer<MigrationMessage> consumer)
Imports configurations from the specified path.
|
static <T> BinaryOperator<T> |
throwingMerger() |
public ConfigurationMigrationManager(List<Migratable> migratables, org.apache.karaf.system.SystemService system)
migratables - list of Migratable services. Needs to be kept up-to-date by the
client of this class.system - the system serviceIOError - if unable to load the distribution branding or version information.public static <T> BinaryOperator<T> throwingMerger()
public MigrationReport doExport(Path exportDirectory)
ConfigurationMigrationServicedoExport in interface ConfigurationMigrationServiceexportDirectory - path to export configurations topublic MigrationReport doExport(Path exportDirectory, Consumer<MigrationMessage> consumer)
ConfigurationMigrationServiceNote: This version of the doExport() method will callback the provided
consumer every time a migration message is recorded. The message will also be recorded with the
report returned at the completion of the operation.
doExport in interface ConfigurationMigrationServiceexportDirectory - path to export configurations toconsumer - a consumer to call whenever a new migration message is recorded during the
operationpublic MigrationReport doImport(Path exportDirectory)
ConfigurationMigrationServicedoImport in interface ConfigurationMigrationServiceexportDirectory - path to import configurations frompublic MigrationReport doImport(Path exportDirectory, Consumer<MigrationMessage> consumer)
ConfigurationMigrationServiceNote: This version of the doImport() method will callback the provided
consumer every time a migration message is recorded. The message will also be recorded with the
report returned at the completion of the operation.
doImport in interface ConfigurationMigrationServiceexportDirectory - path to import configurations fromconsumer - a consumer to call whenever a new migration message is recorded during the
operationpublic MigrationReport doDecrypt(Path exportDirectory)
ConfigurationMigrationServicedoDecrypt in interface ConfigurationMigrationServiceexportDirectory - path to decrypt configurations frompublic MigrationReport doDecrypt(Path exportDirectory, Consumer<MigrationMessage> consumer)
ConfigurationMigrationServiceNote: This version of the doDecrypt() method will callback the provided
consumer every time a migration message is recorded. The message will also be recorded with the
report returned at the completion of the operation.
doDecrypt in interface ConfigurationMigrationServiceexportDirectory - path to decrypt configurations fromconsumer - a consumer to call whenever a new migration message is recorded during the
operationThis work is licensed under a Creative Commons Attribution 4.0 International License.