Class BambooStAXMappingListHelperAbstractImpl<T,I extends T>

java.lang.Object
com.atlassian.bamboo.migration.BambooStAXMappingHelperAbstractImpl<T,I>
com.atlassian.bamboo.migration.BambooStAXMappingListHelperAbstractImpl<T,I>
Type Parameters:
T -
All Implemented Interfaces:
BambooStAXMappingHelper<T,I>
Direct Known Subclasses:
AbstractPlanMapper, AbstractProjectDependencyMapper, AbstractProjectMapper, AbstractResultSummaryMapper, AccessTokenMapper, AceMapper, AclMapper, AgentAssignmentMapper, ApplicationMapper.DirectoryMappingsMapper, ApplicationMapper.GroupMappingsMapper, ArtifactDefinitionMapper, ArtifactLinkMapper, ArtifactMapper, ArtifactSubscriptionMapper, AuditLogMapper, AuthorMapper, BandanaItemMapper, BuildResultsWarningsSummariesMapper, BuildResultWarningSummaryMapper, CapabilitySetMapper, ChainBuildMapper, ChainStageMapper, ChainStageResultMapper, CommentMapper, CommitFilesMapper, CommitMapper, ConsumedSubscriptionMapper, CredentialMapper, CrowdDeletedEntityMapper, CrowdEntityXmlMapper, CrowdEntityXmlMapper.SingleValuedAttributesMapper, CustomDataMapper, DeploymentProjectItemMapper, DeploymentProjectMapper, DeploymentResultMapper, DeploymentVersionItemMapper, DeploymentVersionLinkedJiraIssueMapper, DeploymentVersionMapper, DeploymentVersionStatusMapper, DeploymentVersionVcsChangesetMapper, DeploymentVersionVcsCommitMapper, DirectoryMapper.PermissionsMapper, ElasticImageConfigurationMapper, ElasticInstanceScheduleMapper, EnvironmentMapper, EnvironmentRepositoryLinkMapper, EphemeralAgentTemplateMapper, ExternalEntityMapper, GroupMapper.GroupAttributeMapper, IdGeneratorMapper, InstantMessagingServerMapper, LabellingMapper, LabelMapper, LinkedJiraIssuesMapper, LocalGroupMapper, LocalUserMapper, MailServerMapper, PipelineMapper, PlanBranchPullRequestMapper, PlanBuildNumbersMapper, PlanRepositoryLinkMapper, PlanResultKeyListMapper, PlanSpecsSourceMapper, PlanVcsRevisionHistoryMapper, PropertyEntryMapper, PullRequestMapper, QuickFilterMapper, QuickFilterRuleMapper, RelevantChangesetsMapper, RemoteAgentAuthenticationMapper, RepositoryChangesetMapper, RepositoryDefinitionMapper, RssDeploymentProjectPermissionsMapper, RssProjectPermissionsMapper, ScriptMapper, SpecsSourceMapper, SpecsStateMapper, StageVariableContextMapper, StringListMapper, TestCaseMapper, TestCaseResultErrorMapper, TestCaseResultMapper, TestClassMapper, TestClassResultMapper, TrustedApplicationsMapper, TrustedKeyMapper, UserMapper.CredentialsRecordsMapper, UserMapper.UserAttributesMapper, VariableBaselineItemMapper, VariableContextBaselineMapper, VariableContextSnapshotMapper, VariableDefinitionMapper, VariableSubstitutionMapper, VcsBranchMapper, WebhookTemplateMapper

public abstract class BambooStAXMappingListHelperAbstractImpl<T,I extends T> extends BambooStAXMappingHelperAbstractImpl<T,I>
Skeleton implementation of StAX based export-import helper class for lists. The XML representation of such a list is: valueOfPropertyA ... ... ...
  • Constructor Details

    • BambooStAXMappingListHelperAbstractImpl

      protected BambooStAXMappingListHelperAbstractImpl(org.hibernate.SessionFactory sessionFactory, BambooStAXListImportStrategy listImportStrategy, org.springframework.transaction.support.TransactionOperations transactionOperations)
    • BambooStAXMappingListHelperAbstractImpl

      protected BambooStAXMappingListHelperAbstractImpl(org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.support.TransactionOperations transactionOperations)
  • Method Details

    • getXmlElementNodeName

      @NotNull public @NotNull String getXmlElementNodeName()
    • getXmlRootNodeName

      @NotNull public @NotNull String getXmlRootNodeName()
      Description copied from interface: BambooStAXMappingHelper
      Returns local name of the XML parent node that will contain exported/imported object's properties
      Specified by:
      getXmlRootNodeName in interface BambooStAXMappingHelper<T,I extends T>
      Overrides:
      getXmlRootNodeName in class BambooStAXMappingHelperAbstractImpl<T,I extends T>
      Returns:
      local name of the XML parent node
    • beforeImportListItem

      public void beforeImportListItem(@NotNull @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor, @NotNull @NotNull List<I> list, @NotNull @NotNull org.hibernate.Session session) throws Exception
      Called when parser reaches the list's element node.
      Parameters:
      inputCursor - inputCursor pointing to the list's element opening node
      list - list of elements being imported
      session - Hibernate session object
      Throws:
      Exception - when something went wrong
    • afterImportListItem

      public void afterImportListItem(@NotNull @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor, @NotNull @NotNull List<I> list, @NotNull I object, long objectIndex, @NotNull @NotNull org.hibernate.Session session) throws Exception
      Called after parser completes parsing all child nodes in list's element node.
      Parameters:
      inputCursor - cursor pointing to the list's element opening node
      list - list of elements being imported
      object - object that has been imported
      objectIndex - one-based index of the object being parsed
      session - Hibernate session object
      Throws:
      Exception - when something went wrong
    • createListRootElement

      @NotNull protected @NotNull org.codehaus.staxmate.out.SMOutputElement createListRootElement(@NotNull @NotNull org.codehaus.staxmate.out.SMOutputElement outputElement) throws XMLStreamException
      Creates list root node
      Parameters:
      outputElement - parent node for list root node
      Returns:
      list root node
      Throws:
      XMLStreamException - when something went wrong
    • createRootElement

      @NotNull protected @NotNull org.codehaus.staxmate.out.SMOutputElement createRootElement(@NotNull @NotNull org.codehaus.staxmate.out.SMOutputElement outputElement) throws XMLStreamException
      Creates list item node
      Overrides:
      createRootElement in class BambooStAXMappingHelperAbstractImpl<T,I extends T>
      Parameters:
      outputElement - list root node
      Returns:
      list item node
      Throws:
      XMLStreamException - when something went wrong
    • exportListXml

      public final <E extends T> void exportListXml(@NotNull @NotNull org.codehaus.staxmate.out.SMOutputElement outputElement, @NotNull @NotNull Iterable<E> iterable, ExportDetailsBean exportDetailsBean) throws Exception
      Exports a collection to the XML.
      Parameters:
      outputElement - parent node for collection root node
      iterable - collection to be exported
      exportDetailsBean -
      Throws:
      Exception - when something went wrong
    • exportListXml

      public <E extends T> void exportListXml(@NotNull @NotNull org.hibernate.Session session, @NotNull @NotNull org.codehaus.staxmate.out.SMOutputElement outputElement, @NotNull @NotNull Iterable<E> iterable, ExportDetailsBean exportDetailsBean) throws Exception
      Exports a collection to the XML. If collection is empty collection root not will not be created.
      Parameters:
      session - Hibernate session object
      outputElement - parent node for collection root node
      iterable - collection to be exported
      exportDetailsBean -
      Throws:
      Exception - when something went wrong
    • importListXml

      @NotNull public final @NotNull List<I> importListXml(@NotNull @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor) throws Exception
      Import list from XML
      Parameters:
      inputCursor - parent node for list root node
      Returns:
      list of the imported elements
      Throws:
      Exception - when something went wrong
    • importListXml

      @NotNull public @NotNull List<I> importListXml(@NotNull @NotNull org.hibernate.Session session, @NotNull @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor) throws Exception
      Import list from XML
      Parameters:
      session - Hibernate session object
      inputCursor - parent node for list root node
      Returns:
      list of the imported elements
      Throws:
      Exception - when something went wrong
    • importListXmlInTransaction

      protected void importListXmlInTransaction(org.codehaus.staxmate.in.SMInputCursor inputCursor)
    • eventEndElementOfListItemSaveObject

      protected void eventEndElementOfListItemSaveObject(@NotNull @NotNull org.hibernate.Session session, @NotNull T object, long objectIndex, long flushSize) throws org.hibernate.HibernateException
      Parameters:
      session - Hibernate session object
      object - object to be saved
      objectIndex - one-based index of the object in the list of object being read
      flushSize - number of objects to be saved before session.flush() is executed
      Throws:
      SQLException - when something went wrong
      org.hibernate.HibernateException - when something went wrong
    • flushIfNeeded

      protected void flushIfNeeded(org.hibernate.Session session, long objectIndex, long flushSize) throws org.hibernate.HibernateException
      Throws:
      org.hibernate.HibernateException