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 Details

    • log

      protected final LoggerWrapper log
    • customFieldService

      protected final CustomFieldService customFieldService
    • customFieldMetadata

      protected final CustomFieldMetadata 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 interface DefaultCustomFieldProvider
      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 interface DefaultCustomFieldProvider
      Returns:
      whether the default field currently exists
    • getStoredCustomFieldId

      @Nullable protected abstract Long getStoredCustomFieldId()
      Returns:
      the currently persisted custom field ID
    • setStoredCustomFieldId

      protected abstract void setStoredCustomFieldId(@Nullable Long id)
      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 the Lock is being held.
      Parameters:
      field - the field which was just created