public class DefaultPrioritySchemeService extends Object implements PrioritySchemeService
PrioritySchemeService.PrioritySchemeData| Modifier and Type | Field and Description |
|---|---|
static ProjectAction |
PROJECT_ACTION_PERMISSION |
| Constructor and Description |
|---|
DefaultPrioritySchemeService(GlobalPermissionManager globalPermissionManager,
PrioritySchemeManager prioritySchemeManager,
ProjectService projectService,
I18nHelper i18nHelper,
PrioritySchemeMigratorFinder prioritySchemeMigratorFinder,
FeatureManager featureManager) |
| Modifier and Type | Method and Description |
|---|---|
ServiceOutcome<FieldConfigScheme> |
assignProject(ApplicationUser user,
FieldConfigScheme priorityFieldConfig,
Project project)
Associates a project with a priority scheme.
|
ServiceOutcome<FieldConfigScheme> |
assignProject(ApplicationUser user,
Long schemeId,
com.atlassian.fugue.Either<Long,String> projectKeyOrId,
boolean blockMigration)
Associates a project with a priority scheme.
|
ServiceOutcome<FieldConfigScheme> |
assignProjects(ApplicationUser user,
FieldConfigScheme priorityFieldConfig,
Collection<Project> projects)
Associates projects with a priority scheme.
|
ServiceOutcome<FieldConfigScheme> |
createScheme(ApplicationUser user,
PrioritySchemeService.PrioritySchemeData prioritySchemeData)
Creates the scheme wih given data.
|
ServiceResult |
deleteScheme(ApplicationUser user,
FieldConfigScheme priorityFieldConfig)
Deletes the scheme and associates it's project with the default priority scheme.
|
ServiceResult |
deleteScheme(ApplicationUser user,
Long id)
Deletes the scheme and associates it's project with the default priority scheme.
|
ServiceOutcome<FieldConfigScheme> |
editScheme(ApplicationUser user,
FieldConfigScheme priorityFieldConfig,
List<String> optionIds,
String defaultOption)
Updates the scheme wih given data.
|
ServiceOutcome<FieldConfigScheme> |
editScheme(ApplicationUser user,
PrioritySchemeService.PrioritySchemeData data,
boolean failIfMigrationNeeded)
Updates the scheme wih given data.
|
List<Project> |
filterProjectsNotPossibleToAssociate(List<Project> projects)
Filters out projects which shouldn't be associated to priority scheme (e.g.
|
ServiceOutcome<FieldConfigScheme> |
getScheme(ApplicationUser user,
Long id)
Gets the scheme wih given id.
|
ServiceOutcome<FieldConfigScheme> |
getSchemeForProject(ApplicationUser user,
com.atlassian.fugue.Either<Long,String> projectKeyOrId)
Gets the scheme for given project key.
|
ServiceOutcome<Collection<FieldConfigScheme>> |
getSchemes(ApplicationUser user)
Gets all priority schemes.
|
boolean |
hasAnyNotPossibleToAssociateProject(Collection<Project> projects)
Checks if in given list there is at least one not able to associate project (e.g.
|
ServiceResult |
schemeDataValidate(ApplicationUser user,
PrioritySchemeService.PrioritySchemeData prioritySchemeData)
Validates if passed
PrioritySchemeService.PrioritySchemeData can be used to create/edit priority scheme. |
ServiceOutcome<FieldConfigScheme> |
unassignProject(ApplicationUser user,
Long schemeId,
com.atlassian.fugue.Either<Long,String> projectKeyOrId)
Deassociates a project from a priority scheme.
|
public static final ProjectAction PROJECT_ACTION_PERMISSION
public DefaultPrioritySchemeService(GlobalPermissionManager globalPermissionManager, PrioritySchemeManager prioritySchemeManager, ProjectService projectService, I18nHelper i18nHelper, PrioritySchemeMigratorFinder prioritySchemeMigratorFinder, FeatureManager featureManager)
public ServiceOutcome<FieldConfigScheme> assignProjects(@Nonnull ApplicationUser user, @Nullable FieldConfigScheme priorityFieldConfig, @Nonnull Collection<Project> projects) throws NoPermissionException
PrioritySchemeServiceassignProjects in interface PrioritySchemeServiceuser - Application userpriorityFieldConfig - the priority scheme. Should the scheme be null - association with default scheme is assumed.projects - the Collection of projects to assignServiceOutcome with affected FieldConfigSchemeNoPermissionExceptionpublic ServiceOutcome<FieldConfigScheme> assignProject(@Nonnull ApplicationUser user, @Nullable FieldConfigScheme priorityFieldConfig, @Nonnull Project project)
PrioritySchemeServiceassignProject in interface PrioritySchemeServiceuser - Application userpriorityFieldConfig - the priority scheme. Should the scheme be null - association with default scheme is assumed.project - the projectServiceOutcome with affected FieldConfigSchemepublic ServiceOutcome<FieldConfigScheme> assignProject(@Nonnull ApplicationUser user, @Nullable Long schemeId, @Nonnull com.atlassian.fugue.Either<Long,String> projectKeyOrId, boolean blockMigration)
PrioritySchemeServiceassignProject in interface PrioritySchemeServiceuser - Application userschemeId - id of the priority scheme.projectKeyOrId - key of id of the projectblockMigration - whether validation should fail if migration is neededServiceOutcome with affected FieldConfigSchemepublic ServiceOutcome<FieldConfigScheme> unassignProject(@Nonnull ApplicationUser user, @Nonnull Long schemeId, @Nonnull com.atlassian.fugue.Either<Long,String> projectKeyOrId)
PrioritySchemeServiceunassignProject in interface PrioritySchemeServiceuser - Application userschemeId - id of the priority scheme.projectKeyOrId - key or id of the projectServiceOutcome with affected FieldConfigSchemepublic ServiceOutcome<FieldConfigScheme> editScheme(@Nonnull ApplicationUser user, @Nonnull FieldConfigScheme priorityFieldConfig, @Nonnull List<String> optionIds, @Nullable String defaultOption) throws NoPermissionException
PrioritySchemeServiceeditScheme in interface PrioritySchemeServiceuser - Application userpriorityFieldConfig - the priority scheme to edit. The default priority scheme can not be edited.optionIds - new list of priorities in the schemedefaultOption - default priority of the schemeServiceOutcome with affected FieldConfigSchemeNoPermissionExceptionpublic ServiceOutcome<FieldConfigScheme> editScheme(@Nonnull ApplicationUser user, @Nonnull PrioritySchemeService.PrioritySchemeData data, boolean failIfMigrationNeeded)
PrioritySchemeServiceeditScheme in interface PrioritySchemeServiceuser - Application userdata - priority scheme datafailIfMigrationNeeded - whether validation should fail if migration is neededServiceOutcome with affected FieldConfigSchemepublic ServiceResult deleteScheme(@Nonnull ApplicationUser user, @Nonnull Long id)
PrioritySchemeServicedeleteScheme in interface PrioritySchemeServiceuser - Application userid - id of the priority scheme to delete. The default priority scheme can not be deleted.public ServiceResult deleteScheme(@Nonnull ApplicationUser user, @Nonnull FieldConfigScheme priorityFieldConfig) throws NoPermissionException
PrioritySchemeServicedeleteScheme in interface PrioritySchemeServiceuser - Application userpriorityFieldConfig - the priority scheme to delete. The default priority scheme can not be deleted.NoPermissionExceptionpublic ServiceOutcome<FieldConfigScheme> createScheme(@Nonnull ApplicationUser user, @Nonnull PrioritySchemeService.PrioritySchemeData prioritySchemeData)
PrioritySchemeServicecreateScheme in interface PrioritySchemeServiceuser - Application userprioritySchemeData - data of the priority scheme to create.ServiceOutcome with newly created FieldConfigSchemepublic ServiceResult schemeDataValidate(ApplicationUser user, PrioritySchemeService.PrioritySchemeData prioritySchemeData)
PrioritySchemeServicePrioritySchemeService.PrioritySchemeData can be used to create/edit priority scheme.schemeDataValidate in interface PrioritySchemeServiceuser - Application userpublic ServiceOutcome<FieldConfigScheme> getScheme(@Nonnull ApplicationUser user, @Nonnull Long id)
PrioritySchemeServicegetScheme in interface PrioritySchemeServiceuser - Application userid - id of the priority scheme to get.ServiceOutcome with FieldConfigSchemepublic ServiceOutcome<Collection<FieldConfigScheme>> getSchemes(@Nonnull ApplicationUser user)
PrioritySchemeServicegetSchemes in interface PrioritySchemeServiceuser - Application userServiceOutcome with collection of FieldConfigSchemepublic ServiceOutcome<FieldConfigScheme> getSchemeForProject(@Nonnull ApplicationUser user, @Nonnull com.atlassian.fugue.Either<Long,String> projectKeyOrId)
PrioritySchemeServicegetSchemeForProject in interface PrioritySchemeServiceuser - Application userprojectKeyOrId - key or id of the project to get scheme for.ServiceOutcome with FieldConfigScheme associated with provided projectpublic List<Project> filterProjectsNotPossibleToAssociate(List<Project> projects)
PrioritySchemeServicefilterProjectsNotPossibleToAssociate in interface PrioritySchemeServiceprojects - projects to be filteredpublic boolean hasAnyNotPossibleToAssociateProject(Collection<Project> projects)
PrioritySchemeServicehasAnyNotPossibleToAssociateProject in interface PrioritySchemeServiceprojects - list of projectsCopyright © 2002-2018 Atlassian. All Rights Reserved.