package at.gv.egovernment.moa.id.commons.config.persistence; import java.util.Map; import java.util.Properties; import at.gv.egiz.components.configuration.api.Configuration; import at.gv.egiz.components.configuration.api.ConfigurationException; /** * An interface for a key-value configuration. */ public interface MOAIDConfiguration extends Configuration { /** * Get all key/value pairs with a prefix * * @param preFix: A key prefix * @param removePrefix: Indicates, if the prefix should be removed from the result key * @return All key/value pairs with this prefix or null if no key is found. The prefix is removed from the key. * **/ public Map getPropertySubset(String preFix, boolean removePrefix) throws ConfigurationException; /** * Get all key/value pairs with a prefix * * @param preFix: A key prefix * @return All key/value pairs with this prefix or null if no key is found. The prefix is removed from the key. * **/ public Map getPropertySubset(String preFix) throws ConfigurationException; /** * Searches the configuration use '*' or '%' for wildcards. * * Example: * * db.server1.url=... * db.server1.user=... * db.server1.password=... * db.server1.driver=... * db.server2.url=... * db.server2.user=... * db.server2.password=... * db.server2.driver=... * * searchString: "db.server1.*" returns * ["db.server1.url", "db.server1.user", "db.server1.password", "db.server1.driver"] * @param searchkey The search string * @return All key/value pairs with this prefix or null if no key is found. The prefix is not removed from the key. * @throws ConfigurationException if something went wrong */ public Map searchPropertiesWithWildcard(String searchkey) throws ConfigurationException; /** * Load an OnlineApplication configuration and remove the OA key prefix * * @param publicURLPrefix: Unique identifier of online application * @return Properties of the online application or null if no OA is found * @throws ConfigurationException in case of an configuration access error */ public Map getOnlineApplication(String publicURLPrefix) throws ConfigurationException; /** * Load an OnlineApplication configuration and remove the OA key prefix * This is a backup version if direct UniqueID selection does not work * * @param publicURLPrefix: Unique identifier of online application * @return Properties of the online application or null if no OA is found * @throws ConfigurationException in case of an configuration access error */ public Map getOnlineApplicationBackupVersion(String publicURLPrefix) throws ConfigurationException; }