public abstract class Importer extends Object
ImportContext
.
Subclasses must implement the doImportInternal()
method to perform the actual import,
and may optionally override preImport()
and postImportAndCleanUp()
to do
additional processing.
ImportExportManager
Modifier and Type | Field and Description |
---|---|
protected ImportContext |
context |
protected net.sf.hibernate.SessionFactory |
sessionFactory |
Constructor and Description |
---|
Importer() |
Modifier and Type | Method and Description |
---|---|
protected void |
completeProgessMeter() |
ImportProcessorSummary |
doImport()
Executes an import with this importer.
|
protected abstract ImportProcessorSummary |
doImportInternal()
Performs the actual import.
|
protected com.atlassian.event.api.EventPublisher |
getEventPublisher() |
protected void |
postImportAndCleanUp()
Perform any special logic after the import and post-import tasks are complete.
|
protected void |
preImport()
Perform any special logic prior to the import starting.
|
protected void |
publishEvent(Object event)
Publish an event to the rest of the system.
|
void |
setContext(ImportContext context) |
void |
setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) |
void |
setPostImportTasks(List<PostImportTask> postImportTasks) |
void |
setSessionFactory(net.sf.hibernate.SessionFactory sessionFactory) |
protected ImportContext context
protected net.sf.hibernate.SessionFactory sessionFactory
public final void setContext(ImportContext context)
public final void setSessionFactory(net.sf.hibernate.SessionFactory sessionFactory)
public final void setPostImportTasks(List<PostImportTask> postImportTasks)
public final void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)
public final ImportProcessorSummary doImport() throws ImportExportException
ImportExportManager
.
After the import is complete, runs the post-import tasks, published a ImportFinishedEvent
,
and deletes the import working file.
ImportExportException
- if there was a problem during the import or any of
the post-import tasks failed.protected void completeProgessMeter()
protected void preImport() throws ImportExportException
ImportExportException
- if the import should be abortedprotected void postImportAndCleanUp() throws ImportExportException
ImportExportException
- if the import process should be abortedprotected abstract ImportProcessorSummary doImportInternal() throws ImportExportException
ImportExportException
- if there was a problem executing the importImportExportManager.performImport(ImportContext)
protected final void publishEvent(Object event)
event
- the event to publishprotected com.atlassian.event.api.EventPublisher getEventPublisher()
Copyright © 2003–2018 Atlassian. All rights reserved.