Class IssuePersisterHandler

java.lang.Object
com.atlassian.jira.imports.project.handler.AbstractPersisterHandler
com.atlassian.jira.imports.project.handler.IssuePersisterHandler
All Implemented Interfaces:
ImportOfBizEntityHandler

public class IssuePersisterHandler extends AbstractPersisterHandler implements ImportOfBizEntityHandler
Used to inspect issue entries in a backup file, transform the entities and persist them to the database.
Since:
v3.13
  • Constructor Details

  • Method Details

    • handleEntity

      public void handleEntity(String entityName, Map<String,String> attributes) throws ParseException, AbortImportException
      Will read the issue, transform it, save it, and keep the new mapped value. It also keeps track of the highest seen issue key number.
      Specified by:
      handleEntity in interface ImportOfBizEntityHandler
      Parameters:
      entityName - the entity that is being processed
      attributes - the map containing all the attributes
      Throws:
      ParseException - if something goes wrong interpreting the attributes into an objec
      AbortImportException - to indicate to project import that it should abort its SAX parsing.
    • getLargestIssueKeyNumber

      public long getLargestIssueKeyNumber()
      While running through all the issues this handler keeps track of what the largest issue key number it has encountered. This will return the largest seen number at the time it is called or 0 if it imported nothing.

      The issue key number is the numeric part of the key after the '-' of an issue key (e.g. TST-7, 7 is the issue key number).

      Returns:
      largest seen issue key number
    • startDocument

      public void startDocument()
      Description copied from interface: ImportOfBizEntityHandler
      Provides the implementation an opportunity to perform some action when the document is starting to be read.
      Specified by:
      startDocument in interface ImportOfBizEntityHandler
    • endDocument

      public void endDocument()
      Description copied from interface: ImportOfBizEntityHandler
      Provides the implementation an opportunity to perform some action when the document is finished being read.
      Specified by:
      endDocument in interface ImportOfBizEntityHandler