diff options
author | pwielebs <piotr.wielebski@nokia.com> | 2019-05-27 11:20:22 +0200 |
---|---|---|
committer | pwielebs <piotr.wielebski@nokia.com> | 2019-05-27 13:44:00 +0200 |
commit | 6ef3cb626cdf753b15cf91b88bf8304b7ea7a812 (patch) | |
tree | 64437810b708ee1b63337c5c59ddb3eecb31b588 /rest-services | |
parent | 2668ca2fd0029fe0946f8148882f93c3bfaab466 (diff) |
Refactor of AAI model
Unused fields removed from AAI model in SDK
Change-Id: Ie46c98edd2ccbcff146b210c715f472d15e26bef
Issue-ID: DCAEGEN2-1533
Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'rest-services')
6 files changed, 7 insertions, 55 deletions
diff --git a/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/config/AaiClientConfiguration.java b/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/config/AaiClientConfiguration.java index fad3cb60..00d323cc 100644 --- a/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/config/AaiClientConfiguration.java +++ b/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/config/AaiClientConfiguration.java @@ -37,23 +37,6 @@ public abstract class AaiClientConfiguration implements Serializable { @Value.Parameter public abstract String pnfUrl(); - /** - Due to changes in the aai client configuration json old parameters: - aaiHost, aaiProtocol, aaiPort, aaiBasePath, aaiPnfPath - will be replaced by pnfUrl - */ - @Deprecated - @Value.Parameter - public abstract String aaiHost(); - - @Deprecated - @Value.Parameter - public abstract Integer aaiPort(); - - @Deprecated - @Value.Parameter - public abstract String aaiProtocol(); - @Value.Parameter public abstract String aaiUserName(); @@ -63,14 +46,6 @@ public abstract class AaiClientConfiguration implements Serializable { @Value.Parameter public abstract Boolean aaiIgnoreSslCertificateErrors(); - @Deprecated - @Value.Parameter - public abstract String aaiBasePath(); - - @Deprecated - @Value.Parameter - public abstract String aaiPnfPath(); - @Value.Parameter public abstract String aaiServiceInstancePath(); diff --git a/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/get/AaiGetServiceInstanceClient.java b/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/get/AaiGetServiceInstanceClient.java index 30e28a47..9c9b9fed 100644 --- a/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/get/AaiGetServiceInstanceClient.java +++ b/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/get/AaiGetServiceInstanceClient.java @@ -46,7 +46,7 @@ public class AaiGetServiceInstanceClient implements private final RxHttpClient httpClient; private final AaiClientConfiguration configuration; - public AaiGetServiceInstanceClient(final AaiClientConfiguration configuration, + AaiGetServiceInstanceClient(final AaiClientConfiguration configuration, final RxHttpClient httpClient) { this.configuration = configuration; this.httpClient = httpClient; @@ -69,12 +69,6 @@ public class AaiGetServiceInstanceClient implements } private String getUri(final String endpoint) { - return new URI.URIBuilder() - .scheme(configuration.aaiProtocol()) - .host(configuration.aaiHost()) - .port(configuration.aaiPort()) - .path(configuration.aaiBasePath() + "/" + endpoint) - .build() - .toString(); + return new URI.URIBuilder().path(configuration.pnfUrl() + "/" + endpoint).build().toString(); } } diff --git a/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/get/AaiHttpGetClient.java b/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/get/AaiHttpGetClient.java index d78953da..9c059a99 100644 --- a/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/get/AaiHttpGetClient.java +++ b/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/get/AaiHttpGetClient.java @@ -38,7 +38,7 @@ public final class AaiHttpGetClient implements AaiHttpClient<AaiModel, HttpRespo private final AaiClientConfiguration configuration; - public AaiHttpGetClient(AaiClientConfiguration configuration, RxHttpClient httpClient) { + AaiHttpGetClient(AaiClientConfiguration configuration, RxHttpClient httpClient) { this.configuration = configuration; this.httpClient = httpClient; } @@ -53,10 +53,6 @@ public final class AaiHttpGetClient implements AaiHttpClient<AaiModel, HttpRespo private String getUri(String pnfName) { - return new URI.URIBuilder() - .scheme(configuration.aaiProtocol()) - .host(configuration.aaiHost()) - .port(configuration.aaiPort()) - .path(configuration.aaiBasePath() + configuration.aaiPnfPath() + "/" + pnfName).build().toString(); + return new URI.URIBuilder().path(configuration.pnfUrl() + "/" + pnfName).build().toString(); } } diff --git a/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/patch/AaiHttpPatchClient.java b/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/patch/AaiHttpPatchClient.java index 4d0af7ea..f1629999 100644 --- a/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/patch/AaiHttpPatchClient.java +++ b/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/patch/AaiHttpPatchClient.java @@ -44,7 +44,7 @@ public final class AaiHttpPatchClient implements AaiHttpClient<AaiModel, HttpRes private final JsonBodyBuilder jsonBodyBuilder; - public AaiHttpPatchClient(final AaiClientConfiguration configuration, JsonBodyBuilder jsonBodyBuilder, + AaiHttpPatchClient(final AaiClientConfiguration configuration, JsonBodyBuilder jsonBodyBuilder, RxHttpClient httpClient) { this.configuration = configuration; this.jsonBodyBuilder = jsonBodyBuilder; @@ -66,9 +66,6 @@ public final class AaiHttpPatchClient implements AaiHttpClient<AaiModel, HttpRes private String getUri(String pnfName) { return new URI.URIBuilder() - .scheme(configuration.aaiProtocol()) - .host(configuration.aaiHost()) - .port(configuration.aaiPort()) - .path(configuration.aaiBasePath() + configuration.aaiPnfPath() + "/" + pnfName).build().toString(); + .path(configuration.pnfUrl() + "/" + pnfName).build().toString(); } } diff --git a/rest-services/aai-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/AaiClientConfigurations.java b/rest-services/aai-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/AaiClientConfigurations.java index f93bfd67..d56348c8 100644 --- a/rest-services/aai-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/AaiClientConfigurations.java +++ b/rest-services/aai-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/AaiClientConfigurations.java @@ -44,7 +44,6 @@ public final class AaiClientConfigurations { private static AaiClientConfiguration validConfiguration(Map<String, String> headers, boolean secure) { return new ImmutableAaiClientConfiguration.Builder() .pnfUrl("some-url") - .aaiHost("sample-host") .aaiUserName("sample-username") .aaiUserPassword("sample-password") .aaiIgnoreSslCertificateErrors(false) @@ -54,10 +53,6 @@ public final class AaiClientConfigurations { .keyStorePasswordPath("/server.pass") .enableAaiCertAuth(secure) .aaiHeaders(headers) - .aaiProtocol("sample-protocol") - .aaiPort(8080) - .aaiBasePath("sample-base-path") - .aaiPnfPath("sample-pnf-path") .aaiServiceInstancePath("sample-instance-path") .build(); } diff --git a/rest-services/aai-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/AbstractHttpClientTest.java b/rest-services/aai-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/AbstractHttpClientTest.java index 7a8d39d1..097c5d3a 100644 --- a/rest-services/aai-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/AbstractHttpClientTest.java +++ b/rest-services/aai-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/http/AbstractHttpClientTest.java @@ -37,11 +37,6 @@ public class AbstractHttpClientTest { protected String constructAaiUri(AaiClientConfiguration configuration, String pnfName) { - return new URI.URIBuilder() - .scheme(configuration.aaiProtocol()) - .host(configuration.aaiHost()) - .port(configuration.aaiPort()) - .path(configuration.aaiBasePath() + configuration.aaiPnfPath() + "/" + pnfName) - .build().toString(); + return new URI.URIBuilder().path(configuration.pnfUrl() + "/" + pnfName).build().toString(); } } |