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 Summary
ConstructorsConstructorDescriptionIssuePersisterHandler(ProjectImportPersister projectImportPersister, ProjectImportMapper projectImportMapper, ApplicationUser importAuthor, ProjectImportResults projectImportResults, Executor executor) -
Method Summary
Modifier and TypeMethodDescriptionvoidProvides the implementation an opportunity to perform some action when the document is finished being read.longWhile running through all the issues this handler keeps track of what the largest issue key number it has encountered.voidhandleEntity(String entityName, Map<String, String> attributes) Will read the issue, transform it, save it, and keep the new mapped value.voidProvides 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
-
Constructor Details
-
IssuePersisterHandler
public IssuePersisterHandler(ProjectImportPersister projectImportPersister, ProjectImportMapper projectImportMapper, ApplicationUser importAuthor, ProjectImportResults projectImportResults, Executor executor)
-
-
Method Details
-
handleEntity
public void handleEntity(String entityName, Map<String, String> attributes) throws ParseException, AbortImportExceptionWill 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:
handleEntityin interfaceImportOfBizEntityHandler- Parameters:
entityName- the entity that is being processedattributes- the map containing all the attributes- Throws:
ParseException- if something goes wrong interpreting the attributes into an objecAbortImportException- 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:ImportOfBizEntityHandlerProvides the implementation an opportunity to perform some action when the document is starting to be read.- Specified by:
startDocumentin interfaceImportOfBizEntityHandler
-
endDocument
public void endDocument()Description copied from interface:ImportOfBizEntityHandlerProvides the implementation an opportunity to perform some action when the document is finished being read.- Specified by:
endDocumentin interfaceImportOfBizEntityHandler
-