public interface ImportContext
Importer
that wishes to make state
available for the lifetime of an import will use the facilities provided by this class such as
getAttributeMap()
and getEntityMapping(MigrationEntityType)
. This class also provides a facility
for storing error and warning messages that an Importer
may raise during the import process.Modifier and Type | Method and Description |
---|---|
void |
addError(com.atlassian.bitbucket.i18n.KeyedMessage message,
Object entity)
Report a failed import
|
void |
addError(com.atlassian.bitbucket.i18n.KeyedMessage message,
Object entity,
Throwable t)
Report a failed import
|
void |
addWarning(com.atlassian.bitbucket.i18n.KeyedMessage message,
Object entity)
Report a warning during an import
|
void |
addWarning(com.atlassian.bitbucket.i18n.KeyedMessage message,
Object entity,
Throwable t)
Report a warning during an import
|
com.atlassian.bitbucket.attribute.AttributeMap |
getAttributeMap()
Returns the
AttributeMap object for this context. |
Optional<String> |
getCurrentHierarchyId()
Returns the current hierarchy ID the importer is importing.
|
<T> EntityImportMapping<T> |
getEntityMapping(MigrationEntityType<T> entityType)
Returns the
EntityImportMapping of the MigrationEntityType for this context. |
boolean |
hasErrors() |
void addError(@Nonnull com.atlassian.bitbucket.i18n.KeyedMessage message, @Nullable Object entity)
message
- the failure messageentity
- the entity for which export failedvoid addError(@Nonnull com.atlassian.bitbucket.i18n.KeyedMessage message, @Nullable Object entity, @Nullable Throwable t)
message
- the failure messageentity
- the entity for which export failedt
- an optional Throwable
for the warningvoid addWarning(@Nonnull com.atlassian.bitbucket.i18n.KeyedMessage message, @Nullable Object entity)
message
- the failure messageentity
- the entity for which export failedvoid addWarning(@Nonnull com.atlassian.bitbucket.i18n.KeyedMessage message, @Nullable Object entity, @Nullable Throwable t)
message
- the failure messageentity
- the entity for which export failedt
- an optional Throwable
for the warning@Nonnull com.atlassian.bitbucket.attribute.AttributeMap getAttributeMap()
AttributeMap
object for this context. This allows storage of attributes associated with this
context for the lifetime of this context.AttributeMap
object for this contextAttributeMap
@Nonnull Optional<String> getCurrentHierarchyId()
Optional.empty()
if none@Nonnull <T> EntityImportMapping<T> getEntityMapping(@Nonnull MigrationEntityType<T> entityType)
EntityImportMapping
of the MigrationEntityType
for this context. If the mapping
does not exist for the type, it'll be created.T
- Type of the IDs in the mappingentityType
- Entity type that this mapping should mapEntityImportMapping
of the MigrationEntityType
for this contextboolean hasErrors()
addError(KeyedMessage, Object)
has been calledCopyright © 2024 Atlassian. All rights reserved.