Class CrowdEntityXmlMapper<T,I extends T>
- java.lang.Object
-
- com.atlassian.bamboo.migration.BambooStAXMappingHelperAbstractImpl<T,I>
-
- com.atlassian.bamboo.migration.BambooStAXMappingListHelperAbstractImpl<T,I>
-
- com.atlassian.bamboo.migration.stream.crowd.CrowdEntityXmlMapper<T,I>
-
- All Implemented Interfaces:
BambooStAXMappingHelper<T,I>
- Direct Known Subclasses:
AliasMapper
,ApplicationMapper
,DirectoryMapper
,PartialCrowdEntityXmlMapper
public abstract class CrowdEntityXmlMapper<T,I extends T> extends BambooStAXMappingListHelperAbstractImpl<T,I>
A generic mapper that contains helper methods and attributes to map domain objects to database objects and vice-versa.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
CrowdEntityXmlMapper.SingleValuedAttributesMapper
-
Nested classes/interfaces inherited from interface com.atlassian.bamboo.migration.BambooStAXMappingHelper
BambooStAXMappingHelper.None
-
-
Field Summary
Fields Modifier and Type Field Description static String
GENERIC_XML_ACTIVE
static String
GENERIC_XML_ATTRIBUTE
static String
GENERIC_XML_ATTRIBUTE_NAME
static String
GENERIC_XML_ATTRIBUTE_VALUE
static String
GENERIC_XML_ATTRIBUTES
static String
GENERIC_XML_CREATED_DATE
static String
GENERIC_XML_ID
static String
GENERIC_XML_NAME
static String
GENERIC_XML_UPDATED_DATE
protected static Method
setActive
protected static Method
setId
protected static Method
setName
-
Fields inherited from class com.atlassian.bamboo.migration.BambooStAXMappingHelperAbstractImpl
transactionOperations
-
-
Constructor Summary
Constructors Constructor Description CrowdEntityXmlMapper(org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.support.TransactionOperations ops)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
exportProperties(@NotNull org.codehaus.staxmate.out.SMOutputElement outputElement, T entity, @NotNull org.hibernate.Session session, ExportDetailsBean exportDetailsBean)
Exports an internal entity to an XML element.protected void
exportSingleValuedAttributes(com.atlassian.crowd.embedded.api.Attributes entity, org.codehaus.staxmate.out.SMOutputElement element, ExportDetailsBean exportDetailsBean)
Exports Map<String, String> to an XML element.protected void
importProperties(I object, @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor, @NotNull org.hibernate.Session session)
Import properties to the object.-
Methods inherited from class com.atlassian.bamboo.migration.BambooStAXMappingListHelperAbstractImpl
afterImportListItem, beforeImportListItem, createListRootElement, createRootElement, eventEndElementOfListItemSaveObject, exportListXml, exportListXml, flushIfNeeded, getXmlElementNodeName, getXmlRootNodeName, importListXml, importListXml, importListXmlInTransaction
-
Methods inherited from class com.atlassian.bamboo.migration.BambooStAXMappingHelperAbstractImpl
createItemInstance, exportXml, exportXml, getSession, getSessionFactory, importXml, importXml, isShouldExport, saveBambooObject
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.migration.BambooStAXMappingHelper
exportXml, importXml
-
-
-
-
Field Detail
-
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_CREATED_DATE
public static final String GENERIC_XML_CREATED_DATE
- See Also:
- Constant Field Values
-
GENERIC_XML_UPDATED_DATE
public static final String GENERIC_XML_UPDATED_DATE
- See Also:
- Constant Field Values
-
GENERIC_XML_ACTIVE
public static final String GENERIC_XML_ACTIVE
- See Also:
- Constant Field Values
-
GENERIC_XML_ATTRIBUTES
public static final String GENERIC_XML_ATTRIBUTES
- See Also:
- Constant Field Values
-
GENERIC_XML_ATTRIBUTE
public static final String GENERIC_XML_ATTRIBUTE
- See Also:
- Constant Field Values
-
GENERIC_XML_ATTRIBUTE_NAME
public static final String GENERIC_XML_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
GENERIC_XML_ATTRIBUTE_VALUE
public static final String GENERIC_XML_ATTRIBUTE_VALUE
- See Also:
- Constant Field Values
-
setId
protected static Method setId
-
setName
protected static Method setName
-
setActive
protected static Method setActive
-
-
Method Detail
-
exportProperties
protected void exportProperties(@NotNull @NotNull org.codehaus.staxmate.out.SMOutputElement outputElement, @NotNull T entity, @NotNull @NotNull org.hibernate.Session session, ExportDetailsBean exportDetailsBean) throws Exception
Exports an internal entity to an XML element.This exports: id, name, createdDate, updatedDate and active.
- Overrides:
exportProperties
in classBambooStAXMappingHelperAbstractImpl<T,I extends T>
- Parameters:
outputElement
- XML element to export to.entity
- entity to export.session
- Hibernate session object- Throws:
Exception
- when something went wrong
-
importProperties
protected void importProperties(@NotNull I object, @NotNull @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor, @NotNull @NotNull org.hibernate.Session session) throws Exception
Description copied from class:BambooStAXMappingHelperAbstractImpl
Import properties to the object. Due to nature of XML parsing this method is called for each child node in the node that was passed to importXml method- Overrides:
importProperties
in classBambooStAXMappingHelperAbstractImpl<T,I extends T>
- Parameters:
object
- object being importedinputCursor
- input cursor pointing to the child node of node that was passed to importXml methodsession
- Hibernate session object- Throws:
Exception
- when something went wrong
-
exportSingleValuedAttributes
protected void exportSingleValuedAttributes(com.atlassian.crowd.embedded.api.Attributes entity, org.codehaus.staxmate.out.SMOutputElement element, ExportDetailsBean exportDetailsBean) throws Exception
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.- Throws:
Exception
-
-