import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
private AAIExecutorInterface executor;
- public void setExecutor(AAIExecutorInterface executor) {
- this.executor = executor;
- }
+ public AAIService(final UtilsProvider configuration) {
+ this(configuration.getProperties());
+ }
+
+ public AAIService(final URL url) {
+ this(getProperties(url));
+ }
+
+ private static Properties getProperties(URL url) {
+ Properties properties = new Properties();
+ try {
+ properties.load(url.openStream());
+ } catch (IOException exc) {
+ LOG.error("getProperties", exc);
+ }
+ return properties;
+ }
- public AAIService(URL propURL) {
+ public AAIService(Properties props) {
LOG.info("Entered AAIService.ctor");
String runtime = System.getProperty("aaiclient.runtime");
runtimeOSGI = false;
}
- Properties props = null;
try {
- props = initialize(propURL);
AAIRequest.setProperties(props, this);
} catch(Exception exc){
String tmpApplicationId = props.getProperty(APPLICATION_ID);
if(tmpApplicationId == null || tmpApplicationId.isEmpty()) {
- tmpApplicationId = "SDNC";
+ tmpApplicationId = "SDNC";
}
this.applicationId = tmpApplicationId;
}
+ public void setExecutor(AAIExecutorInterface executor) {
+ this.executor = executor;
+ }
+
public void cleanUp() {
}
String normResource = resource.split(":")[0];
switch(normResource){
- case "custom-query":
+ case "custom-query":
case "formatted-query":
case "generic-query":
case "named-query":
String normResource = resource.split(":")[0];
switch(normResource){
- case "custom-query":
+ case "custom-query":
case "formatted-query":
case "generic-query":
case "named-query":
String normResource = resource.split(":")[0];
switch(normResource){
- case "custom-query":
+ case "custom-query":
case "formatted-query":
case "generic-query":
case "named-query":