@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 |
---|---|
void |
flushCaches()
Flush all caches of this persister.
|
List<JiraContextNode> |
getAllContextsForConfigScheme(FieldConfigScheme fieldConfigScheme) |
List<JiraContextNode> |
getAllContextsForCustomField(String key) |
Long |
getRelevantConfigSchemeId(IssueContext issueContext,
String fieldId) |
Long |
getRelevantConfigSchemeId(Project project,
String fieldId,
boolean lookUpParentContexts) |
void |
onClearCache(ClearCacheEvent clearCacheEvent)
Clears this CachingFieldConfigContextPersister's cache upon receiving a ClearCacheEvent.
|
void |
remove(com.atlassian.bandana.BandanaContext context)
Remove the storage of data associated with this context
|
void |
remove(com.atlassian.bandana.BandanaContext context,
String customField)
Remove the storage of data associated with this context, under the key
|
void |
removeContextsForConfigScheme(FieldConfigScheme fieldConfigScheme) |
void |
removeContextsForConfigScheme(Long fieldConfigSchemeId)
Remove contexts for a scheme
|
void |
removeContextsForProject(org.ofbiz.core.entity.GenericValue project) |
void |
removeContextsForProject(Project project) |
void |
removeContextsForProjectCategory(ProjectCategory projectCategory) |
Object |
retrieve(com.atlassian.bandana.BandanaContext context,
String key)
Retrieve a value by it's context/key tuple.
|
void |
start()
Registers this CachingFieldConfigContextPersister's cache in the JIRA instrumentation.
|
void |
store(com.atlassian.bandana.BandanaContext context,
String customField,
Object fieldConfigScheme)
Store a context/key/value triplet.
|
void |
store(Collection<? extends com.atlassian.bandana.BandanaContext> contexts,
String customField,
Object fieldConfigScheme)
Bulk store context/key/value triplets.
|
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> getAllContextsForCustomField(String key)
getAllContextsForCustomField
in interface FieldConfigContextPersister
public List<JiraContextNode> getAllContextsForConfigScheme(FieldConfigScheme fieldConfigScheme)
getAllContextsForConfigScheme
in interface FieldConfigContextPersister
public void removeContextsForConfigScheme(@Nonnull FieldConfigScheme fieldConfigScheme)
removeContextsForConfigScheme
in interface FieldConfigContextPersister
public void removeContextsForConfigScheme(Long fieldConfigSchemeId)
FieldConfigContextPersister
removeContextsForConfigScheme
in interface FieldConfigContextPersister
fieldConfigSchemeId
- ID of scheme to remove.public void removeContextsForProject(org.ofbiz.core.entity.GenericValue project)
removeContextsForProject
in interface FieldConfigContextPersister
project
- the projectpublic void removeContextsForProject(Project project)
removeContextsForProject
in interface FieldConfigContextPersister
public void removeContextsForProjectCategory(ProjectCategory projectCategory)
removeContextsForProjectCategory
in interface FieldConfigContextPersister
@Nullable public Long getRelevantConfigSchemeId(@Nonnull IssueContext issueContext, @Nonnull String fieldId)
getRelevantConfigSchemeId
in interface FieldConfigContextPersister
@Nullable public Long getRelevantConfigSchemeId(Project project, @Nonnull String fieldId, boolean lookUpParentContexts)
getRelevantConfigSchemeId
in interface FieldConfigContextPersister
public Object retrieve(com.atlassian.bandana.BandanaContext context, String key)
FieldConfigContextPersister
Method definition pulled up from BandanaPersister
retrieve
in interface com.atlassian.bandana.BandanaPersister
retrieve
in interface FieldConfigContextPersister
public void store(com.atlassian.bandana.BandanaContext context, String customField, Object fieldConfigScheme)
FieldConfigContextPersister
Method definition pulled up from BandanaPersister
store
in interface com.atlassian.bandana.BandanaPersister
store
in interface FieldConfigContextPersister
public void store(String fieldId, JiraContextNode contextNode, FieldConfigScheme fieldConfigScheme)
FieldConfigContextPersister
store
in interface FieldConfigContextPersister
public void store(Collection<? extends com.atlassian.bandana.BandanaContext> contexts, String customField, Object fieldConfigScheme)
FieldConfigContextPersister
store
in interface FieldConfigContextPersister
public void store(String fieldId, Collection<? extends JiraContextNode> contextNodes, FieldConfigScheme fieldConfigScheme)
FieldConfigContextPersister
store
in interface FieldConfigContextPersister
public void flushCaches()
FieldConfigContextPersister
Method definition pulled up from BandanaPersister
flushCaches
in interface com.atlassian.bandana.BandanaPersister
flushCaches
in interface FieldConfigContextPersister
public void remove(com.atlassian.bandana.BandanaContext context)
FieldConfigContextPersister
Method definition pulled up from BandanaPersister
remove
in interface com.atlassian.bandana.BandanaPersister
remove
in interface FieldConfigContextPersister
public void remove(com.atlassian.bandana.BandanaContext context, String customField)
FieldConfigContextPersister
Method definition pulled up from BandanaPersister
remove
in interface com.atlassian.bandana.BandanaPersister
remove
in interface FieldConfigContextPersister
Copyright © 2002-2015 Atlassian. All Rights Reserved.