com.atlassian.jira.imports.project.mapper
Interface ProjectImportIdMapper

All Known Subinterfaces:
SimpleProjectImportIdMapper
All Known Implementing Classes:
AbstractMapper, CustomFieldMapper, CustomFieldOptionMapper, GroupMapper, IssueLinkTypeMapper, IssueTypeMapper, SimpleProjectImportIdMapperImpl, StatusMapper, UserMapper

public interface ProjectImportIdMapper

Base interface for a Project Import Id Mapper. Defines a value mapper used for project import. This allows us to map an old value with a new value in the target system. Each instance of this interface represents a particular type of object in the system; eg IssueType, Issue, etc.

Since:
v3.13

Method Summary
 void clearMappedValues()
          This will clear any mapped data that may have been entered into the mappers.
 java.util.Collection<java.lang.String> getAllMappedIds()
          Returns a Collection of all the new IDs that are mapped to.
 java.lang.String getDisplayName(java.lang.String oldId)
          Returns a display name for the given old ID.
 java.lang.String getKey(java.lang.String oldId)
          Returns the registered "key" for the given old ID, or null if none is registered.
 java.lang.String getMappedId(java.lang.String oldId)
          Retrieves a String that corresponds to the id in the target JIRA system, null if none has been mapped.
 java.util.Collection<java.lang.String> getRegisteredOldIds()
          Returns a collection of ID's as String objects identifying all objects of the appropriate type found in the import file.
 java.util.Collection<java.lang.String> getRequiredOldIds()
          Returns a collection of ID's as String objects identifying objects from the import file that are required for the import.
 java.util.Collection<IdKeyPair> getValuesFromImport()
          Deprecated. Use getRegisteredOldIds()
 void mapValue(java.lang.String oldId, java.lang.String newId)
          This method maps a value from the backup system to a valid value in the target system.
 

Method Detail

getValuesFromImport

@Deprecated
java.util.Collection<IdKeyPair> getValuesFromImport()
Deprecated. Use getRegisteredOldIds()

Returns a collection of IdKeyPair representing objects from the import file.

Returns:
a collection of IdKeyPair representing objects from the import file.
See Also:
IdKeyPair

getRequiredOldIds

java.util.Collection<java.lang.String> getRequiredOldIds()
Returns a collection of ID's as String objects identifying objects from the import file that are required for the import.

Returns:
a collection of ID's as String objects identifying objects from the import file that are required for the import.

getRegisteredOldIds

java.util.Collection<java.lang.String> getRegisteredOldIds()
Returns a collection of ID's as String objects identifying all objects of the appropriate type found in the import file. Note that that this should normally be a super set of the "required" ID's. Each of these ID's will have a unique key associated with it that can be used for mapping old ID's in the import file to "new" ID's in the current JIRA system. You can use the getKey(String) method to extract this key.

Returns:
a collection of ID's as String objects identifying all objects of the appropriate type found in the import file.
See Also:
getRequiredOldIds(), getKey(String)

getKey

java.lang.String getKey(java.lang.String oldId)
Returns the registered "key" for the given old ID, or null if none is registered. This is the unique "name" that will be used for automatic mapping of objects in the import file to the objects in the current JIRA system.

Parameters:
oldId - The old ID.
Returns:
the registered "key" for the given old ID, or null if none is registered.
See Also:
getDisplayName(String), getRegisteredOldIds()

getDisplayName

java.lang.String getDisplayName(java.lang.String oldId)
Returns a display name for the given old ID. This will normally be the registered key for that ID, but if no key was registered we return the ID in square brackets (eg "[1234]").

Parameters:
oldId - The old ID.
Returns:
a display name for the given old ID.
See Also:
getKey(String)

mapValue

void mapValue(java.lang.String oldId,
              java.lang.String newId)
This method maps a value from the backup system to a valid value in the target system.

Parameters:
oldId - the string representation of the id of the backup value.
newId - the string representation of the id of the valid mapped value in the target system.

getMappedId

java.lang.String getMappedId(java.lang.String oldId)
Retrieves a String that corresponds to the id in the target JIRA system, null if none has been mapped.

Parameters:
oldId - identifies the mapping we are looking for.
Returns:
String that corresponds to the id in the target JIRA system, null if none has been mapped.

getAllMappedIds

java.util.Collection<java.lang.String> getAllMappedIds()
Returns a Collection of all the new IDs that are mapped to.

Returns:
a Collection of all the new IDs that are mapped to.

clearMappedValues

void clearMappedValues()
This will clear any mapped data that may have been entered into the mappers. All registered values and values that have been flagged as required will not be changed. This method only affects the mapped data. It is used to re-map and re-validate the data after the user has made changes to the current configuration.



Copyright © 2002-2010 Atlassian. All Rights Reserved.