public class CachingWorkflowDescriptorStore extends Object implements WorkflowDescriptorStore
ImmutableWorkflowDescriptors.
These objects are very heavy weight and ideally we would not cache them, but it is the only way to
quickly give JIRA access to workflow objects. This is because the safe thing to cache is the workflow XML string but
converting this to an object graph will be expensive. Also please note that the implementation of
ImmutableWorkflowDescriptor cannot guarantee 100% immutability.
This is essentially replacing the store in the JiraWorkflowFactory, but it adds
some more concurrency controls to ensure consistency with the underlying store (such as the
OfBizWorkflowDescriptorStore)
| Constructor and Description |
|---|
CachingWorkflowDescriptorStore(WorkflowDescriptorStore delegate,
com.atlassian.cache.CacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
List<JiraWorkflowDTO> |
getAllJiraWorkflowDTOs()
Returns a list of all the workflows stored in the underlying store.
|
ImmutableWorkflowDescriptor |
getWorkflow(String name)
Retrieves a
WorkflowDescriptor from the underlying store. |
String[] |
getWorkflowNames()
Returns an array of all the workflowNames stored.
|
void |
onClearCache(ClearCacheEvent event) |
void |
onWorkflowDescriptorXmlUpdatedEvent(WorkflowDescriptorXmlUpdatedEvent event) |
boolean |
removeWorkflow(String name)
Removes a workflow from the underlying store.
|
boolean |
saveWorkflow(String name,
com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor,
boolean replace)
Saves or updates a workflowDescriptor.
|
public CachingWorkflowDescriptorStore(WorkflowDescriptorStore delegate, com.atlassian.cache.CacheManager cacheManager)
@EventListener public void onClearCache(ClearCacheEvent event)
@EventListener public void onWorkflowDescriptorXmlUpdatedEvent(WorkflowDescriptorXmlUpdatedEvent event)
public ImmutableWorkflowDescriptor getWorkflow(@Nonnull String name) throws com.opensymphony.workflow.FactoryException
WorkflowDescriptorStoreWorkflowDescriptor from the underlying store. Returns
null if no WorkflowDescriptor can be foundgetWorkflow in interface WorkflowDescriptorStorename - The workflow namecom.opensymphony.workflow.FactoryException - If there's an error constructing the WorkflowDescriptor from its underlying representationpublic boolean removeWorkflow(@Nonnull String name)
WorkflowDescriptorStoreremoveWorkflow in interface WorkflowDescriptorStorename - The workflow namepublic boolean saveWorkflow(@Nonnull String name, @Nonnull com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, boolean replace) throws DataAccessException
WorkflowDescriptorStoresaveWorkflow in interface WorkflowDescriptorStorename - The name of the workflowworkflowDescriptor - The WorkflowDescriptor to save/update in the underlying storereplace - true if an update should be done, if the workflow already exists, false otherwiseDataAccessException - If there was a problem, storing the workflowdescriptorpublic String[] getWorkflowNames()
WorkflowDescriptorStoregetWorkflowNames in interface WorkflowDescriptorStorepublic List<JiraWorkflowDTO> getAllJiraWorkflowDTOs()
WorkflowDescriptorStoregetAllJiraWorkflowDTOs in interface WorkflowDescriptorStoreJiraWorkflowDTOsCopyright © 2002-2024 Atlassian. All Rights Reserved.