public class DefaultStatusService extends Object implements StatusService
MAX_STATUS_LENGTH| Constructor and Description |
|---|
DefaultStatusService(StatusManager statusManager,
I18nHelper i18nHelper,
ConstantsManager constantsManager,
PermissionManager permissionManager,
WorkflowManager workflowManager,
com.atlassian.event.api.EventPublisher eventPublisher,
StatusCategoryManager statusCategoryManager,
WorkflowSchemeManager workflowSchemeManager) |
| Modifier and Type | Method and Description |
|---|---|
static java.util.function.Predicate<JiraWorkflow> |
containsStatus(Status status) |
ServiceOutcome<Status> |
createStatus(ApplicationUser user,
String name,
String description,
String iconUrl,
StatusCategory statusCategory)
Validates and when validation is performed successfully creates new status basing on given parameters
|
ServiceOutcome<Status> |
editStatus(ApplicationUser user,
Status status,
String name,
String description,
String iconUrl,
StatusCategory statusCategory)
Validates and when validation is performed successfully alters given status basing on given parameters
|
java.util.stream.Stream<Status> |
findStatuses(String substring,
Set<Long> projectIds,
Set<String> issueTypeIds)
Returns statuses whose names start with or fully match given substring.
|
ServiceOutcome<List<JiraWorkflow>> |
getAssociatedWorkflows(ApplicationUser user,
Status status)
Gets a list of workflows which contains given status
|
Status |
getStatusById(ApplicationUser user,
String id)
Get a status by id.
|
boolean |
isStatusAsLozengeEnabled()
Returns a boolean whether status lozenge is enabled or not
|
ServiceResult |
moveStatusDown(ApplicationUser user,
String id)
Move a status down the order.
|
ServiceResult |
moveStatusUp(ApplicationUser user,
String id)
Move a status up the order.
|
ServiceResult |
removeStatus(ApplicationUser user,
Status status)
Removes a status.
|
ServiceResult |
validateCreateStatus(ApplicationUser user,
String name,
String description,
String iconUrl,
StatusCategory statusCategory)
Validates new status basing on given parameters
|
ServiceResult |
validateEditStatus(ApplicationUser user,
Status status,
String name,
String description,
String iconUrl,
StatusCategory statusCategory)
Validates given status basing on given parameters
|
ServiceResult |
validateRemoveStatus(ApplicationUser user,
Status status)
Validates removal of given status
|
public DefaultStatusService(StatusManager statusManager, I18nHelper i18nHelper, ConstantsManager constantsManager, PermissionManager permissionManager, WorkflowManager workflowManager, com.atlassian.event.api.EventPublisher eventPublisher, StatusCategoryManager statusCategoryManager, WorkflowSchemeManager workflowSchemeManager)
public ServiceOutcome<Status> createStatus(ApplicationUser user, String name, String description, String iconUrl, StatusCategory statusCategory)
StatusServicecreateStatus in interface StatusServiceuser - User performing operationname - Name of the status. Should neither be blank nor duplicate existing namedescription - Optional description of the statusiconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be nullstatusCategory - StatusCategory for given status. Cannot be nullStatusService.validateCreateStatus(com.atlassian.jira.user.ApplicationUser, String, String, String, com.atlassian.jira.issue.status.category.StatusCategory)public ServiceOutcome<Status> editStatus(ApplicationUser user, Status status, String name, String description, String iconUrl, StatusCategory statusCategory)
StatusServiceeditStatus in interface StatusServiceuser - User performing operationstatus - The status to be editedname - Name of the status. Should neither be blank nor duplicate existing namedescription - Optional description of the statusiconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be nullstatusCategory - StatusCategory for given status. Cannot be nullStatusService.validateEditStatus(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.status.Status, String, String, String, com.atlassian.jira.issue.status.category.StatusCategory)public ServiceResult validateCreateStatus(ApplicationUser user, String name, String description, String iconUrl, StatusCategory statusCategory)
StatusServicevalidateCreateStatus in interface StatusServiceuser - User performing operationname - Name of the status. Should neither be blank nor duplicate existing namedescription - Optional description of the statusiconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be nullstatusCategory - StatusCategory for given status. Cannot be nullpublic ServiceResult validateEditStatus(ApplicationUser user, Status status, String name, String description, String iconUrl, StatusCategory statusCategory)
StatusServicevalidateEditStatus in interface StatusServiceuser - User performing operationstatus - The status to be editedname - Name of the status. Should neither be blank nor duplicate existing namedescription - Optional description of the statusiconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be nullstatusCategory - StatusCategory for given status. Cannot be nullpublic Status getStatusById(ApplicationUser user, String id)
StatusServicegetStatusById in interface StatusServiceuser - User performing operationid - status idStatus, or null if no status with this id exists.public ServiceResult validateRemoveStatus(ApplicationUser user, Status status)
StatusServicevalidateRemoveStatus in interface StatusServiceuser - User performing operationstatus - The Statuspublic ServiceResult removeStatus(ApplicationUser user, Status status)
StatusServiceremoveStatus in interface StatusServiceuser - User performing operationstatus - Statuspublic ServiceOutcome<List<JiraWorkflow>> getAssociatedWorkflows(ApplicationUser user, Status status)
StatusServicegetAssociatedWorkflows in interface StatusServiceuser - User performing operationstatus - The Statuspublic ServiceResult moveStatusUp(ApplicationUser user, String id)
StatusServicemoveStatusUp in interface StatusServiceuser - User performing operaitonid - Status idpublic ServiceResult moveStatusDown(ApplicationUser user, String id)
StatusServicemoveStatusDown in interface StatusServiceuser - User performing operaitonid - Status idpublic static java.util.function.Predicate<JiraWorkflow> containsStatus(Status status)
public boolean isStatusAsLozengeEnabled()
StatusServiceisStatusAsLozengeEnabled in interface StatusServicepublic java.util.stream.Stream<Status> findStatuses(@Nonnull String substring, @Nonnull Set<Long> projectIds, @Nonnull Set<String> issueTypeIds)
StatusServicefindStatuses in interface StatusServicesubstring - the string that status names will be matched withprojectIds - the set of project ids to filter statusesissueTypeIds - the set of issue type ids to filter statusesCopyright © 2002-2023 Atlassian. All Rights Reserved.