Package com.atlassian.crowd.migration
Class XmlMigrationManagerImpl
java.lang.Object
com.atlassian.crowd.migration.XmlMigrationManagerImpl
- All Implemented Interfaces:
XmlMigrationManager
,org.springframework.beans.factory.Aware
,org.springframework.web.context.ServletContextAware
public class XmlMigrationManagerImpl
extends Object
implements XmlMigrationManager, org.springframework.web.context.ServletContextAware
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
long
Exports the Crowd server's state to an XML file.long
Imports exported Crowd server state from an XML file.void
runPostImportActions
(String path) For testing purposes only.void
setAuditLogContext
(AuditLogContext auditLogContext) void
setAuditLogMetadataResolver
(AuditLogMetadataResolver auditLogMetadataResolver) void
setCacheManagers
(List<com.atlassian.cache.CacheManager> cacheManagers) void
setConnectionProviderController
(ConnectionProviderController connectionProviderController) void
setEventPublisher
(com.atlassian.event.api.EventPublisher eventPublisher) void
setI18nHelper
(I18nHelper i18nHelper) void
setLegacyXmlMigrator
(LegacyXmlMigrator legacyXmlMigrator) void
setLockService
(com.atlassian.beehive.ClusterLockService lockService) void
setPluginUpgradeManagerSupplier
(PluginUpgradeManagerSupplier pluginUpgradeManagerSupplier) void
setResettableHiLoGeneratorResetter
(ResettableHiLoGeneratorResetter resettableHiLoGeneratorResetter) void
setSchemaHelper
(SchemaHelper schemaHelper) void
setServletContext
(javax.servlet.ServletContext servletContext) void
setSessionFactory
(org.hibernate.SessionFactory sessionFactory) void
setTransactionManager
(org.springframework.transaction.PlatformTransactionManager transactionManager) void
setUpgradeManager
(UpgradeManager upgradeManager) void
setVerificationManager
(VerificationManager verificationManager) void
setXmlMigrator
(XmlMigrator xmlMigrator)
-
Field Details
-
TRIM_WHITESPACE_IN_BACKUP
-
IMPORT_EVENT_TYPE
- See Also:
-
XML_ROOT
- See Also:
-
CROWD_XML_VERSION
- See Also:
-
CROWD_XML_DATE
- See Also:
-
CROWD_XML_BUILD_NUMBER
- See Also:
-
CROWD_XML_BUILD_DATE
- See Also:
-
OPTION_RESET_DOMAIN
- See Also:
-
CROWD_DATEFORMAT_ATTRIBUTE
- See Also:
-
ISO8601_PATTERN
- See Also:
-
-
Constructor Details
-
XmlMigrationManagerImpl
public XmlMigrationManagerImpl()
-
-
Method Details
-
exportXml
@Transactional public long exportXml(String path, Map<String, Object> options) throws ExportException, BackupOrRestoreAlreadyInProgressExceptionDescription copied from interface:XmlMigrationManager
Exports the Crowd server's state to an XML file. This exports data from the Crowd database, crowd.cfg.xml and crowd.properties. The XML file will be a Crowd 2.x export, incompatible with Crowd 1.x.- Specified by:
exportXml
in interfaceXmlMigrationManager
- Parameters:
path
- file path of export XML.options
- export options.- Returns:
- time taken to export (milliseconds).
- Throws:
ExportException
- something went wrong during the export.BackupOrRestoreAlreadyInProgressException
- in case a backup or a restore is already in progress
-
importXml
public long importXml(String path) throws ImportException, BackupOrRestoreAlreadyInProgressException Description copied from interface:XmlMigrationManager
Imports exported Crowd server state from an XML file. The XML file can be a Crowd 1.x export or a Crowd 2.x export.- Specified by:
importXml
in interfaceXmlMigrationManager
- Parameters:
path
- file path of the XML backup to import.- Returns:
- time taken to import (milliseconds).
- Throws:
ImportException
- something went wrong during the import.BackupOrRestoreAlreadyInProgressException
- in case a backup or a restore is already in progress
-
runPostImportActions
Description copied from interface:XmlMigrationManager
For testing purposes only. Called by the external process after restoring database state.- Specified by:
runPostImportActions
in interfaceXmlMigrationManager
- Parameters:
path
- file path of the XML backup that was restored- Throws:
ImportException
- something went wrong during post import actions
-
cleanDatabase
- Throws:
OperationFailedException
-
setSessionFactory
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory) -
setCacheManagers
-
setResettableHiLoGeneratorResetter
public void setResettableHiLoGeneratorResetter(ResettableHiLoGeneratorResetter resettableHiLoGeneratorResetter) -
setUpgradeManager
-
setEventPublisher
public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) -
setXmlMigrator
-
setLegacyXmlMigrator
-
setServletContext
public void setServletContext(javax.servlet.ServletContext servletContext) - Specified by:
setServletContext
in interfaceorg.springframework.web.context.ServletContextAware
-
setVerificationManager
-
setLockService
public void setLockService(com.atlassian.beehive.ClusterLockService lockService) -
setSchemaHelper
-
setConnectionProviderController
public void setConnectionProviderController(ConnectionProviderController connectionProviderController) -
setTransactionManager
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) -
setAuditLogContext
-
setAuditLogMetadataResolver
-
setPluginUpgradeManagerSupplier
public void setPluginUpgradeManagerSupplier(PluginUpgradeManagerSupplier pluginUpgradeManagerSupplier) -
setI18nHelper
-