public class ExportOperation
extends java.lang.Object
Repository objects will be copied into a sub-directory named 'webDAV' within the zip-archive. The entire pathname of the repository object will be kept in the archive.
Using the IEventCallback interface messages like errors, warnings and informational messages are communicated.
Example: OutputStream os = new FileOutputStream("myfile.zip"); ExportOperation eo = new ExportOperation("http://localhost:53305/CentraSite/CentraSite", "usr", "pwd", os); eo.addExportObject(regObj); eo.execute();
The export set may also be determined by a prepared query. This query can be prepared as a 'saved search'
in WEBDAV, see addSavedSearchObjects(String, String)
, or be directly specified as query file,
see addSearchFromFile(java.lang.String)
.
Also the objects to be exported can be filtered with the modifiedSince time stamp so only objects which
were created or modified after the given time stamp are selected for export, see setModifiedSince(String)
.
Example: export with saved search, modified since 2 hours: OutputStream os = new FileOutputStream("myfile.zip"); ExportOperation eo = new ExportOperation("http://localhost:53305/CentraSite/CentraSite", "usr", "pwd", os); eo.addSavedSearchObjects("MySavedSearch"); eo.setModifiedSince("PT2H"); eo.execute();
Modifier and Type | Class and Description |
---|---|
static class |
ExportOperation.CollectorResults
Collects the expected registry objects from the CentraSite registry.
|
static class |
ExportOperation.ExportOrganizationMode
This is the Organization export mode.
|
Modifier and Type | Field and Description |
---|---|
static ExportOperation.ExportOrganizationMode |
exportOrganizationModeDefault |
Constructor and Description |
---|
ExportOperation(com.centrasite.jaxr.CentraSiteConnection connection,
java.io.OutputStream outputStream)
Constructs a CentraSite export instance with an existing connection.
|
ExportOperation(java.lang.String centraSiteUrl,
java.lang.String user,
java.lang.String password,
java.io.OutputStream outputStream)
Constructs a CentraSite export instance with a new CentraSite connection.
|
Modifier and Type | Method and Description |
---|---|
void |
addExportKey(javax.xml.registry.infomodel.Key key)
Adds a key of an object to the collection of keys to be exported.
|
void |
addExportKeys(java.util.Collection<javax.xml.registry.infomodel.Key> keyCollection)
Adds a collection of object keys to the collection of keys to be exported.
|
void |
addExportObject(javax.xml.registry.infomodel.RegistryObject registryObject)
Adds a registry object to the collection of objects to be exported.
|
void |
addExportObjects(java.util.Collection<javax.xml.registry.infomodel.RegistryObject> registryObjectsCollection)
Adds a collection of registry objects to the collection of objects to be exported.
|
void |
addSavedSearchObjects(java.lang.String savedSearchName)
Adds the objects from the named saved search to the objects for export.
|
void |
addSavedSearchObjects(java.lang.String savedSearchName,
java.lang.String userName)
Adds the objects from a named saved search to the objects for export.
|
void |
addSearchFromFile(java.lang.String queryFileName)
Adds the objects executed by the search, given by its file name to the objects for export.
|
void |
close()
Closes connections and resources of an open ExportOperation.
|
void |
execute()
Executes the export operation.
|
java.util.List<ExportOperation.CollectorResults> |
getCollectorResult()
Gets the list of all exported objects
|
javax.xml.registry.infomodel.Concept |
getConcept(java.lang.String conceptValue)
Gets a concept using the name of the concept.
|
int |
getExportObjectCount()
Returns the object count to be exported.
|
javax.xml.registry.infomodel.Key |
getKey(java.lang.String keyValue)
Creates a key of a registryObject using the key given as a String
|
java.util.Collection<javax.xml.registry.infomodel.RegistryObject> |
getMainObjectsToExport()
Gets all top level objects to be exported.
|
java.util.Map<javax.xml.registry.infomodel.RegistryObject,java.util.Collection<javax.xml.registry.infomodel.RegistryObject>> |
getMainObjectsToExportMap()
Gets all selected objects to be exported as a map.
|
static void |
main(java.lang.String[] args)
The main entry point.
|
void |
removeExportObject(javax.xml.registry.infomodel.RegistryObject registryObject)
Removes the object from the set of objects to be exported.
|
void |
removeExportObject(java.lang.String key)
Removes the object from the set of objects to be exported.
|
void |
removeExportObjects(java.util.Collection<java.lang.String> keys)
Removes the objects from the set of objects to be exported.
|
void |
setCheckUnreferencedAssociations(boolean checkUnreferencedAssociations)
Sets whether to check for unreferenced objects during export.
|
void |
setDeleteAfterExport(boolean isObjectsDeletedAfterExport)
Sets whether to delete registry objects after export.
|
void |
setErrorMessageLocale(java.util.Locale locale)
Sets the error message locale.
|
void |
setEventCallback(com.centrasite.jaxr.importexport.IEventCallback eventCallback)
Sets a callback class which is called for messages (errors, warnings, informational).
|
void |
setEventCallback(com.centrasite.importexport.IEventCallback eventCallback)
Deprecated.
please use setEventCallback(com.centrasite.jaxr.importexport.IEventCallback)
|
void |
setExportOrganizationMode(ExportOperation.ExportOrganizationMode mode)
Sets the export mode for exporting organizations.
|
void |
setHeterogeneousObjectsExport(boolean isHeterogeneousObjectsExport)
Sets whether to include heterogeneous objects as part of the export archive.
|
void |
setIncludeChildOrganizations(boolean includeChildOrganizations)
Indicates if child organizations should be exported with their parent organization.
|
void |
setIncludeChildren(boolean isChildrenIncluded)
Deprecated.
|
void |
setIncludeExternalLinks(boolean isExternalLinksIncluded)
Deprecated.
|
void |
setIncludeImports(boolean isImportsIncluded)
Deprecated.
|
void |
setIncludeInstances(boolean isInstancesIncluded)
Sets whether to include instances of asset types or the classified
objects of taxonomies.
|
void |
setIncludeInstancesOfLCM(boolean isInstancesIncludedForLCM)
Sets whether to include all related lifecycle models.
|
void |
setIncludeInstancesOfTaxonomy(boolean isInstancesIncludedForTaxonomy)
Sets whether to include all taxonomies as part of the export archive
|
void |
setIncludeInstancesOfType(boolean isInstancesIncludedForType)
Sets whether to include the instances from already included Asset Types.
|
void |
setIncludeReferencedAssets(boolean includeReferencedAssets)
Indicates if referenced assets should also be exported.
|
void |
setIncludeReferencedAssetsOfAsset(boolean includeReferencedAssetsOfAsset)
Sets whether to include referenced assets from already included assets.
|
void |
setIncludeReferencedAssetsOfLCM(boolean includeReferencedAssetsOfLCM)
Sets whether to include the referenced assets of already included lifecycle models
|
void |
setIncludeReferencedAssetsOfTaxonomy(boolean includeReferencedAssetsOfTaxonomy)
Sets whether to include all referenced assets of already included taxonomies.
|
void |
setIncludeReferencedAssetsOfType(boolean includeReferencedAssetsOfType)
Sets whether to include referenced assets from already included Types.
|
void |
setIncludeTypeInfo(boolean isTypeInfoIncluded)
Deprecated.
|
void |
setMinimizeAuditableEvents(boolean minimizeAuditableEvents)
Controls the amount of audit trail for the objects.
|
void |
setModifiedSince(java.lang.String timeSpec)
Sets the time stamp for filtering the objects to export which were created/modified after this time stamp.
|
void |
setOrgWithAssets(boolean orgWithAssets)
Indicates if assets of an organization should be exported with the organization.
|
void |
setOutputStream(java.io.OutputStream outputStream)
Sets the output stream.
|
void |
setRepositoryRoot(java.lang.String repositoryRoot)
Sets the root of the Repository.
|
public static final ExportOperation.ExportOrganizationMode exportOrganizationModeDefault
public ExportOperation(com.centrasite.jaxr.CentraSiteConnection connection, java.io.OutputStream outputStream) throws java.lang.Exception
connection
- Existing connectionoutputStream
- the stream the export archive goes tojava.lang.Exception
- error connecting to CentraSitepublic ExportOperation(java.lang.String centraSiteUrl, java.lang.String user, java.lang.String password, java.io.OutputStream outputStream) throws java.lang.Exception
centraSiteUrl
- the URL of the CentraSite databaseuser
- the user namepassword
- the password of the useroutputStream
- the stream the export archive goes tojava.lang.Exception
- error connecting to CentraSitepublic void setExportOrganizationMode(ExportOperation.ExportOrganizationMode mode)
mode
- the ExportOrganizationModepublic void setIncludeChildOrganizations(boolean includeChildOrganizations)
includeChildOrganizations
- true: include child organizations (default)public void setIncludeReferencedAssets(boolean includeReferencedAssets)
includeReferencedAssets
- true: include referenced assets.public void setHeterogeneousObjectsExport(boolean isHeterogeneousObjectsExport)
isHeterogeneousObjectsExport
- true: include heterogeneous object(default).public void setOrgWithAssets(boolean orgWithAssets)
orgWithAssets
- true: include assets of organizations.public void setMinimizeAuditableEvents(boolean minimizeAuditableEvents)
minimizeAuditableEvents
- true: generate minimum auditable events for the objects.public final void setEventCallback(com.centrasite.jaxr.importexport.IEventCallback eventCallback)
eventCallback
- the instance of the message callback class;
null: no message callback (default)public final void setEventCallback(com.centrasite.importexport.IEventCallback eventCallback)
public void setIncludeExternalLinks(boolean isExternalLinksIncluded)
public void setIncludeChildren(boolean isChildrenIncluded)
public void setIncludeImports(boolean isImportsIncluded)
public void setIncludeTypeInfo(boolean isTypeInfoIncluded)
public void setIncludeInstances(boolean isInstancesIncluded)
isInstancesIncluded
- true: include the instances (default).public void setIncludeInstancesOfTaxonomy(boolean isInstancesIncludedForTaxonomy)
isInstancesIncludedForTaxonomy
- true: include all taxonomies (default).public void setIncludeReferencedAssetsOfTaxonomy(boolean includeReferencedAssetsOfTaxonomy)
includeReferencedAssetsOfTaxonomy
- true: include all referenced assets of taxonomy (default).public void setIncludeInstancesOfLCM(boolean isInstancesIncludedForLCM)
isInstancesIncludedForLCM
- true: include all referenced lifecycle models (default).public void setIncludeReferencedAssetsOfLCM(boolean includeReferencedAssetsOfLCM)
includeReferencedAssetsOfLCM
- true: include all referenced assets of already included lifecycle models(default).public void setIncludeInstancesOfType(boolean isInstancesIncludedForType)
isInstancesIncludedForType
- true: include all referenced instances from already included types (default).public void setIncludeReferencedAssetsOfType(boolean includeReferencedAssetsOfType)
includeReferencedAssetsOfType
- true: include all referenced from already included Types(default).public void setIncludeReferencedAssetsOfAsset(boolean includeReferencedAssetsOfAsset)
includeReferencedAssetsOfAsset
- true: include all referenced assets.public void setDeleteAfterExport(boolean isObjectsDeletedAfterExport)
isObjectsDeletedAfterExport
- true: delete objects after export;
false: do not delete objects (default)public final void setCheckUnreferencedAssociations(boolean checkUnreferencedAssociations)
checkUnreferencedAssociations
- true: check for unreferenced objects (default).public void setRepositoryRoot(java.lang.String repositoryRoot)
repositoryRoot
- Root directory of CentraSite Repositorypublic void setOutputStream(java.io.OutputStream outputStream)
outputStream
- Absolute path to store results.public void addExportKey(javax.xml.registry.infomodel.Key key) throws javax.xml.registry.JAXRException
key
- the key of the object to be exportedjavax.xml.registry.JAXRException
- Jaxr query failurepublic void addExportKeys(java.util.Collection<javax.xml.registry.infomodel.Key> keyCollection) throws javax.xml.registry.JAXRException
keyCollection
- the collection of keys to be exportedjavax.xml.registry.JAXRException
- Jaxr query failurepublic void addExportObject(javax.xml.registry.infomodel.RegistryObject registryObject) throws javax.xml.registry.JAXRException
registryObject
- the registry objectjavax.xml.registry.JAXRException
- jaxr query failure.public void addExportObjects(java.util.Collection<javax.xml.registry.infomodel.RegistryObject> registryObjectsCollection)
registryObjectsCollection
- collection of registry objectspublic void removeExportObject(javax.xml.registry.infomodel.RegistryObject registryObject)
getMainObjectsToExportMap()
has already been executed.registryObject
- the object to be removed from the set.public void removeExportObject(java.lang.String key)
key
- key of a top object to be ignored at exportpublic void removeExportObjects(java.util.Collection<java.lang.String> keys)
keys
- keys of a top object to be ignored at exportpublic int getExportObjectCount()
getMainObjectsToExport()
or (getMainObjectsToExport()
.public void addSavedSearchObjects(java.lang.String savedSearchName) throws com.centrasite.jaxr.importexport.ExportException
QueryExecutor
for more information.savedSearchName
- the name of the saved searchcom.centrasite.jaxr.importexport.ExportException
- query failurepublic void addSavedSearchObjects(java.lang.String savedSearchName, java.lang.String userName) throws com.centrasite.jaxr.importexport.ExportException
QueryExecutor
for more information.savedSearchName
- the name of the saved searchuserName
- the user name where the saved search is stored (null: take current jaxr user)com.centrasite.jaxr.importexport.ExportException
- query failurepublic void addSearchFromFile(java.lang.String queryFileName) throws com.centrasite.jaxr.importexport.ExportException
queryFileName
- path name (or URL) of a query filecom.centrasite.jaxr.importexport.ExportException
- query failurepublic void setModifiedSince(java.lang.String timeSpec) throws com.centrasite.jaxr.importexport.ExportException
The time stamp will be checked for all the following cases:
timeSpec
- the time specification in xs:dateTime or xs:duration syntax (null: no time limit)com.centrasite.jaxr.importexport.ExportException
- invalid dateTime/duration syntaxpublic void execute() throws java.lang.Exception
java.lang.Exception
- if encounters an internal error on failurepublic void close()
public java.util.Collection<javax.xml.registry.infomodel.RegistryObject> getMainObjectsToExport() throws java.lang.Exception
java.lang.Exception
- error while processing objectspublic java.util.Map<javax.xml.registry.infomodel.RegistryObject,java.util.Collection<javax.xml.registry.infomodel.RegistryObject>> getMainObjectsToExportMap() throws java.lang.Exception
java.lang.Exception
- error while processing objectspublic java.util.List<ExportOperation.CollectorResults> getCollectorResult() throws java.lang.Exception
java.lang.Exception
- error while processing objectspublic javax.xml.registry.infomodel.Concept getConcept(java.lang.String conceptValue) throws java.lang.Exception
conceptValue
- the name of the conceptjava.lang.Exception
- error while processing objectspublic javax.xml.registry.infomodel.Key getKey(java.lang.String keyValue) throws java.lang.Exception
keyValue
- the key as a uddi stringjava.lang.Exception
- error while processing objectspublic void setErrorMessageLocale(java.util.Locale locale)
locale
- the locale as a stringpublic static void main(java.lang.String[] args)
usage:
ExportOperation [options] < CentraSite URL > < export filename >
< user > < password > [< registry-key > ...]
Options:
Option | Explanation |
-noinstances | Do not export the instances of a Type and/or Taxonomy |
-deleteafterexport | Delete the objects to be exported after export (not for types and organizations) |
-minimizeauditableevents | Export only the minimal set of audit trail |
-withreferencedassets | Export also the directly referenced(associated) assets |
-orgnousers | Do not export the users of exported organizations |
-orgwithpolicyandlifecycle | Export the policies and LCMs of exported organizations |
-orgnochildorganization | Do not export the child organizations of exported organizations |
-orgwithassets | Export all the assets of the exported organizations |
-ignore id | Ignore the top object at export. This option may be specified more than once |
-savedsearch searchname | Add the result of the saved search to the objects to export. This option may be specified more than once |
-savedsearchuser user | Use the given user for the -savedsearch option instead of session user |
-searchfile file | Add the result of the search, specified in the XML file, to the objects to export. This option may be specified more than once |
-modifiedsince timespec | Export only objects created/modified after timespec (syntax: xs:dateTime or xs:duration) |
-displaymainobjects | Display the main objects to be exported but do NOT export |
-displaycollectorresult | Display the collector result but do NOT export |
-full | Full output option of a display |
deprecated option: [-orgnorelated] : use -orgnousers
args
- program arguments