public class

DefaultConstantsService

extends Object
implements ConstantsService
java.lang.Object
   ↳ com.atlassian.jira.bc.config.DefaultConstantsService

Class Overview

This class implements constant-related business cases.

Summary

Public Constructors
DefaultConstantsService(I18nHelper.BeanFactory i18n, ConstantsManager constantsManager, PermissionManager permissionManager, WorkflowSchemeManager workflowSchemeMgr, WorkflowManager workflowMgr, StatusCategoryManager statusCategoryManager, IssueTypeService issueTypeService)
Public Methods
ServiceOutcome<Collection<IssueType>> getAllIssueTypes(ApplicationUser user)
Returns a ServiceOutcome containing all IssueTypes.
ServiceOutcome<Collection<StatusCategory>> getAllStatusCategories(ApplicationUser user)
Returns a ServiceOutcome containing all StatusCategories.
ServiceOutcome<Collection<Status>> getAllStatuses(ApplicationUser user)
Returns a ServiceOutcome containing all Statuses.
ServiceOutcome<StatusCategory> getDefaultStatusCategory(ApplicationUser user)
Returns a ServiceOutcome containing default StatusCategory.
ServiceOutcome<IssueType> getIssueTypeById(ApplicationUser user, String issueTypeId)
Returns a ServiceOutcome containing the IssueType that has the given id.
ServiceOutcome<Status> getStatusById(ApplicationUser user, String statusId)
Returns a ServiceOutcome containing the Status that has the given id.
ServiceOutcome<Status> getStatusByName(ApplicationUser user, String statusName)
Returns a ServiceOutcome containing the Status that has the given Name.
ServiceOutcome<Status> getStatusByTranslatedName(ApplicationUser user, String statusName)
Returns a ServiceOutcome containing the Status that has the given Name.
ServiceOutcome<StatusCategory> getStatusCategoryById(ApplicationUser user, String id)
Returns a ServiceOutcome containing StatusCategory that has the gived id.
ServiceOutcome<StatusCategory> getStatusCategoryByKey(ApplicationUser user, String key)
Returns a ServiceOutcome containing StatusCategory that has the gived key.
ServiceOutcome<Collection<StatusCategory>> getUserVisibleStatusCategories(ApplicationUser user)
Returns a ServiceOutcome containing StatusCategories visible to any user.
boolean isStatusAsLozengeEnabled()
Returns a boolean value indicating whether statuses should appear as lozenges or not.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.bc.config.ConstantsService

Public Constructors

public DefaultConstantsService (I18nHelper.BeanFactory i18n, ConstantsManager constantsManager, PermissionManager permissionManager, WorkflowSchemeManager workflowSchemeMgr, WorkflowManager workflowMgr, StatusCategoryManager statusCategoryManager, IssueTypeService issueTypeService)

Public Methods

public ServiceOutcome<Collection<IssueType>> getAllIssueTypes (ApplicationUser user)

Returns a ServiceOutcome containing all IssueTypes. Only issue types that the calling user has permission to see will be returned in the ServiceOutcome

Parameters
user the calling user
Returns
  • a ServiceOutcome

public ServiceOutcome<Collection<StatusCategory>> getAllStatusCategories (ApplicationUser user)

Returns a ServiceOutcome containing all StatusCategories.

Parameters
user the calling user. Will be used for formatting error messages
Returns
  • a ServiceOutcome

public ServiceOutcome<Collection<Status>> getAllStatuses (ApplicationUser user)

Returns a ServiceOutcome containing all Statuses. Only statuses that the calling user has permission to see will be returned in the ServiceOutcome

Parameters
user the calling user
Returns
  • a ServiceOutcome

public ServiceOutcome<StatusCategory> getDefaultStatusCategory (ApplicationUser user)

Returns a ServiceOutcome containing default StatusCategory. The method returns status category independently on dark feature state.

Parameters
user the calling User. Will be used for formatting error messages
Returns
  • a ServiceOutcome

public ServiceOutcome<IssueType> getIssueTypeById (ApplicationUser user, String issueTypeId)

Returns a ServiceOutcome containing the IssueType that has the given id. If there is no IssueType with the given id, or if the calling user does not have permission to see the IssueType, the ServiceOutcome will contain an error message to that effect. Otherwise, the IssueType can be obtained by calling getReturnedValue() on the returned ServiceOutcome.

Parameters
user the calling user
issueTypeId a String containing an IssueType id
Returns
  • a ServiceOutcome

public ServiceOutcome<Status> getStatusById (ApplicationUser user, String statusId)

Returns a ServiceOutcome containing the Status that has the given id. If the Status with the provided id is not found, or if the calling user does not have permission to see the Status, the ServiceOutcome will contain the appropriate error. Otherwise, the status can be obtained by calling getReturnedValue() on the returned ServiceOutcome.

Parameters
user the calling user
statusId a String containing a Status id
Returns
  • a ServiceOutcome

public ServiceOutcome<Status> getStatusByName (ApplicationUser user, String statusName)

Returns a ServiceOutcome containing the Status that has the given Name. If the Status with the provided Name is not found, or if the calling user does not have permission to see the Status, the ServiceOutcome will contain the appropriate error. Otherwise, the status can be obtained by calling getReturnedValue() on the returned ServiceOutcome.

Parameters
user the calling user
statusName a String containing a Status name
Returns
  • a ServiceOutcome

public ServiceOutcome<Status> getStatusByTranslatedName (ApplicationUser user, String statusName)

Returns a ServiceOutcome containing the Status that has the given Name. The preference is to find the status by its translated name. If no matching translated name is found the true (untranslated) name will be tried. If the Status with the provided Name is not found, or if the calling user does not have permission to see the Status, the ServiceOutcome will contain the appropriate error. Otherwise, the status can be obtained by calling getReturnedValue() on the returned ServiceOutcome.

Parameters
user the calling user
statusName a String containing a Status name
Returns
  • a ServiceOutcome

public ServiceOutcome<StatusCategory> getStatusCategoryById (ApplicationUser user, String id)

Returns a ServiceOutcome containing StatusCategory that has the gived id. If the Status with the provided id is not found, the ServiceOutcome will contain the appropriate error. Otherwise, the status can be obtained by calling getReturnedValue() on the returned ServiceOutcome.

Parameters
user the calling user. Will be used for formatting error messages
id a String containing a StatusCategory id

public ServiceOutcome<StatusCategory> getStatusCategoryByKey (ApplicationUser user, String key)

Returns a ServiceOutcome containing StatusCategory that has the gived key. If the Status with the provided key is not found, the ServiceOutcome will contain the appropriate error. Otherwise, the status can be obtained by calling getReturnedValue() on the returned ServiceOutcome.

Parameters
user the calling user. Will be used for formatting error messages
key a String containing a StatusCategory id

public ServiceOutcome<Collection<StatusCategory>> getUserVisibleStatusCategories (ApplicationUser user)

Returns a ServiceOutcome containing StatusCategories visible to any user.

Parameters
user the calling user. Will be used for formatting error messages
Returns
  • a ServiceOutcome

public boolean isStatusAsLozengeEnabled ()

Returns a boolean value indicating whether statuses should appear as lozenges or not.

Returns
  • a boolean value