diff options
author | kurczews <krzysztof.kurczewski@nokia.com> | 2019-06-10 14:39:01 +0200 |
---|---|---|
committer | kurczews <krzysztof.kurczewski@nokia.com> | 2019-06-11 07:13:31 +0200 |
commit | f13bb478e0b79db83dcf6f8e5e67ff4c815c0610 (patch) | |
tree | a09a4dbc30b8beeff0b27e6c3fa99ae6eb4f7abe /rest-services/aai-client/src | |
parent | 13cc0bf2987cd12bccf131fd99019d8e16c6c07d (diff) |
Deprecate AAI pnfUrl
Issue-ID: DCAEGEN2-1608
Change-Id: I4efdcdcde4e3905e369cec171bcd7e629e1b7bee
Signed-off-by: kurczews <krzysztof.kurczewski@nokia.com>
Diffstat (limited to 'rest-services/aai-client/src')
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 |