Class ReferenceAoPreImport

java.lang.Object
com.atlassian.jira.dev.reference.plugin.imports.project.ReferenceAoPreImport
All Implemented Interfaces:
AoEntityHandler, PluggableImportAoEntityHandler, PluggableImportHandler

public class ReferenceAoPreImport extends Object implements PluggableImportAoEntityHandler
Reference plugin to observe AO data during the initial stages of a project import.
Since:
v7.0
  • Constructor Details

    • ReferenceAoPreImport

      public ReferenceAoPreImport()
  • Method Details

    • handleEntity

      public void handleEntity(String entityName, Map<String,Object> attributes) throws ParseException, AbortImportException
      Description copied from interface: AoEntityHandler
      This is the main method to implement when using this ImportEntityHandler. This method will provide the entity name and a complete map of attribute key/value pairs. This includes any nested element tags that will have CDATA bodies.
      Specified by:
      handleEntity in interface AoEntityHandler
      Parameters:
      entityName - identifies the entity (i.e. Issue)
      attributes - complete list of the attributes listed in the XML element including the nested elements.
      Throws:
      ParseException - if the entity is invalid a ParseException will be thrown.
      AbortImportException - to indicate to Project Import that it should abort its SAX parsing.
    • handlesEntity

      public boolean handlesEntity(String entityName)
      Description copied from interface: AoEntityHandler
      Return true if the handler should handle this entity.
      Specified by:
      handlesEntity in interface AoEntityHandler
      Returns:
      true if the handler should handle this entity.
    • getEntityWeight

      public Long getEntityWeight(String entityName)
      Description copied from interface: PluggableImportAoEntityHandler
      Return the weight for this entity. If this handler is does not handle the entity or care about it's ordering return PluggableImportAoEntityHandler.WEIGHT_NONE.

      This is ignored (not called) during the pre-import stage where the entities are supplied in the backup XML order.

      Specified by:
      getEntityWeight in interface PluggableImportAoEntityHandler
      Returns:
      the weight by which to order this entity when importing.
    • startDocument

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

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

      public void endTable(String tableName)
      Description copied from interface: AoEntityHandler
      Provides the implementation an opportunity to perform some action once all rows of a table are processed.
      Specified by:
      endTable in interface AoEntityHandler
    • setBackupProject

      public void setBackupProject(BackupProject backupProject)
      Description copied from interface: PluggableImportHandler
      Set the backup project. This will be injected after the handler is constructed, before any entities are processed.
      Specified by:
      setBackupProject in interface PluggableImportHandler
      Parameters:
      backupProject - The backup project
    • setBackupSystemInformation

      public void setBackupSystemInformation(BackupSystemInformation backupSystemInformation)
      Description copied from interface: PluggableImportHandler
      Set the backup system information. This will be injected after the handler is constructed, before any entities are processed.
      Specified by:
      setBackupSystemInformation in interface PluggableImportHandler
      Parameters:
      backupSystemInformation - The backup system information
    • setProjectImportMapper

      public void setProjectImportMapper(ProjectImportMapper projectImportMapper)
      Description copied from interface: PluggableImportHandler
      Set the project import mapper. This will be injected after the handler is constructed, before any entities are processed.
      Specified by:
      setProjectImportMapper in interface PluggableImportHandler
      Parameters:
      projectImportMapper - The project import mapper
    • setProjectImportResults

      public void setProjectImportResults(@Nullable ProjectImportResults projectImportResults)
      Description copied from interface: PluggableImportHandler
      Set the project import results. This will be injected after the handler is constructed, before any entities are processed. For pre-import handlers this will be null.
      Specified by:
      setProjectImportResults in interface PluggableImportHandler
      Parameters:
      projectImportResults - The project import results
    • isDocStarted

      public boolean isDocStarted()
    • isDocEnded

      public boolean isDocEnded()
    • getTables

      public List<String> getTables()
    • getBackupProject

      public BackupProject getBackupProject()
    • getBackupSystemInformation

      public BackupSystemInformation getBackupSystemInformation()
    • getProjectImportMapper

      public ProjectImportMapper getProjectImportMapper()
    • getProjectImportResults

      @Nullable public ProjectImportResults getProjectImportResults()