com.atlassian.jira.imports.project.handler
Class IssuePersisterHandler

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

public class IssuePersisterHandler
extends AbstractPersisterHandler
implements ImportEntityHandler

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

Since:
v3.13

Constructor Summary
IssuePersisterHandler(ProjectImportPersister projectImportPersister, ProjectImportMapper projectImportMapper, com.atlassian.crowd.embedded.api.User importAuthor, ProjectImportResults projectImportResults, Executor executor)
           
 
Method Summary
 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<String,String> 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.
 
Methods inherited from class com.atlassian.jira.imports.project.handler.AbstractPersisterHandler
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IssuePersisterHandler

public IssuePersisterHandler(ProjectImportPersister projectImportPersister,
                             ProjectImportMapper projectImportMapper,
                             com.atlassian.crowd.embedded.api.User importAuthor,
                             ProjectImportResults projectImportResults,
                             Executor executor)
Method Detail

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 ImportEntityHandler
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 the ChainedSaxHandler 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: ImportEntityHandler
Provides the implementation an opportunity to perform some action when the document is starting to be read.

Specified by:
startDocument in interface ImportEntityHandler

endDocument

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

Specified by:
endDocument in interface ImportEntityHandler


Copyright © 2002-2015 Atlassian. All Rights Reserved.