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,
io.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,
io.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,
io.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
PrioritySchemeService
assignProjects
in interface PrioritySchemeService
user
- 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 FieldConfigScheme
NoPermissionException
public ServiceOutcome<FieldConfigScheme> assignProject(@Nonnull ApplicationUser user, @Nullable FieldConfigScheme priorityFieldConfig, @Nonnull Project project)
PrioritySchemeService
assignProject
in interface PrioritySchemeService
user
- Application userpriorityFieldConfig
- the priority scheme. Should the scheme be null - association with default scheme is assumed.project
- the projectServiceOutcome
with affected FieldConfigScheme
public ServiceOutcome<FieldConfigScheme> assignProject(@Nonnull ApplicationUser user, @Nullable Long schemeId, @Nonnull io.atlassian.fugue.Either<Long,String> projectKeyOrId, boolean blockMigration)
PrioritySchemeService
assignProject
in interface PrioritySchemeService
user
- Application userschemeId
- id of the priority scheme.projectKeyOrId
- key of id of the projectblockMigration
- whether validation should fail if migration is neededServiceOutcome
with affected FieldConfigScheme
public ServiceOutcome<FieldConfigScheme> unassignProject(@Nonnull ApplicationUser user, @Nonnull Long schemeId, @Nonnull io.atlassian.fugue.Either<Long,String> projectKeyOrId)
PrioritySchemeService
unassignProject
in interface PrioritySchemeService
user
- Application userschemeId
- id of the priority scheme.projectKeyOrId
- key or id of the projectServiceOutcome
with affected FieldConfigScheme
public ServiceOutcome<FieldConfigScheme> editScheme(@Nonnull ApplicationUser user, @Nonnull FieldConfigScheme priorityFieldConfig, @Nonnull List<String> optionIds, @Nullable String defaultOption) throws NoPermissionException
PrioritySchemeService
editScheme
in interface PrioritySchemeService
user
- 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 FieldConfigScheme
NoPermissionException
public ServiceOutcome<FieldConfigScheme> editScheme(@Nonnull ApplicationUser user, @Nonnull PrioritySchemeService.PrioritySchemeData data, boolean failIfMigrationNeeded)
PrioritySchemeService
editScheme
in interface PrioritySchemeService
user
- Application userdata
- priority scheme datafailIfMigrationNeeded
- whether validation should fail if migration is neededServiceOutcome
with affected FieldConfigScheme
public ServiceResult deleteScheme(@Nonnull ApplicationUser user, @Nonnull Long id)
PrioritySchemeService
deleteScheme
in interface PrioritySchemeService
user
- 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
PrioritySchemeService
deleteScheme
in interface PrioritySchemeService
user
- Application userpriorityFieldConfig
- the priority scheme to delete. The default priority scheme can not be deleted.NoPermissionException
public ServiceOutcome<FieldConfigScheme> createScheme(@Nonnull ApplicationUser user, @Nonnull PrioritySchemeService.PrioritySchemeData prioritySchemeData)
PrioritySchemeService
createScheme
in interface PrioritySchemeService
user
- Application userprioritySchemeData
- data of the priority scheme to create.ServiceOutcome
with newly created FieldConfigScheme
public ServiceResult schemeDataValidate(ApplicationUser user, PrioritySchemeService.PrioritySchemeData prioritySchemeData)
PrioritySchemeService
PrioritySchemeService.PrioritySchemeData
can be used to create/edit priority scheme.schemeDataValidate
in interface PrioritySchemeService
user
- Application userpublic ServiceOutcome<FieldConfigScheme> getScheme(@Nonnull ApplicationUser user, @Nonnull Long id)
PrioritySchemeService
getScheme
in interface PrioritySchemeService
user
- Application userid
- id of the priority scheme to get.ServiceOutcome
with FieldConfigScheme
public ServiceOutcome<Collection<FieldConfigScheme>> getSchemes(@Nonnull ApplicationUser user)
PrioritySchemeService
getSchemes
in interface PrioritySchemeService
user
- Application userServiceOutcome
with collection of FieldConfigScheme
public ServiceOutcome<FieldConfigScheme> getSchemeForProject(@Nonnull ApplicationUser user, @Nonnull io.atlassian.fugue.Either<Long,String> projectKeyOrId)
PrioritySchemeService
getSchemeForProject
in interface PrioritySchemeService
user
- 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)
PrioritySchemeService
filterProjectsNotPossibleToAssociate
in interface PrioritySchemeService
projects
- projects to be filteredpublic boolean hasAnyNotPossibleToAssociateProject(Collection<Project> projects)
PrioritySchemeService
hasAnyNotPossibleToAssociateProject
in interface PrioritySchemeService
projects
- list of projectsCopyright © 2002-2021 Atlassian. All Rights Reserved.