1 package org.naftulin.configmgr.parsers; 2 3 import java.io.Serializable; 4 import java.util.List; 5 6 import org.naftulin.configmgr.ConfigurationManagerException; 7 import org.naftulin.configmgr.content.NameValuePairImpl; 8 9 /*** 10 * Interface that enables to brige an external configuration to be used with configuration managment engine. 11 * To create an external record you need to creating a custom bridge class between the 12 * externaly managed configuration and configuration manager. 13 * 14 * @author Henry Naftulin 15 * @since 1.0 16 * 17 */ 18 public interface ExternalRecordAdapter extends Serializable { 19 20 /*** 21 * Returns an object to be stored in configuration manager entry. Is called 22 * to load the configuration for the first time. 23 * @param args list of name value pairs {@link org.naftulin.configmgr.content.NameValuePairImpl} read from master configuration file 24 * @return an object to be stored in configuration manager entry 25 * @throws ConfigurationManagerException 26 */ 27 public Object load(List<NameValuePairImpl> args) throws ConfigurationManagerException; 28 29 /*** 30 * Returns an object to be stored in configuration manager entry. Is called 31 * to re-load the configuration after the configuration has been loaded. 32 * @param args list of name value pairs {@link org.naftulin.configmgr.content.NameValuePairImpl} read from master configuration file 33 * @return an object to be stored in configuration manager entry 34 * @throws ConfigurationManagerException 35 */ 36 public Object reload(List<NameValuePairImpl> args) throws ConfigurationManagerException; 37 38 /*** 39 * Returns information about the external configuration, such as file from which 40 * the configuration is read. 41 * @param args list of name value pairs {@link org.naftulin.configmgr.content.NameValuePairImpl} read from master configuration file 42 * @return information about the external configuration 43 */ 44 public String getInfo(List<NameValuePairImpl> args); 45 }