com.atlassian.bitbucket.migration.Exporter |
Implement this interface to export data so that it can be imported by an Importer
.
Migration archives are read and written sequentially. Entries added by this exporter will be read in the same order
by the corresponding Importer
.
There are two different types of entries:
File entries
Used to migrate data that has been generated in memory, for example, JSON data.
Archive entries
Used to migrate data that already exists on the file system.
Exporters
are required to be stateless, as they are essentially singletons. State, which
should persist over the whole lifetime of a job, can be stored in getAttributeMap()
. This data
is kept in memory and care should be taken that memory usage in this attribute map does not grow considerably over
time.
repositories
or Project projects, should be exported
using their export ID
.
Importers
can use this export ID to retrieve the local ID of the entity using the
import entity mapping
.
StandardMigrationEntityTypes
define mappings for
projects
and repositories
.
Custom entity types should implement the MigrationEntityType
interface.
<migration-handler>
module in its atlassian-plugin.xml
for the migration
process to include it. Migration handlers always define a pair of exporters
and
importers
. Only entries added by the corresponding Exporter
will be consumed by its
Importer
.
Example module definition:
<migration-handler key="handler" weight="150">
<exporter class="org.foo.bar.PluginExporter"/>
<importer class="org.foo.bar.PluginImporter"/>
</migration-handler>
A migration handler's weight defines the order in which it is called in relation to other migration handlers. A higher
weight signifies a dependency on a lower weight handler. All core handlers have a weight lower than 100
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called when a repository is exported.
| |||||||||||
Called when a project is exported.
| |||||||||||
Called when a pull request is exported.
| |||||||||||
Called after the export is finished.
| |||||||||||
Called before the export is started.
|
Called when a repository is exported. Implementors should implement this method to export all relevant data that is associated with the repository.
exportContext | the context for this export operation |
---|---|
repository | the repository that is exported |
Called when a project is exported. Implementors should implement this method to export all relevant data that is associated with the project.
exportContext | the context for this export operation |
---|---|
project | the project that is exported |
Called when a pull request is exported. Implementors should implement this method to export all relevant data that is associated with the pull request.
exportContext | the context for this export operation |
---|---|
pullRequest | the pull request that is exported |
Called after the export is finished.
exportContext | the context for this export operation
|
---|
Called before the export is started.
exportContext | the context for this export operation
|
---|