Class CachedOptionSetManager
- All Implemented Interfaces:
InitializingComponent,OptionSetManager
-
Constructor Summary
ConstructorsConstructorDescriptionCachedOptionSetManager(OptionSetManagerImpl delegate, com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionaddOptionToOptionSet(FieldConfig config, String optionId) Adds a new option to the option set.voidCalled after all the beans are constructed and the ApplicationContext is fully populated.createOptionSet(FieldConfig config, Collection<String> optionIds) Creates a new option set or replaces an existing one.voidflushCacheForFieldConfig(FieldConfig config) getOptionsForConfig(FieldConfig config) Retrieves an option set that contains the options for the given field configuration.voidonClearCache(ClearCacheEvent event) removeOptionFromOptionSet(FieldConfig config, String optionId) Removes an option from the option set.voidremoveOptionSet(FieldConfig config) Removes all options from this field configuration.updateOptionSet(FieldConfig config, Collection<String> optionIds) Creates a new option set or replaces an existing one.
-
Constructor Details
-
CachedOptionSetManager
public CachedOptionSetManager(OptionSetManagerImpl delegate, com.atlassian.cache.CacheManager cacheManager)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled 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:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
onClearCache
-
getOptionsForConfig
Description copied from interface:OptionSetManagerRetrieves an option set that contains the options for the given field configuration.- Specified by:
getOptionsForConfigin interfaceOptionSetManager- Parameters:
config- the field configuration whose options are to be retrieved- Returns:
- an option set containing the options for that field configuration
-
createOptionSet
Description copied from interface:OptionSetManagerCreates a new option set or replaces an existing one.Well... maybe. For historic reasons, a
nullvalue is tolerated foroptionIdsand is treated the same as callingOptionSetManager.removeOptionSet(FieldConfig). It is now annotated with@Nonnullto warn callers that this should be avoided. Please callOptionSetManager.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:
createOptionSetin interfaceOptionSetManager- Parameters:
config- the field configuration associated with the option setoptionIds- the collection of options to include. The options will be ordered by the iteration order of the collection, so it should be aListorSortedSetif you want the results to be predictable.- Returns:
- the set of options assigned to this field configuration
-
updateOptionSet
Description copied from interface:OptionSetManagerCreates a new option set or replaces an existing one.Well... maybe. For historic reasons, a
nullvalue is tolerated foroptionIdsand is treated the same as callingOptionSetManager.removeOptionSet(FieldConfig). It is now annotated with@Nonnullto warn callers that this should be avoided. Please callOptionSetManager.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:
updateOptionSetin interfaceOptionSetManager- Parameters:
config- the field configuration associated with the option setoptionIds- the collection of options to include. The options will be ordered by the iteration order of the collection, so it should be aListorSortedSetif you want the results to be predictable.- Returns:
- the set of options assigned to this field configuration
-
addOptionToOptionSet
Description copied from interface:OptionSetManagerAdds a new option to the option set. This will be placed in the last position of the set (highest sequence).- Specified by:
addOptionToOptionSetin interfaceOptionSetManager- Parameters:
config- the field configuration associated with the option setoptionId- to add to the option set- Returns:
- the set of options assigned to this field configuration
-
removeOptionFromOptionSet
Description copied from interface:OptionSetManagerRemoves an option from the option set.- Specified by:
removeOptionFromOptionSetin interfaceOptionSetManager- Parameters:
config- the field configuration associated with the option setoptionId- to remove from the option set- Returns:
- the set of options assigned to this field configuration
-
removeOptionSet
Description copied from interface:OptionSetManagerRemoves all options from this field configuration.- Specified by:
removeOptionSetin interfaceOptionSetManager- Parameters:
config- the field configuration to destroy
-
flushCacheForFieldConfig
-