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) |
Modifier and Type | Method and Description |
---|---|
static com.google.common.base.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
|
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)
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 com.google.common.base.Predicate<JiraWorkflow> containsStatus(Status status)
public boolean isStatusAsLozengeEnabled()
StatusService
isStatusAsLozengeEnabled
in interface StatusService
Copyright © 2002-2015 Atlassian. All Rights Reserved.