* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2019 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
package org.onap.ccsdk.sli.adaptors.aai;
-
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
private final String targetUri;
private final String networkVserverPath;
- private final String svc_inst_qry_path;
+ private final String svc_inst_query_path;
private final String ubb_notify_path;
private final String selflinkAvpn;
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(Properties props) {
LOG.info("Entered AAIService.ctor");
networkVserverPath =props.getProperty(NETWORK_VSERVER_PATH);
props.getProperty(SVC_INSTANCE_PATH);
- svc_inst_qry_path = props.getProperty(SVC_INST_QRY_PATH);
+ svc_inst_query_path = props.getProperty(SVC_INST_QRY_PATH);
props.getProperty(PARAM_SERVICE_TYPE, "service-type");
props.getProperty(P_INTERFACE_PATH);
methodsField.set(null, methods);
} catch (SecurityException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {
- e.printStackTrace();
+ LOG.error("Exception occured", e);
}
}
+ 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 void setExecutor(AAIExecutorInterface executor) {
this.executor = executor;
}
InputStream inputStream = null;
try {
- String path = svc_inst_qry_path;
+ String path = svc_inst_query_path;
path = path.replace("{svc-instance-id}", encodeQuery(svc_instance_id));
String request_url = targetUri+path;
try {
inputStream.close();
} catch(Exception exc) {
+ LOG.warn("Error closing Inputstream", exc);
}
}
}
try {
inputStream.close();
} catch(Exception exc) {
-
+ LOG.warn("Error closing InputStream", exc);
}
}
}
if(inputStream != null)
inputStream.close();
} catch (Exception exc) {
-
+ LOG.warn("Error closing Input stream", exc);
}
}
}
try {
inputStream.close();
} catch(Exception exc) {
-
+ LOG.warn("Error closing Input stream", exc);
}
}
}
try {
inputStream.close();
} catch(Exception exc) {
-
+ LOG.warn("Error closing Input stream", exc);
}
}
}
try {
u = new URL(url);
} catch (MalformedURLException e) {
+ LOG.warn("MalformedURLException", e);
return false;
}
try {
u.toURI();
} catch (URISyntaxException e) {
+ LOG.warn("URISyntaxException", e);
return false;
}
try {
u = new URI(url);
} catch (URISyntaxException e) {
+ LOG.warn("URISyntaxException", e);
return false;
}