Class CachedOptionsManager
java.lang.Object
com.atlassian.jira.issue.customfields.manager.DefaultOptionsManager
com.atlassian.jira.issue.customfields.manager.CachedOptionsManager
- All Implemented Interfaces:
InitializingComponent,OptionsManager
Cache for Options Manager. Not particularly neat More a problem with how the OptionsManager is used really
-
Field Summary
Fields inherited from class com.atlassian.jira.issue.customfields.manager.DefaultOptionsManager
ENTITY_CONFIG_ID, fieldConfigManager, ORDER_BY_LIST -
Constructor Summary
ConstructorsConstructorDescriptionCachedOptionsManager(OfBizDelegator delegator, FieldConfigManager fieldConfigManager, com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value) Create a new option for the given custom field config.createOptions(FieldConfig config, Long parentOptionId, Long sequence, Iterable<String> options) Bulk version ofOptionsManager.createOption(FieldConfig, Long, Long, String)methodvoiddeleteOptionAndChildren(Option option) voiddisableOption(Option option) Set an option to disabled.voidenableOption(Option option) Set an option to enabled.findByOptionId(Long optionId) findByOptionValue(String value) Finds all options with the given value.findByParentId(Long parentOptionId) Finds all options with the given parent option id.Retreives allOptionin the system.getOptions(FieldConfig fieldConfig) Get options for this particular custom field type.voidonClearCache(ClearCacheEvent event) voidremoveCustomFieldConfigOptions(FieldConfig fieldConfig) voidremoveCustomFieldOptions(CustomField customField) voidsetRootOptions(FieldConfig fieldConfig, Options options) voidvoidupdateOptions(Collection<Option> options) Update a set of options.Methods inherited from class com.atlassian.jira.issue.customfields.manager.DefaultOptionsManager
getOptions
-
Constructor Details
-
CachedOptionsManager
public CachedOptionsManager(OfBizDelegator delegator, FieldConfigManager fieldConfigManager, 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
-
getAllOptions
Description copied from interface:OptionsManagerRetreives allOptionin the system.- Specified by:
getAllOptionsin interfaceOptionsManager- Overrides:
getAllOptionsin classDefaultOptionsManager- Returns:
- a list of all options in the system
-
findByOptionValue
Description copied from interface:OptionsManagerFinds all options with the given value. Returns and empty list if no options are found.- Specified by:
findByOptionValuein interfaceOptionsManager- Overrides:
findByOptionValuein classDefaultOptionsManager- Parameters:
value- the value of the options to find (case insensitive). Must not be null.- Returns:
- the list of found options, empty if non found.
-
getOptions
Description copied from interface:OptionsManagerGet options for this particular custom field type. As a custom field may have multiple types of options (e.g. cascading drop-downs), the type can be used to signify this- Specified by:
getOptionsin interfaceOptionsManager- Overrides:
getOptionsin classDefaultOptionsManager- Parameters:
fieldConfig- For example, retrieved fromCustomField.getRelevantConfig(com.atlassian.jira.issue.Issue)- Returns:
- An option Object of Options
-
setRootOptions
- Specified by:
setRootOptionsin interfaceOptionsManager- Overrides:
setRootOptionsin classDefaultOptionsManager
-
removeCustomFieldOptions
- Specified by:
removeCustomFieldOptionsin interfaceOptionsManager- Overrides:
removeCustomFieldOptionsin classDefaultOptionsManager
-
removeCustomFieldConfigOptions
- Specified by:
removeCustomFieldConfigOptionsin interfaceOptionsManager- Overrides:
removeCustomFieldConfigOptionsin classDefaultOptionsManager
-
updateOptions
Description copied from interface:OptionsManagerUpdate a set of options. After doing this, any existingOptionsobjects may be stale, and should be re-fetched withOptionsManager.getOptions(com.atlassian.jira.issue.fields.config.FieldConfig).- Specified by:
updateOptionsin interfaceOptionsManager- Overrides:
updateOptionsin classDefaultOptionsManager- Parameters:
options- Usually anOptionsimplementation.
-
createOption
public Option createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value) Description copied from interface:OptionsManagerCreate a new option for the given custom field config.- Specified by:
createOptionin interfaceOptionsManager- Overrides:
createOptionin classDefaultOptionsManager- Parameters:
fieldConfig- The custom field config to create the option forparentOptionId- The id of the parent option, or null if this is a root optionsequence- The sequence of the option (position on the list)value- The value of the option- Returns:
- The newly created option
-
createOptions
public List<Option> createOptions(FieldConfig config, Long parentOptionId, Long sequence, Iterable<String> options) Description copied from interface:OptionsManagerBulk version ofOptionsManager.createOption(FieldConfig, Long, Long, String)method- Specified by:
createOptionsin interfaceOptionsManager- Overrides:
createOptionsin classDefaultOptionsManager
-
deleteOptionAndChildren
- Specified by:
deleteOptionAndChildrenin interfaceOptionsManager- Overrides:
deleteOptionAndChildrenin classDefaultOptionsManager
-
setValue
- Specified by:
setValuein interfaceOptionsManager- Overrides:
setValuein classDefaultOptionsManager
-
disableOption
Description copied from interface:OptionsManagerSet an option to disabled. A disabled option will is not available to be assigned to this associated custom field, It remains valid historically and for searching with.- Specified by:
disableOptionin interfaceOptionsManager- Overrides:
disableOptionin classDefaultOptionsManager- Parameters:
option- The option to be disabled.
-
enableOption
Description copied from interface:OptionsManagerSet an option to enabled.- Specified by:
enableOptionin interfaceOptionsManager- Overrides:
enableOptionin classDefaultOptionsManager- Parameters:
option- The Option to enable.
-
findByOptionId
- Specified by:
findByOptionIdin interfaceOptionsManager- Overrides:
findByOptionIdin classDefaultOptionsManager
-
findByParentId
Description copied from interface:OptionsManagerFinds all options with the given parent option id. Returns an empty list if no options are found.- Specified by:
findByParentIdin interfaceOptionsManager- Overrides:
findByParentIdin classDefaultOptionsManager- Parameters:
parentOptionId- the id of the parent option.- Returns:
- the list of found options, empty if non found.
-