public class ProjectImportResultsImpl extends Object implements ProjectImportResults
| Constructor and Description |
|---|
ProjectImportResultsImpl(long startTime,
int expectedIssuesCreatedCount,
int expectedUsersCreatedCount,
int expectedAttachmentsCreatedCount,
I18nHelper i18n) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
abortImport()
Returns false if the number of allowed errors have been exceeded, true otherwise
|
void |
addError(String error)
Adds the given Error message to the error list.
|
void |
addResult(long count,
String msgKey)
Add an import result.
|
int |
getAttachmentsCreatedCount()
Returns the number of created attachments.
|
List<String> |
getErrors()
Returns a list of all the errors that were added to this result object.
|
int |
getExpectedAttachmentsCreatedCount()
Returns the number of attachments the import expected it could create before doing the actual import.
|
int |
getExpectedIssuesCreatedCount()
Returns the number of issues the import expected it could create before doing the actual import.
|
int |
getExpectedUsersCreatedCount()
Returns the number of users the import expected it could create before doing the actual import.
|
int |
getGroupsCreatedCountForRole(String roleName)
Returns the count of all groups added to the specified role
|
I18nHelper |
getI18n()
Returns the
I18nHelper associated with this Project Import. |
long |
getImportDuration()
This uses the start time and the end time to determine how long the actual import took.
|
Project |
getImportedProject()
Returns the created/updated project that the import imported into.
|
int |
getIssuesCreatedCount()
Returns the number of created issues.
|
List<io.atlassian.fugue.Pair<String,Long>> |
getResults()
Get the results.
|
Collection<String> |
getRoles()
Returns the role names of all roles that have had a group or user added to it.
|
int |
getUsersCreatedCount()
Returns the number of created users.
|
int |
getUsersCreatedCountForRole(String roleName)
Returns the count of all users added to the specified role
|
void |
incrementAttachmentsCreatedCount()
Adds to the count of created attachments.
|
void |
incrementIssuesCreatedCount()
Adds to the count of created issues.
|
void |
incrementRoleGroupCreatedCount(String roleName)
Should be called to increment the count of groups added to a specific role.
|
void |
incrementRoleUserCreatedCount(String roleName)
Should be called to increment the count of users added to a specific role.
|
void |
incrementUsersCreatedCount()
Adds to the count of created users.
|
boolean |
isImportCompleted()
Returns true if the import completed all steps of the import, false otherwise.
|
void |
setEndTime(long endTime)
The time, as milliseconds, that the import ended.
|
void |
setImportCompleted(boolean importCompleted)
Should be called with true if all steps of the import were able to proceed (i.e.
|
void |
setImportedProject(Project importedProject)
Sets the imported project, this is the project that exists in JIRA.
|
public ProjectImportResultsImpl(long startTime,
int expectedIssuesCreatedCount,
int expectedUsersCreatedCount,
int expectedAttachmentsCreatedCount,
I18nHelper i18n)
public long getImportDuration()
ProjectImportResultsgetImportDuration in interface ProjectImportResultsProjectImportResults.setEndTime(long)public void setEndTime(long endTime)
ProjectImportResultssetEndTime in interface ProjectImportResultsendTime - the time the import has stopped in millisecondsProjectImportResults.getImportDuration()public void incrementRoleUserCreatedCount(String roleName)
ProjectImportResultsincrementRoleUserCreatedCount in interface ProjectImportResultsroleName - uniquely identifies the project role by its human readable name, this should not be the role id.ProjectImportResults.getUsersCreatedCountForRole(String),
ProjectImportResults.incrementRoleGroupCreatedCount(String)public void incrementRoleGroupCreatedCount(String roleName)
ProjectImportResultsincrementRoleGroupCreatedCount in interface ProjectImportResultsroleName - uniquely identifies the project role by its human readable name, this should not be the role id.ProjectImportResults.getGroupsCreatedCountForRole(String),
ProjectImportResults.incrementRoleUserCreatedCount(String)public Collection<String> getRoles()
ProjectImportResultsgetRoles in interface ProjectImportResultspublic int getGroupsCreatedCountForRole(String roleName)
ProjectImportResultsgetGroupsCreatedCountForRole in interface ProjectImportResultsroleName - the role you want the count for, this should be the role name as provided in the increment methodpublic int getUsersCreatedCountForRole(String roleName)
ProjectImportResultsgetUsersCreatedCountForRole in interface ProjectImportResultsroleName - the role you want the count for, this should be the role name as provided in the increment methodpublic void addError(String error)
ProjectImportResultsAbortImportException to stop the import.addError in interface ProjectImportResultserror - the error message.public List<String> getErrors()
ProjectImportResultsgetErrors in interface ProjectImportResultspublic boolean isImportCompleted()
ProjectImportResultsisImportCompleted in interface ProjectImportResultspublic void incrementIssuesCreatedCount()
ProjectImportResultsincrementIssuesCreatedCount in interface ProjectImportResultspublic void incrementUsersCreatedCount()
ProjectImportResultsincrementUsersCreatedCount in interface ProjectImportResultspublic void incrementAttachmentsCreatedCount()
ProjectImportResultsincrementAttachmentsCreatedCount in interface ProjectImportResultspublic int getIssuesCreatedCount()
ProjectImportResultsgetIssuesCreatedCount in interface ProjectImportResultspublic int getUsersCreatedCount()
ProjectImportResultsgetUsersCreatedCount in interface ProjectImportResultspublic int getAttachmentsCreatedCount()
ProjectImportResultsgetAttachmentsCreatedCount in interface ProjectImportResultspublic int getExpectedIssuesCreatedCount()
ProjectImportResultsgetExpectedIssuesCreatedCount in interface ProjectImportResultspublic int getExpectedUsersCreatedCount()
ProjectImportResultsgetExpectedUsersCreatedCount in interface ProjectImportResultspublic int getExpectedAttachmentsCreatedCount()
ProjectImportResultsgetExpectedAttachmentsCreatedCount in interface ProjectImportResultspublic void setImportCompleted(boolean importCompleted)
ProjectImportResultssetImportCompleted in interface ProjectImportResultsimportCompleted - true if completed, false otherwise.public Project getImportedProject()
ProjectImportResultsgetImportedProject in interface ProjectImportResultspublic void setImportedProject(Project importedProject)
ProjectImportResultssetImportedProject in interface ProjectImportResultsimportedProject - the imported project, this is the project that exists in JIRA.public I18nHelper getI18n()
ProjectImportResultsI18nHelper associated with this Project Import.
This can be used to localise error messages before they are added in this ProjectImportResult.getI18n in interface ProjectImportResultsI18nHelper associated with this Project Import.public boolean abortImport()
ProjectImportResultsabortImport in interface ProjectImportResultspublic void addResult(long count,
String msgKey)
ProjectImportResultsaddResult in interface ProjectImportResultscount - Number of objects importedmsgKey - Key to a label message for the objects importedpublic List<io.atlassian.fugue.Pair<String,Long>> getResults()
ProjectImportResultsPair consisting of a resolved description and the number of those objects imported.
e.g.
getResults in interface ProjectImportResultsCopyright © 2002-2021 Atlassian. All Rights Reserved.