Class CachingFieldConfigContextPersister
java.lang.Object
com.atlassian.jira.issue.context.persistence.CachingFieldConfigContextPersister
- All Implemented Interfaces:
Startable,InitializingComponent,FieldConfigContextPersister
@Internal
public class CachingFieldConfigContextPersister
extends Object
implements FieldConfigContextPersister, Startable, InitializingComponent
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 TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.com.atlassian.jira.issue.context.persistence.CachingFieldConfigContextPersister.IssueTypeSetconfigSchemeIssueTypeLoader(Long schemeId) getAllContextsForConfigScheme(FieldConfigScheme fieldConfigScheme) getRelevantConfigSchemeId(IssueContext issueContext, String fieldId) getRelevantConfigSchemeId(Long projectId, String fieldId) voidonClearCache(ClearCacheEvent clearCacheEvent) Clears this CachingFieldConfigContextPersister's cache upon receiving a ClearCacheEvent.voidremoveContexts(String fieldId, Collection<? extends JiraContextNode> contextNodes) Bulk remove a collection of contextNode for a given fieldIdvoidremoveContextsForConfigScheme(FieldConfigScheme fieldConfigScheme) voidremoveContextsForProject(Project project) voidstart()Registers this CachingFieldConfigContextPersister's cache in the JIRA instrumentation.voidstore(String fieldId, JiraContextNode contextNode, FieldConfigScheme fieldConfigScheme) Store a fieldId/contextNode/scheme triplet.voidstore(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
-
afterInstantiation
Description copied from interface:InitializingComponentCalled after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
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:
getAllContextsForConfigSchemein interfaceFieldConfigContextPersister
-
removeContextsForConfigScheme
- Specified by:
removeContextsForConfigSchemein interfaceFieldConfigContextPersister
-
removeContextsForProject
- Specified by:
removeContextsForProjectin interfaceFieldConfigContextPersister
-
removeContexts
Description copied from interface:FieldConfigContextPersisterBulk remove a collection of contextNode for a given fieldId- Specified by:
removeContextsin interfaceFieldConfigContextPersister
-
getRelevantConfigSchemeId
@Nullable public Long getRelevantConfigSchemeId(@Nonnull IssueContext issueContext, @Nonnull String fieldId) - Specified by:
getRelevantConfigSchemeIdin interfaceFieldConfigContextPersister
-
getRelevantConfigSchemeId
- Specified by:
getRelevantConfigSchemeIdin interfaceFieldConfigContextPersister
-
store
Description copied from interface:FieldConfigContextPersisterStore a fieldId/contextNode/scheme triplet.- Specified by:
storein interfaceFieldConfigContextPersister
-
store
public void store(String fieldId, Collection<? extends JiraContextNode> contextNodes, FieldConfigScheme fieldConfigScheme) Description copied from interface:FieldConfigContextPersisterBulk store fieldId/contextNode/scheme triplets.- Specified by:
storein interfaceFieldConfigContextPersister
-
configSchemeIssueTypeLoader
@Nonnull public com.atlassian.jira.issue.context.persistence.CachingFieldConfigContextPersister.IssueTypeSet configSchemeIssueTypeLoader(Long schemeId)
-