Package com.atlassian.jira.bc.dataimport
Interface DataImportOSPropertyValidator
@PublicApi
public interface DataImportOSPropertyValidator
Plugins can implement this interface to add logic to validate
<OSPropertyEntry>
elements in the backup XML.
All DataImportOSPropertyValidator
instances will be invoked before the import
(restore) process starts.
To register an implementation of this interface, use the <data-import-properties-validator>
element in your
atlassian-plugin.xml
.
Example:
<data-import-properties-validator key="my-data-import-validator"
i18n-name-key="my.data.import.validator.name"
class="com.example.myplugin.MyDataImportPropertiesValidator" />
- Since:
- v7.1
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Accessors to property entries in the backup XML. -
Method Summary
Modifier and TypeMethodDescriptionSpecifies a set of property entries that will be validated.validate
(DataImportParams dataImportParams, DataImportOSPropertyValidator.DataImportProperties dataImportProperties) Validates the backup XML.
-
Method Details
-
getPropertyKeysToValidate
Specifies a set of property entries that will be validated. Any entries specified here will then be made available in theDataImportOSPropertyValidator.DataImportProperties
instance that gets passed into thevalidate(DataImportParams, DataImportOSPropertyValidator.DataImportProperties)
method. Note that theDataImportOSPropertyValidator.DataImportProperties
instance will also contain properties that are requested by other instances ofDataImportOSPropertyValidator
.- Returns:
- A set of property entries that will be validated by this validator.
-
validate
ServiceResult validate(DataImportParams dataImportParams, DataImportOSPropertyValidator.DataImportProperties dataImportProperties) Validates the backup XML.- Parameters:
dataImportParams
- Import parameters provided by user during import processdataImportProperties
- Property entries loaded from the backup XML being validated. To guarantee that the properties we need to validate are available, we need to ensure that they are returned by thegetPropertyKeysToValidate()
method. The entries contained here are those requested by all validator instances, i.e. you may get additional properties beyond what's specified bygetPropertyKeysToValidate()
.- Returns:
- Valid service result if all properties are valid, else a service result containing some errors.
-