public class CachedFieldConfigSchemePersister extends FieldConfigSchemePersisterImpl
NOTE : you may be wondering about the cache invalidation strategy on this cache. Will the top level classes
that use this cache such as com.atlassian.jira.issue.CustomFieldManager@refreshCache call init()
and this clears the cache.
TODO: This probably should be rewritten so that the upper lays of code are not responsible for clearing the lower level caches and also the "cache inheritance" pattern should be removed.
ENTITY_CONFIG_ID, ENTITY_DESCRIPTION, ENTITY_FIELD, ENTITY_ID, ENTITY_ISSUE_TYPE, ENTITY_NAME, ENTITY_RELATED_TABLE_NAME, ENTITY_SCHEME_ID, ENTITY_TABLE_NAME, FK_RELATED_CONFIGS| Constructor and Description |
|---|
CachedFieldConfigSchemePersister(OfBizDelegator delegator,
QueryDslAccessor queryDslAccessor,
ConstantsManager constantsManager,
FieldConfigPersister fieldConfigPersister,
FieldConfigContextPersister fieldContextPersister,
FieldConfigManager fieldConfigManager,
com.atlassian.cache.CacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
FieldConfigScheme |
create(FieldConfigScheme configScheme,
ConfigurableField field) |
FieldConfigScheme |
getConfigSchemeForFieldConfig(FieldConfig fieldConfig)
Finds the
FieldConfigScheme that contains
the FieldConfig |
List<FieldConfigScheme> |
getConfigSchemesForCustomField(ConfigurableField field) |
FieldConfigScheme |
getFieldConfigScheme(Long configSchemeId) |
void |
init() |
void |
onClearCache(ClearCacheEvent event) |
void |
onSchemeContextUpdated(FieldConfigSchemeContextUpdated fieldConfigSchemeContextUpdated) |
void |
remove(Long fieldConfigSchemeId) |
void |
removeByIssueType(IssueType issueType)
Removes
FieldConfigScheme associations for the given issue type. |
protected void |
removeRelatedConfigsForUpdate(FieldConfigScheme configScheme,
org.ofbiz.core.entity.GenericValue gv) |
FieldConfigScheme |
update(FieldConfigScheme configScheme) |
createWithDefaultValues, getConfigSchemeIdsForCustomFieldId, getInvalidFieldConfigSchemeAfterIssueTypeRemoval, invalidateAll, removeIfExistpublic CachedFieldConfigSchemePersister(OfBizDelegator delegator, QueryDslAccessor queryDslAccessor, ConstantsManager constantsManager, FieldConfigPersister fieldConfigPersister, FieldConfigContextPersister fieldContextPersister, FieldConfigManager fieldConfigManager, com.atlassian.cache.CacheManager cacheManager)
public void init()
init in interface FieldConfigSchemePersisterinit in class FieldConfigSchemePersisterImpl@EventListener public void onClearCache(ClearCacheEvent event)
@EventListener public void onSchemeContextUpdated(FieldConfigSchemeContextUpdated fieldConfigSchemeContextUpdated)
@Nullable public FieldConfigScheme getFieldConfigScheme(Long configSchemeId)
getFieldConfigScheme in interface FieldConfigSchemePersistergetFieldConfigScheme in class FieldConfigSchemePersisterImpl@Nullable public List<FieldConfigScheme> getConfigSchemesForCustomField(ConfigurableField field)
getConfigSchemesForCustomField in interface FieldConfigSchemePersistergetConfigSchemesForCustomField in class FieldConfigSchemePersisterImpl@Nullable public FieldConfigScheme getConfigSchemeForFieldConfig(FieldConfig fieldConfig)
FieldConfigSchemePersisterFieldConfigScheme that contains
the FieldConfiggetConfigSchemeForFieldConfig in interface FieldConfigSchemePersistergetConfigSchemeForFieldConfig in class FieldConfigSchemePersisterImplfieldConfig - the config to find the containing FieldConfigScheme of; cannot be null.FieldConfig. Not Null.public FieldConfigScheme create(FieldConfigScheme configScheme, ConfigurableField field)
create in interface FieldConfigSchemePersistercreate in class FieldConfigSchemePersisterImplpublic FieldConfigScheme update(FieldConfigScheme configScheme)
update in interface FieldConfigSchemePersisterupdate in class FieldConfigSchemePersisterImplprotected void removeRelatedConfigsForUpdate(@Nonnull FieldConfigScheme configScheme, @Nonnull org.ofbiz.core.entity.GenericValue gv) throws org.ofbiz.core.entity.GenericEntityException
removeRelatedConfigsForUpdate in class FieldConfigSchemePersisterImplorg.ofbiz.core.entity.GenericEntityExceptionpublic void remove(Long fieldConfigSchemeId)
remove in interface FieldConfigSchemePersisterremove in class FieldConfigSchemePersisterImplpublic void removeByIssueType(IssueType issueType)
FieldConfigSchemePersisterFieldConfigScheme associations for the given issue type. Please note that this method call
on it's own is NOT safe. it removes rows from a many-to-many table without considering other entities in
the many-to-many relationship. What this means is that if there's only one row left in the table, this
method may remove it, and you'll end up with orphaned values. Only use this in conjunction with
FieldConfigSchemePersister.getInvalidFieldConfigSchemeAfterIssueTypeRemoval(com.atlassian.jira.issue.issuetype.IssueType).
Also see FieldConfigSchemeManagerImpl.removeInvalidFieldConfigSchemesForIssueType(com.atlassian.jira.issue.issuetype.IssueType)
for correct usage.
removeByIssueType in interface FieldConfigSchemePersisterremoveByIssueType in class FieldConfigSchemePersisterImplissueType - the issue type to remove the associations forCopyright © 2002-2017 Atlassian. All Rights Reserved.