|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.workflow.CachingDraftWorkflowStore
public class CachingDraftWorkflowStore
Provides a caching implementation of the DraftWorkflowStore
. This
implementation ensures cache consistency by using a ConcurrentMap
for the store, and a ReentrantReadWriteLock
to ensure
that any updates of the database (and cache) are atomic. The lock is a ReadWriteLock, to speed up performance for
gets which will be the most common operation.
Constructor Summary | |
---|---|
CachingDraftWorkflowStore(DraftWorkflowStore delegate,
com.atlassian.event.api.EventPublisher eventPublisher)
|
Method Summary | |
---|---|
JiraWorkflow |
createDraftWorkflow(String authorName,
JiraWorkflow parentWorkflow)
Creates a temporary workflow linked back to the named active workflow by id. |
boolean |
deleteDraftWorkflow(String parentWorkflowName)
Removes a temporary workflow linked to the workflow name. |
JiraWorkflow |
getDraftWorkflow(String parentWorkflowName)
This will retrieve an draft workflow that is related to the named saved workflow. |
void |
onClearCache(ClearCacheEvent event)
|
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
JiraWorkflow |
updateDraftWorkflow(String username,
String parentWorkflowName,
JiraWorkflow workflow)
Updates a temporary workflow with the one provided for the parent workflow name passed in. |
JiraWorkflow |
updateDraftWorkflowWithoutAudit(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 |
Constructor Detail |
---|
public CachingDraftWorkflowStore(DraftWorkflowStore delegate, com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail |
---|
public void start() throws Exception
Startable
start
in interface Startable
Exception
- Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public JiraWorkflow getDraftWorkflow(String parentWorkflowName) throws DataAccessException
DraftWorkflowStore
getDraftWorkflow
in interface DraftWorkflowStore
parentWorkflowName
- of the saved parent workflow.
JiraDraftWorkflow
.
DataAccessException
- DataAccessExceptionpublic JiraWorkflow createDraftWorkflow(String authorName, JiraWorkflow parentWorkflow) throws DataAccessException, IllegalStateException, IllegalArgumentException
DraftWorkflowStore
createDraftWorkflow
in interface DraftWorkflowStore
authorName
- The username of the user making the editparentWorkflow
- The parent workflow to copy for the draft workflow.
JiraDraftWorkflow
.
DataAccessException
- if there are any db errors
IllegalStateException
- thrown if you are adding an draft workflow which already exists for the
provided parent workflow
IllegalArgumentException
- If the username is nullpublic boolean deleteDraftWorkflow(String parentWorkflowName) throws DataAccessException, IllegalArgumentException
DraftWorkflowStore
deleteDraftWorkflow
in interface DraftWorkflowStore
parentWorkflowName
- of the saved parent workflow.
DataAccessException
- RuntimeException wrapper around a DB Exception.
IllegalArgumentException
public JiraWorkflow updateDraftWorkflow(String username, String parentWorkflowName, JiraWorkflow workflow) throws DataAccessException
DraftWorkflowStore
updateDraftWorkflow
in interface DraftWorkflowStore
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.
JiraDraftWorkflow
.
DataAccessException
- RuntimeException wrapper around a DB Exception.public JiraWorkflow updateDraftWorkflowWithoutAudit(String parentWorkflowName, JiraWorkflow workflow) throws DataAccessException
DraftWorkflowStore
DraftWorkflowStore.updateDraftWorkflow(String, String, JiraWorkflow)
instead.
updateDraftWorkflowWithoutAudit
in interface DraftWorkflowStore
parentWorkflowName
- of the saved parent workflow.workflow
- The JiraWorkflow
to use for the update.
JiraDraftWorkflow
.
DataAccessException
- RuntimeException wrapper around a DB Exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |