Class AbstractDefaultCustomFieldProvider
java.lang.Object
com.atlassian.greenhopper.manager.issue.fields.AbstractDefaultCustomFieldProvider
- All Implemented Interfaces:
DefaultCustomFieldProvider
- Direct Known Subclasses:
BusinessValueCustomFieldProvider,ClassicEpicLabelCustomFieldProvider,FlagCustomFieldProvider,StoryPointsCustomFieldProvider
public abstract class AbstractDefaultCustomFieldProvider
extends Object
implements DefaultCustomFieldProvider
A base class for implementing the
DefaultCustomFieldProvider interface. Provides the common patterns of
checking for "default" custom field existence and creation if it does not exist.
This class should only be used to manage custom field instances where the CustomFieldType is provided by
JIRA's system plugins, and not JIRA Agile. This is because this implementation does not adequately handle scenarios
where the Custom Field Type plugin module is not known to JIRA's CustomFieldManager at the time of querying.
For contrast, see SprintCustomFieldServiceImpl.- Since:
- 7.1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CustomFieldMetadataprotected final CustomFieldServiceprotected final com.atlassian.jira.security.JiraAuthenticationContextprotected final LoggerWrapper -
Constructor Summary
ConstructorsConstructorDescriptionAbstractDefaultCustomFieldProvider(CustomFieldService customFieldService, com.atlassian.jira.security.JiraAuthenticationContext jiraAuthenticationContext, com.atlassian.jira.config.ReindexMessageManager reindexMessageManager, com.atlassian.beehive.ClusterLockService clusterLockService, String typeName, CustomFieldMetadata customFieldMetadata) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterFieldIsProduced(com.atlassian.jira.issue.fields.CustomField field) Post-creation code that is also executed while theLockis being held.booleancom.atlassian.jira.issue.fields.CustomFieldGet the default custom field that JIRA Agile is aware of.protected abstract Longprotected abstract voidPersist the custom field ID for later retrieval
-
Field Details
-
log
-
customFieldService
-
customFieldMetadata
-
jiraAuthenticationContext
protected final com.atlassian.jira.security.JiraAuthenticationContext jiraAuthenticationContext
-
-
Constructor Details
-
AbstractDefaultCustomFieldProvider
public AbstractDefaultCustomFieldProvider(CustomFieldService customFieldService, com.atlassian.jira.security.JiraAuthenticationContext jiraAuthenticationContext, com.atlassian.jira.config.ReindexMessageManager reindexMessageManager, com.atlassian.beehive.ClusterLockService clusterLockService, String typeName, CustomFieldMetadata customFieldMetadata)
-
-
Method Details
-
getOrCreateDefaultField
public com.atlassian.jira.issue.fields.CustomField getOrCreateDefaultField()Description copied from interface:DefaultCustomFieldProviderGet the default custom field that JIRA Agile is aware of.- Specified by:
getOrCreateDefaultFieldin interfaceDefaultCustomFieldProvider- Returns:
- the custom field. If the field does not yet exist, this will try its hardest to ensure that an instance of this custom field is returned; whether created or retrieved.
-
doesDefaultFieldExist
public boolean doesDefaultFieldExist()- Specified by:
doesDefaultFieldExistin interfaceDefaultCustomFieldProvider- Returns:
- whether the default field currently exists
-
getStoredCustomFieldId
- Returns:
- the currently persisted custom field ID
-
setStoredCustomFieldId
Persist the custom field ID for later retrieval- Parameters:
id- the custom field ID
-
afterFieldIsProduced
protected void afterFieldIsProduced(com.atlassian.jira.issue.fields.CustomField field) Post-creation code that is also executed while theLockis being held.- Parameters:
field- the field which was just created
-