public class

IssuePersisterHandler

extends AbstractPersisterHandler
implements ImportEntityHandler
java.lang.Object
   ↳ com.atlassian.jira.imports.project.handler.AbstractPersisterHandler
     ↳ com.atlassian.jira.imports.project.handler.IssuePersisterHandler

Class Overview

Used to inspect issue entries in a backup file, transform the entities and persist them to the database.

Summary

Public Constructors
IssuePersisterHandler(ProjectImportPersister projectImportPersister, ProjectImportMapper projectImportMapper, User importAuthor, ProjectImportResults projectImportResults, Executor executor)
Public Methods
void endDocument()
Provides the implementation an opportunity to perform some action when the document is finished being read.
long getLargestIssueKeyNumber()
While running through all the issues this handler keeps track of what the largest issue key number it has encountered.
void handleEntity(String entityName, Map<StringString> attributes)
Will read the issue, transform it, save it, and keep the new mapped value.
void startDocument()
Provides the implementation an opportunity to perform some action when the document is starting to be read.
[Expand]
Inherited Methods
From class com.atlassian.jira.imports.project.handler.AbstractPersisterHandler
From class java.lang.Object
From interface com.atlassian.jira.imports.project.handler.ImportEntityHandler

Public Constructors

public IssuePersisterHandler (ProjectImportPersister projectImportPersister, ProjectImportMapper projectImportMapper, User importAuthor, ProjectImportResults projectImportResults, Executor executor)

Public Methods

public void endDocument ()

Provides the implementation an opportunity to perform some action when the document is finished being read.

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

public void handleEntity (String entityName, Map<StringString> attributes)

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.

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

public void startDocument ()

Provides the implementation an opportunity to perform some action when the document is starting to be read.