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

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

public class IssueRelatedEntitiesPartionHandler
extends AbstractImportPartitionHandler

Parses an XML import file and writes a smaller "partition" containing just the values for certain issue-related entities that are valid for the project we are importing.

Since:
v3.13

Constructor Summary
IssueRelatedEntitiesPartionHandler(BackupProject backupProject, PrintWriter printWriter, PrintWriter changeItemXmlWriter, List modelEntities, String encoding)
           
 
Method Summary
 void endDocument()
          Provides the implementation an opportunity to perform some action when the document is finished being read.
 int getChangeItemEntityCount()
           
 int getEntityCount()
           
 Map getRegisteredHandlers()
           
 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.AbstractImportPartitionHandler
assertModelEntityForName, getEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IssueRelatedEntitiesPartionHandler

public IssueRelatedEntitiesPartionHandler(BackupProject backupProject,
                                          PrintWriter printWriter,
                                          PrintWriter changeItemXmlWriter,
                                          List modelEntities,
                                          String encoding)
Parameters:
backupProject - contains the issue id's that we are interested in partitioning.
printWriter - the partitioned writer that should be written to if the entity being processed should be written.
changeItemXmlWriter - the writer that will write
modelEntities - a List of ModelEntity's that the partitioner should be interested in.
encoding - is the encoding that the partitioned files are going to writen in.
Method Detail

handleEntity

public void handleEntity(String entityName,
                         Map<String,String> attributes)
                  throws ParseException
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.

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.

getEntityCount

public int getEntityCount()

getChangeItemEntityCount

public int getChangeItemEntityCount()

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
Overrides:
startDocument in class AbstractImportPartitionHandler

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
Overrides:
endDocument in class AbstractImportPartitionHandler

getRegisteredHandlers

public Map getRegisteredHandlers()


Copyright © 2002-2012 Atlassian. All Rights Reserved.