diff --git a/pom.xml b/pom.xml index 96fa279532d5e496d716ae6d31a3dd27315e2afb..cb11bcd655ac67fd8087e84f65ba2c3d8bebf8b0 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,12 @@ 0.8-SNAPSHOT --> + + javax.inject + javax.inject + 1 + provided + junit diff --git a/src/main/java/org/aktin/Configurable.java b/src/main/java/org/aktin/Configurable.java deleted file mode 100644 index 50768951a0e8666667d099d489acc19057a795cb..0000000000000000000000000000000000000000 --- a/src/main/java/org/aktin/Configurable.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.aktin; - -import java.lang.reflect.Method; -import java.util.LinkedList; -import java.util.List; - -/** - * Marker interface to allow automatic injection of configuration preferences - * - * @author R.W.Majeed - * - */ -public interface Configurable { - - public default List getPreferences(){ - List prefs = new LinkedList<>(); - Method[] methods = getClass().getDeclaredMethods(); - for( int i=0; i validator() to validate preferences -} \ No newline at end of file + String get(String key); + + Set keySet(); +} diff --git a/src/main/java/org/aktin/prefs/Preference.java b/src/main/java/org/aktin/prefs/Preference.java deleted file mode 100644 index 7bd7c239eb45cab15c590e066bfeadecab02fdd6..0000000000000000000000000000000000000000 --- a/src/main/java/org/aktin/prefs/Preference.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.aktin.prefs; - -/** - * All preferences can be read/written by the API (system). - * Some preferences might be readable/writable publicly - * e.g. by an authenticated user. - * - * @author R.W.Majeed - * - * @param value type - */ -public interface Preference { - Preferences getPreferences(); - /** - * Get the preference value data type - * @return data type for the value - */ - Class getType(); - /** - * Get the preference value - * @return value - */ - T getValue(); - /** - * Get the preference name / key - * @return key name - */ - String getKey(); - - boolean isPublicWritable(); - boolean isPublicReadable(); - - /** - * Perform a public update by user - * @param user user name - * @param value value - */ - public void setValue(T value, String user); - - /** - * Set the value by the system user - * @param value value - */ - public void setValue(T value); - - /** - * Set the value to the given string representation. The value - * is changed by the system user. - * @param value string representing the value - * @throws IllegalArgumentException if the string conversion fails - */ - public void setValueString(String value) throws IllegalArgumentException; - - /** - * Set the value to the given string representation. The specified - * user name is used to perform the change. - * - * @param value string value - * @param user user name - * @throws IllegalArgumentException if string conversion fails - */ - public void setValueString(String value, String user) throws IllegalArgumentException; -} diff --git a/src/main/java/org/aktin/prefs/Preferences.java b/src/main/java/org/aktin/prefs/Preferences.java deleted file mode 100644 index d6566c2ec53cb018f2c62c82a61df331fd06b9b3..0000000000000000000000000000000000000000 --- a/src/main/java/org/aktin/prefs/Preferences.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.aktin.prefs; - -import java.io.IOException; -/** - * API for AKTIN preferences. - *

- * To access preferences, use a CDI injection - * in your class (e.g with {@code javax.inject.Inject} - * annotation. - * - * @author R.W.Majeed - * - */ -public interface Preferences { - public String getString(String key); - public Integer getInteger(String key); - - public void putString(String key, String value); - public void putInteger(String key, Integer value); - - public Preference get(String key); - /** - * Write the changed preferences to the underlying - * storage (e.g. database) - * @throws IOException flush error - */ - public void flush() throws IOException; -} diff --git a/src/main/java/org/aktin/prefs/Validator.java b/src/main/java/org/aktin/prefs/Validator.java deleted file mode 100644 index 1fb71e5d67ae992fc83a7a997d0ad2fddb28fdf2..0000000000000000000000000000000000000000 --- a/src/main/java/org/aktin/prefs/Validator.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.aktin.prefs; - -/** - * Validates preference settings. - * A validator may work for one or more preferences, - * e.g for R executable (one preference) or email server settings (multiple) - * @author R.W.Majeed - * - */ -public interface Validator { - -}