diff options
author | Piotr Wielebski <piotr.wielebski@nokia.com> | 2019-06-11 06:51:05 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-06-11 06:51:05 +0000 |
commit | 6c2951519650779c019431f990b22b71feb220dc (patch) | |
tree | 694adb46f18f7f076b427c1c922f5808dc4cd71b | |
parent | 444159b6a990cb63c95fdf4e8a4332ae64ed53bc (diff) | |
parent | f13bb478e0b79db83dcf6f8e5e67ff4c815c0610 (diff) |
Merge "Deprecate AAI pnfUrl"
2 files changed, 29 insertions, 11 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 00d323cc..ff74f9b7 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 @@ -20,22 +20,35 @@ package org.onap.dcaegen2.services.sdk.rest.services.aai.client.config; -import org.immutables.gson.Gson; -import org.immutables.value.Value; - import java.io.Serializable; import java.util.Map; - +import org.immutables.gson.Gson; +import org.immutables.value.Value; @Value.Immutable(prehash = true) @Value.Style(builder = "new") @Gson.TypeAdapters public abstract class AaiClientConfiguration implements Serializable { + private static final String PNF_PATH = "/network/pnfs/pnf"; + private static final String SERVICE_INSTANCE_PATH = "/business/customers/customer/${customer}/service-subscriptions/service-subscription/${serviceType}/service-instances/service-instance/${serviceInstanceId}"; + private static final long serialVersionUID = 1L; @Value.Parameter - public abstract String pnfUrl(); + @Value.Default + public String baseUrl() { + return ""; + } + + /** + * Please use baseUrl() instead + */ + @Deprecated + @Value.Default + public String pnfUrl() { + return baseUrl() + PNF_PATH; + } @Value.Parameter public abstract String aaiUserName(); @@ -46,8 +59,14 @@ public abstract class AaiClientConfiguration implements Serializable { @Value.Parameter public abstract Boolean aaiIgnoreSslCertificateErrors(); - @Value.Parameter - public abstract String aaiServiceInstancePath(); + /** + * Please use baseUrl() instead + */ + @Deprecated + @Value.Default + public String aaiServiceInstancePath() { + return SERVICE_INSTANCE_PATH; + } @Value.Parameter public abstract Map<String, String> aaiHeaders(); @@ -66,5 +85,4 @@ public abstract class AaiClientConfiguration implements Serializable { @Value.Parameter public abstract Boolean enableAaiCertAuth(); - -} +}
\ No newline at end of file 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 d56348c8..23bfb171 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 @@ -43,7 +43,7 @@ public final class AaiClientConfigurations { private static AaiClientConfiguration validConfiguration(Map<String, String> headers, boolean secure) { return new ImmutableAaiClientConfiguration.Builder() - .pnfUrl("some-url") + .baseUrl("https://aai.onap.svc.cluster.local:8443/aai/v12") .aaiUserName("sample-username") .aaiUserPassword("sample-password") .aaiIgnoreSslCertificateErrors(false) @@ -56,4 +56,4 @@ public final class AaiClientConfigurations { .aaiServiceInstancePath("sample-instance-path") .build(); } -} +}
\ No newline at end of file |