View Javadoc

1   package com.atlassian.sal.api.pluginsettings;
2   
3   /**
4    * Factory for mutable, non-threadsafe PluginSettings objects.
5    *
6    * @since 2.0
7    */
8   public interface PluginSettingsFactory
9   {
10      /**
11       * Gets all settings for a key, for which valid values are application-specific (Confluence maps this to space keys,
12       * JIRA to project keys, and FishEye to repository keys, for example). To store settings for other keys, 
13       * createGlobalSettings should be used, and the keys should be sensibly namespaced by the plugin.
14       *
15       * @param key the key, can be null to retrieve global settings
16       * @throws IllegalArgumentException if no "concept" for the key can be found
17       * @return The settings
18       */
19      PluginSettings createSettingsForKey(String key);
20  
21      /**
22       * Gets all global settings. This is useful to store settings against arbitrary keys. When storing settings against
23       * arbitrary keys, plugins are advised to namespace the key with something unique to the plugin (for example
24       * "com.example.plugin:key-I-would-like-to-use" ) to avoid clashes with other keys.
25       *
26       * @return Global settings
27       */
28      PluginSettings createGlobalSettings();
29  }