Package com.atlassian.jira.bc.config
Class DefaultConstantsService
java.lang.Object
com.atlassian.jira.bc.config.DefaultConstantsService
- All Implemented Interfaces:
ConstantsService
This class implements constant-related business cases.
- Since:
- v4.2
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultConstantsService
(I18nHelper.BeanFactory i18n, ConstantsManager constantsManager, PermissionManager permissionManager, WorkflowSchemeManager workflowSchemeMgr, WorkflowManager workflowMgr, StatusCategoryManager statusCategoryManager, IssueTypeService issueTypeService) -
Method Summary
Modifier and TypeMethodDescriptionReturns a ServiceOutcome containing all IssueTypes.Returns a ServiceOutcome containing all StatusCategories.Returns a ServiceOutcome containing all Statuses.Returns a ServiceOutcome containing default StatusCategory.getIssueTypeById
(ApplicationUser user, String issueTypeId) Returns a ServiceOutcome containing the IssueType that has the given id.getStatusById
(ApplicationUser user, String statusId) Returns a ServiceOutcome containing the Status that has the given id.getStatusByName
(ApplicationUser user, String statusName) Returns a ServiceOutcome containing the Status that has the given Name.getStatusByNameIgnoreCase
(ApplicationUser user, String statusName) Returns a ServiceOutcome containing the Status that has the given Name ignoring case.getStatusByTranslatedName
(ApplicationUser user, String statusName) Returns a ServiceOutcome containing the Status that has the given Name.getStatusCategoryById
(ApplicationUser user, String id) Returns a ServiceOutcome containing StatusCategory that has the gived id.getStatusCategoryByKey
(ApplicationUser user, String key) Returns a ServiceOutcome containing StatusCategory that has the gived key.Returns a ServiceOutcome containing StatusCategories visible to any user.boolean
Returns a boolean value indicating whether statuses should appear as lozenges or not.
-
Constructor Details
-
DefaultConstantsService
public DefaultConstantsService(I18nHelper.BeanFactory i18n, ConstantsManager constantsManager, PermissionManager permissionManager, WorkflowSchemeManager workflowSchemeMgr, WorkflowManager workflowMgr, StatusCategoryManager statusCategoryManager, IssueTypeService issueTypeService)
-
-
Method Details
-
getStatusById
Description copied from interface:ConstantsService
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 callingServiceOutcome.getReturnedValue()
on the returned ServiceOutcome.- Specified by:
getStatusById
in interfaceConstantsService
- Parameters:
user
- the calling userstatusId
- a String containing a Status id- Returns:
- a ServiceOutcome
-
getStatusByName
Description copied from interface:ConstantsService
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 callingServiceOutcome.getReturnedValue()
on the returned ServiceOutcome.- Specified by:
getStatusByName
in interfaceConstantsService
- Parameters:
user
- the calling userstatusName
- a String containing a Status name- Returns:
- a ServiceOutcome
-
getStatusByNameIgnoreCase
Description copied from interface:ConstantsService
Returns a ServiceOutcome containing the Status that has the given Name ignoring case. 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 callingServiceOutcome.getReturnedValue()
on the returned ServiceOutcome.- Specified by:
getStatusByNameIgnoreCase
in interfaceConstantsService
- Parameters:
user
- the calling userstatusName
- a String containing a Status name- Returns:
- a ServiceOutcome
-
getStatusByTranslatedName
Description copied from interface:ConstantsService
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 callingServiceOutcome.getReturnedValue()
on the returned ServiceOutcome.- Specified by:
getStatusByTranslatedName
in interfaceConstantsService
- Parameters:
user
- the calling userstatusName
- a String containing a Status name- Returns:
- a ServiceOutcome
-
getAllStatuses
Description copied from interface:ConstantsService
Returns a ServiceOutcome containing all Statuses. Only statuses that the calling user has permission to see will be returned in the ServiceOutcome- Specified by:
getAllStatuses
in interfaceConstantsService
- Parameters:
user
- the calling user- Returns:
- a ServiceOutcome
-
getAllIssueTypes
Description copied from interface:ConstantsService
Returns a ServiceOutcome containing all IssueTypes. Only issue types that the calling user has permission to see will be returned in the ServiceOutcome- Specified by:
getAllIssueTypes
in interfaceConstantsService
- Parameters:
user
- the calling user- Returns:
- a ServiceOutcome
-
getIssueTypeById
Description copied from interface:ConstantsService
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 callingServiceOutcome.getReturnedValue()
on the returned ServiceOutcome.- Specified by:
getIssueTypeById
in interfaceConstantsService
- Parameters:
user
- the calling userissueTypeId
- a String containing an IssueType id- Returns:
- a ServiceOutcome
-
getAllStatusCategories
Description copied from interface:ConstantsService
Returns a ServiceOutcome containing all StatusCategories.- Specified by:
getAllStatusCategories
in interfaceConstantsService
- Parameters:
user
- the calling user. Will be used for formatting error messages- Returns:
- a ServiceOutcome
-
getUserVisibleStatusCategories
public ServiceOutcome<Collection<StatusCategory>> getUserVisibleStatusCategories(ApplicationUser user) Description copied from interface:ConstantsService
Returns a ServiceOutcome containing StatusCategories visible to any user.- Specified by:
getUserVisibleStatusCategories
in interfaceConstantsService
- Parameters:
user
- the calling user. Will be used for formatting error messages- Returns:
- a ServiceOutcome
-
getStatusCategoryById
Description copied from interface:ConstantsService
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 callingServiceOutcome.getReturnedValue()
on the returned ServiceOutcome.- Specified by:
getStatusCategoryById
in interfaceConstantsService
- Parameters:
user
- the calling user. Will be used for formatting error messagesid
- a String containing a StatusCategory id
-
getStatusCategoryByKey
Description copied from interface:ConstantsService
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 callingServiceOutcome.getReturnedValue()
on the returned ServiceOutcome.- Specified by:
getStatusCategoryByKey
in interfaceConstantsService
- Parameters:
user
- the calling user. Will be used for formatting error messageskey
- a String containing a StatusCategory id
-
getDefaultStatusCategory
Description copied from interface:ConstantsService
Returns a ServiceOutcome containing default StatusCategory. The method returns status category independently on dark feature state.- Specified by:
getDefaultStatusCategory
in interfaceConstantsService
- Parameters:
user
- the calling User. Will be used for formatting error messages- Returns:
- a ServiceOutcome
-
isStatusAsLozengeEnabled
public boolean isStatusAsLozengeEnabled()Description copied from interface:ConstantsService
Returns a boolean value indicating whether statuses should appear as lozenges or not.- Specified by:
isStatusAsLozengeEnabled
in interfaceConstantsService
- Returns:
- a boolean value
-