Class CachedOptionSetManager

java.lang.Object
com.atlassian.jira.issue.fields.option.CachedOptionSetManager
All Implemented Interfaces:
InitializingComponent, OptionSetManager

@ParametersAreNonnullByDefault public class CachedOptionSetManager extends Object implements OptionSetManager, InitializingComponent
  • Constructor Details

    • CachedOptionSetManager

      public CachedOptionSetManager(OptionSetManagerImpl delegate, com.atlassian.cache.CacheManager cacheManager)
  • Method Details

    • afterInstantiation

      public void afterInstantiation() throws Exception
      Description copied from interface: InitializingComponent
      Called after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.
      Specified by:
      afterInstantiation in interface InitializingComponent
      Throws:
      Exception
    • onClearCache

      @EventListener public void onClearCache(ClearCacheEvent event)
    • getOptionsForConfig

      @Nonnull public OptionSet getOptionsForConfig(FieldConfig config)
      Description copied from interface: OptionSetManager
      Retrieves an option set that contains the options for the given field configuration.
      Specified by:
      getOptionsForConfig in interface OptionSetManager
      Parameters:
      config - the field configuration whose options are to be retrieved
      Returns:
      an option set containing the options for that field configuration
    • createOptionSet

      @Nonnull public OptionSet createOptionSet(FieldConfig config, Collection<String> optionIds)
      Description copied from interface: OptionSetManager
      Creates a new option set or replaces an existing one.

      Well... maybe. For historic reasons, a null value is tolerated for optionIds and is treated the same as calling OptionSetManager.removeOptionSet(FieldConfig). It is now annotated with @Nonnull to warn callers that this should be avoided. Please call OptionSetManager.removeOptionSet(FieldConfig) if that's what you really mean!

      By the way, this method and OptionSetManager.updateOptionSet(FieldConfig, Collection) do exactly the same thing. Don't ask me why we have both of them; I'm sure it seemed like a great idea at the time.

      Specified by:
      createOptionSet in interface OptionSetManager
      Parameters:
      config - the field configuration associated with the option set
      optionIds - the collection of options to include. The options will be ordered by the iteration order of the collection, so it should be a List or SortedSet if you want the results to be predictable.
      Returns:
      the set of options assigned to this field configuration
    • updateOptionSet

      @Nonnull public OptionSet updateOptionSet(FieldConfig config, Collection<String> optionIds)
      Description copied from interface: OptionSetManager
      Creates a new option set or replaces an existing one.

      Well... maybe. For historic reasons, a null value is tolerated for optionIds and is treated the same as calling OptionSetManager.removeOptionSet(FieldConfig). It is now annotated with @Nonnull to warn callers that this should be avoided. Please call OptionSetManager.removeOptionSet(FieldConfig) if that's what you really mean!

      By the way, this method and OptionSetManager.createOptionSet(FieldConfig, Collection) do exactly the same thing. Don't ask me why we have both of them; I'm sure it seemed like a great idea at the time.

      Specified by:
      updateOptionSet in interface OptionSetManager
      Parameters:
      config - the field configuration associated with the option set
      optionIds - the collection of options to include. The options will be ordered by the iteration order of the collection, so it should be a List or SortedSet if you want the results to be predictable.
      Returns:
      the set of options assigned to this field configuration
    • addOptionToOptionSet

      public OptionSet addOptionToOptionSet(FieldConfig config, String optionId)
      Description copied from interface: OptionSetManager
      Adds a new option to the option set. This will be placed in the last position of the set (highest sequence).
      Specified by:
      addOptionToOptionSet in interface OptionSetManager
      Parameters:
      config - the field configuration associated with the option set
      optionId - to add to the option set
      Returns:
      the set of options assigned to this field configuration
    • removeOptionFromOptionSet

      public OptionSet removeOptionFromOptionSet(FieldConfig config, String optionId)
      Description copied from interface: OptionSetManager
      Removes an option from the option set.
      Specified by:
      removeOptionFromOptionSet in interface OptionSetManager
      Parameters:
      config - the field configuration associated with the option set
      optionId - to remove from the option set
      Returns:
      the set of options assigned to this field configuration
    • removeOptionSet

      public void removeOptionSet(FieldConfig config)
      Description copied from interface: OptionSetManager
      Removes all options from this field configuration.
      Specified by:
      removeOptionSet in interface OptionSetManager
      Parameters:
      config - the field configuration to destroy
    • flushCacheForFieldConfig

      public void flushCacheForFieldConfig(FieldConfig config)