@Internal
public interface StructureBackupProvider
This is an extension point for Structure backup/restore mechanism. You need to declare its implementation in
structure-backup-provider
module in atlassian-plugin.xml
Example:
<structure-backup-provider key="my-backup-provider" class="com.acme.myapp.MyBackupProvider"/>
You should declare only one structure-backup-provider
module in your app. In case of multiple providers
only one of them will be used.
Modifier and Type | Method and Description |
---|---|
void |
backup(BackupWriter writer,
LongSet structureIds)
Called during Structure Backup procedure.
|
void |
migrate(BackupReader reader,
Map<Long,Long> backupToStoredStructureIds,
ErrorsReporter errorsReporter)
Deprecated.
since Structure 7.5
|
default void |
migrate(BackupReader reader,
MigrationMapping mapping,
ErrorsReporter errorsReporter)
Called during Migrate Structure procedure.
|
void |
restore(BackupReader reader,
ErrorsReporter errorsReporter)
Called during Structure Restore procedure.
|
void backup(@NotNull BackupWriter writer, @Nullable LongSet structureIds)
Called during Structure Backup procedure. Use writer
to back up data in XML format.
Data is written to extension
section. extension
element has app key and version values as attributes.
Data format:
<extensions> <extension key="com.acme.app" version="1.0"> writer adds data here... </extension> ... </extensions>
writer
- backup data writerstructureIds
- the collection of structure IDs to back up; null
means all structuresvoid restore(@NotNull BackupReader reader, @NotNull ErrorsReporter errorsReporter)
Called during Structure Restore procedure. reader
points to extension
element related to your app.
You can get app version at the time of backup by reading "version" attribute of extension
element.
Attempts to read data outside the extension
section will result in an exception.
Use errorsReporter
to warn about problems during restore. The errors will be shown on UI after
Structure Restore procedure.
reader
- backup data readererrorsReporter
- reporter for errors@Deprecated void migrate(@NotNull BackupReader reader, @NotNull Map<Long,Long> backupToStoredStructureIds, @NotNull ErrorsReporter errorsReporter)
Called during Migrate Structure procedure.
Works the same way as restore(BackupReader, ErrorsReporter)
but must restore data only for
the provided structures.
reader
- backup data readerbackupToStoredStructureIds
- keys of this map are IDs of structures to migrate as they occur in a backup;
values - corresponding structure IDs in the systemerrorsReporter
- reporter for migration errorsrestore(BackupReader, ErrorsReporter)
default void migrate(@NotNull BackupReader reader, @NotNull MigrationMapping mapping, @NotNull ErrorsReporter errorsReporter)
Called during Migrate Structure procedure.
Works the same way as restore(BackupReader, ErrorsReporter)
but must restore data only for
the provided structures.
reader
- backup data readermapping
- migrated structures and items ID mapping.errorsReporter
- reporter for migration errorsCopyright © 2024 Tempo Software. All Rights Reserved.