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, removeIfExist
public CachedFieldConfigSchemePersister(OfBizDelegator delegator, QueryDslAccessor queryDslAccessor, ConstantsManager constantsManager, FieldConfigPersister fieldConfigPersister, FieldConfigContextPersister fieldContextPersister, FieldConfigManager fieldConfigManager, com.atlassian.cache.CacheManager cacheManager)
public void init()
init
in interface FieldConfigSchemePersister
init
in class FieldConfigSchemePersisterImpl
@EventListener public void onClearCache(ClearCacheEvent event)
@EventListener public void onSchemeContextUpdated(FieldConfigSchemeContextUpdated fieldConfigSchemeContextUpdated)
@Nullable public FieldConfigScheme getFieldConfigScheme(Long configSchemeId)
getFieldConfigScheme
in interface FieldConfigSchemePersister
getFieldConfigScheme
in class FieldConfigSchemePersisterImpl
@Nullable public List<FieldConfigScheme> getConfigSchemesForCustomField(ConfigurableField field)
getConfigSchemesForCustomField
in interface FieldConfigSchemePersister
getConfigSchemesForCustomField
in class FieldConfigSchemePersisterImpl
@Nullable public FieldConfigScheme getConfigSchemeForFieldConfig(FieldConfig fieldConfig)
FieldConfigSchemePersister
FieldConfigScheme
that contains
the FieldConfig
getConfigSchemeForFieldConfig
in interface FieldConfigSchemePersister
getConfigSchemeForFieldConfig
in class FieldConfigSchemePersisterImpl
fieldConfig
- the config to find the containing FieldConfigScheme
of; cannot be null.FieldConfig
. Not Null.public FieldConfigScheme create(FieldConfigScheme configScheme, ConfigurableField field)
create
in interface FieldConfigSchemePersister
create
in class FieldConfigSchemePersisterImpl
public FieldConfigScheme update(FieldConfigScheme configScheme)
update
in interface FieldConfigSchemePersister
update
in class FieldConfigSchemePersisterImpl
protected void removeRelatedConfigsForUpdate(@Nonnull FieldConfigScheme configScheme, @Nonnull org.ofbiz.core.entity.GenericValue gv) throws org.ofbiz.core.entity.GenericEntityException
removeRelatedConfigsForUpdate
in class FieldConfigSchemePersisterImpl
org.ofbiz.core.entity.GenericEntityException
public void remove(Long fieldConfigSchemeId)
remove
in interface FieldConfigSchemePersister
remove
in class FieldConfigSchemePersisterImpl
public void removeByIssueType(IssueType issueType)
FieldConfigSchemePersister
FieldConfigScheme
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 FieldConfigSchemePersister
removeByIssueType
in class FieldConfigSchemePersisterImpl
issueType
- the issue type to remove the associations forCopyright © 2002-2019 Atlassian. All Rights Reserved.