Change AAI variable syntax 28/123228/2
authorTomasz Wrobel <tomasz.wrobel@nokia.com>
Tue, 10 Aug 2021 14:00:23 +0000 (16:00 +0200)
committerTomasz Wrobel <tomasz.wrobel@nokia.com>
Wed, 11 Aug 2021 07:41:17 +0000 (09:41 +0200)
Issue-ID: DCAEGEN2-2863
Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com>
Change-Id: I4e7a2a29edcd85867065ce0457848b42dbfb0db2

Changelog.md
pom.xml
prh-app-server/pom.xml
prh-commons/pom.xml
prh-commons/src/main/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiGetServiceInstanceClient.java
prh-commons/src/test/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiClientConfigurations.java
version.properties

index e92367c..3e5ba62 100644 (file)
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/)
 and this project adheres to [Semantic Versioning](http://semver.org/).
 
+## [1.7.0] - 10/08/2021 - not released
+### Changed
+- Change AAI variable syntax to "{{variable}}" 
+
 ## [1.6.1] - 29/07/2021
 ### Changed
 - Fix vulnerabilities (top up spring-boot version to 2.4.8) 
diff --git a/pom.xml b/pom.xml
index 0c4fd86..f403bbc 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
 
   <groupId>org.onap.dcaegen2.services</groupId>
   <artifactId>prh</artifactId>
-  <version>1.6.1-SNAPSHOT</version>
+  <version>1.7.0-SNAPSHOT</version>
 
   <name>dcaegen2-services-prh</name>
   <description>PNF Registration Handler</description>
index c01a5a6..ed3ae81 100644 (file)
@@ -27,7 +27,7 @@
   <parent>
     <groupId>org.onap.dcaegen2.services</groupId>
     <artifactId>prh</artifactId>
-    <version>1.6.1-SNAPSHOT</version>
+    <version>1.7.0-SNAPSHOT</version>
   </parent>
 
   <groupId>org.onap.dcaegen2.services.prh</groupId>
index 5cb5165..cc4b6e8 100644 (file)
@@ -27,7 +27,7 @@
   <parent>
     <groupId>org.onap.dcaegen2.services</groupId>
     <artifactId>prh</artifactId>
-    <version>1.6.1-SNAPSHOT</version>
+    <version>1.7.0-SNAPSHOT</version>
   </parent>
 
   <groupId>org.onap.dcaegen2.services.prh</groupId>
index 26fb849..93efa8c 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * DCAEGEN2-SERVICES-SDK
  * ================================================================================
- * Copyright (C) 2019 NOKIA Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2021 NOKIA Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -41,6 +41,9 @@ public class AaiGetServiceInstanceClient implements
     private static final String SERVICE_TYPE = "serviceType";
     private static final String SERVICE_INSTANCE_ID = "serviceInstanceId";
 
+    private static final String VARIABLE_PREFIX = "{{";
+    private static final String VARIABLE_SUFFIX = "}}";
+
     private final RxHttpClient httpClient;
     private final AaiClientConfiguration configuration;
 
@@ -57,7 +60,8 @@ public class AaiGetServiceInstanceClient implements
             SERVICE_TYPE, aaiModel.serviceType(),
             SERVICE_INSTANCE_ID, aaiModel.serviceInstanceId());
 
-        final StringSubstitutor substitutor = new StringSubstitutor(mapping.toJavaMap());
+        final StringSubstitutor substitutor =
+            new StringSubstitutor(mapping.toJavaMap(), VARIABLE_PREFIX, VARIABLE_SUFFIX);
         final String endpoint = substitutor.replace(configuration.aaiServiceInstancePath());
 
         return httpClient.call(ImmutableHttpRequest.builder()
index fa04804..2f3dba0 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * DCAEGEN2-SERVICES-SDK
  * ================================================================================
- * Copyright (C) 2019 NOKIA Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2021 NOKIA Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ public final class AaiClientConfigurations {
             .enableAaiCertAuth(secure)
             .aaiHeaders(headers)
             .aaiServiceInstancePath(
-                "/business/customers/customer/${customer}/service-subscriptions/service-subscription/${serviceType}/service-instances/service-instance/${serviceInstanceId}")
+                "/business/customers/customer/{{customer}}/service-subscriptions/service-subscription/{{serviceType}}/service-instances/service-instance/{{serviceInstanceId}}")
             .build();
     }
-}
\ No newline at end of file
+}
index 3022380..24828c2 100644 (file)
@@ -1,6 +1,6 @@
 major=1
-minor=6
-patch=1
+minor=7
+patch=0
 base_version=${major}.${minor}.${patch}
 release_version=${base_version}
 snapshot_version=${base_version}-SNAPSHOT