Package com.atlassian.jira.workflow
Class CachingDraftWorkflowStore
java.lang.Object
com.atlassian.jira.workflow.CachingDraftWorkflowStore
- All Implemented Interfaces:
InitializingComponent,DraftWorkflowStore
public class CachingDraftWorkflowStore
extends Object
implements DraftWorkflowStore, InitializingComponent
Provides a caching implementation of the
DraftWorkflowStore.- Since:
- v3.13
-
Constructor Summary
ConstructorsConstructorDescriptionCachingDraftWorkflowStore(DraftWorkflowStore delegate, com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.createDraftWorkflow(ApplicationUser author, JiraWorkflow parentWorkflow) Creates a temporary workflow linked back to the named active workflow by id.booleandeleteDraftWorkflow(String parentWorkflowName) Removes a temporary workflow linked to the workflow name.getDraftWorkflow(String parentWorkflowName) This will retrieve an draft workflow that is related to the named saved workflow.voidonClearCache(ClearCacheEvent event) updateDraftWorkflow(ApplicationUser user, String parentWorkflowName, JiraWorkflow workflow) Updates a temporary workflow with the one provided for the parent workflow name passed in.updateDraftWorkflowWithoutAudit(String parentWorkflowName, JiraWorkflow workflow) Updates a temporary workflow with the one provided for the parent workflow name passed in.
-
Constructor Details
-
CachingDraftWorkflowStore
public CachingDraftWorkflowStore(DraftWorkflowStore delegate, com.atlassian.cache.CacheManager cacheManager)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
onClearCache
-
getDraftWorkflow
Description copied from interface:DraftWorkflowStoreThis 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:
getDraftWorkflowin interfaceDraftWorkflowStore- 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(ApplicationUser author, JiraWorkflow parentWorkflow) throws DataAccessException, IllegalStateException, IllegalArgumentException Description copied from interface:DraftWorkflowStoreCreates 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:
createDraftWorkflowin interfaceDraftWorkflowStore- Parameters:
author- The user making the editparentWorkflow- 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 errorsIllegalStateException- thrown if you are adding an draft workflow which already exists for the provided parent workflowIllegalArgumentException- If the username is null
-
deleteDraftWorkflow
public boolean deleteDraftWorkflow(String parentWorkflowName) throws DataAccessException, IllegalArgumentException Description copied from interface:DraftWorkflowStoreRemoves a temporary workflow linked to the workflow name.- Specified by:
deleteDraftWorkflowin interfaceDraftWorkflowStore- Parameters:
parentWorkflowName- of the saved parent workflow.- Returns:
- True if deleted successfully
- Throws:
DataAccessException- RuntimeException wrapper around a DB Exception.IllegalArgumentException
-
updateDraftWorkflow
public JiraWorkflow updateDraftWorkflow(ApplicationUser user, String parentWorkflowName, JiraWorkflow workflow) throws DataAccessException Description copied from interface:DraftWorkflowStoreUpdates 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:
updateDraftWorkflowin interfaceDraftWorkflowStore- Parameters:
user- is the user updating this draft workflow.parentWorkflowName- of the saved parent workflow.workflow- TheJiraWorkflowto 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.
-
updateDraftWorkflowWithoutAudit
public JiraWorkflow updateDraftWorkflowWithoutAudit(String parentWorkflowName, JiraWorkflow workflow) throws DataAccessException Description copied from interface:DraftWorkflowStoreUpdates 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(ApplicationUser, String, JiraWorkflow)instead.- Specified by:
updateDraftWorkflowWithoutAuditin interfaceDraftWorkflowStore- Parameters:
parentWorkflowName- of the saved parent workflow.workflow- TheJiraWorkflowto 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.
-