com.atlassian.jira.bc.config
Class DefaultStatusService

java.lang.Object
  extended by com.atlassian.jira.bc.config.DefaultStatusService
All Implemented Interfaces:
StatusService

public class DefaultStatusService
extends Object
implements StatusService

Since:
v6.1

Field Summary
 
Fields inherited from interface com.atlassian.jira.bc.config.StatusService
MAX_STATUS_LENGTH
 
Constructor Summary
DefaultStatusService(StatusManager statusManager, I18nHelper i18nHelper, ConstantsManager constantsManager, PermissionManager permissionManager, WorkflowManager workflowManager, com.atlassian.event.api.EventPublisher eventPublisher, StatusCategoryManager statusCategoryManager)
           
 
Method Summary
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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultStatusService

public DefaultStatusService(StatusManager statusManager,
                            I18nHelper i18nHelper,
                            ConstantsManager constantsManager,
                            PermissionManager permissionManager,
                            WorkflowManager workflowManager,
                            com.atlassian.event.api.EventPublisher eventPublisher,
                            StatusCategoryManager statusCategoryManager)
Method Detail

createStatus

public ServiceOutcome<Status> createStatus(ApplicationUser user,
                                           String name,
                                           String description,
                                           String iconUrl,
                                           StatusCategory statusCategory)
Description copied from interface: StatusService
Validates and when validation is performed successfully creates new status basing on given parameters

Specified by:
createStatus in interface StatusService
Parameters:
user - User performing operation
name - Name of the status. Should neither be blank nor duplicate existing name
description - Optional description of the status
iconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be null
statusCategory - StatusCategory for given status. Cannot be null
Returns:
The result of performed operation
See Also:
StatusService.validateCreateStatus(com.atlassian.jira.user.ApplicationUser, String, String, String, com.atlassian.jira.issue.status.category.StatusCategory)

editStatus

public ServiceOutcome<Status> editStatus(ApplicationUser user,
                                         Status status,
                                         String name,
                                         String description,
                                         String iconUrl,
                                         StatusCategory statusCategory)
Description copied from interface: StatusService
Validates and when validation is performed successfully alters given status basing on given parameters

Specified by:
editStatus in interface StatusService
Parameters:
user - User performing operation
status - The status to be edited
name - Name of the status. Should neither be blank nor duplicate existing name
description - Optional description of the status
iconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be null
statusCategory - StatusCategory for given status. Cannot be null
Returns:
The result of performed operation
See Also:
StatusService.validateEditStatus(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.status.Status, String, String, String, com.atlassian.jira.issue.status.category.StatusCategory)

validateCreateStatus

public ServiceResult validateCreateStatus(ApplicationUser user,
                                          String name,
                                          String description,
                                          String iconUrl,
                                          StatusCategory statusCategory)
Description copied from interface: StatusService
Validates new status basing on given parameters

Specified by:
validateCreateStatus in interface StatusService
Parameters:
user - User performing operation
name - Name of the status. Should neither be blank nor duplicate existing name
description - Optional description of the status
iconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be null
statusCategory - StatusCategory for given status. Cannot be null
Returns:
The result of performed operation

validateEditStatus

public ServiceResult validateEditStatus(ApplicationUser user,
                                        Status status,
                                        String name,
                                        String description,
                                        String iconUrl,
                                        StatusCategory statusCategory)
Description copied from interface: StatusService
Validates given status basing on given parameters

Specified by:
validateEditStatus in interface StatusService
Parameters:
user - User performing operation
status - The status to be edited
name - Name of the status. Should neither be blank nor duplicate existing name
description - Optional description of the status
iconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be null
statusCategory - StatusCategory for given status. Cannot be null
Returns:
The result of performed operation

getStatusById

public Status getStatusById(ApplicationUser user,
                            String id)
Description copied from interface: StatusService
Get a status by id.

Specified by:
getStatusById in interface StatusService
Parameters:
user - User performing operation
id - status id
Returns:
the Status, or null if no status with this id exists.

validateRemoveStatus

public ServiceResult validateRemoveStatus(ApplicationUser user,
                                          Status status)
Description copied from interface: StatusService
Validates removal of given status

Specified by:
validateRemoveStatus in interface StatusService
Parameters:
user - User performing operation
status - The Status
Returns:

removeStatus

public ServiceResult removeStatus(ApplicationUser user,
                                  Status status)
Description copied from interface: StatusService
Removes a status.

Specified by:
removeStatus in interface StatusService
Parameters:
user - User performing operation
status - Status
Returns:
The result of performed operation

getAssociatedWorkflows

public ServiceOutcome<List<JiraWorkflow>> getAssociatedWorkflows(ApplicationUser user,
                                                                 Status status)
Description copied from interface: StatusService
Gets a list of workflows which contains given status

Specified by:
getAssociatedWorkflows in interface StatusService
Parameters:
user - User performing operation
status - The Status
Returns:

containsStatus

public static com.google.common.base.Predicate<JiraWorkflow> containsStatus(Status status)

isStatusAsLozengeEnabled

public boolean isStatusAsLozengeEnabled()
Description copied from interface: StatusService
Returns a boolean whether status lozenge is enabled or not

Specified by:
isStatusAsLozengeEnabled in interface StatusService
Returns:
a boolean


Copyright © 2002-2014 Atlassian. All Rights Reserved.