diff options
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 |