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<com.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()
ProjectImportResults
getImportDuration
in interface ProjectImportResults
ProjectImportResults.setEndTime(long)
public void setEndTime(long endTime)
ProjectImportResults
setEndTime
in interface ProjectImportResults
endTime
- the time the import has stopped in millisecondsProjectImportResults.getImportDuration()
public void incrementRoleUserCreatedCount(String roleName)
ProjectImportResults
incrementRoleUserCreatedCount
in interface ProjectImportResults
roleName
- 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)
ProjectImportResults
incrementRoleGroupCreatedCount
in interface ProjectImportResults
roleName
- 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()
ProjectImportResults
getRoles
in interface ProjectImportResults
public int getGroupsCreatedCountForRole(String roleName)
ProjectImportResults
getGroupsCreatedCountForRole
in interface ProjectImportResults
roleName
- the role you want the count for, this should be the role name as provided in the increment methodpublic int getUsersCreatedCountForRole(String roleName)
ProjectImportResults
getUsersCreatedCountForRole
in interface ProjectImportResults
roleName
- the role you want the count for, this should be the role name as provided in the increment methodpublic void addError(String error)
ProjectImportResults
AbortImportException
to stop the import.addError
in interface ProjectImportResults
error
- the error message.public List<String> getErrors()
ProjectImportResults
getErrors
in interface ProjectImportResults
public boolean isImportCompleted()
ProjectImportResults
isImportCompleted
in interface ProjectImportResults
public void incrementIssuesCreatedCount()
ProjectImportResults
incrementIssuesCreatedCount
in interface ProjectImportResults
public void incrementUsersCreatedCount()
ProjectImportResults
incrementUsersCreatedCount
in interface ProjectImportResults
public void incrementAttachmentsCreatedCount()
ProjectImportResults
incrementAttachmentsCreatedCount
in interface ProjectImportResults
public int getIssuesCreatedCount()
ProjectImportResults
getIssuesCreatedCount
in interface ProjectImportResults
public int getUsersCreatedCount()
ProjectImportResults
getUsersCreatedCount
in interface ProjectImportResults
public int getAttachmentsCreatedCount()
ProjectImportResults
getAttachmentsCreatedCount
in interface ProjectImportResults
public int getExpectedIssuesCreatedCount()
ProjectImportResults
getExpectedIssuesCreatedCount
in interface ProjectImportResults
public int getExpectedUsersCreatedCount()
ProjectImportResults
getExpectedUsersCreatedCount
in interface ProjectImportResults
public int getExpectedAttachmentsCreatedCount()
ProjectImportResults
getExpectedAttachmentsCreatedCount
in interface ProjectImportResults
public void setImportCompleted(boolean importCompleted)
ProjectImportResults
setImportCompleted
in interface ProjectImportResults
importCompleted
- true if completed, false otherwise.public Project getImportedProject()
ProjectImportResults
getImportedProject
in interface ProjectImportResults
public void setImportedProject(Project importedProject)
ProjectImportResults
setImportedProject
in interface ProjectImportResults
importedProject
- the imported project, this is the project that exists in JIRA.public I18nHelper getI18n()
ProjectImportResults
I18nHelper
associated with this Project Import.
This can be used to localise error messages before they are added in this ProjectImportResult.getI18n
in interface ProjectImportResults
I18nHelper
associated with this Project Import.public boolean abortImport()
ProjectImportResults
abortImport
in interface ProjectImportResults
public void addResult(long count, String msgKey)
ProjectImportResults
addResult
in interface ProjectImportResults
count
- Number of objects importedmsgKey
- Key to a label message for the objects importedpublic List<com.atlassian.fugue.Pair<String,Long>> getResults()
ProjectImportResults
Pair
consisting of a resolved description and the number of those objects imported.
e.g.
getResults
in interface ProjectImportResults
Copyright © 2002-2015 Atlassian. All Rights Reserved.