summaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/main
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2019-05-28 10:47:03 +0200
committerpwielebs <piotr.wielebski@nokia.com>2019-05-28 15:52:10 +0200
commit37dd2cb2d2ad38ad1e6dd83f3ff5b40bc2c0f614 (patch)
treef0ed1982612bdca8a2b17d67c554d53d5083f5d4 /prh-app-server/src/main
parent57cbc1a3e9f3c1b8049115461266d15736d2f391 (diff)
Refactor due to AAI model changes
Change-Id: I1684cb798b40c5d58b531549f2596582f14bc901 Issue-ID: DCAEGEN2-1533 Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-app-server/src/main')
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsContentParser.java5
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskImpl.java18
2 files changed, 6 insertions, 17 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsContentParser.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsContentParser.java
index 51d86399..63947fa9 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsContentParser.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsContentParser.java
@@ -82,16 +82,11 @@ class CbsContentParser {
AaiClientConfiguration getAaiClientConfig() {
return new ImmutableAaiClientConfiguration.Builder()
.pnfUrl(jsonObject.get("aai.aaiClientConfiguration.pnfUrl").getAsString())
- .aaiHost(jsonObject.get("aai.aaiClientConfiguration.aaiHost").getAsString())
- .aaiPort(jsonObject.get("aai.aaiClientConfiguration.aaiHostPortNumber").getAsInt())
.aaiUserName(jsonObject.get("aai.aaiClientConfiguration.aaiUserName").getAsString())
- .aaiPnfPath(jsonObject.get("aai.aaiClientConfiguration.aaiPnfPath").getAsString())
.aaiServiceInstancePath(jsonObject.get("aai.aaiClientConfiguration.aaiServiceInstancePath").getAsString())
.aaiIgnoreSslCertificateErrors(
jsonObject.get("aai.aaiClientConfiguration.aaiIgnoreSslCertificateErrors").getAsBoolean())
.aaiUserPassword(jsonObject.get("aai.aaiClientConfiguration.aaiUserPassword").getAsString())
- .aaiProtocol(jsonObject.get("aai.aaiClientConfiguration.aaiProtocol").getAsString())
- .aaiBasePath(jsonObject.get("aai.aaiClientConfiguration.aaiBasePath").getAsString())
.trustStorePath(jsonObject.get(SECURITY_TRUST_STORE_PATH).getAsString())
.trustStorePasswordPath(jsonObject.get(SECURITY_TRUST_STORE_PASS_PATH).getAsString())
.keyStorePath(jsonObject.get(SECURITY_KEY_STORE_PATH).getAsString())
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskImpl.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskImpl.java
index a0d844b1..ba0ed2a7 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskImpl.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskImpl.java
@@ -33,7 +33,6 @@ import org.onap.dcaegen2.services.prh.model.bbs.RelationshipWrapper;
import org.onap.dcaegen2.services.prh.model.utils.HttpUtils;
import org.onap.dcaegen2.services.prh.model.utils.PrhModelAwareGsonBuilder;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.*;
-import org.onap.dcaegen2.services.sdk.rest.services.uri.URI.URIBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -51,8 +50,8 @@ public class BbsActionsTaskImpl implements BbsActionsTask {
private static final Logger LOGGER = LoggerFactory.getLogger(BbsActionsTaskImpl.class);
private static final String ATTACHMENT_POINT = "attachmentPoint";
- private static final String LOGICAL_LINK_URI = "/network/logical-links/logical-link/";
- private static final String PNF_URI = "/network/pnfs/pnf/";
+ private static final String LOGICAL_LINK_URI = "/network/logical-links/logical-link";
+ private static final String PNF_URI = "/network/pnfs/pnf";
private final Config config;
private final RxHttpClient httpClient;
@@ -130,18 +129,13 @@ public class BbsActionsTaskImpl implements BbsActionsTask {
.builder()
.relationship(ImmutableRelationship
.builder()
- .relatedLink(PNF_URI + pnfName)
+ .relatedLink(PNF_URI + "/" + pnfName)
.build())
.build());
}
private String buildLogicalLinkUri(String linkName) {
- return new URIBuilder()
- .scheme(config.getAaiClientConfiguration().aaiProtocol())
- .host(config.getAaiClientConfiguration().aaiHost())
- .port(config.getAaiClientConfiguration().aaiPort())
- .path(config.getAaiClientConfiguration().aaiBasePath() + LOGICAL_LINK_URI + linkName)
- .build()
- .toString();
+ return config.getAaiClientConfiguration().pnfUrl().replace(PNF_URI, LOGICAL_LINK_URI) + "/" + linkName;
}
-} \ No newline at end of file
+}
+