Class XmlMapper

java.lang.Object
com.atlassian.crowd.migration.GenericMapper
com.atlassian.crowd.migration.legacy.XmlMapper
Direct Known Subclasses:
AliasMapper, ApplicationMapper, AuditLogMapper, CrowdPropertiesMapper, DirectoryMapper, GrantedPermissionMapper, GroupLevelAdminMapper, PartialXmlMapper, PropertyMapper

public class XmlMapper extends GenericMapper
A generic mapper that contains helper methods and attributes to map domain objects to database objects and vice-versa.
  • Field Details

  • Constructor Details

    • XmlMapper

      public XmlMapper(org.hibernate.SessionFactory sessionFactory, BatchProcessor batchProcessor)
  • Method Details

    • exportInternalEntity

      protected void exportInternalEntity(InternalEntity entity, org.dom4j.Element element)
      Exports an internal entity to an XML element.

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

      Parameters:
      entity - entity to export.
      element - XML element to export to.
    • exportSingleValuedAttributes

      protected void exportSingleValuedAttributes(Attributes entity, org.dom4j.Element element)
      Exports Map<String, String> to an XML element.

      Only use this for entities with simple attributes (Directory, Application) and not complex attributes (User, Group).

      Parameters:
      entity - entity with single valued attributes.
      element - XML element to export to.
    • getInternalEntityTemplateFromXml

      protected InternalEntityTemplate getInternalEntityTemplateFromXml(org.dom4j.Element element, CrowdBackupDateConverter dateConverter)
      Constructs an InternalEntityTemplate from an XML element.

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

      Parameters:
      element - XML element to import from.
      dateConverter - the CrowdBackupDateConverter suitable for the
      Returns:
      InternalEntityTemplate holding the values.
    • getSingleValuedAttributesMapFromXml

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

      This imports attributes with single values.

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