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 reorderer, FieldConfigManager fieldConfigManager)
           
 
Method Summary
 Option createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value)
           
 void deleteOptionAndChildren(Option option)
           
 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 removeCustomFieldConfigOptions(FieldConfig fieldConfig)
           
 void removeCustomFieldOptions(CustomField customField)
           
 void setRootOptions(FieldConfig fieldConfig, Options options)
           
 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 reorderer,
                            FieldConfigManager fieldConfigManager)
Method Detail

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

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-2009 Atlassian. All Rights Reserved.