Class CachingFieldConfigContextPersister
java.lang.Object
com.atlassian.jira.issue.context.persistence.CachingFieldConfigContextPersister
- All Implemented Interfaces:
Startable
,FieldConfigContextPersister
@Internal
public class CachingFieldConfigContextPersister
extends Object
implements FieldConfigContextPersister, Startable
Caching decorator for
FieldConfigContextPersister
. This corresponds to the configurationcontext
table, which is essentially an association table between CustomField
and either a ProjectCategory
or a Project
, but not both (in practice it is always a
Project). Each association also has FieldConfigScheme
as a property of the association, and this is where
things like default values for custom fields are ultimately stored. When both the project and projectCategory are
null, then that database row is in fact a special row holding the FieldConfigScheme for the "Global Context".
See CustomField Configuration - DB Entity Model for a more in-depth explanation of how this all works.
- Since:
- v5.1
-
Constructor Summary
ConstructorsConstructorDescriptionCachingFieldConfigContextPersister
(OfBizDelegator delegator, ProjectManager projectManager, com.atlassian.cache.CacheManager cacheManager, TransactionSupport transactionSupport, com.atlassian.event.api.EventPublisher eventPublisher) Creates a new CachingFieldConfigContextPersister that wraps a new FieldConfigContextPersisterImpl instance. -
Method Summary
Modifier and TypeMethodDescriptioncom.atlassian.jira.issue.context.persistence.CachingFieldConfigContextPersister.IssueTypeSet
configSchemeIssueTypeLoader
(Long schemeId) getAllContextsForConfigScheme
(FieldConfigScheme fieldConfigScheme) getRelevantConfigSchemeId
(IssueContext issueContext, String fieldId) getRelevantConfigSchemeId
(Long projectId, String fieldId) void
onClearCache
(ClearCacheEvent clearCacheEvent) Clears this CachingFieldConfigContextPersister's cache upon receiving a ClearCacheEvent.void
removeContexts
(String fieldId, Collection<? extends JiraContextNode> contextNodes) Bulk remove a collection of contextNode for a given fieldIdvoid
removeContextsForConfigScheme
(FieldConfigScheme fieldConfigScheme) void
removeContextsForProject
(Project project) void
start()
Registers this CachingFieldConfigContextPersister's cache in the JIRA instrumentation.void
store
(String fieldId, JiraContextNode contextNode, FieldConfigScheme fieldConfigScheme) Store a fieldId/contextNode/scheme triplet.void
store
(String fieldId, Collection<? extends JiraContextNode> contextNodes, FieldConfigScheme fieldConfigScheme) Bulk store fieldId/contextNode/scheme triplets.
-
Constructor Details
-
CachingFieldConfigContextPersister
public CachingFieldConfigContextPersister(OfBizDelegator delegator, ProjectManager projectManager, com.atlassian.cache.CacheManager cacheManager, TransactionSupport transactionSupport, com.atlassian.event.api.EventPublisher eventPublisher) Creates a new CachingFieldConfigContextPersister that wraps a new FieldConfigContextPersisterImpl instance.- Parameters:
delegator
- the OfBizDelegatorprojectManager
- the ProjectManagereventPublisher
- is used to rise that config scheme was updated
-
-
Method Details
-
start
Registers this CachingFieldConfigContextPersister's cache in the JIRA instrumentation. -
onClearCache
Clears this CachingFieldConfigContextPersister's cache upon receiving a ClearCacheEvent.- Parameters:
clearCacheEvent
- a ClearCacheEvent
-
getAllContextsForConfigScheme
- Specified by:
getAllContextsForConfigScheme
in interfaceFieldConfigContextPersister
-
removeContextsForConfigScheme
- Specified by:
removeContextsForConfigScheme
in interfaceFieldConfigContextPersister
-
removeContextsForProject
- Specified by:
removeContextsForProject
in interfaceFieldConfigContextPersister
-
removeContexts
Description copied from interface:FieldConfigContextPersister
Bulk remove a collection of contextNode for a given fieldId- Specified by:
removeContexts
in interfaceFieldConfigContextPersister
-
getRelevantConfigSchemeId
@Nullable public Long getRelevantConfigSchemeId(@Nonnull IssueContext issueContext, @Nonnull String fieldId) - Specified by:
getRelevantConfigSchemeId
in interfaceFieldConfigContextPersister
-
getRelevantConfigSchemeId
- Specified by:
getRelevantConfigSchemeId
in interfaceFieldConfigContextPersister
-
store
Description copied from interface:FieldConfigContextPersister
Store a fieldId/contextNode/scheme triplet.- Specified by:
store
in interfaceFieldConfigContextPersister
-
store
public void store(String fieldId, Collection<? extends JiraContextNode> contextNodes, FieldConfigScheme fieldConfigScheme) Description copied from interface:FieldConfigContextPersister
Bulk store fieldId/contextNode/scheme triplets.- Specified by:
store
in interfaceFieldConfigContextPersister
-
configSchemeIssueTypeLoader
@Nonnull public com.atlassian.jira.issue.context.persistence.CachingFieldConfigContextPersister.IssueTypeSet configSchemeIssueTypeLoader(Long schemeId)
-