com.atlassian.crowd.migration.legacy
Class GenericLegacyImporter

java.lang.Object
  extended by com.atlassian.crowd.migration.GenericMapper
      extended by com.atlassian.crowd.migration.legacy.GenericLegacyImporter
Direct Known Subclasses:
ApplicationMapper, DirectoryMapper, GroupMapper, PropertyMapper, RoleMapper, SALPropertyMapper, UserMapper

public class GenericLegacyImporter
extends GenericMapper

A generic mapper that contains helper methods and attributes to map domain objects to database objects and vice-versa.


Field Summary
protected static String DATE_FORMAT
           
static String GENERIC_XML_ACTIVE
           
static String GENERIC_XML_ATTRIBUTE
           
static String GENERIC_XML_ATTRIBUTE_ID
           
static String GENERIC_XML_ATTRIBUTE_KEY
           
static String GENERIC_XML_ATTRIBUTE_VALUE
           
static String GENERIC_XML_ATTRIBUTE_VALUES
           
static String GENERIC_XML_ATTRIBUTES_NODE
           
static String GENERIC_XML_CONCEPTION
           
static String GENERIC_XML_ID
           
static String GENERIC_XML_LASTMODIFIED
           
static String GENERIC_XML_NAME
           
protected  org.slf4j.Logger logger
           
 
Fields inherited from class com.atlassian.crowd.migration.GenericMapper
DATABASE_DATE_FORMAT, PLUGIN_KEY_PREFIX, XML_DATE_FORMAT
 
Constructor Summary
GenericLegacyImporter(org.hibernate.SessionFactory sessionFactory, BatchProcessor batchProcessor)
           
 
Method Summary
 DirectoryManager getDirectoryManager()
           
protected  InternalEntityTemplate getInternalEntityTemplateFromLegacyXml(org.dom4j.Element element)
          Constructs an InternalEntityTemplate from a legacy (Crowd 1.x) XML element.
protected  Map<String,Set<String>> getMultiValuedAttributesMapFromXml(org.dom4j.Element element)
          Constructs an Map> of attributes from a legacy (Crowd 1.x) XML element.
protected  PasswordCredential getPasswordCredentialFromXml(org.dom4j.Element parentElement)
           
protected  Map<String,String> getSingleValuedAttributesMapFromXml(org.dom4j.Element element)
          Constructs an Map of attributes from a legacy (Crowd 1.x) XML element.
 void setDirectoryManager(DirectoryManager directoryManager)
           
 
Methods inherited from class com.atlassian.crowd.migration.GenericMapper
addEntities, addEntity, addEntityViaMerge, addEntityViaSave, getAttributeValue, getDateAsFormattedString, getDateFromDatabase, getDateFromXml, getDirectoryTypeFromLegacyCode, getNameFromLegacyCode, getOperationTypeFromLegacyPermissionName, getSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger

DATE_FORMAT

protected static final String DATE_FORMAT
See Also:
Constant Field Values

GENERIC_XML_ID

public static final String GENERIC_XML_ID
See Also:
Constant Field Values

GENERIC_XML_NAME

public static final String GENERIC_XML_NAME
See Also:
Constant Field Values

GENERIC_XML_ACTIVE

public static final String GENERIC_XML_ACTIVE
See Also:
Constant Field Values

GENERIC_XML_CONCEPTION

public static final String GENERIC_XML_CONCEPTION
See Also:
Constant Field Values

GENERIC_XML_LASTMODIFIED

public static final String GENERIC_XML_LASTMODIFIED
See Also:
Constant Field Values

GENERIC_XML_ATTRIBUTES_NODE

public static final String GENERIC_XML_ATTRIBUTES_NODE
See Also:
Constant Field Values

GENERIC_XML_ATTRIBUTE

public static final String GENERIC_XML_ATTRIBUTE
See Also:
Constant Field Values

GENERIC_XML_ATTRIBUTE_ID

public static final String GENERIC_XML_ATTRIBUTE_ID
See Also:
Constant Field Values

GENERIC_XML_ATTRIBUTE_VALUES

public static final String GENERIC_XML_ATTRIBUTE_VALUES
See Also:
Constant Field Values

GENERIC_XML_ATTRIBUTE_VALUE

public static final String GENERIC_XML_ATTRIBUTE_VALUE
See Also:
Constant Field Values

GENERIC_XML_ATTRIBUTE_KEY

public static final String GENERIC_XML_ATTRIBUTE_KEY
See Also:
Constant Field Values
Constructor Detail

GenericLegacyImporter

public GenericLegacyImporter(org.hibernate.SessionFactory sessionFactory,
                             BatchProcessor batchProcessor)
Method Detail

getInternalEntityTemplateFromLegacyXml

protected InternalEntityTemplate getInternalEntityTemplateFromLegacyXml(org.dom4j.Element element)
Constructs an InternalEntityTemplate from a legacy (Crowd 1.x) XML element.

This imports: id, name, createdDate, updatedDate and active.

Parameters:
element - XML element to import from.
Returns:
InternalEntityTemplate holding the values.

getMultiValuedAttributesMapFromXml

protected Map<String,Set<String>> getMultiValuedAttributesMapFromXml(org.dom4j.Element element)
Constructs an Map> of attributes from a legacy (Crowd 1.x) XML element.

This imports attributes with multiple values.

Parameters:
element - XML element to import from.
Returns:
Map> holding the attributes.

getSingleValuedAttributesMapFromXml

protected Map<String,String> getSingleValuedAttributesMapFromXml(org.dom4j.Element element)
Constructs an Map of attributes from a legacy (Crowd 1.x) XML element.

This imports attributes with multiple values and picks the first attribute value if more than one exists.

Parameters:
element - XML element to import from.
Returns:
Map

getDirectoryManager

public DirectoryManager getDirectoryManager()

setDirectoryManager

public void setDirectoryManager(DirectoryManager directoryManager)

getPasswordCredentialFromXml

protected PasswordCredential getPasswordCredentialFromXml(org.dom4j.Element parentElement)


Copyright © 2012 Atlassian. All Rights Reserved.