com.atlassian.jira.bc.config
Class DefaultConstantsService

java.lang.Object
  extended by com.atlassian.jira.bc.config.DefaultConstantsService
All Implemented Interfaces:
ConstantsService

public class DefaultConstantsService
extends Object
implements ConstantsService

This class implements constant-related business cases.

Since:
v4.2

Constructor Summary
DefaultConstantsService(I18nHelper.BeanFactory i18n, ConstantsManager constantsManager, PermissionManager permissionManager, WorkflowSchemeManager workflowSchemeMgr, WorkflowManager workflowMgr, IssueTypeSchemeManager issueTypeSchemeMgr, StatusCategoryManager statusCategoryManager)
          Creates a new DefaultConstantsService.
 
Method Summary
 ServiceOutcome<Collection<IssueType>> getAllIssueTypes(com.atlassian.crowd.embedded.api.User user)
          Returns a ServiceOutcome containing all IssueTypes.
 ServiceOutcome<Collection<StatusCategory>> getAllStatusCategories(com.atlassian.crowd.embedded.api.User user)
          Returns a ServiceOutcome containing all StatusCategories.
 ServiceOutcome<Collection<Status>> getAllStatuses(com.atlassian.crowd.embedded.api.User user)
          Returns a ServiceOutcome containing all Statuses.
 ServiceOutcome<StatusCategory> getDefaultStatusCategory(com.atlassian.crowd.embedded.api.User user)
          Returns a ServiceOutcome containing default StatusCategory.
 ServiceOutcome<IssueType> getIssueTypeById(com.atlassian.crowd.embedded.api.User user, String issueTypeId)
          Returns a ServiceOutcome containing the IssueType that has the given id.
 ServiceOutcome<Status> getStatusById(com.atlassian.crowd.embedded.api.User user, String statusId)
          Returns a ServiceOutcome containing the Status that has the given id.
 ServiceOutcome<Status> getStatusByName(com.atlassian.crowd.embedded.api.User user, String statusName)
          Returns a ServiceOutcome containing the Status that has the given Name.
 ServiceOutcome<Status> getStatusByTranslatedName(com.atlassian.crowd.embedded.api.User user, String statusName)
          Returns a ServiceOutcome containing the Status that has the given Name.
 ServiceOutcome<StatusCategory> getStatusCategoryById(com.atlassian.crowd.embedded.api.User user, String id)
          Returns a ServiceOutcome containing StatusCategory that has the gived id.
 ServiceOutcome<StatusCategory> getStatusCategoryByKey(com.atlassian.crowd.embedded.api.User user, String key)
          Returns a ServiceOutcome containing StatusCategory that has the gived key.
 ServiceOutcome<Collection<StatusCategory>> getUserVisibleStatusCategories(com.atlassian.crowd.embedded.api.User 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConstantsService

public DefaultConstantsService(I18nHelper.BeanFactory i18n,
                               ConstantsManager constantsManager,
                               PermissionManager permissionManager,
                               WorkflowSchemeManager workflowSchemeMgr,
                               WorkflowManager workflowMgr,
                               IssueTypeSchemeManager issueTypeSchemeMgr,
                               StatusCategoryManager statusCategoryManager)
Creates a new DefaultConstantsService.

Parameters:
i18n - a I18nHelper
constantsManager - a ConstantsManager
permissionManager - a PermissionManager
workflowSchemeMgr - a WorkflowSchemeManager
workflowMgr - a WorkflowManager
issueTypeSchemeMgr - an IssueTypeSchemeManager
statusCategoryManager - a StatusCategoryManager
Method Detail

getStatusById

public ServiceOutcome<Status> getStatusById(com.atlassian.crowd.embedded.api.User user,
                                            String statusId)
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 calling ServiceOutcome.getReturnedValue() on the returned ServiceOutcome.

Specified by:
getStatusById in interface ConstantsService
Parameters:
user - the calling user
statusId - a String containing a Status id
Returns:
a ServiceOutcome

getStatusByName

public ServiceOutcome<Status> getStatusByName(com.atlassian.crowd.embedded.api.User user,
                                              String statusName)
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 calling ServiceOutcome.getReturnedValue() on the returned ServiceOutcome.

Specified by:
getStatusByName in interface ConstantsService
Parameters:
user - the calling user
statusName - a String containing a Status name
Returns:
a ServiceOutcome

getStatusByTranslatedName

public ServiceOutcome<Status> getStatusByTranslatedName(com.atlassian.crowd.embedded.api.User user,
                                                        String statusName)
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 calling ServiceOutcome.getReturnedValue() on the returned ServiceOutcome.

Specified by:
getStatusByTranslatedName in interface ConstantsService
Parameters:
user - the calling user
statusName - a String containing a Status name
Returns:
a ServiceOutcome

getAllStatuses

public ServiceOutcome<Collection<Status>> getAllStatuses(com.atlassian.crowd.embedded.api.User user)
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 interface ConstantsService
Parameters:
user - the calling user
Returns:
a ServiceOutcome

getAllIssueTypes

public ServiceOutcome<Collection<IssueType>> getAllIssueTypes(com.atlassian.crowd.embedded.api.User user)
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 interface ConstantsService
Parameters:
user - the calling user
Returns:
a ServiceOutcome

getIssueTypeById

public ServiceOutcome<IssueType> getIssueTypeById(com.atlassian.crowd.embedded.api.User user,
                                                  String issueTypeId)
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 calling ServiceOutcome.getReturnedValue() on the returned ServiceOutcome.

Specified by:
getIssueTypeById in interface ConstantsService
Parameters:
user - the calling user
issueTypeId - a String containing an IssueType id
Returns:
a ServiceOutcome

getAllStatusCategories

public ServiceOutcome<Collection<StatusCategory>> getAllStatusCategories(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: ConstantsService
Returns a ServiceOutcome containing all StatusCategories.

Specified by:
getAllStatusCategories in interface ConstantsService
Parameters:
user - the calling user. Will be used for formatting error messages
Returns:
a ServiceOutcome

getUserVisibleStatusCategories

public ServiceOutcome<Collection<StatusCategory>> getUserVisibleStatusCategories(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: ConstantsService
Returns a ServiceOutcome containing StatusCategories visible to any user.

Specified by:
getUserVisibleStatusCategories in interface ConstantsService
Parameters:
user - the calling user. Will be used for formatting error messages
Returns:
a ServiceOutcome

getStatusCategoryById

public ServiceOutcome<StatusCategory> getStatusCategoryById(com.atlassian.crowd.embedded.api.User user,
                                                            String id)
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 calling ServiceOutcome.getReturnedValue() on the returned ServiceOutcome.

Specified by:
getStatusCategoryById in interface ConstantsService
Parameters:
user - the calling user. Will be used for formatting error messages
id - a String containing a StatusCategory id

getStatusCategoryByKey

public ServiceOutcome<StatusCategory> getStatusCategoryByKey(com.atlassian.crowd.embedded.api.User user,
                                                             String key)
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 calling ServiceOutcome.getReturnedValue() on the returned ServiceOutcome.

Specified by:
getStatusCategoryByKey in interface ConstantsService
Parameters:
user - the calling user. Will be used for formatting error messages
key - a String containing a StatusCategory id

getDefaultStatusCategory

public ServiceOutcome<StatusCategory> getDefaultStatusCategory(com.atlassian.crowd.embedded.api.User user)
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 interface ConstantsService
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 interface ConstantsService
Returns:
a boolean value


Copyright © 2002-2014 Atlassian. All Rights Reserved.