public abstract class

Importer

extends Object
java.lang.Object
   ↳ com.atlassian.confluence.importexport.Importer
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

An importer is a single-use object for performing an import with a given ImportContext.

Subclasses must implement the doImportInternal() method to perform the actual import, and may optionally override preImport() and postImportAndCleanUp() to do additional processing.

Summary

Fields
protected ImportContext context
protected SessionFactory sessionFactory
Public Constructors
Importer()
Public Methods
final void doImport()
Executes an import with this importer.
final void setContext(ImportContext context)
final void setEventPublisher(EventPublisher eventPublisher)
final void setPostImportTasks(List<PostImportTask> postImportTasks)
final void setSessionFactory(SessionFactory sessionFactory)
Protected Methods
abstract void doImportInternal()
Performs the actual import.
EventPublisher getEventPublisher()
void postImportAndCleanUp()
Perform any special logic after the import and post-import tasks are complete.
void preImport()
Perform any special logic prior to the import starting.
final void publishEvent(Object event)
Publish an event to the rest of the system.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected ImportContext context

protected SessionFactory sessionFactory

Public Constructors

public Importer ()

Public Methods

public final void doImport ()

Executes an import with this importer. Clients should not normally call this method directly, but instead use the ImportExportManager.

After the import is complete, runs the post-import tasks, published a ImportFinishedEvent, and deletes the import working file.
Throws
ImportExportException if there was a problem during the import or any of the post-import tasks failed.

public final void setContext (ImportContext context)

public final void setEventPublisher (EventPublisher eventPublisher)

public final void setPostImportTasks (List<PostImportTask> postImportTasks)

public final void setSessionFactory (SessionFactory sessionFactory)

Protected Methods

protected abstract void doImportInternal ()

Performs the actual import.

Throws
ImportExportException if there was a problem executing the import

protected EventPublisher getEventPublisher ()

protected void postImportAndCleanUp ()

Perform any special logic after the import and post-import tasks are complete. This method will run even if the import fails. The default implementation does nothing.

Throws
ImportExportException if the import process should be aborted

protected void preImport ()

Perform any special logic prior to the import starting. Default implementation does nothing.

Throws
ImportExportException if the import should be aborted

protected final void publishEvent (Object event)

Publish an event to the rest of the system.

Parameters
event the event to publish