public class RepositoryExporter extends Object implements IRepositoryExporterFeedback
This class is used to read repository, load jobs and transformations, and export them into xml file. Xml file will be overwrite. In case of not success export this file will be deleted.
It is possible to set some export rules (similar as import rules). In case of export rule violation - whole export process will be treated as unsuccessful, export xml file will be deleted.
In case of during export some item form repository will be failed to load in case of missing step plugin etc - same as before - whole export process will be treated as failed, export xml file will be deleted.
Internally this implementation uses 2 types of output xml writers - actual and null implementation. When during export some item violates export rule - output xml file will be deleted, actual writer implementation will be replaced by null (nothing-to-do) implementation. Monitor current status will be replaced by error message with number of rule violation errors.
Monitor's progress bar is not the actual progress, as we don't actually know the amount of real export. In current implementation we avoid to discover repository for total amount of export work to show more sophisticated progress bar. Export may be canceled using this monitor cancel action. Using monitor cancel is only the way to interrupt running export without exception. In case of export is canceled - output export file will not be created.
Modifier and Type | Class and Description |
---|---|
static class |
RepositoryExporter.ExportType |
Constructor and Description |
---|
RepositoryExporter(Repository repository) |
Modifier and Type | Method and Description |
---|---|
void |
exportAllObjects(ProgressMonitorListener monitorOuter,
String xmlFilename,
RepositoryDirectoryInterface root,
String exportType)
This implementation is backward compatible.
|
List<ExportFeedback> |
exportAllObjectsWithFeedback(ProgressMonitorListener monitorOuter,
String xmlFilename,
RepositoryDirectoryInterface root,
String exportType)
This implementation attempts to scan whole repository for all items according to export type.
|
boolean |
isRulesViolation()
Call to this fast-access way to determine that export had rules violations.
|
void |
setImportRulesToValidate(ImportRules importRules)
Pass a set of import rules to the exporter to validate against during the export.
|
public RepositoryExporter(Repository repository)
repository
- public boolean isRulesViolation()
IRepositoryExporterFeedback
isRulesViolation
in interface IRepositoryExporterFeedback
public void setImportRulesToValidate(ImportRules importRules)
IRepositoryExporter
setImportRulesToValidate
in interface IRepositoryExporter
importRules
- The import rules to adhere to during export.public List<ExportFeedback> exportAllObjectsWithFeedback(ProgressMonitorListener monitorOuter, String xmlFilename, RepositoryDirectoryInterface root, String exportType) throws KettleException
This implementation attempts to scan whole repository for all items according to export type. If we have one or more export rules defined - it will NOT throw exception on first export rule violation. Instead of it this method attempts to scan whole repository to get full picture how many items violates export rules. This information is available as collection of feedbacks. To determine possible export rule violations and not perform full collection scan for error feedbacks use isRuleViolation() call
exportAllObjectsWithFeedback
in interface IRepositoryExporterFeedback
monitorOuter
- - export monitor.xmlFilename
- - export output file nameroot
- - repository to export fromexportType
- - type of items to exportKettleException
isRulesViolation()
public void exportAllObjects(ProgressMonitorListener monitorOuter, String xmlFilename, RepositoryDirectoryInterface root, String exportType) throws KettleException
exportAllObjects
in interface IRepositoryExporter
monitorOuter
- Progress Monitor for providing feedback during the export process.xmlFilename
- Filename to write out to.root
- Root directory to start export from.exportType
- Type of objects to export: "all", "trans", "job"KettleException
Copyright © 2018 Hitachi Vantara. All rights reserved.