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
Modifier and TypeClassDescriptionprotected static class
Nested classes/interfaces inherited from interface com.atlassian.bamboo.migration.BambooStAXMappingHelper
BambooStAXMappingHelper.None
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected static Method
protected static Method
protected static Method
Fields inherited from class com.atlassian.bamboo.migration.BambooStAXMappingHelperAbstractImpl
transactionOperations
-
Constructor Summary
ConstructorDescriptionCrowdEntityXmlMapper
(org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.support.TransactionOperations ops) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 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:
-
setId
-
setName
-
setActive
-
-
Constructor Details
-
CrowdEntityXmlMapper
public CrowdEntityXmlMapper(org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.support.TransactionOperations ops)
-
-
Method Details
-
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
-