com.atlassian.crowd.migration
Class XmlMigrationManagerImpl

java.lang.Object
  extended by com.atlassian.crowd.migration.XmlMigrationManagerImpl
All Implemented Interfaces:
XmlMigrationManager

public class XmlMigrationManagerImpl
extends java.lang.Object
implements XmlMigrationManager


Field Summary
static java.lang.String OPTION_RESET_DOMAIN
           
static java.lang.String XML_ROOT
           
 
Constructor Summary
XmlMigrationManagerImpl()
           
 
Method Summary
protected  void cleanDatabase()
           
protected  void clearCaches()
           
 long exportXml(java.lang.String path, java.util.Map options)
          Exports the Crowd server's state to an XML file.
protected  void flushAndClearHibernateSession()
           
 net.sf.ehcache.CacheManager getCacheManager()
           
 ResetableHiLoGeneratorHelper getResetableHiLoGeneratorHelper()
           
 SchemaHelper getSchemaHelper()
           
 org.hibernate.SessionFactory getSessionFactory()
           
 UpgradeManager getUpgradeManager()
           
 long importXml(java.lang.String path)
          Imports exported Crowd server state from an XML file.
protected  void resetIdentifierGenerators()
          Reset Hibernate incremental ID generators so we don't get ID collisions after a restore.
 void setCacheManager(net.sf.ehcache.CacheManager cacheManager)
           
 void setCrowdApplicationPasswordManager(CrowdApplicationPasswordManager crowdApplicationPasswordManager)
           
 void setEventManager(com.atlassian.event.EventManager eventManager)
           
 void setLegacyXmlMigrator(LegacyXmlMigrator legacyXmlMigrator)
           
 void setResetableHiLoGeneratorHelper(ResetableHiLoGeneratorHelper resetableHiLoGeneratorHelper)
           
 void setSchemaHelper(SchemaHelper schemaHelper)
           
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
           
 void setUpgradeManager(UpgradeManager upgradeManager)
           
 void setXmlMigrator(XmlMigrator xmlMigrator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_ROOT

public static final java.lang.String XML_ROOT
See Also:
Constant Field Values

OPTION_RESET_DOMAIN

public static final java.lang.String OPTION_RESET_DOMAIN
See Also:
Constant Field Values
Constructor Detail

XmlMigrationManagerImpl

public XmlMigrationManagerImpl()
Method Detail

exportXml

public long exportXml(java.lang.String path,
                      java.util.Map options)
               throws java.lang.Exception
Description 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 interface XmlMigrationManager
Parameters:
path - file path of export XML.
options - export options.
Returns:
time taken to export (milliseconds).
Throws:
java.lang.Exception - something went wrong during the export.

importXml

public long importXml(java.lang.String path)
               throws java.lang.Exception
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 interface XmlMigrationManager
Parameters:
path - file path of the XML backup to import.
Returns:
time taken to import (milliseconds).
Throws:
java.lang.Exception - something went wrong during the import.

clearCaches

protected void clearCaches()

flushAndClearHibernateSession

protected void flushAndClearHibernateSession()
                                      throws java.sql.SQLException
Throws:
java.sql.SQLException

cleanDatabase

protected void cleanDatabase()

resetIdentifierGenerators

protected void resetIdentifierGenerators()
                                  throws ImportExportException
Reset Hibernate incremental ID generators so we don't get ID collisions after a restore.

Throws:
ImportExportException - if some hibernate error prevents us doing the reset

getSessionFactory

public org.hibernate.SessionFactory getSessionFactory()

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)

getSchemaHelper

public SchemaHelper getSchemaHelper()

setSchemaHelper

public void setSchemaHelper(SchemaHelper schemaHelper)

getCacheManager

public net.sf.ehcache.CacheManager getCacheManager()

setCacheManager

public void setCacheManager(net.sf.ehcache.CacheManager cacheManager)

getResetableHiLoGeneratorHelper

public ResetableHiLoGeneratorHelper getResetableHiLoGeneratorHelper()

setResetableHiLoGeneratorHelper

public void setResetableHiLoGeneratorHelper(ResetableHiLoGeneratorHelper resetableHiLoGeneratorHelper)

getUpgradeManager

public UpgradeManager getUpgradeManager()

setUpgradeManager

public void setUpgradeManager(UpgradeManager upgradeManager)

setEventManager

public void setEventManager(com.atlassian.event.EventManager eventManager)

setXmlMigrator

public void setXmlMigrator(XmlMigrator xmlMigrator)

setLegacyXmlMigrator

public void setLegacyXmlMigrator(LegacyXmlMigrator legacyXmlMigrator)

setCrowdApplicationPasswordManager

public void setCrowdApplicationPasswordManager(CrowdApplicationPasswordManager crowdApplicationPasswordManager)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.