com.atlassian.jira.issue.customfields.manager
Class CachedOptionsManager

java.lang.Object
  extended by com.atlassian.jira.issue.customfields.manager.DefaultOptionsManager
      extended by com.atlassian.jira.issue.customfields.manager.CachedOptionsManager
All Implemented Interfaces:
OptionsManager

public class CachedOptionsManager
extends DefaultOptionsManager

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
 
Constructor Summary
CachedOptionsManager(OfBizDelegator delegator, CollectionReorderer<Option> reorderer, FieldConfigManager fieldConfigManager)
           
 
Method Summary
 Option createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value)
           
 void deleteOptionAndChildren(Option option)
           
 void disableOption(Option option)
          Set an option to disabled.
 void enableOption(Option option)
          Set an option to enabled.
 Option findByOptionId(Long optionId)
           
 List<Option> findByOptionValue(String value)
          Finds all options with the given value.
 List findByParentId(Long parentOptionId)
           
 List<Option> getAllOptions()
          Retreives all Option in the system.
 Options getOptions(FieldConfig fieldConfig)
          Get options for this particular custom field type.
 void onClearCache(ClearCacheEvent event)
           
 void removeCustomFieldConfigOptions(FieldConfig fieldConfig)
           
 void removeCustomFieldOptions(CustomField customField)
           
 void setRootOptions(FieldConfig fieldConfig, Options options)
           
 void setValue(Option option, String value)
           
 void updateOptions(Collection options)
          Update a set of options.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedOptionsManager

public CachedOptionsManager(OfBizDelegator delegator,
                            CollectionReorderer<Option> reorderer,
                            FieldConfigManager fieldConfigManager)
Method Detail

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)

getAllOptions

public List<Option> getAllOptions()
Description copied from interface: OptionsManager
Retreives all Option in the system.

Specified by:
getAllOptions in interface OptionsManager
Overrides:
getAllOptions in class DefaultOptionsManager
Returns:
a list of all options in the system

findByOptionValue

public List<Option> findByOptionValue(String value)
Description copied from interface: OptionsManager
Finds all options with the given value. Returns and empty list if no options are found.

Specified by:
findByOptionValue in interface OptionsManager
Overrides:
findByOptionValue in class DefaultOptionsManager
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

public Options getOptions(FieldConfig fieldConfig)
Description copied from interface: OptionsManager
Get options for this particular custom field type. As a custom field may have multiple types of options (eg cascading drop downs), the type can be used to signify this

Specified by:
getOptions in interface OptionsManager
Overrides:
getOptions in class DefaultOptionsManager
Parameters:
fieldConfig - For example, retrieved from CustomField.getRelevantConfig(com.atlassian.jira.issue.Issue)
Returns:
An option Object of Options

setRootOptions

public void setRootOptions(FieldConfig fieldConfig,
                           Options options)
Specified by:
setRootOptions in interface OptionsManager
Overrides:
setRootOptions in class DefaultOptionsManager

removeCustomFieldOptions

public void removeCustomFieldOptions(CustomField customField)
Specified by:
removeCustomFieldOptions in interface OptionsManager
Overrides:
removeCustomFieldOptions in class DefaultOptionsManager

removeCustomFieldConfigOptions

public void removeCustomFieldConfigOptions(FieldConfig fieldConfig)
Specified by:
removeCustomFieldConfigOptions in interface OptionsManager
Overrides:
removeCustomFieldConfigOptions in class DefaultOptionsManager

updateOptions

public void updateOptions(Collection options)
Description copied from interface: OptionsManager
Update a set of options. After doing this, any existing Options objects may be stale, and should be re-fetched with OptionsManager.getOptions(com.atlassian.jira.issue.fields.config.FieldConfig).

Specified by:
updateOptions in interface OptionsManager
Overrides:
updateOptions in class DefaultOptionsManager
Parameters:
options - Usually an Options implementation.

createOption

public Option createOption(FieldConfig fieldConfig,
                           Long parentOptionId,
                           Long sequence,
                           String value)
Specified by:
createOption in interface OptionsManager
Overrides:
createOption in class DefaultOptionsManager

deleteOptionAndChildren

public void deleteOptionAndChildren(Option option)
Specified by:
deleteOptionAndChildren in interface OptionsManager
Overrides:
deleteOptionAndChildren in class DefaultOptionsManager

setValue

public void setValue(Option option,
                     String value)
Specified by:
setValue in interface OptionsManager
Overrides:
setValue in class DefaultOptionsManager

disableOption

public void disableOption(Option option)
Description copied from interface: OptionsManager
Set 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:
disableOption in interface OptionsManager
Overrides:
disableOption in class DefaultOptionsManager
Parameters:
option - The option to be disabled.

enableOption

public void enableOption(Option option)
Description copied from interface: OptionsManager
Set an option to enabled.

Specified by:
enableOption in interface OptionsManager
Overrides:
enableOption in class DefaultOptionsManager
Parameters:
option - The Option to enable.

findByOptionId

public Option findByOptionId(Long optionId)
Specified by:
findByOptionId in interface OptionsManager
Overrides:
findByOptionId in class DefaultOptionsManager

findByParentId

public List findByParentId(Long parentOptionId)
Specified by:
findByParentId in interface OptionsManager
Overrides:
findByParentId in class DefaultOptionsManager


Copyright © 2002-2013 Atlassian. All Rights Reserved.