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 CustomFieldMetadata
protected final CustomFieldService
protected final com.atlassian.jira.security.JiraAuthenticationContext
protected 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 void
afterFieldIsProduced
(com.atlassian.jira.issue.fields.CustomField field) Post-creation code that is also executed while theLock
is being held.boolean
com.atlassian.jira.issue.fields.CustomField
Get the default custom field that JIRA Agile is aware of.protected abstract Long
protected abstract void
Persist 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:DefaultCustomFieldProvider
Get the default custom field that JIRA Agile is aware of.- Specified by:
getOrCreateDefaultField
in 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:
doesDefaultFieldExist
in 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 theLock
is being held.- Parameters:
field
- the field which was just created
-