Package com.atlassian.jira.bc.config
Class DefaultStatusService
java.lang.Object
com.atlassian.jira.bc.config.DefaultStatusService
- All Implemented Interfaces:
StatusService
- Since:
- v6.1
-
Field Summary
Fields inherited from interface com.atlassian.jira.bc.config.StatusService
MAX_STATUS_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionDefaultStatusService(StatusManager statusManager, I18nHelper i18nHelper, ConstantsManager constantsManager, PermissionManager permissionManager, WorkflowManager workflowManager, com.atlassian.event.api.EventPublisher eventPublisher, StatusCategoryManager statusCategoryManager, WorkflowSchemeManager workflowSchemeManager) -
Method Summary
Modifier and TypeMethodDescriptionstatic Predicate<JiraWorkflow>containsStatus(Status 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 parameterseditStatus(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 parametersfindStatuses(ApplicationUser user, String substring, Set<Long> projectIds, Set<String> issueTypeIds) Returns statuses whose names start with or fully match given substring.getAssociatedWorkflows(ApplicationUser user, Status status) Gets a list of workflows which contains given statusgetStatusById(ApplicationUser user, String id) Get a status by id.booleanReturns a boolean whether status lozenge is enabled or notmoveStatusDown(ApplicationUser user, String id) Move a status down the order.moveStatusUp(ApplicationUser user, String id) Move a status up the order.removeStatus(ApplicationUser user, Status status) Removes a status.validateCreateStatus(ApplicationUser user, String name, String description, String iconUrl, StatusCategory statusCategory) Validates new status basing on given parametersvalidateEditStatus(ApplicationUser user, Status status, String name, String description, String iconUrl, StatusCategory statusCategory) Validates given status basing on given parametersvalidateRemoveStatus(ApplicationUser user, Status status) Validates removal of given status
-
Constructor Details
-
DefaultStatusService
public DefaultStatusService(StatusManager statusManager, I18nHelper i18nHelper, ConstantsManager constantsManager, PermissionManager permissionManager, WorkflowManager workflowManager, com.atlassian.event.api.EventPublisher eventPublisher, StatusCategoryManager statusCategoryManager, WorkflowSchemeManager workflowSchemeManager)
-
-
Method Details
-
createStatus
public ServiceOutcome<Status> createStatus(ApplicationUser user, String name, String description, String iconUrl, StatusCategory statusCategory) Description copied from interface:StatusServiceValidates and when validation is performed successfully creates new status basing on given parameters- Specified by:
createStatusin interfaceStatusService- Parameters:
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-StatusCategoryfor given status. Cannot be null- Returns:
- The result of performed operation
- See Also:
-
editStatus
public ServiceOutcome<Status> editStatus(ApplicationUser user, Status status, String name, String description, String iconUrl, StatusCategory statusCategory) Description copied from interface:StatusServiceValidates and when validation is performed successfully alters given status basing on given parameters- Specified by:
editStatusin interfaceStatusService- Parameters:
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-StatusCategoryfor given status. Cannot be null- Returns:
- The result of performed operation
- See Also:
-
validateCreateStatus
public ServiceResult validateCreateStatus(ApplicationUser user, String name, String description, String iconUrl, StatusCategory statusCategory) Description copied from interface:StatusServiceValidates new status basing on given parameters- Specified by:
validateCreateStatusin interfaceStatusService- Parameters:
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-StatusCategoryfor 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:StatusServiceValidates given status basing on given parameters- Specified by:
validateEditStatusin interfaceStatusService- Parameters:
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-StatusCategoryfor given status. Cannot be null- Returns:
- The result of performed operation
-
getStatusById
Description copied from interface:StatusServiceGet a status by id.- Specified by:
getStatusByIdin interfaceStatusService- Parameters:
user- User performing operationid- status id- Returns:
- the
Status, or null if no status with this id exists.
-
validateRemoveStatus
Description copied from interface:StatusServiceValidates removal of given status- Specified by:
validateRemoveStatusin interfaceStatusService- Parameters:
user- User performing operationstatus- The Status- Returns:
-
removeStatus
Description copied from interface:StatusServiceRemoves a status.- Specified by:
removeStatusin interfaceStatusService- Parameters:
user- User performing operationstatus- Status- Returns:
- The result of performed operation
-
getAssociatedWorkflows
public ServiceOutcome<List<JiraWorkflow>> getAssociatedWorkflows(ApplicationUser user, Status status) Description copied from interface:StatusServiceGets a list of workflows which contains given status- Specified by:
getAssociatedWorkflowsin interfaceStatusService- Parameters:
user- User performing operationstatus- The Status- Returns:
-
moveStatusUp
Description copied from interface:StatusServiceMove a status up the order.- Specified by:
moveStatusUpin interfaceStatusService- Parameters:
user- User performing operationid- Status id- Returns:
-
moveStatusDown
Description copied from interface:StatusServiceMove a status down the order.- Specified by:
moveStatusDownin interfaceStatusService- Parameters:
user- User performing operationid- Status id- Returns:
-
containsStatus
-
isStatusAsLozengeEnabled
public boolean isStatusAsLozengeEnabled()Description copied from interface:StatusServiceReturns a boolean whether status lozenge is enabled or not- Specified by:
isStatusAsLozengeEnabledin interfaceStatusService- Returns:
- a boolean
-
findStatuses
public Stream<Status> findStatuses(ApplicationUser user, @Nonnull String substring, @Nonnull Set<Long> projectIds, @Nonnull Set<String> issueTypeIds) Description copied from interface:StatusServiceReturns statuses whose names start with or fully match given substring. If string is empty then skips filtering. Statuses that the calling user has no permissions to see are filtered out.- Specified by:
findStatusesin interfaceStatusService- Parameters:
user- User performing operation (or null if user is anonymous)substring- The string that status names will be matched withprojectIds- The set of project ids to filter statusesissueTypeIds- The set of issue type ids to filter statuses
-