1 package gov.bnl.gums.db; 2 3 import java.text.DateFormat; 4 import java.util.Collection; 5 import java.util.Date; 6 7 public interface ConfigurationDB { 8 /** 9 * Delete backup configuration 10 * 11 * @param A name string 12 */ 13 public boolean deleteBackupConfiguration(String name); 14 15 /** 16 * Get a list of config date strings that have been stored 17 * 18 * @return collection of date strings. 19 */ 20 public Collection getBackupNames(DateFormat format); 21 22 /** 23 * Get last modified 24 * 25 * @return Date 26 */ 27 public Date getLastModification(); 28 29 /** 30 * Defines whether a configuration can be retrieved from the database. 31 * This should only check whether configuration information is accessible, 32 * not if it is inconsistent. For example, it should check whether 33 * the configuration file is present, not if contains valid information. 34 * 35 * @return true if the store is configured correctly. 36 */ 37 public boolean isActive(); 38 39 /** 40 * Restores configuration in memory. If the configuration cannot be loaded 41 * due to an inconsistency in the store, it should throw an exception. 42 * 43 * @param A name string 44 * @return configuration text. 45 */ 46 public String restoreConfiguration(String name); 47 48 /** 49 * Loads the configuration text. If the configuration cannot be loaded 50 * due to an inconsistency in the database, it should throw an exception. 51 * 52 * @return configuration text. 53 */ 54 public String retrieveCurrentConfiguration(); 55 56 /** 57 * Set and store the configuration. 58 * 59 * @param text as configuration text 60 * @param date as Date 61 * @param backupCopy as boolean 62 * @param name as name 63 */ 64 public void setConfiguration(String text, boolean backupCopy, String name, Date date); 65 }