1
2
3
4
5
6
7 package gov.bnl.gums;
8
9 /*** Encapsulate the logic of retrieving the configuration from where it is stored.
10 * This will allow to retrieve the configuration from a File, from a database,
11 * or from whenever we will need to.
12 *
13 * @author Gabriele Carcassi
14 */
15 public interface ConfigurationStore {
16 /***
17 * Defines whether a configuration can be retrieved from the store.
18 * This should only check whether configuration information is accessible,
19 * not if it is inconsistent. For example, it should check whether
20 * the configuration file is present, not if contains valid information.
21 * @return true if the store is configured correctly.
22 */
23 boolean isActive();
24 /***
25 * Defines whether the configuration can be changed or not.
26 * @return true if storeConfiguration is allowed.
27 */
28 boolean isReadOnly();
29 /***
30 * Loads the configuration in memory. If the configuration cannot be loaded
31 * due to an inconsistency in the store, it should throw an exception.
32 * @return A configuration object.
33 */
34 Configuration retrieveConfiguration();
35 /***
36 * Store a configuration. If the configuration couldn't be stored properly,
37 * it must throw an exception.
38 * @param conf
39 */
40 void storeConfiguration(Configuration conf);
41
42 }