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)
StatusService
createStatus
in interface StatusService
user
- 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)
StatusService
editStatus
in interface StatusService
user
- 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)
StatusService
validateCreateStatus
in interface StatusService
user
- 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)
StatusService
validateEditStatus
in interface StatusService
user
- 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)
StatusService
getStatusById
in interface StatusService
user
- User performing operationid
- status idStatus
, or null if no status with this id exists.public ServiceResult validateRemoveStatus(ApplicationUser user, Status status)
StatusService
validateRemoveStatus
in interface StatusService
user
- User performing operationstatus
- The Statuspublic ServiceResult removeStatus(ApplicationUser user, Status status)
StatusService
removeStatus
in interface StatusService
user
- User performing operationstatus
- Statuspublic ServiceOutcome<List<JiraWorkflow>> getAssociatedWorkflows(ApplicationUser user, Status status)
StatusService
getAssociatedWorkflows
in interface StatusService
user
- User performing operationstatus
- The Statuspublic ServiceResult moveStatusUp(ApplicationUser user, String id)
StatusService
moveStatusUp
in interface StatusService
user
- User performing operaitonid
- Status idpublic ServiceResult moveStatusDown(ApplicationUser user, String id)
StatusService
moveStatusDown
in interface StatusService
user
- User performing operaitonid
- Status idpublic static java.util.function.Predicate<JiraWorkflow> containsStatus(Status status)
public boolean isStatusAsLozengeEnabled()
StatusService
isStatusAsLozengeEnabled
in interface StatusService
public java.util.stream.Stream<Status> findStatuses(@Nonnull String substring, @Nonnull Set<Long> projectIds, @Nonnull Set<String> issueTypeIds)
StatusService
findStatuses
in interface StatusService
substring
- 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-2024 Atlassian. All Rights Reserved.