com.atlassian.jira.workflow
Class OfBizDraftWorkflowStore

java.lang.Object
  extended by com.atlassian.jira.workflow.OfBizDraftWorkflowStore
All Implemented Interfaces:
DraftWorkflowStore

public class OfBizDraftWorkflowStore
extends java.lang.Object
implements DraftWorkflowStore


Field Summary
static java.lang.String DESCRIPTOR_ENTITY_FIELD
           
static java.lang.String DRAFT_WORKFLOW_ENTITY_NAME
           
static java.lang.String PARENTNAME_ENTITY_FIELD
           
 
Constructor Summary
OfBizDraftWorkflowStore(OfBizDelegator ofBizDelegator)
           
 
Method Summary
 JiraWorkflow createDraftWorkflow(java.lang.String authorName, JiraWorkflow parentWorkflow)
          Creates a temporary workflow linked back to the named active workflow by id.
 boolean deleteDraftWorkflow(java.lang.String parentWorkflowName)
          Removes a temporary workflow linked to the workflow name.
 JiraWorkflow getDraftWorkflow(java.lang.String parentWorkflowName)
          This will retrieve an draft workflow that is related to the named saved workflow.
 JiraWorkflow updateDraftWorkflow(java.lang.String username, java.lang.String parentWorkflowName, JiraWorkflow workflow)
          Updates a temporary workflow with the one provided for the parent workflow name passed in.
 JiraWorkflow updateDraftWorkflowWithoutAudit(java.lang.String parentWorkflowName, JiraWorkflow workflow)
          Updates a temporary workflow with the one provided for the parent workflow name passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DRAFT_WORKFLOW_ENTITY_NAME

public static final java.lang.String DRAFT_WORKFLOW_ENTITY_NAME
See Also:
Constant Field Values

PARENTNAME_ENTITY_FIELD

public static final java.lang.String PARENTNAME_ENTITY_FIELD
See Also:
Constant Field Values

DESCRIPTOR_ENTITY_FIELD

public static final java.lang.String DESCRIPTOR_ENTITY_FIELD
See Also:
Constant Field Values
Constructor Detail

OfBizDraftWorkflowStore

public OfBizDraftWorkflowStore(OfBizDelegator ofBizDelegator)
Method Detail

getDraftWorkflow

public JiraWorkflow getDraftWorkflow(java.lang.String parentWorkflowName)
                              throws DataAccessException
Description copied from interface: DraftWorkflowStore
This will retrieve an draft workflow that is related to the named saved workflow. If an draft workflow is not associated with the passed in name this will return null.

Specified by:
getDraftWorkflow in interface DraftWorkflowStore
Parameters:
parentWorkflowName - of the saved parent workflow.
Returns:
workflow that represents the draft "copy" of the named active workflow. This will be of type JiraDraftWorkflow.
Throws:
DataAccessException - DataAccessException

createDraftWorkflow

public JiraWorkflow createDraftWorkflow(java.lang.String authorName,
                                        JiraWorkflow parentWorkflow)
                                 throws DataAccessException,
                                        java.lang.IllegalStateException,
                                        java.lang.IllegalArgumentException
Description copied from interface: DraftWorkflowStore
Creates a temporary workflow linked back to the named active workflow by id. If a temporary workflow already exists, this method will throw an exception.

Specified by:
createDraftWorkflow in interface DraftWorkflowStore
Parameters:
authorName - The username of the user making the edit
parentWorkflow - The parent workflow to copy for the draft workflow.
Returns:
workflow that represents the draft "copy" of the named active workflow. This will be of type JiraDraftWorkflow.
Throws:
DataAccessException - if there are any db errors
java.lang.IllegalStateException - thrown if you are adding an draft workflow which already exists for the provided parent workflow
java.lang.IllegalArgumentException - If the username is null

deleteDraftWorkflow

public boolean deleteDraftWorkflow(java.lang.String parentWorkflowName)
                            throws DataAccessException
Description copied from interface: DraftWorkflowStore
Removes a temporary workflow linked to the workflow name.

Specified by:
deleteDraftWorkflow in interface DraftWorkflowStore
Parameters:
parentWorkflowName - of the saved parent workflow.
Returns:
True if deleted successfully
Throws:
DataAccessException - RuntimeException wrapper around a DB Exception.

updateDraftWorkflowWithoutAudit

public JiraWorkflow updateDraftWorkflowWithoutAudit(java.lang.String parentWorkflowName,
                                                    JiraWorkflow workflow)
                                             throws DataAccessException
Description copied from interface: DraftWorkflowStore
Updates a temporary workflow with the one provided for the parent workflow name passed in. Throws an exception, if no temporary workflow exists for the one being updated. This will not update the draft author or the draft date. This method should only be used by upgrade tasks. Use DraftWorkflowStore.updateDraftWorkflow(String, String, JiraWorkflow) instead.

Specified by:
updateDraftWorkflowWithoutAudit in interface DraftWorkflowStore
Parameters:
parentWorkflowName - of the saved parent workflow.
workflow - The JiraWorkflow to use for the update.
Returns:
workflow that represents the draft "copy" of the named active workflow. This will be of type JiraDraftWorkflow.
Throws:
DataAccessException - RuntimeException wrapper around a DB Exception.

updateDraftWorkflow

public JiraWorkflow updateDraftWorkflow(java.lang.String username,
                                        java.lang.String parentWorkflowName,
                                        JiraWorkflow workflow)
                                 throws DataAccessException
Description copied from interface: DraftWorkflowStore
Updates a temporary workflow with the one provided for the parent workflow name passed in. Throws an exception, if no temporary workflow exists for the one being updated.

Specified by:
updateDraftWorkflow in interface DraftWorkflowStore
Parameters:
username - is the username of the user updating this draft workflow.
parentWorkflowName - of the saved parent workflow.
workflow - The JiraWorkflow to use for the update.
Returns:
workflow that represents the draft "copy" of the named active workflow. This will be of type JiraDraftWorkflow.
Throws:
DataAccessException - RuntimeException wrapper around a DB Exception.


Copyright © 2002-2011 Atlassian. All Rights Reserved.