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.void
Called 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.void
flushCacheForFieldConfig
(FieldConfig config) getOptionsForConfig
(FieldConfig config) Retrieves an option set that contains the options for the given field configuration.void
onClearCache
(ClearCacheEvent event) removeOptionFromOptionSet
(FieldConfig config, String optionId) Removes an option from the option set.void
removeOptionSet
(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: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 interfaceInitializingComponent
- Throws:
Exception
-
onClearCache
-
getOptionsForConfig
Description copied from interface:OptionSetManager
Retrieves an option set that contains the options for the given field configuration.- Specified by:
getOptionsForConfig
in 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:OptionSetManager
Creates a new option set or replaces an existing one.Well... maybe. For historic reasons, a
null
value is tolerated foroptionIds
and is treated the same as callingOptionSetManager.removeOptionSet(FieldConfig)
. It is now annotated with@Nonnull
to 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:
createOptionSet
in 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 aList
orSortedSet
if you want the results to be predictable.- Returns:
- the set of options assigned to this field configuration
-
updateOptionSet
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 foroptionIds
and is treated the same as callingOptionSetManager.removeOptionSet(FieldConfig)
. It is now annotated with@Nonnull
to 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:
updateOptionSet
in 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 aList
orSortedSet
if you want the results to be predictable.- Returns:
- the set of options assigned to this field configuration
-
addOptionToOptionSet
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 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:OptionSetManager
Removes an option from the option set.- Specified by:
removeOptionFromOptionSet
in 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:OptionSetManager
Removes all options from this field configuration.- Specified by:
removeOptionSet
in interfaceOptionSetManager
- Parameters:
config
- the field configuration to destroy
-
flushCacheForFieldConfig
-