public class DefaultWorkflowSchemeService extends Object implements WorkflowSchemeService
Constructor and Description |
---|
DefaultWorkflowSchemeService(PermissionManager permissionManager,
I18nHelper.BeanFactory i18Factory,
WorkflowSchemeManager workflowSchemeManager,
WorkflowManager workflowManager,
IssueTypeManager issueTypeManager) |
Modifier and Type | Method and Description |
---|---|
AssignableWorkflowScheme.Builder |
assignableBuilder()
Return a builder that can be used to create a
AssignableWorkflowScheme . |
ServiceOutcome<DraftWorkflowScheme> |
createDraft(ApplicationUser creator,
DraftWorkflowScheme draftWorkflowScheme)
Create a draft workflow scheme.
|
ServiceOutcome<DraftWorkflowScheme> |
createDraft(ApplicationUser creator,
long parentId)
Create a draft for the passed workflow scheme.
|
ServiceOutcome<AssignableWorkflowScheme> |
createScheme(ApplicationUser creator,
AssignableWorkflowScheme scheme)
Create a new workflow scheme.
|
ServiceOutcome<Void> |
deleteWorkflowScheme(ApplicationUser user,
WorkflowScheme scheme)
Delete the passed workflow scheme.
|
DraftWorkflowScheme.Builder |
draftBuilder(AssignableWorkflowScheme parent)
Return a builder that can be used to create a
DraftWorkflowScheme for the passed workflow scheme. |
ServiceOutcome<DraftWorkflowScheme> |
getDraftWorkflowScheme(ApplicationUser user,
AssignableWorkflowScheme parentScheme)
Return draft of the passed workflow scheme if it actually exists.
|
ServiceOutcome<DraftWorkflowScheme> |
getDraftWorkflowSchemeNotNull(ApplicationUser user,
AssignableWorkflowScheme parentScheme)
Return draft of the passed workflow scheme if it actually exists.
|
ServiceOutcome<AssignableWorkflowScheme> |
getSchemeForProject(ApplicationUser user,
Project project)
Return the workflow scheme associated with passed project.
|
int |
getUsageCount(AssignableWorkflowScheme assignableWorkflowScheme)
Return the number of projects that use the passed scheme.
|
ServiceOutcome<AssignableWorkflowScheme> |
getWorkflowScheme(ApplicationUser user,
long id)
Return the workflow scheme for the passed id.
|
boolean |
isActive(WorkflowScheme workflowScheme)
Is the passed workflow scheme being used by a project in JIRA.
|
boolean |
isUsingDefaultScheme(Project project)
Tells the caller if the passed project is using the default workflow scheme.
|
ServiceOutcome<AssignableWorkflowScheme> |
updateWorkflowScheme(ApplicationUser user,
AssignableWorkflowScheme scheme)
Save changes to the passed workflow scheme.
|
ServiceOutcome<DraftWorkflowScheme> |
updateWorkflowScheme(ApplicationUser user,
DraftWorkflowScheme scheme)
Save changes to the passed workflow scheme.
|
ServiceOutcome<Void> |
validateUpdateWorkflowScheme(ApplicationUser user,
AssignableWorkflowScheme scheme)
Validate that the passed scheme can be saved.
|
public DefaultWorkflowSchemeService(PermissionManager permissionManager, I18nHelper.BeanFactory i18Factory, WorkflowSchemeManager workflowSchemeManager, WorkflowManager workflowManager, IssueTypeManager issueTypeManager)
public AssignableWorkflowScheme.Builder assignableBuilder()
WorkflowSchemeService
AssignableWorkflowScheme
. The actual scheme will not
be created in JIRA until the WorkflowSchemeService.createScheme(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.workflow.AssignableWorkflowScheme)
method is called.assignableBuilder
in interface WorkflowSchemeService
AssignableWorkflowScheme
.public DraftWorkflowScheme.Builder draftBuilder(AssignableWorkflowScheme parent)
WorkflowSchemeService
DraftWorkflowScheme
for the passed workflow scheme.
The actual scheme will not be created in JIRA until the WorkflowSchemeService.createDraft(com.atlassian.jira.user.ApplicationUser, DraftWorkflowScheme)
method is called.draftBuilder
in interface WorkflowSchemeService
DraftWorkflowScheme
.@Nonnull public ServiceOutcome<AssignableWorkflowScheme> createScheme(ApplicationUser creator, @Nonnull AssignableWorkflowScheme scheme)
WorkflowSchemeService
createScheme
in interface WorkflowSchemeService
creator
- the user creating the scheme.scheme
- the scheme to create.public ServiceOutcome<DraftWorkflowScheme> createDraft(ApplicationUser creator, long parentId)
WorkflowSchemeService
To create a draft scheme the parent must be:
createDraft
in interface WorkflowSchemeService
creator
- the user creating the draft.parentId
- the workflow scheme to create a draft for.public ServiceOutcome<DraftWorkflowScheme> createDraft(ApplicationUser creator, DraftWorkflowScheme draftWorkflowScheme)
WorkflowSchemeService
WorkflowSchemeService.draftBuilder(com.atlassian.jira.workflow.AssignableWorkflowScheme)
method.
To create a draft scheme the parent must be:
createDraft
in interface WorkflowSchemeService
creator
- the user creating the draft.draftWorkflowScheme
- the draft to create.public ServiceOutcome<AssignableWorkflowScheme> getWorkflowScheme(ApplicationUser user, long id)
WorkflowSchemeService
getWorkflowScheme
in interface WorkflowSchemeService
user
- the user searching for the scheme.id
- the id of the workflow scheme to find.public ServiceOutcome<DraftWorkflowScheme> getDraftWorkflowScheme(ApplicationUser user, @Nonnull AssignableWorkflowScheme parentScheme)
WorkflowSchemeService
getDraftWorkflowScheme
in interface WorkflowSchemeService
user
- the user making the request.parentScheme
- the workflow scheme whose draft we are searching for.public ServiceOutcome<DraftWorkflowScheme> getDraftWorkflowSchemeNotNull(ApplicationUser user, @Nonnull AssignableWorkflowScheme parentScheme)
WorkflowSchemeService
getDraftWorkflowSchemeNotNull
in interface WorkflowSchemeService
user
- the user making the request.parentScheme
- the workflow scheme whose draft we are searching for.public ServiceOutcome<Void> deleteWorkflowScheme(ApplicationUser user, @Nonnull WorkflowScheme scheme)
WorkflowSchemeService
deleteWorkflowScheme
in interface WorkflowSchemeService
user
- the user deleting the scheme.scheme
- the scheme.public boolean isActive(WorkflowScheme workflowScheme)
WorkflowSchemeService
isActive
in interface WorkflowSchemeService
workflowScheme
- the workflow scheme to test.public ServiceOutcome<AssignableWorkflowScheme> getSchemeForProject(ApplicationUser user, @Nonnull Project project)
WorkflowSchemeService
getSchemeForProject
in interface WorkflowSchemeService
project
- the project.public ServiceOutcome<AssignableWorkflowScheme> updateWorkflowScheme(ApplicationUser user, @Nonnull AssignableWorkflowScheme scheme)
WorkflowSchemeService
updateWorkflowScheme
in interface WorkflowSchemeService
user
- the user making the changes.scheme
- the scheme to change.public ServiceOutcome<Void> validateUpdateWorkflowScheme(ApplicationUser user, @Nonnull AssignableWorkflowScheme scheme)
WorkflowSchemeService
validateUpdateWorkflowScheme
in interface WorkflowSchemeService
user
- the user making the changes.scheme
- the scheme to change.public ServiceOutcome<DraftWorkflowScheme> updateWorkflowScheme(ApplicationUser user, @Nonnull DraftWorkflowScheme scheme)
WorkflowSchemeService
updateWorkflowScheme
in interface WorkflowSchemeService
user
- the user making the changes.scheme
- the scheme to change.public int getUsageCount(@Nonnull AssignableWorkflowScheme assignableWorkflowScheme)
WorkflowSchemeService
getUsageCount
in interface WorkflowSchemeService
assignableWorkflowScheme
- the scheme to check.public boolean isUsingDefaultScheme(@Nonnull Project project)
WorkflowSchemeService
isUsingDefaultScheme
in interface WorkflowSchemeService
project
- the project to check.Copyright © 2002-2019 Atlassian. All Rights Reserved.