com.atlassian.crowd.migration
Class GenericMapper

java.lang.Object
  extended by com.atlassian.crowd.migration.GenericMapper
Direct Known Subclasses:
ApplicationMapper, CrowdConfigMapper, CrowdPropertiesMapper, DirectoryMapper, PropertyMapper, RemoteGroupMapper, RemotePrincipalMapper, RemoteRoleMapper, SALPropertyMapper

public class GenericMapper
extends java.lang.Object

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


Field Summary
protected static java.lang.String DATE_FORMAT
           
static java.lang.String GENERIC_XML_ATTRIBUTE
           
static java.lang.String GENERIC_XML_ATTRIBUTE_ID
           
static java.lang.String GENERIC_XML_ATTRIBUTE_KEY
           
static java.lang.String GENERIC_XML_ATTRIBUTE_VALUE
           
static java.lang.String GENERIC_XML_ATTRIBUTE_VALUES
           
static java.lang.String GENERIC_XML_ATTRIBUTES_NODE
           
static java.lang.String GENERIC_XML_CONCEPTION
           
static java.lang.String GENERIC_XML_ID
           
static java.lang.String GENERIC_XML_LASTMODIFIED
           
protected  org.apache.log4j.Logger logger
           
 
Constructor Summary
GenericMapper()
           
 
Method Summary
protected  void addEntities(java.util.List<? extends NamedEntity> entitiesToPersist)
           
protected  void addEntity(java.lang.Object entityToPersist)
           
protected  void addEntityAttributes(org.dom4j.Element element, java.util.Map attributes)
           
protected  void exportDefaults(java.lang.Object object, org.dom4j.Element element)
           
protected  java.util.List findAllExportableDirectories()
           
 BatchProcessor getBatchProcessor()
           
protected  java.lang.String getDateAsFormattedString(java.util.Date date)
           
protected  java.util.Date getDateFromFormattedString(java.lang.String dateString)
           
 DirectoryManager getDirectoryManager()
           
protected  java.util.Map getEntityAttributes(org.dom4j.Element element)
           
 org.hibernate.SessionFactory getSessionFactory()
           
protected  void populateDefaults(java.lang.Object object, org.dom4j.Element element)
           
 void setBatchProcessor(BatchProcessor batchProcessor)
           
 void setDirectoryManager(DirectoryManager directoryManager)
           
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.log4j.Logger logger

DATE_FORMAT

protected static final java.lang.String DATE_FORMAT
See Also:
Constant Field Values

GENERIC_XML_ID

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

GENERIC_XML_CONCEPTION

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

GENERIC_XML_LASTMODIFIED

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

GENERIC_XML_ATTRIBUTES_NODE

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

GENERIC_XML_ATTRIBUTE

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

GENERIC_XML_ATTRIBUTE_ID

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

GENERIC_XML_ATTRIBUTE_VALUES

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

GENERIC_XML_ATTRIBUTE_VALUE

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

GENERIC_XML_ATTRIBUTE_KEY

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

GenericMapper

public GenericMapper()
Method Detail

populateDefaults

protected void populateDefaults(java.lang.Object object,
                                org.dom4j.Element element)
                         throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getDateAsFormattedString

protected java.lang.String getDateAsFormattedString(java.util.Date date)

getDateFromFormattedString

protected java.util.Date getDateFromFormattedString(java.lang.String dateString)

exportDefaults

protected void exportDefaults(java.lang.Object object,
                              org.dom4j.Element element)
                       throws java.lang.IllegalArgumentException,
                              java.text.ParseException
Throws:
java.lang.IllegalArgumentException
java.text.ParseException

addEntityAttributes

protected void addEntityAttributes(org.dom4j.Element element,
                                   java.util.Map attributes)

getEntityAttributes

protected java.util.Map getEntityAttributes(org.dom4j.Element element)

findAllExportableDirectories

protected java.util.List findAllExportableDirectories()

addEntity

protected void addEntity(java.lang.Object entityToPersist)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

addEntities

protected void addEntities(java.util.List<? extends NamedEntity> entitiesToPersist)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getDirectoryManager

public DirectoryManager getDirectoryManager()

setDirectoryManager

public void setDirectoryManager(DirectoryManager directoryManager)

getSessionFactory

public org.hibernate.SessionFactory getSessionFactory()

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)

getBatchProcessor

public BatchProcessor getBatchProcessor()

setBatchProcessor

public void setBatchProcessor(BatchProcessor batchProcessor)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.