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       * Gets all settings for a key, for which valid values are application-specific (Confluence maps this to space keys,
11       * JIRA to project keys, and FishEye to repository keys, for example). To store settings for other keys,
12       * createGlobalSettings should be used, and the keys should be sensibly namespaced by the plugin.
13       *
14       * @param key the key, can be null to retrieve global settings
15       * @return The settings
16       * @throws IllegalArgumentException if no "concept" for the key can be found
17       */
18      PluginSettings createSettingsForKey(String key);
19  
20      /**
21       * Gets all global settings. This is useful to store settings against arbitrary keys. When storing settings against
22       * arbitrary keys, plugins are advised to namespace the key with something unique to the plugin (for example
23       * "com.example.plugin:key-I-would-like-to-use" ) to avoid clashes with other keys.
24       *
25       * @return Global settings
26       */
27      PluginSettings createGlobalSettings();
28  }