com.atlassian.jira.imports.project.core
Interface ProjectImportResults

All Known Implementing Classes:
ProjectImportResultsImpl

public interface ProjectImportResults

Used to store the results of the actual importing of the project. This includes statistics on what was created and any error messages that may have been generated during the import.

Since:
v3.13

Method Summary
 boolean abortImport()
          Returns false if the number of allowed errors have been exceeded, true otherwise
 void addError(java.lang.String error)
          Adds the given Error message to the error list.
 int getAttachmentsCreatedCount()
          Returns the number of created attachments.
 java.util.List<java.lang.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(java.lang.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.
 java.util.Collection<java.lang.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(java.lang.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(java.lang.String roleName)
          Should be called to increment the count of groups added to a specific role.
 void incrementRoleUserCreatedCount(java.lang.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.
 

Method Detail

getImportDuration

long getImportDuration()
This uses the start time and the end time to determine how long the actual import took.

Returns:
number of milliseconds the import took to run.
See Also:
setEndTime(long)

setEndTime

void setEndTime(long endTime)
The time, as milliseconds, that the import ended. This must be set in order to get the import duration.

Parameters:
endTime - the time the import has stopped in milliseconds
See Also:
getImportDuration()

incrementRoleUserCreatedCount

void incrementRoleUserCreatedCount(java.lang.String roleName)
Should be called to increment the count of users added to a specific role.

Parameters:
roleName - uniquely identifies the project role by its human readable name, this should not be the role id.
See Also:
getUsersCreatedCountForRole(String), incrementRoleGroupCreatedCount(String)

incrementRoleGroupCreatedCount

void incrementRoleGroupCreatedCount(java.lang.String roleName)
Should be called to increment the count of groups added to a specific role.

Parameters:
roleName - uniquely identifies the project role by its human readable name, this should not be the role id.
See Also:
getGroupsCreatedCountForRole(String), incrementRoleUserCreatedCount(String)

getRoles

java.util.Collection<java.lang.String> getRoles()
Returns the role names of all roles that have had a group or user added to it.

Returns:
the role names of all roles that have had a group or user added to it.

getGroupsCreatedCountForRole

int getGroupsCreatedCountForRole(java.lang.String roleName)
Returns the count of all groups added to the specified role

Parameters:
roleName - the role you want the count for, this should be the role name as provided in the increment method
Returns:
the count of all groups added to the specified role

getUsersCreatedCountForRole

int getUsersCreatedCountForRole(java.lang.String roleName)
Returns the count of all users added to the specified role

Parameters:
roleName - the role you want the count for, this should be the role name as provided in the increment method
Returns:
the count of all users added to the specified role

addError

void addError(java.lang.String error)
Adds the given Error message to the error list. If the error limit is reached, then we throw an AbortImportException to stop the import.

Parameters:
error - the error message.

getErrors

java.util.List<java.lang.String> getErrors()
Returns a list of all the errors that were added to this result object.

Returns:
a list of all the errors that were added to this result object.

isImportCompleted

boolean isImportCompleted()
Returns true if the import completed all steps of the import, false otherwise. This method can return true and the getErrors can return errors. This will not return true if the errors went over the allowable threshold, and the Import was aborted.

Returns:
true if the import completed all steps of the import, false otherwise.

incrementIssuesCreatedCount

void incrementIssuesCreatedCount()
Adds to the count of created issues.


incrementUsersCreatedCount

void incrementUsersCreatedCount()
Adds to the count of created users.


incrementAttachmentsCreatedCount

void incrementAttachmentsCreatedCount()
Adds to the count of created attachments.


getIssuesCreatedCount

int getIssuesCreatedCount()
Returns the number of created issues.

Returns:
the number of created issues.

getUsersCreatedCount

int getUsersCreatedCount()
Returns the number of created users.

Returns:
the number of created users.

getAttachmentsCreatedCount

int getAttachmentsCreatedCount()
Returns the number of created attachments.

Returns:
the number of created attachments.

getExpectedIssuesCreatedCount

int getExpectedIssuesCreatedCount()
Returns the number of issues the import expected it could create before doing the actual import.

Returns:
the number of issues the import expected it could create before doing the actual import.

getExpectedUsersCreatedCount

int getExpectedUsersCreatedCount()
Returns the number of users the import expected it could create before doing the actual import.

Returns:
the number of users the import expected it could create before doing the actual import.

getExpectedAttachmentsCreatedCount

int getExpectedAttachmentsCreatedCount()
Returns the number of attachments the import expected it could create before doing the actual import.

Returns:
the number of attachments the import expected it could create before doing the actual import.

setImportCompleted

void setImportCompleted(boolean importCompleted)
Should be called with true if all steps of the import were able to proceed (i.e. no AbortImportException was thrown).

Parameters:
importCompleted - true if completed, false otherwise.

getImportedProject

Project getImportedProject()
Returns the created/updated project that the import imported into.

Returns:
the created/updated project that the import imported into.

setImportedProject

void setImportedProject(Project importedProject)
Sets the imported project, this is the project that exists in JIRA.

Parameters:
importedProject - the imported project, this is the project that exists in JIRA.

getI18n

I18nHelper getI18n()
Returns the I18nHelper associated with this Project Import. This can be used to localise error messages before they are added in this ProjectImportResult.

Returns:
the I18nHelper associated with this Project Import.

abortImport

boolean abortImport()
Returns false if the number of allowed errors have been exceeded, true otherwise

Returns:
false if the number of allowed errors have been exceeded, true otherwise


Copyright © 2002-2010 Atlassian. All Rights Reserved.