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

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

public class AttachmentPersisterHandler
extends AbstractPersisterHandler
implements ImportEntityHandler

Reads, transforms, and stores all attachment entities from a backup file and copies the actual attachment, as specified in the attachment directory into the JIRA attachment format. It is assumed that all attachment data that is processed by this handler is relevant and should be saved. NOTE: This handler will not process attachment data if ProjectImportOptions.getAttachmentPath() is null.

Since:
v3.13

Field Summary
protected  com.google.common.base.Supplier<AttachmentParser> attachmentParser
           
 
Constructor Summary
AttachmentPersisterHandler(ProjectImportPersister projectImportPersister, ProjectImportOptions projectImportOptions, ProjectImportMapper projectImportMapper, BackupProject backupProject, BackupSystemInformation backupSystemInformation, ProjectImportResults projectImportResults, Executor executor, AttachmentStore attachmentStore)
           
 
Method Summary
 void endDocument()
          Provides the implementation an opportunity to perform some action when the document is finished being read.
 void handleEntity(String entityName, Map<String,String> attributes)
          This is the main method to implement when using this ImportEntityHandler.
 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
 

Field Detail

attachmentParser

protected com.google.common.base.Supplier<AttachmentParser> attachmentParser
Constructor Detail

AttachmentPersisterHandler

public AttachmentPersisterHandler(ProjectImportPersister projectImportPersister,
                                  ProjectImportOptions projectImportOptions,
                                  ProjectImportMapper projectImportMapper,
                                  BackupProject backupProject,
                                  BackupSystemInformation backupSystemInformation,
                                  ProjectImportResults projectImportResults,
                                  Executor executor,
                                  AttachmentStore attachmentStore)
Method Detail

handleEntity

public void handleEntity(String entityName,
                         Map<String,String> attributes)
                  throws ParseException,
                         AbortImportException
Description copied from interface: ImportEntityHandler
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 ImportEntityHandler
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 the ChainedSaxHandler that it should abort its SAX parsing.

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-2014 Atlassian. All Rights Reserved.