@Internal public class CachingFieldConfigContextPersister extends Object implements FieldConfigContextPersister, Startable
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.
Constructor and Description |
---|
CachingFieldConfigContextPersister(OfBizDelegator delegator,
ProjectManager projectManager,
com.atlassian.cache.CacheManager cacheManager)
Creates a new CachingFieldConfigContextPersister that wraps a new FieldConfigContextPersisterImpl instance.
|
Modifier and Type | Method and Description |
---|---|
com.atlassian.jira.issue.context.persistence.CachingFieldConfigContextPersister.IssueTypeSet |
configSchemeIssueTypeLoader(Long schemeId) |
List<JiraContextNode> |
getAllContextsForConfigScheme(FieldConfigScheme fieldConfigScheme) |
Long |
getRelevantConfigSchemeId(IssueContext issueContext,
String fieldId) |
Long |
getRelevantConfigSchemeId(Long projectId,
String fieldId) |
void |
onClearCache(ClearCacheEvent clearCacheEvent)
Clears this CachingFieldConfigContextPersister's cache upon receiving a ClearCacheEvent.
|
void |
removeContextsForConfigScheme(FieldConfigScheme fieldConfigScheme) |
void |
removeContextsForProject(Project project) |
void |
start()
Registers this CachingFieldConfigContextPersister's cache in the JIRA instrumentation.
|
void |
store(String fieldId,
Collection<? extends JiraContextNode> contextNodes,
FieldConfigScheme fieldConfigScheme)
Bulk store fieldId/contextNode/scheme triplets.
|
void |
store(String fieldId,
JiraContextNode contextNode,
FieldConfigScheme fieldConfigScheme)
Store a fieldId/contextNode/scheme triplet.
|
public CachingFieldConfigContextPersister(OfBizDelegator delegator, ProjectManager projectManager, com.atlassian.cache.CacheManager cacheManager)
delegator
- the OfBizDelegatorprojectManager
- the ProjectManagerpublic void start() throws Exception
@EventListener public void onClearCache(ClearCacheEvent clearCacheEvent)
clearCacheEvent
- a ClearCacheEventpublic List<JiraContextNode> getAllContextsForConfigScheme(FieldConfigScheme fieldConfigScheme)
getAllContextsForConfigScheme
in interface FieldConfigContextPersister
public void removeContextsForConfigScheme(@Nonnull FieldConfigScheme fieldConfigScheme)
removeContextsForConfigScheme
in interface FieldConfigContextPersister
public void removeContextsForProject(Project project)
removeContextsForProject
in interface FieldConfigContextPersister
@Nullable public Long getRelevantConfigSchemeId(@Nonnull IssueContext issueContext, @Nonnull String fieldId)
getRelevantConfigSchemeId
in interface FieldConfigContextPersister
@Nullable public Long getRelevantConfigSchemeId(@Nullable Long projectId, @Nonnull String fieldId)
getRelevantConfigSchemeId
in interface FieldConfigContextPersister
public void store(String fieldId, JiraContextNode contextNode, FieldConfigScheme fieldConfigScheme)
FieldConfigContextPersister
store
in interface FieldConfigContextPersister
public void store(String fieldId, Collection<? extends JiraContextNode> contextNodes, FieldConfigScheme fieldConfigScheme)
FieldConfigContextPersister
store
in interface FieldConfigContextPersister
Copyright © 2002-2017 Atlassian. All Rights Reserved.