public class ImportOperation
extends java.lang.Object
Moreover it is possible to import only selected object(s) from an archive
(@see addImportKey(String)
for more information).
Modifier and Type | Class and Description |
---|---|
static class |
ImportOperation.Timing
Logs the duration of the import process.
|
Constructor and Description |
---|
ImportOperation(com.centrasite.jaxr.CentraSiteConnection connection,
java.lang.String zipFileName)
Constructs a CentraSite import instance which carries an existing CenntraSite connection.
|
ImportOperation(java.lang.String centraSiteUrl,
java.lang.String user,
java.lang.String password,
java.lang.String zipFileName)
Constructs a CentraSite import instance with a new CentraSite connection.
|
ImportOperation(java.lang.String centraSiteUrl,
java.lang.String user,
java.lang.String password,
java.lang.String zipFileName,
java.util.Properties sslProperties)
Constructs a CentraSite import instance which creates a new CentraSite connection with https if SSL properties are given.
|
Modifier and Type | Method and Description |
---|---|
void |
addImportKey(java.lang.String uddiKey)
Adds a key to import.
|
void |
addImportKeys(java.util.Collection<java.lang.String> uddiKeys)
Adds keys to import.
|
void |
close()
Close the underlying JAXR Connection in case object persistence was skipped
see
setSkipObjectPersistence(boolean) |
void |
completeSaveForSkippedObjects(java.util.Collection<? extends RegistryObject> registryObjects) |
void |
execute()
Execute the import operation.
|
java.lang.String |
getConsumerRegistrationKey(RegistryObject asset) |
java.util.Locale |
getErrorMessageLocale()
Returns the error message locale.
|
java.util.Collection<RegistryObject> |
getImportedObjectsToSave() |
java.util.Collection<java.lang.String> |
getImportedObjectTypeNames() |
java.lang.String |
getZipFileName()
Gets the absolute file name of the exported zip file.
|
boolean |
isClustered()
Checks the compatibility of the zip-archive file to import
|
static boolean |
isObjectToLog(RegistryObject registryObject)
Checks if the given registry object is supposed to be logged via event-logging.
|
static void |
main(java.lang.String[] args)
This is the main entry point.
|
void |
setErrorMessageLocale(java.util.Locale locale)
Sets the locale of the error message.
|
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 |
setIgnoreApikey(boolean ignoreApikey)
Indicate if "API Key or OAuth Applications" objects are to be ignored.
|
void |
setIgnoreExistingAliases(boolean ignoreExistingAliases)
Indicate if "Runtime Alias" objects are to be replaced or ignored.
|
void |
setIgnoreWSDLRegeneration(boolean ignoreWSDLRegeneration)
Control the "regeneration wsdl" policy.
|
void |
setImportGroup(boolean importGroup)
Imports the groups of the user for a single-user import.
|
void |
setImportOrganizationKey(java.lang.String importOrganizationKey)
Sets the organization the objects should be imported into.
|
void |
setImportOrganizationName(java.lang.String importOrganizationName)
Sets the organization the objects should be imported into.
|
void |
setKeepLCMState(boolean keepLCMState)
Maintains the lifecycle state of objects from the archive.
|
void |
setKeepOrganization(boolean keepOrganization)
Keeps the original organization for all of the objects being imported from the zip-archive.
|
void |
setKeepOwner(boolean keepOwner)
Keeps the original owner of all the objects being imported.
|
void |
setLimitTransactionSize(boolean limitTransactionSize)
Limit the size of a saveObjects() call and do it in intervals (only for audit trail)
to avoid large transactions.
|
void |
setMinimizeAudits(boolean minimizeAudits)
Limit the number of auditable events per object, that only the first and last
audit record gets imported.
|
void |
setNewOwner(User newOwner)
Sets a new user as owner of all the objects being imported.
|
void |
setNewOwnerName(java.lang.String newOwnerName)
Sets the given user as the owner of all the objects being imported.
|
void |
setRemoveAllMissingReferences(boolean removeAllMissingReferences)
Removes all missing associations for objects being imported.
|
void |
setReplace(boolean replaceOption)
Replaces the existing registry objects with the objects found in zip-archive.
|
void |
setRepositoryRoot(java.lang.String repositoryRoot)
Deprecated.
|
void |
setSimulate(boolean simulate)
Simulates importing objects; this means no records will be updated in the registry.
|
void |
setSkipObjectPersistence(boolean skipObjectPersistence)
Skips the persistence of objects within the import operation.
|
void |
setVerifyTypeVersion(boolean verifyTypeVersion)
Verifies the version numbers (repair version) of the asset types while importing.
|
public ImportOperation(com.centrasite.jaxr.CentraSiteConnection connection, java.lang.String zipFileName) throws java.lang.Exception
connection
- active registry connection (null: working without connection)zipFileName
- name of the zip-archive to importjava.lang.Exception
- error connecting to CentraSitepublic ImportOperation(java.lang.String centraSiteUrl, java.lang.String user, java.lang.String password, java.lang.String zipFileName, java.util.Properties sslProperties) throws java.lang.Exception
centraSiteUrl
- URL of the CentraSite Registryuser
- user namepassword
- password of the userzipFileName
- name of the zip-archive to importsslProperties
- SSL properties to enable https communication (null: no https)java.lang.Exception
- If the CentraSite connection failspublic ImportOperation(java.lang.String centraSiteUrl, java.lang.String user, java.lang.String password, java.lang.String zipFileName) throws java.lang.Exception
centraSiteUrl
- URL of the CentraSite databaseuser
- user namepassword
- password of the userzipFileName
- name of the zip-archive to importjava.lang.Exception
- If CentraSite connection failspublic void setReplace(boolean replaceOption)
replaceOption
- true: replace objects regardless of their timestamp;
false: reject older objects (default)public void setImportGroup(boolean importGroup)
importGroup
- true: import groups;
false: do not import groups (default)public void setKeepOwner(boolean keepOwner)
keepOwner
- true: keep the original owner from archive.public void setNewOwner(User newOwner)
newOwner
- The ID of CentraSite user.public void setNewOwnerName(java.lang.String newOwnerName) throws JAXRException, com.centrasite.jaxr.importexport.ExportException
newOwnerName
- name of the new owner (syntax: "domain\name", default domain: "INTERNAL")JAXRException
- If Jaxr query failscom.centrasite.jaxr.importexport.ExportException
- If the given user is not found in registrypublic void setKeepOrganization(boolean keepOrganization) throws com.centrasite.jaxr.importexport.ExportException
keepOrganization
- true: keep the original organization specified from archive;
false: set the owning organization to the organization of the importing user (default)com.centrasite.jaxr.importexport.ExportException
- If import fails.public final void setKeepLCMState(boolean keepLCMState)
keepLCMState
- true: keep lifecycle state at importpublic final void setRemoveAllMissingReferences(boolean removeAllMissingReferences)
removeAllMissingReferences
- true: remove all missing associationspublic final void setIgnoreExistingAliases(boolean ignoreExistingAliases)
ignoreExistingAliases
- - true if updates are to be ignoredpublic final void setIgnoreApikey(boolean ignoreApikey)
ignoreApikey
- - true if API key imports to be ignoredpublic final void setVerifyTypeVersion(boolean verifyTypeVersion)
verifyTypeVersion
- true: verify the version and reject types if there is no matchpublic final void setSimulate(boolean simulate)
simulate
- true: simulate the importpublic final void setLimitTransactionSize(boolean limitTransactionSize)
limitTransactionSize
- true: limit the size of single saveObjects()public final void setMinimizeAudits(boolean minimizeAudits)
minimizeAudits
- true: limit the audit event records
false: write all audit records (default)public final void setIgnoreWSDLRegeneration(boolean ignoreWSDLRegeneration)
ignoreWSDLRegeneration
- true: ignore wsdl regenerationpublic void setSkipObjectPersistence(boolean skipObjectPersistence)
saveObjects(Collection)
to store the objects after modifying them
After save, caller should invoke close()
to close the underlying connection after persisting the objectsskipObjectPersistence
- the skipObjectPersistence to setpublic void close() throws com.centrasite.jaxr.importexport.ExportException
setSkipObjectPersistence(boolean)
com.centrasite.jaxr.importexport.ExportException
public final void addImportKey(java.lang.String uddiKey)
uddiKey
- "uddi:..."public final void addImportKeys(java.util.Collection<java.lang.String> uddiKeys)
uddiKeys
- list of "uddi:..."public void setRepositoryRoot(java.lang.String repositoryRoot)
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 setImportOrganizationKey(java.lang.String importOrganizationKey) throws com.centrasite.jaxr.importexport.ExportException
importOrganizationKey
- the key of an organization;
null: take the user's organizationcom.centrasite.jaxr.importexport.ExportException
- If the import fails while setting the organizationpublic void setImportOrganizationName(java.lang.String importOrganizationName) throws com.centrasite.jaxr.importexport.ExportException, JAXRException
importOrganizationName
- name of Organizationcom.centrasite.jaxr.importexport.ExportException
- If the expected object is not available in the registryJAXRException
- If the jaxr query failspublic java.lang.String getZipFileName()
public boolean isClustered() throws java.lang.IllegalArgumentException, java.io.IOException
java.lang.IllegalArgumentException
- If wrong entries exist in zip - > MANIFEST_ENTRYjava.io.IOException
- If not able to reach the zip-archive filepublic void execute() throws com.centrasite.jaxr.importexport.ExportException
com.centrasite.jaxr.importexport.ExportException
- error with importpublic java.util.Collection<java.lang.String> getImportedObjectTypeNames()
public java.util.Collection<RegistryObject> getImportedObjectsToSave()
public java.lang.String getConsumerRegistrationKey(RegistryObject asset) throws JAXRException
JAXRException
public void completeSaveForSkippedObjects(java.util.Collection<? extends RegistryObject> registryObjects) throws com.centrasite.jaxr.importexport.ExportException
registryObjects
- com.centrasite.jaxr.importexport.ExportException
public static boolean isObjectToLog(RegistryObject registryObject)
registryObject
- the created/updated registry object.public final java.util.Locale getErrorMessageLocale()
public void setErrorMessageLocale(java.util.Locale locale)
locale
- Locale (e.g. Locale_en)public static void main(java.lang.String[] args)
usage:
ImportOperation [options] < CentraSite URL > < export filename >
< user > < password >
Options:
-setreplace | replace objects if already present in the registry |
-keepowner | keep the object owner instead of assiging the importing user |
-setowner < username > | all imported objects will be set to specified user |
-keeporganization | keep the organization instead of assigning the active one |
-keeplcmstate | keep the LCM state of the object which is set at export |
-importorg < org-key > | import the objects into the given organization by key |
-importorgname < orgname > | import the objects into the given organization by name |
-importgroup | import the groups which are present together with a single user |
-simulate | simulate the import, no updates to the registry but message logging |
-removemissingreferences | remove all missing associations causing dangling references |
-importkeys uddi[,uddi...] | import only those object(s) given by key(s) |
-sequential | Imports the objects sequentially in a reasonable order rather than in one go |
args
- program arguments