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,SealedSecretMapper
A generic mapper that contains helper methods and attributes to
map domain objects to database objects and vice-versa.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.crowd.migration.GenericMapper
GenericMapper.Exporter<T>, GenericMapper.Importer<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.atlassian.crowd.migration.GenericMapper
DATABASE_DATE_FORMAT, DATE_CONVERTER_FOR_EXPORT, LEGACY_XML_DATE_FORMAT, logger, PLUGIN_KEY_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionXmlMapper(org.hibernate.SessionFactory sessionFactory, BatchProcessor batchProcessor) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexportInternalEntity(InternalEntity entity, org.dom4j.Element element) Exports an internal entity to an XML element.protected voidexportSingleValuedAttributes(Attributes entity, org.dom4j.Element element) Exports Map<String, String> to an XML element.protected InternalEntityTemplategetInternalEntityTemplateFromXml(org.dom4j.Element element, CrowdBackupDateConverter dateConverter) Constructs an InternalEntityTemplate from an XML element.getSingleValuedAttributesMapFromXml(org.dom4j.Element element) Constructs an Map<String, String> of attributes from an XML element.Methods inherited from class com.atlassian.crowd.migration.GenericMapper
addEntities, addEntitiesViaMerge, addEntitiesViaReplicate, addEntity, addEntity, addEntityViaMerge, addEntityViaSave, clearSession, exportXml, getAttributeValue, getBoolean, getBoolean, getDateConverterForXml, getDateFromTimestamp, getDirectoryTypeFromLegacyCode, getLong, getNameFromLegacyCode, getOperationTypeFromLegacyPermissionName, getOptionalValue, getSessionFactory, getString, getValue, importXml, setCDATA, setText, setTimestamp
-
Field Details
-
GENERIC_XML_ID
- See Also:
-
GENERIC_XML_NAME
- See Also:
-
GENERIC_XML_CREATED_DATE
- See Also:
-
GENERIC_XML_UPDATED_DATE
- See Also:
-
GENERIC_XML_ACTIVE
- See Also:
-
GENERIC_XML_ATTRIBUTES
- See Also:
-
GENERIC_XML_ATTRIBUTE
- See Also:
-
GENERIC_XML_ATTRIBUTE_NAME
- See Also:
-
GENERIC_XML_ATTRIBUTE_VALUE
- See Also:
-
-
Constructor Details
-
XmlMapper
-
-
Method Details
-
exportInternalEntity
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
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- theCrowdBackupDateConvertersuitable for the- Returns:
- InternalEntityTemplate holding the values.
-
getSingleValuedAttributesMapFromXml
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.
-