Merge branch 'master' of ssh://git.indexdata.com/home/git/private/mkjsf.git into...
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / config / Configurable.java
diff --git a/src/main/java/com/indexdata/mkjsf/config/Configurable.java b/src/main/java/com/indexdata/mkjsf/config/Configurable.java
new file mode 100644 (file)
index 0000000..fb142ea
--- /dev/null
@@ -0,0 +1,49 @@
+package com.indexdata.mkjsf.config;\r
+\r
+import java.util.List;\r
+import java.util.Map;\r
+\r
+import com.indexdata.mkjsf.errors.ConfigurationException;\r
+\r
+/**\r
+ * Interface to be implemented by any part of an application that wish to\r
+ * use a ConfigurationReader for it's configuration. The Configurables that\r
+ * come with the project are a Pazpar2 client and a Service Proxy client\r
+ * \r
+ * @author Niels Erik\r
+ *\r
+ */\r
+public interface Configurable {\r
+\r
+  /**\r
+   * Configures the Configurable using the configuration obtained by the \r
+   * provided configuration reader\r
+   * @param reader used for reading the configuration \r
+   * @throws ConfigurationException\r
+   */\r
+  public void configure(ConfigurationReader reader) throws ConfigurationException;\r
+  \r
+  /**\r
+   * Returns the default parameters that the configurable has defined for itself\r
+   * Should be invoked by the configuration reader before it possibly overrides\r
+   * some parameters obtained from the external configuration source  \r
+   * @return\r
+   */\r
+  public Map<String,String> getDefaults();\r
+  \r
+  /**\r
+   * Returns the name of the module, can be used by a configuration reader that \r
+   * distinguishes between sets of configuration properties by component name, a\r
+   * name space of sorts.\r
+   * @return name of the part that is to be configured\r
+   */\r
+  public String getModuleName();\r
+  \r
+  /**\r
+   * The components documentation of how it was configured. \r
+   * \r
+   * @return a list of Strings describing configuration details\r
+   */\r
+  public List<String> documentConfiguration(); \r
+  \r
+}\r