com.atlassian.jira.rest.v2.admin.workflowscheme
Class WorkflowSchemeResource

java.lang.Object
  extended by com.atlassian.jira.rest.v2.admin.workflowscheme.WorkflowSchemeResource

public class WorkflowSchemeResource
extends Object

Since:
v5.2

Constructor Summary
WorkflowSchemeResource(AssignableRestWorkflowScheme.Factory factory, WorkflowManager workflowManager, IssueTypeManager issueTypeManager, JiraAuthenticationContext authenticationContext)
           
 
Method Summary
 javax.ws.rs.core.Response createDraftForParent(long id)
          Create a draft for the passed scheme.
 javax.ws.rs.core.Response createScheme(WorkflowSchemeBean bean)
          Create a new workflow scheme.
 javax.ws.rs.core.Response deleteDefault(long id, boolean updateDraftIfNeeded)
          Remove the default workflow from the passed workflow scheme.
 javax.ws.rs.core.Response deleteDraftById(long id)
          Delete the passed draft workflow scheme.
 javax.ws.rs.core.Response deleteDraftDefault(long id)
          Remove the default workflow from the passed draft workflow scheme.
 javax.ws.rs.core.Response deleteDraftIssueType(long id, String issueType)
          Remove the specified issue type mapping from the draft scheme.
 javax.ws.rs.core.Response deleteDraftWorkflowMapping(long id, String workflowName)
          Delete the passed workflow from the draft workflow scheme.
 javax.ws.rs.core.Response deleteIssueType(long id, String issueType, boolean updateDraftIfNeeded)
          Remove the specified issue type mapping from the scheme.
 javax.ws.rs.core.Response deleteScheme(long id)
          Delete the passed workflow scheme.
 javax.ws.rs.core.Response deleteWorkflowMapping(long id, String workflowName, boolean updateDraftIfNeeded)
          Delete the passed workflow from the workflow scheme.
 javax.ws.rs.core.Response getById(long id, boolean returnDraftIfExists)
          Returns the requested workflow scheme to the caller.
 javax.ws.rs.core.Response getDefault(long id, boolean returnDraftIfExists)
          Return the default workflow from the passed workflow scheme.
 javax.ws.rs.core.Response getDraftById(long id)
          Returns the requested draft workflow scheme to the caller.
 javax.ws.rs.core.Response getDraftDefault(long id)
          Return the default workflow from the passed draft workflow scheme to the caller.
 javax.ws.rs.core.Response getDraftIssueType(long id, String issueType)
          Returns the issue type mapping for the passed draft workflow scheme.
 javax.ws.rs.core.Response getDraftWorkflow(long id, String workflowName)
          Returns the draft workflow mappings or requested mapping to the caller.
 javax.ws.rs.core.Response getIssueType(long id, String issueType, boolean returnDraftIfExists)
          Returns the issue type mapping for the passed workflow scheme.
 javax.ws.rs.core.Response getWorkflow(long id, String workflowName, boolean returnDraftIfExists)
          Returns the workflow mappings or requested mapping to the caller for the passed scheme.
 javax.ws.rs.core.Response setDraftIssueType(long id, String issueType, IssueTypeMappingBean mappingBean)
          Set the issue type mapping for the passed draft scheme.
 javax.ws.rs.core.Response setIssueType(long id, String issueType, IssueTypeMappingBean mappingBean)
          Set the issue type mapping for the passed scheme.
 javax.ws.rs.core.Response update(long id, WorkflowSchemeBean bean)
          Update the passed workflow scheme.
 javax.ws.rs.core.Response updateDefault(long id, DefaultBean bean)
          Set the default workflow for the passed workflow scheme.
 javax.ws.rs.core.Response updateDraft(long id, WorkflowSchemeBean bean)
          Update a draft workflow scheme.
 javax.ws.rs.core.Response updateDraftDefault(long id, DefaultBean bean)
          Set the default workflow for the passed draft workflow scheme.
 javax.ws.rs.core.Response updateDraftWorkflowMapping(long id, String workflowName, WorkflowMappingBean updateBean)
          Update the draft scheme to include the passed mapping.
 javax.ws.rs.core.Response updateWorkflowMapping(long id, String workflowName, WorkflowMappingBean updateBean)
          Update the scheme to include the passed mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowSchemeResource

public WorkflowSchemeResource(AssignableRestWorkflowScheme.Factory factory,
                              WorkflowManager workflowManager,
                              IssueTypeManager issueTypeManager,
                              JiraAuthenticationContext authenticationContext)
Method Detail

getById

public javax.ws.rs.core.Response getById(long id,
                                         boolean returnDraftIfExists)
Returns the requested workflow scheme to the caller.

Parameters:
id - the id of the scheme.
returnDraftIfExists - when true indicates that a scheme's draft, if it exists, should be queried instead of the scheme itself.
Returns:
the requested workflow scheme.

createScheme

public javax.ws.rs.core.Response createScheme(WorkflowSchemeBean bean)
Create a new workflow scheme. The body contains a representation of the new scheme. Values not passed are assumed to be set to their defaults.


deleteScheme

public javax.ws.rs.core.Response deleteScheme(long id)
Delete the passed workflow scheme.

Parameters:
id - the id of the scheme.

update

public javax.ws.rs.core.Response update(long id,
                                        WorkflowSchemeBean bean)
Update the passed workflow scheme. The body of the request is a representation of the workflow scheme. Values not passed are assumed to indicate no change for that field. The passed representation can have its updateDraftIfNeeded flag set to true to indicate that the draft should be created and/or updated when the actual scheme cannot be edited (e.g. when the scheme is being used by a project). Values not appearing the body will not be touched.

Parameters:
id - the id of the scheme.

getDraftById

public javax.ws.rs.core.Response getDraftById(long id)
Returns the requested draft workflow scheme to the caller.

Parameters:
id - the id of the parent scheme.
Returns:
the requested draft workflow scheme.

deleteDraftById

public javax.ws.rs.core.Response deleteDraftById(long id)
Delete the passed draft workflow scheme.

Parameters:
id - the id of the parent scheme.

createDraftForParent

public javax.ws.rs.core.Response createDraftForParent(long id)
Create a draft for the passed scheme. The draft will be a copy of the state of the parent.

Parameters:
id - the id of the parent scheme.

updateDraft

public javax.ws.rs.core.Response updateDraft(long id,
                                             WorkflowSchemeBean bean)
Update a draft workflow scheme. The draft will created if necessary. The body is a representation of the workflow scheme. Values not passed are assumed to indicate no change for that field.

Parameters:
id - the id of the parent scheme.

getWorkflow

public javax.ws.rs.core.Response getWorkflow(long id,
                                             String workflowName,
                                             boolean returnDraftIfExists)
Returns the workflow mappings or requested mapping to the caller for the passed scheme.

Parameters:
id - the id of the scheme.
returnDraftIfExists - when true indicates that a scheme's draft, if it exists, should be queried instead of the scheme itself.
workflowName - the workflow mapping to return. Null can be passed to return all mappings. Must be a valid workflow name.
Returns:
the requested workflow scheme.

getDraftWorkflow

public javax.ws.rs.core.Response getDraftWorkflow(long id,
                                                  String workflowName)
Returns the draft workflow mappings or requested mapping to the caller.

Parameters:
id - the id of the parent scheme.
workflowName - the workflow mapping to return. Null can be passed to return all mappings. Must be a valid workflow name.
Returns:
the requested workflow scheme.

deleteWorkflowMapping

public javax.ws.rs.core.Response deleteWorkflowMapping(long id,
                                                       String workflowName,
                                                       boolean updateDraftIfNeeded)
Delete the passed workflow from the workflow scheme.

Parameters:
id - the id of the scheme.
workflowName - the name of the workflow to delete.
updateDraftIfNeeded - flag to indicate if a draft should be created if necessary to delete the workflow from the scheme.

deleteDraftWorkflowMapping

public javax.ws.rs.core.Response deleteDraftWorkflowMapping(long id,
                                                            String workflowName)
Delete the passed workflow from the draft workflow scheme.

Parameters:
id - the id of the parent scheme.
workflowName - the name of the workflow to delete.

updateWorkflowMapping

public javax.ws.rs.core.Response updateWorkflowMapping(long id,
                                                       String workflowName,
                                                       WorkflowMappingBean updateBean)
Update the scheme to include the passed mapping. The body is a representation of the workflow mapping. Values not passed are assumed to indicate no change for that field. The passed representation can have its updateDraftIfNeeded flag set to true to indicate that the draft should be created/updated when the actual scheme cannot be edited.

Parameters:
id - the id of the scheme.
workflowName - the name of the workflow mapping to update.

updateDraftWorkflowMapping

public javax.ws.rs.core.Response updateDraftWorkflowMapping(long id,
                                                            String workflowName,
                                                            WorkflowMappingBean updateBean)
Update the draft scheme to include the passed mapping. The body is a representation of the workflow mapping. Values not passed are assumed to indicate no change for that field.

Parameters:
id - the id of the parent scheme.
workflowName - the name of the workflow mapping to update.

getIssueType

public javax.ws.rs.core.Response getIssueType(long id,
                                              String issueType,
                                              boolean returnDraftIfExists)
Returns the issue type mapping for the passed workflow scheme.

Parameters:
id - the id of the scheme.
returnDraftIfExists - when true indicates that a scheme's draft, if it exists, should be queried instead of the scheme itself.
issueType - the issue type to query.
Returns:
the requested mapping.

getDraftIssueType

public javax.ws.rs.core.Response getDraftIssueType(long id,
                                                   String issueType)
Returns the issue type mapping for the passed draft workflow scheme.

Parameters:
id - the id of the parent scheme.
issueType - the issue type to query.
Returns:
the requested mapping.

deleteIssueType

public javax.ws.rs.core.Response deleteIssueType(long id,
                                                 String issueType,
                                                 boolean updateDraftIfNeeded)
Remove the specified issue type mapping from the scheme.

Parameters:
id - the id of the scheme.
issueType - the issue type to remove.
updateDraftIfNeeded - when true will create and return a draft when the workflow scheme cannot be edited (e.g. when it is being used by a project).
Returns:
the updated scheme or an error.

deleteDraftIssueType

public javax.ws.rs.core.Response deleteDraftIssueType(long id,
                                                      String issueType)
Remove the specified issue type mapping from the draft scheme.

Parameters:
id - the parent of the draft scheme.
issueType - the issue type to remove.
Returns:
the updated scheme or an error.

setIssueType

public javax.ws.rs.core.Response setIssueType(long id,
                                              String issueType,
                                              IssueTypeMappingBean mappingBean)
Set the issue type mapping for the passed scheme. The passed representation can have its updateDraftIfNeeded flag set to true to indicate that the draft should be created/updated when the actual scheme cannot be edited.

Parameters:
id - the id of the scheme.
issueType - the issue type being set.
mappingBean - the new mapping for the issue type.
Returns:
updated scheme or an error.

setDraftIssueType

public javax.ws.rs.core.Response setDraftIssueType(long id,
                                                   String issueType,
                                                   IssueTypeMappingBean mappingBean)
Set the issue type mapping for the passed draft scheme. The passed representation can have its updateDraftIfNeeded flag set to true to indicate that the draft should be created/updated when the actual scheme cannot be edited.

Parameters:
id - the id of the parent scheme.
issueType - the issue type being set.
mappingBean - the new mapping for the issue type.
Returns:
updated scheme or an error.

getDefault

public javax.ws.rs.core.Response getDefault(long id,
                                            boolean returnDraftIfExists)
Return the default workflow from the passed workflow scheme.

Parameters:
id - the id of the scheme.
returnDraftIfExists - when true indicates that a scheme's draft, if it exists, should be queried instead of the scheme itself.
Returns:
the default workflow or an error.

getDraftDefault

public javax.ws.rs.core.Response getDraftDefault(long id)
Return the default workflow from the passed draft workflow scheme to the caller.

Parameters:
id - the id of the parent scheme.
Returns:
the default workflow or an error.

deleteDefault

public javax.ws.rs.core.Response deleteDefault(long id,
                                               boolean updateDraftIfNeeded)
Remove the default workflow from the passed workflow scheme.

Parameters:
id - the id of the scheme.
updateDraftIfNeeded - when true will create and return a draft when the workflow scheme cannot be edited (e.g. when it is being used by a project).
Returns:
the updated scheme or an error.

deleteDraftDefault

public javax.ws.rs.core.Response deleteDraftDefault(long id)
Remove the default workflow from the passed draft workflow scheme.

Parameters:
id - the id of the parent scheme.
Returns:
the updated scheme or an error.

updateDefault

public javax.ws.rs.core.Response updateDefault(long id,
                                               DefaultBean bean)
Set the default workflow for the passed workflow scheme. The passed representation can have its updateDraftIfNeeded flag set to true to indicate that the draft should be created/updated when the actual scheme cannot be edited.

Parameters:
id - the id of the scheme.
bean - the new default.
Returns:
the updated scheme or an error.

updateDraftDefault

public javax.ws.rs.core.Response updateDraftDefault(long id,
                                                    DefaultBean bean)
Set the default workflow for the passed draft workflow scheme.

Parameters:
id - the id of the parent scheme.
bean - the new default.
Returns:
the updated scheme or an error.


Copyright © 2002-2014 Atlassian. All Rights Reserved.