Unify dmi/private/additional/cmhandle properties naming to additional 13/141313/4
authorseanbeirne <sean.beirne@est.tech>
Tue, 17 Jun 2025 10:58:21 +0000 (11:58 +0100)
committerseanbeirne <sean.beirne@est.tech>
Mon, 23 Jun 2025 12:33:28 +0000 (13:33 +0100)
properties

Issue-ID: CPS-2855
Change-Id: Iba5923ed7e1dd454ef1657b6b8dc41c35d74f9b7
Signed-off-by: seanbeirne <sean.beirne@est.tech>
34 files changed:
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/NcmpRestInputMapper.java
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/RestOutputCmHandleMapper.java
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryControllerSpec.groovy
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/util/NcmpRestInputMapperSpec.groovy
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/util/RestOutputCmHandleMapperSpec.groovy
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/models/NcmpServiceCmHandle.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/dmi/DmiInEventMapper.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/DmiDataOperations.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/models/DmiOperationCmHandle.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/utils/DmiDataOperationsHelper.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/dmi/DmiServiceAuthenticationProperties.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/dmi/DmiServiceNameOrganizer.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleRegistrationServicePropertyHandler.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceImpl.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/models/YangModelCmHandle.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/DmiModelOperations.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/models/DmiRequestBody.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/YangDataConverter.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/cmnotificationsubscription/dmi/DmiInEventMapperSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/data/DmiDataOperationsSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/data/utils/DmiDataOperationsHelperSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/WriteRequestExaminerSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/dmi/DmiOperationsBaseSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/CmHandleRegistrationServicePropertyHandlerSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/CmHandleRegistrationServiceSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImplSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/models/YangModelCmHandleSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/DmiModelOperationsSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/utils/YangDataConverterSpec.groovy

index 2af4441..a3b4086 100644 (file)
@@ -83,20 +83,20 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor
      * Execute cm handle query search and return a list of cm handle details. Any number of conditions can be applied.
      *
      * @param cmHandleQueryParameters the cm handle query parameters
-     * @param includePrivateProperties boolean value to determine the inclusion of private properties
+     * @param includeAdditionalProperties boolean value to determine the inclusion of additional properties
      * @return collection of cm handles
      */
     @Override
     public ResponseEntity<List<RestOutputCmHandle>> searchCmHandles(
             final CmHandleQueryParameters cmHandleQueryParameters,
-            final Boolean includePrivateProperties) {
+            final Boolean includeAdditionalProperties) {
         final CmHandleQueryApiParameters cmHandleQueryApiParameters =
                 deprecationHelper.mapOldConditionProperties(cmHandleQueryParameters);
-        final boolean includePrivatePropertiesParameter = Boolean.TRUE.equals(includePrivateProperties);
+        final boolean includeAdditionalPropertiesParameter = Boolean.TRUE.equals(includeAdditionalProperties);
         final List<RestOutputCmHandle> restOutputCmHandles =
                 networkCmProxyInventoryFacade.executeCmHandleInventorySearch(cmHandleQueryApiParameters)
                         .map(handle -> restOutputCmHandleMapper
-                                .toRestOutputCmHandle(handle, includePrivatePropertiesParameter))
+                                .toRestOutputCmHandle(handle, includeAdditionalPropertiesParameter))
                         .collectList().block();
         return ResponseEntity.ok(restOutputCmHandles);
     }
index 442dee2..c06e730 100644 (file)
@@ -54,7 +54,7 @@ public interface NcmpRestInputMapper {
     DmiPluginRegistration toDmiPluginRegistration(final RestDmiPluginRegistration restDmiPluginRegistration);
 
     @Mapping(source = "cmHandle", target = "cmHandleId")
-    @Mapping(source = "cmHandleProperties", target = "dmiProperties")
+    @Mapping(source = "cmHandleProperties", target = "additionalProperties")
     @Mapping(source = "publicCmHandleProperties", target = "publicProperties")
     @Mapping(source = "trustLevel", target = "registrationTrustLevel")
     NcmpServiceCmHandle toNcmpServiceCmHandle(final RestInputCmHandle restInputCmHandle);
index 095d062..685b0d5 100644 (file)
@@ -36,18 +36,18 @@ public class RestOutputCmHandleMapper {
      * Map NcmpServiceCmHandle to a RestOutputCmHandle object.
      *
      * @param ncmpServiceCmHandle            DMI plugin identifier
-     * @param includePrivateProperties       Boolean for cm handle reference type either
+     * @param includeAdditionalProperties       Boolean for cm handle reference type either
      *                                       cm handle id (False) or alternate id (True)
      * @return                               list of cm handles
      */
     public RestOutputCmHandle toRestOutputCmHandle(final NcmpServiceCmHandle ncmpServiceCmHandle,
-                                                   final boolean includePrivateProperties) {
+                                                   final boolean includeAdditionalProperties) {
         final RestOutputCmHandle restOutputCmHandle = new RestOutputCmHandle();
         restOutputCmHandle.setCmHandle(ncmpServiceCmHandle.getCmHandleId());
         restOutputCmHandle.setPublicCmHandleProperties(
                 Collections.singletonList(ncmpServiceCmHandle.getPublicProperties()));
-        if (includePrivateProperties) {
-            restOutputCmHandle.setPrivateCmHandleProperties(ncmpServiceCmHandle.getDmiProperties());
+        if (includeAdditionalProperties) {
+            restOutputCmHandle.setPrivateCmHandleProperties(ncmpServiceCmHandle.getAdditionalProperties());
         }
         restOutputCmHandle.setState(
                 cmHandleStateMapper.toCmHandleCompositeStateExternalLockReason(
index 7f1f4d6..8e55bbb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  ============LICENSE_START=======================================================
  *  Copyright (C) 2021-2022 Bell Canada
- *  Modifications Copyright (C) 2021-2024 Nordix Foundation
+ *  Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe. 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.
@@ -273,9 +273,9 @@ class NetworkCmProxyInventoryControllerSpec extends Specification {
             def postUrl = "$ncmpBasePathV1/ch/searchCmHandles?includePrivatePropertiesInQuery=true"
             String jsonString = TestUtils.getResourceFileContent('cm-handle-search-by-dmi-service.json')
         and: 'a cm handle is returned'
-            def ncmpServiceCmHandle = new NcmpServiceCmHandle(dmiProperties: ['someName': 'my dmi'])
+            def ncmpServiceCmHandle = new NcmpServiceCmHandle(additionalProperties: ['someName': 'my dmi'])
             mockNetworkCmProxyInventoryFacade.executeCmHandleInventorySearch(_) >> Flux.fromIterable([ncmpServiceCmHandle])
-        and: 'the mapper is requested to convert the object with private properties'
+        and: 'the mapper is requested to convert the object with additional properties'
             mockRestOutputCmHandleMapper.toRestOutputCmHandle(ncmpServiceCmHandle, true) >> new RestOutputCmHandle()
         when: 'the endpoint is invoked'
             def response = mvc.perform(post(postUrl).contentType(MediaType.APPLICATION_JSON).content(jsonString)).andReturn().response
index 9d1e27b..ba91e89 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2022-2024 Nordix Foundation
+ *  Copyright (C) 2022-2025 OpenInfra Foundation Europe. 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.
@@ -40,7 +40,7 @@ class NcmpRestInputMapperSpec extends Specification {
 
     def 'Convert a created REST CM Handle Input to an NCMP Service CM Handle with #scenario'() {
         given: 'a rest cm handle input'
-            def inputRestCmHandle = new RestInputCmHandle(cmHandle : 'example-id', cmHandleProperties: registrationDmiProperties,
+            def inputRestCmHandle = new RestInputCmHandle(cmHandle : 'example-id', cmHandleProperties: registrationAdditionalProperties,
                 publicCmHandleProperties: registrationPublicProperties, trustLevel: registrationTrustLevel, alternateId: 'my-alternate-id', moduleSetTag: 'my-module-set-tag', dataProducerIdentifier: 'my-data-producer-identifier')
             def restDmiPluginRegistration = new RestDmiPluginRegistration(
                 createdCmHandles: [inputRestCmHandle])
@@ -51,7 +51,7 @@ class NcmpRestInputMapperSpec extends Specification {
         and: 'the converted cm handle has the same id'
             result.createdCmHandles[0].cmHandleId == 'example-id'
         and: '(empty) properties are converted correctly'
-            result.createdCmHandles[0].dmiProperties == mappedDmiProperties
+            result.createdCmHandles[0].additionalProperties == mappedAdditionalProperties
             result.createdCmHandles[0].publicProperties == mappedPublicProperties
         and: 'other fields are mapped correctly'
             result.createdCmHandles[0].alternateId == 'my-alternate-id'
@@ -59,9 +59,9 @@ class NcmpRestInputMapperSpec extends Specification {
             result.createdCmHandles[0].registrationTrustLevel == mappedTrustLevel
             result.createdCmHandles[0].dataProducerIdentifier == 'my-data-producer-identifier'
         where: 'the following parameters are used'
-            scenario                    | registrationDmiProperties                | registrationPublicProperties                           | registrationTrustLevel || mappedDmiProperties                      | mappedPublicProperties                                 | mappedTrustLevel
-            'dmi and public properties' | ['Property-Example': 'example property'] | ['Public-Property-Example': 'public example property'] | 'COMPLETE'             || ['Property-Example': 'example property'] | ['Public-Property-Example': 'public example property'] | TrustLevel.COMPLETE
-            'no properties'             | null                                     | null                                                   | null                   || [:]                                      | [:]                                                    | null
+            scenario                           | registrationAdditionalProperties         | registrationPublicProperties                           | registrationTrustLevel || mappedAdditionalProperties               | mappedPublicProperties                                 | mappedTrustLevel
+            'additional and public properties' | ['Property-Example': 'example property'] | ['Public-Property-Example': 'public example property'] | 'COMPLETE'             || ['Property-Example': 'example property'] | ['Public-Property-Example': 'public example property'] | TrustLevel.COMPLETE
+            'no properties'                    | null                                     | null                                                   | null                   || [:]                                      | [:]                                                    | null
     }
 
     def 'Handling empty dmi registration'() {
index d6eff59..0190537 100644 (file)
@@ -37,9 +37,9 @@ class RestOutputCmHandleMapperSpec extends Specification {
         and: 'the state mapper returns a composite state'
             mockCmHandleStateMapper.toCmHandleCompositeStateExternalLockReason(ncmpServiceCmHandle.getCompositeState()) >> new CmHandleCompositeState(cmHandleState: 'ADVISED')
         when: 'the mapper function is called'
-            def result = objectUnderTest.toRestOutputCmHandle(ncmpServiceCmHandle, includePrivateProperties)
+            def result = objectUnderTest.toRestOutputCmHandle(ncmpServiceCmHandle, includeAdditionalProperties)
         then: 'result has the expected properties'
-            assert result.privateCmHandleProperties.containsKey('private property key') == includePrivateProperties
+            assert result.privateCmHandleProperties.containsKey('additional property key') == includeAdditionalProperties
             if (trustLevel != null) {
                 assert result.trustLevel == trustLevel.toString()
             }
@@ -47,14 +47,14 @@ class RestOutputCmHandleMapperSpec extends Specification {
             assert result.alternateId == 'alt-1'
             assert result.cmHandle == 'ch-1'
         where:
-            scenario                     | includePrivateProperties || trustLevel
-            'without private properties' | false                    || null
-            'with private properties'    | true                     || TrustLevel.NONE
-            'with trust level'           | false                    || TrustLevel.COMPLETE
+            scenario                        | includeAdditionalProperties || trustLevel
+            'without additional properties' | false                       || null
+            'with additional properties'    | true                        || TrustLevel.NONE
+            'with trust level'              | false                       || TrustLevel.COMPLETE
     }
 
     def createNcmpServiceCmHandle(trustLevel) {
-        return new NcmpServiceCmHandle(cmHandleId: 'ch-1', dmiProperties: ['private property key': 'some value'],
+        return new NcmpServiceCmHandle(cmHandleId: 'ch-1', additionalProperties: ['additional property key': 'some value'],
                 currentTrustLevel: trustLevel,
                 publicProperties: ['public property key': 'public property value'],
                 alternateId: 'alt-1', compositeState: new CompositeState(cmHandleState: 'ADVISED'))
index 25c9f76..5c928c1 100644 (file)
@@ -51,7 +51,7 @@ public class NcmpServiceCmHandle {
     private String dmiModelServiceName;
 
     @JsonSetter(nulls = Nulls.AS_EMPTY)
-    private Map<String, String> dmiProperties = Collections.emptyMap();
+    private Map<String, String> additionalProperties = Collections.emptyMap();
 
     @JsonSetter(nulls = Nulls.AS_EMPTY)
     private Map<String, String> publicProperties = Collections.emptyMap();
index 4ce4ef3..04fe6d1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2024 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. 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.
@@ -52,7 +52,7 @@ public class DmiInEventMapper {
         final DmiInEvent dmiInEvent = new DmiInEvent();
         final Data cmSubscriptionData = new Data();
         cmSubscriptionData.setPredicates(mapToDmiInEventPredicates(dmiCmSubscriptionPredicates));
-        cmSubscriptionData.setCmHandles(mapToCmSubscriptionCmHandleWithPrivateProperties(
+        cmSubscriptionData.setCmHandles(mapToCmSubscriptionCmHandleWithAdditionalProperties(
                 extractUniqueCmHandleIds(dmiCmSubscriptionPredicates)));
         dmiInEvent.setData(cmSubscriptionData);
         return dmiInEvent;
@@ -79,18 +79,19 @@ public class DmiInEventMapper {
 
     }
 
-    private List<CmHandle> mapToCmSubscriptionCmHandleWithPrivateProperties(final Set<String> cmHandleIds) {
+    private List<CmHandle> mapToCmSubscriptionCmHandleWithAdditionalProperties(final Set<String> cmHandleIds) {
 
         final List<CmHandle> cmSubscriptionCmHandles = new ArrayList<>();
 
         inventoryPersistence.getYangModelCmHandles(cmHandleIds).forEach(yangModelCmHandle -> {
-            final CmHandle cmhandle = new CmHandle();
-            final Map<String, String> cmhandleDmiProperties = new LinkedHashMap<>();
-            yangModelCmHandle.getDmiProperties()
-                    .forEach(dmiProperty -> cmhandleDmiProperties.put(dmiProperty.getName(), dmiProperty.getValue()));
-            cmhandle.setCmhandleId(yangModelCmHandle.getId());
-            cmhandle.setPrivateProperties(cmhandleDmiProperties);
-            cmSubscriptionCmHandles.add(cmhandle);
+            final CmHandle cmHandle = new CmHandle();
+            final Map<String, String> cmHandleAdditionalProperties = new LinkedHashMap<>();
+            yangModelCmHandle.getAdditionalProperties()
+                    .forEach(additionalProperty -> cmHandleAdditionalProperties.put(additionalProperty.getName(),
+                        additionalProperty.getValue()));
+            cmHandle.setCmhandleId(yangModelCmHandle.getId());
+            cmHandle.setPrivateProperties(cmHandleAdditionalProperties);
+            cmSubscriptionCmHandles.add(cmHandle);
         });
 
         return cmSubscriptionCmHandles;
index 25229b7..4975c35 100644 (file)
@@ -210,7 +210,7 @@ public class DmiDataOperations {
                 .dataType(dataType)
                 .moduleSetTag(yangModelCmHandle.getModuleSetTag())
                 .build();
-        dmiRequestBody.asDmiProperties(yangModelCmHandle.getDmiProperties());
+        dmiRequestBody.asAdditionalProperties(yangModelCmHandle.getAdditionalProperties());
         return jsonObjectMapper.asJsonString(dmiRequestBody);
     }
 
index 6926b68..0e18ef6 100644 (file)
@@ -33,17 +33,17 @@ public class DmiOperationCmHandle {
     private String id;
 
     @JsonProperty("cmHandleProperties")
-    private Map<String, String> dmiProperties;
+    private Map<String, String> additionalProperties;
     private String moduleSetTag;
 
     /**
      * Builds Dmi Operation Cm Handle object with all its associated properties.
      */
     public static DmiOperationCmHandle buildDmiOperationCmHandle(final String cmHandleId,
-                                                                 final Map<String, String> dmiProperties,
+                                                                 final Map<String, String> additionalProperties,
                                                                  final String moduleSetTag) {
         return DmiOperationCmHandle.builder().id(cmHandleId)
-                .dmiProperties(dmiProperties).moduleSetTag(moduleSetTag)
+                .additionalProperties(additionalProperties).moduleSetTag(moduleSetTag)
                 .build();
     }
 }
index bfacc3a..0946eae 100644 (file)
@@ -74,11 +74,11 @@ public class DmiDataOperationsHelper {
         final Map<String, String> nonReadyAlternateIdPerCmHandleId =
             filterAndGetNonReadyAlternateIdPerCmHandleId(yangModelCmHandles);
 
-        final Map<String, Map<String, Map<String, String>>> dmiPropertiesPerCmHandleIdPerServiceName =
-                DmiServiceNameOrganizer.getDmiPropertiesPerCmHandleIdPerServiceName(yangModelCmHandles);
+        final Map<String, Map<String, Map<String, String>>> additionalPropertiesPerCmHandleIdPerDmiServiceName =
+                DmiServiceNameOrganizer.getAdditionalPropertiesPerCmHandleIdPerDmiServiceName(yangModelCmHandles);
 
         final Map<String, String> dmiServiceNamesPerCmHandleId =
-                getDmiServiceNamesPerCmHandleId(dmiPropertiesPerCmHandleIdPerServiceName);
+                getDmiServiceNamesPerCmHandleId(additionalPropertiesPerCmHandleIdPerDmiServiceName);
 
         final Map<String, String> moduleSetTagPerCmHandle = getModuleSetTagPerCmHandleId(yangModelCmHandles);
 
@@ -93,15 +93,15 @@ public class DmiDataOperationsHelper {
                 } else {
                     final String cmHandleId = getCmHandleId(cmHandleReference, yangModelCmHandles);
                     final String dmiServiceName = dmiServiceNamesPerCmHandleId.get(cmHandleId);
-                    final Map<String, String> cmHandleIdProperties
-                            = dmiPropertiesPerCmHandleIdPerServiceName.get(dmiServiceName).get(cmHandleId);
-                    if (cmHandleIdProperties == null) {
+                    final Map<String, String> additionalProperties
+                            = additionalPropertiesPerCmHandleIdPerDmiServiceName.get(dmiServiceName).get(cmHandleId);
+                    if (additionalProperties == null) {
                         nonExistingCmHandleReferences.add(cmHandleReference);
                     } else {
                         final DmiDataOperation dmiBatchOperationOut = getOrAddDmiBatchOperation(dmiServiceName,
                                 dataOperationDefinitionIn, dmiDataOperationsOutPerDmiServiceName);
                         final DmiOperationCmHandle dmiOperationCmHandle = DmiOperationCmHandle
-                                .buildDmiOperationCmHandle(cmHandleId, cmHandleIdProperties,
+                                .buildDmiOperationCmHandle(cmHandleId, additionalProperties,
                                         moduleSetTagPerCmHandle.get(cmHandleId));
                         dmiBatchOperationOut.getCmHandles().add(dmiOperationCmHandle);
                     }
@@ -149,17 +149,19 @@ public class DmiDataOperationsHelper {
     }
 
     private static Map<String, String> getDmiServiceNamesPerCmHandleId(
-            final Map<String, Map<String, Map<String, String>>> dmiDmiPropertiesPerCmHandleIdPerServiceName) {
+            final Map<String, Map<String, Map<String, String>>> additionalPropertiesPerCmHandleIdPerDmiServiceName) {
         final Map<String, String> dmiServiceNamesPerCmHandleId = new HashMap<>();
-        for (final Map.Entry<String, Map<String, Map<String, String>>> dmiDmiPropertiesEntry
-                : dmiDmiPropertiesPerCmHandleIdPerServiceName.entrySet()) {
-            final String dmiServiceName = dmiDmiPropertiesEntry.getKey();
-            final Set<String> cmHandleIds = dmiDmiPropertiesPerCmHandleIdPerServiceName.get(dmiServiceName).keySet();
+        for (final Map.Entry<String, Map<String, Map<String, String>>>
+            additionalPropertiesPerCmHandleIdPerDmiServiceNameEntry
+                : additionalPropertiesPerCmHandleIdPerDmiServiceName.entrySet()) {
+            final String dmiServiceName = additionalPropertiesPerCmHandleIdPerDmiServiceNameEntry.getKey();
+            final Set<String> cmHandleIds
+                = additionalPropertiesPerCmHandleIdPerDmiServiceName.get(dmiServiceName).keySet();
             for (final String cmHandleId : cmHandleIds) {
                 dmiServiceNamesPerCmHandleId.put(cmHandleId, dmiServiceName);
             }
         }
-        dmiDmiPropertiesPerCmHandleIdPerServiceName.put(UNKNOWN_SERVICE_NAME, Collections.emptyMap());
+        additionalPropertiesPerCmHandleIdPerDmiServiceName.put(UNKNOWN_SERVICE_NAME, Collections.emptyMap());
         return dmiServiceNamesPerCmHandleId;
     }
 
index 6f9a343..e90e0e7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2024 Nordix Foundation.
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. 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.
index 37e982d..6d35f37 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2023 Nordix Foundation
+ *  Copyright (C) 2023-2025 OpenInfra Foundation Europe. 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.
@@ -38,27 +38,29 @@ public class DmiServiceNameOrganizer {
      *
      * @param yangModelCmHandles list of cm handle model
      */
-    public static Map<String, Map<String, Map<String, String>>> getDmiPropertiesPerCmHandleIdPerServiceName(
+    public static Map<String, Map<String, Map<String, String>>> getAdditionalPropertiesPerCmHandleIdPerDmiServiceName(
             final Collection<YangModelCmHandle> yangModelCmHandles) {
-        final Map<String, Map<String, Map<String, String>>> dmiPropertiesPerCmHandleIdPerServiceName
+        final Map<String, Map<String, Map<String, String>>> additionalPropertiesPerCmHandleIdPerServiceName
                 = new HashMap<>();
         yangModelCmHandles.forEach(yangModelCmHandle -> {
             final String dmiServiceName = yangModelCmHandle.resolveDmiServiceName(RequiredDmiService.DATA);
-            if (!dmiPropertiesPerCmHandleIdPerServiceName.containsKey(dmiServiceName)) {
-                final Map<String, Map<String, String>> cmHandleDmiPropertiesMap = new HashMap<>();
-                cmHandleDmiPropertiesMap.put(yangModelCmHandle.getId(),
-                        dmiPropertiesAsMap(yangModelCmHandle.getDmiProperties()));
-                dmiPropertiesPerCmHandleIdPerServiceName.put(dmiServiceName, cmHandleDmiPropertiesMap);
+            if (!additionalPropertiesPerCmHandleIdPerServiceName.containsKey(dmiServiceName)) {
+                final Map<String, Map<String, String>> cmHandleAdditionalPropertiesMap = new HashMap<>();
+                cmHandleAdditionalPropertiesMap.put(yangModelCmHandle.getId(),
+                        additionalPropertiesAsMap(yangModelCmHandle.getAdditionalProperties()));
+                additionalPropertiesPerCmHandleIdPerServiceName.put(dmiServiceName, cmHandleAdditionalPropertiesMap);
             } else {
-                dmiPropertiesPerCmHandleIdPerServiceName.get(dmiServiceName)
-                        .put(yangModelCmHandle.getId(), dmiPropertiesAsMap(yangModelCmHandle.getDmiProperties()));
+                additionalPropertiesPerCmHandleIdPerServiceName.get(dmiServiceName)
+                        .put(yangModelCmHandle.getId(),
+                            additionalPropertiesAsMap(yangModelCmHandle.getAdditionalProperties()));
             }
         });
-        return dmiPropertiesPerCmHandleIdPerServiceName;
+        return additionalPropertiesPerCmHandleIdPerServiceName;
     }
 
-    private static Map<String, String> dmiPropertiesAsMap(final List<YangModelCmHandle.Property> dmiProperties) {
-        return dmiProperties.stream().collect(
+    private static Map<String, String> additionalPropertiesAsMap(
+        final List<YangModelCmHandle.Property> additionalProperties) {
+        return additionalProperties.stream().collect(
                 Collectors.toMap(YangModelCmHandle.Property::getName, YangModelCmHandle.Property::getValue));
     }
 }
index d51a7b9..dae2f45 100644 (file)
@@ -69,9 +69,9 @@ public class CmHandleQueryServiceImpl implements CmHandleQueryService {
     private final CpsValidator cpsValidator;
 
     @Override
-    public Collection<String> queryCmHandleAdditionalProperties(final Map<String, String> privatePropertyQueryPairs,
+    public Collection<String> queryCmHandleAdditionalProperties(final Map<String, String> additionalPropertyQueryPairs,
                                                                 final boolean outputAlternateId) {
-        return queryCmHandleAnyProperties(privatePropertyQueryPairs, PropertyType.ADDITIONAL, outputAlternateId);
+        return queryCmHandleAnyProperties(additionalPropertyQueryPairs, PropertyType.ADDITIONAL, outputAlternateId);
     }
 
     @Override
index 47d03c6..0996263 100644 (file)
@@ -26,7 +26,7 @@ import static org.onap.cps.api.parameters.FetchDescendantsOption.INCLUDE_ALL_DES
 import static org.onap.cps.ncmp.api.NcmpResponseStatus.CM_HANDLES_NOT_FOUND;
 import static org.onap.cps.ncmp.api.NcmpResponseStatus.CM_HANDLE_ALREADY_EXIST;
 import static org.onap.cps.ncmp.api.NcmpResponseStatus.CM_HANDLE_INVALID_ID;
-import static org.onap.cps.ncmp.impl.inventory.CmHandleRegistrationServicePropertyHandler.PropertyType.DMI_PROPERTY;
+import static org.onap.cps.ncmp.impl.inventory.CmHandleRegistrationServicePropertyHandler.PropertyType.ADDITIONAL_PROPERTY;
 import static org.onap.cps.ncmp.impl.inventory.CmHandleRegistrationServicePropertyHandler.PropertyType.PUBLIC_PROPERTY;
 import static org.onap.cps.ncmp.impl.inventory.NcmpPersistence.NCMP_DATASPACE_NAME;
 import static org.onap.cps.ncmp.impl.inventory.NcmpPersistence.NCMP_DMI_REGISTRY_ANCHOR;
@@ -123,8 +123,9 @@ public class CmHandleRegistrationServicePropertyHandler {
             updateProperties(existingCmHandleDataNode, PUBLIC_PROPERTY,
                 updatedNcmpServiceCmHandle.getPublicProperties());
         }
-        if (!updatedNcmpServiceCmHandle.getDmiProperties().isEmpty()) {
-            updateProperties(existingCmHandleDataNode, DMI_PROPERTY, updatedNcmpServiceCmHandle.getDmiProperties());
+        if (!updatedNcmpServiceCmHandle.getAdditionalProperties().isEmpty()) {
+            updateProperties(existingCmHandleDataNode, ADDITIONAL_PROPERTY,
+                updatedNcmpServiceCmHandle.getAdditionalProperties());
         }
     }
 
@@ -242,7 +243,7 @@ public class CmHandleRegistrationServicePropertyHandler {
     }
 
     enum PropertyType {
-        DMI_PROPERTY("additional-properties"), PUBLIC_PROPERTY("public-properties");
+        ADDITIONAL_PROPERTY("additional-properties"), PUBLIC_PROPERTY("public-properties");
 
         private static final String LIST_INDEX_PATTERN = "\\[@(\\w+)[^\\/]'([^']+)']";
 
index 74ddc22..c0fd13f 100644 (file)
@@ -76,7 +76,7 @@ public class ParameterizedCmHandleQueryServiceImpl implements ParameterizedCmHan
         return executeQueries(cmHandleQueryServiceParameters, outputAlternateId,
                 this::executeCpsPathQuery,
                 this::queryCmHandlesByPublicProperties,
-                this::queryCmHandlesByPrivateProperties,
+                this::queryCmHandlesByAdditionalProperties,
                 this::queryCmHandlesByDmiPlugin);
     }
 
@@ -109,17 +109,17 @@ public class ParameterizedCmHandleQueryServiceImpl implements ParameterizedCmHan
 
     }
 
-    private Collection<String> queryCmHandlesByPrivateProperties(
+    private Collection<String> queryCmHandlesByAdditionalProperties(
             final CmHandleQueryServiceParameters cmHandleQueryServiceParameters, final boolean outputAlternateId) {
 
-        final Map<String, String> privatePropertyQueryPairs =
+        final Map<String, String> additionalPropertyQueryPairs =
                 getPropertyPairs(cmHandleQueryServiceParameters.getCmHandleQueryParameters(),
                         InventoryQueryConditions.HAS_ALL_ADDITIONAL_PROPERTIES.getName());
 
-        if (privatePropertyQueryPairs.isEmpty()) {
+        if (additionalPropertyQueryPairs.isEmpty()) {
             return NO_QUERY_TO_EXECUTE;
         }
-        return cmHandleQueryService.queryCmHandleAdditionalProperties(privatePropertyQueryPairs, outputAlternateId);
+        return cmHandleQueryService.queryCmHandleAdditionalProperties(additionalPropertyQueryPairs, outputAlternateId);
     }
 
     private Collection<String> queryCmHandlesByPublicProperties(
index a262367..21ffb39 100644 (file)
@@ -74,7 +74,7 @@ public class YangModelCmHandle {
     private String dataProducerIdentifier;
 
     @JsonProperty("additional-properties")
-    private List<Property> dmiProperties;
+    private List<Property> additionalProperties;
 
     @JsonProperty("public-properties")
     private List<Property> publicProperties;
@@ -93,7 +93,8 @@ public class YangModelCmHandle {
         copy.dmiModelServiceName = original.getDmiModelServiceName();
         copy.compositeState =
                 original.getCompositeState() == null ? null : new CompositeState(original.getCompositeState());
-        copy.dmiProperties = original.getDmiProperties() == null ? null : new ArrayList<>(original.getDmiProperties());
+        copy.additionalProperties = original.getAdditionalProperties()
+            == null ? null : new ArrayList<>(original.getAdditionalProperties());
         copy.publicProperties =
                 original.getPublicProperties() == null ? null : new ArrayList<>(original.getPublicProperties());
         copy.moduleSetTag = original.getModuleSetTag();
@@ -129,7 +130,8 @@ public class YangModelCmHandle {
         yangModelCmHandle.setModuleSetTag(StringUtils.trimToEmpty(moduleSetTag));
         yangModelCmHandle.setAlternateId(StringUtils.trimToEmpty(alternateId));
         yangModelCmHandle.setDataProducerIdentifier(StringUtils.trimToEmpty(dataProducerIdentifier));
-        yangModelCmHandle.setDmiProperties(asYangModelCmHandleProperties(ncmpServiceCmHandle.getDmiProperties()));
+        yangModelCmHandle.setAdditionalProperties(
+            asYangModelCmHandleProperties(ncmpServiceCmHandle.getAdditionalProperties()));
         yangModelCmHandle.setPublicProperties(asYangModelCmHandleProperties(ncmpServiceCmHandle.getPublicProperties()));
         yangModelCmHandle.setCompositeState(ncmpServiceCmHandle.getCompositeState());
         return yangModelCmHandle;
index eeaab0e..59a99ea 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2021-2025 Nordix Foundation
+ *  Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
  *  Modifications Copyright (C) 2022 Bell Canada
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
@@ -69,7 +69,7 @@ public class DmiModelOperations {
     public List<ModuleReference> getModuleReferences(final YangModelCmHandle yangModelCmHandle,
                                                      final String targetModuleSetTag) {
         final DmiRequestBody dmiRequestBody = DmiRequestBody.builder().moduleSetTag(targetModuleSetTag).build();
-        dmiRequestBody.asDmiProperties(yangModelCmHandle.getDmiProperties());
+        dmiRequestBody.asAdditionalProperties(yangModelCmHandle.getAdditionalProperties());
         final ResponseEntity<Object> dmiFetchModulesResponseEntity = getResourceFromDmiWithJsonData(
             yangModelCmHandle.resolveDmiServiceName(MODEL),
                 jsonObjectMapper.asJsonString(dmiRequestBody), yangModelCmHandle.getId(), "modules");
@@ -92,11 +92,11 @@ public class DmiModelOperations {
         if (newModuleReferences.isEmpty()) {
             return Collections.emptyMap();
         }
-        final String jsonWithDataAndDmiProperties = getRequestBodyToFetchYangResources(newModuleReferences,
-                yangModelCmHandle.getDmiProperties(), targetModuleSetTag);
+        final String jsonWithDataAndAdditionalProperties = getRequestBodyToFetchYangResources(newModuleReferences,
+                yangModelCmHandle.getAdditionalProperties(), targetModuleSetTag);
         final ResponseEntity<Object> responseEntity = getResourceFromDmiWithJsonData(
             yangModelCmHandle.resolveDmiServiceName(MODEL),
-            jsonWithDataAndDmiProperties,
+            jsonWithDataAndAdditionalProperties,
             yangModelCmHandle.getId(),
             "moduleResources");
         return asModuleNameToYangResourceMap(responseEntity);
@@ -125,7 +125,8 @@ public class DmiModelOperations {
     }
 
     private static String getRequestBodyToFetchYangResources(final Collection<ModuleReference> newModuleReferences,
-                                                             final List<YangModelCmHandle.Property> dmiProperties,
+                                                             final List<YangModelCmHandle.Property>
+                                                                 additionalProperties,
                                                              final String targetModuleSetTag) {
         final JsonArray moduleReferencesAsJson = getModuleReferencesAsJson(newModuleReferences);
         final JsonObject data = new JsonObject();
@@ -135,7 +136,7 @@ public class DmiModelOperations {
             jsonRequestObject.addProperty("moduleSetTag", targetModuleSetTag);
         }
         jsonRequestObject.add("data", data);
-        jsonRequestObject.add("cmHandleProperties", toJsonObject(dmiProperties));
+        jsonRequestObject.add("cmHandleProperties", toJsonObject(additionalProperties));
         return jsonRequestObject.toString();
     }
 
@@ -152,9 +153,9 @@ public class DmiModelOperations {
     }
 
     private static JsonObject toJsonObject(final List<YangModelCmHandle.Property>
-                                               dmiProperties) {
+                                               additionalProperties) {
         final JsonObject asJsonObject = new JsonObject();
-        for (final YangModelCmHandle.Property additionalProperty : dmiProperties) {
+        for (final YangModelCmHandle.Property additionalProperty : additionalProperties) {
             asJsonObject.addProperty(additionalProperty.getName(), additionalProperty.getValue());
         }
         return asJsonObject;
index 6b05385..2989b3d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2021-2023 Nordix Foundation
+ *  Copyright (C) 2021-2025 OpenInfra Foundation Europe. 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.
@@ -42,20 +42,20 @@ public class DmiRequestBody {
     private String dataType;
     private String data;
     @JsonProperty("cmHandleProperties")
-    private Map<String, String> dmiProperties;
+    private Map<String, String> additionalProperties;
     private String requestId;
     private String moduleSetTag;
 
     /**
-     * Set DMI Properties by converting a list of YangModelCmHandle.Property objects.
+     * Set additional Properties by converting a list of YangModelCmHandle.Property objects.
      *
-     * @param yangModelCmHandleProperties list of cm handle dmi properties
+     * @param yangModelCmHandleProperties list of cm handle additional properties
      */
-    public void asDmiProperties(
+    public void asAdditionalProperties(
         final List<YangModelCmHandle.Property> yangModelCmHandleProperties) {
-        dmiProperties = new LinkedHashMap<>();
-        for (final YangModelCmHandle.Property dmiProperty : yangModelCmHandleProperties) {
-            dmiProperties.put(dmiProperty.getName(), dmiProperty.getValue());
+        additionalProperties = new LinkedHashMap<>();
+        for (final YangModelCmHandle.Property additionalProperty : yangModelCmHandleProperties) {
+            additionalProperties.put(additionalProperty.getName(), additionalProperty.getValue());
         }
     }
 
index 1ca6a1f..07945d9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2022-2024 Nordix Foundation
+ *  Copyright (C) 2022-2025 OpenInfra Foundation Europe. 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.
@@ -49,7 +49,7 @@ public class YangDataConverter {
      */
     public static NcmpServiceCmHandle toNcmpServiceCmHandle(final YangModelCmHandle yangModelCmHandle) {
         final NcmpServiceCmHandle ncmpServiceCmHandle = new NcmpServiceCmHandle();
-        final List<YangModelCmHandle.Property> dmiProperties = yangModelCmHandle.getDmiProperties();
+        final List<YangModelCmHandle.Property> additionalProperties = yangModelCmHandle.getAdditionalProperties();
         final List<YangModelCmHandle.Property> publicProperties = yangModelCmHandle.getPublicProperties();
         ncmpServiceCmHandle.setCmHandleId(yangModelCmHandle.getId());
         ncmpServiceCmHandle.setDmiServiceName(yangModelCmHandle.getDmiServiceName());
@@ -59,7 +59,7 @@ public class YangDataConverter {
         ncmpServiceCmHandle.setModuleSetTag(yangModelCmHandle.getModuleSetTag());
         ncmpServiceCmHandle.setAlternateId(yangModelCmHandle.getAlternateId());
         ncmpServiceCmHandle.setDataProducerIdentifier(yangModelCmHandle.getDataProducerIdentifier());
-        setDmiProperties(dmiProperties, ncmpServiceCmHandle);
+        setAdditionalProperties(additionalProperties, ncmpServiceCmHandle);
         setPublicProperties(publicProperties, ncmpServiceCmHandle);
         return ncmpServiceCmHandle;
     }
@@ -122,20 +122,20 @@ public class YangDataConverter {
 
     private static void populateCmHandleDetails(final DataNode cmHandleDataNode,
                                                 final NcmpServiceCmHandle ncmpServiceCmHandle) {
-        final Map<String, String> dmiProperties = new LinkedHashMap<>();
+        final Map<String, String> additionalProperties = new LinkedHashMap<>();
         final Map<String, String> publicProperties = new LinkedHashMap<>();
         final CompositeStateBuilder compositeStateBuilder = new CompositeStateBuilder();
         CompositeState compositeState = compositeStateBuilder.build();
         for (final DataNode childDataNode: cmHandleDataNode.getChildDataNodes()) {
             if (childDataNode.getXpath().contains("/additional-properties[@name=")) {
-                addProperty(childDataNode, dmiProperties);
+                addProperty(childDataNode, additionalProperties);
             } else if (childDataNode.getXpath().contains("/public-properties[@name=")) {
                 addProperty(childDataNode, publicProperties);
             } else if (childDataNode.getXpath().endsWith("/state")) {
                 compositeState = compositeStateBuilder.fromDataNode(childDataNode).build();
             }
         }
-        ncmpServiceCmHandle.setDmiProperties(dmiProperties);
+        ncmpServiceCmHandle.setAdditionalProperties(additionalProperties);
         ncmpServiceCmHandle.setPublicProperties(publicProperties);
         ncmpServiceCmHandle.setCompositeState(compositeState);
     }
@@ -145,9 +145,9 @@ public class YangDataConverter {
                 String.valueOf(propertyDataNode.getLeaves().get("value")));
     }
 
-    private static void setDmiProperties(final List<YangModelCmHandle.Property> dmiProperties,
+    private static void setAdditionalProperties(final List<YangModelCmHandle.Property> additionalProperties,
                                          final NcmpServiceCmHandle ncmpServiceCmHandle) {
-        ncmpServiceCmHandle.setDmiProperties(toPropertiesMap(dmiProperties));
+        ncmpServiceCmHandle.setAdditionalProperties(toPropertiesMap(additionalProperties));
     }
 
     private static void setPublicProperties(final List<YangModelCmHandle.Property> publicProperties,
index 62d1572..44f5890 100644 (file)
@@ -36,8 +36,8 @@ class DmiInEventMapperSpec extends Specification {
     def objectUnderTest = new DmiInEventMapper(mockInventoryPersistence)
 
     def setup() {
-        def yangModelCmHandles = [new YangModelCmHandle(id: 'ch-1', dmiProperties: [new YangModelCmHandle.Property('k1', 'v1')], publicProperties: []),
-                                  new YangModelCmHandle(id: 'ch-2', dmiProperties: [new YangModelCmHandle.Property('k2', 'v2')], publicProperties: [])]
+        def yangModelCmHandles = [new YangModelCmHandle(id: 'ch-1', additionalProperties: [new YangModelCmHandle.Property('k1', 'v1')], publicProperties: []),
+                                  new YangModelCmHandle(id: 'ch-2', additionalProperties: [new YangModelCmHandle.Property('k2', 'v2')], publicProperties: [])]
         mockInventoryPersistence.getYangModelCmHandles(['ch-1', 'ch-2'] as Set) >> yangModelCmHandles
     }
 
index 717b35a..1f4da93 100644 (file)
@@ -85,7 +85,7 @@ class DmiDataOperationsSpec extends DmiOperationsBaseSpec {
     def 'call get resource data for #expectedDataStore from DMI without topic #scenario.'() {
         given: 'a cm handle for #cmHandleId'
             alternateIdMatcher.getCmHandleId(cmHandleId) >> cmHandleId
-            mockYangModelCmHandleRetrieval(dmiProperties)
+            mockYangModelCmHandleRetrieval(additionalProperties)
         and: 'a positive response from DMI service when it is called with the expected parameters'
             def responseFromDmi = Mono.just(new ResponseEntity<Object>('{some-key:some-value}', HttpStatus.OK))
             def expectedUrlTemplateWithVariables = getExpectedUrlTemplateWithVariables(expectedOptions, expectedDataStore)
@@ -98,7 +98,7 @@ class DmiDataOperationsSpec extends DmiOperationsBaseSpec {
             assert result.body == '{some-key:some-value}'
             assert result.statusCode.'2xxSuccessful'
         where: 'the following parameters are used'
-            scenario                               | dmiProperties               || expectedDataStore       | expectedOptions | expectedProperties
+            scenario                               | additionalProperties        || expectedDataStore       | expectedOptions | expectedProperties
             'without properties'                   | []                          || PASSTHROUGH_OPERATIONAL | OPTIONS_PARAM   | '{}'
             'with properties'                      | [yangModelCmHandleProperty] || PASSTHROUGH_OPERATIONAL | OPTIONS_PARAM   | '{"prop1":"val1"}'
             'null options'                         | [yangModelCmHandleProperty] || PASSTHROUGH_OPERATIONAL | null            | '{"prop1":"val1"}'
index 22ce4ab..f282b75 100644 (file)
@@ -135,24 +135,24 @@ class DmiDataOperationsHelperSpec extends MessagingBaseSpec {
     }
 
     static def getYangModelCmHandles() {
-        def dmiProperties = [new YangModelCmHandle.Property('prop', 'some DMI property')]
+        def additionalProperties = [new YangModelCmHandle.Property('prop', 'some additional property')]
         def readyState = new CompositeStateBuilder().withCmHandleState(READY).withLastUpdatedTimeNow().build()
         def advisedState = new CompositeStateBuilder().withCmHandleState(ADVISED).withLastUpdatedTimeNow().build()
-        return [new YangModelCmHandle(id: 'ch1-dmi1', 'alternateId': 'alt1-dmi1', dmiServiceName: 'dmi1', dmiProperties: dmiProperties, compositeState: readyState),
-                new YangModelCmHandle(id: 'ch2-dmi1', 'alternateId': 'alt2-dmi1', dmiServiceName: 'dmi1', dmiProperties: dmiProperties, compositeState: readyState),
-                new YangModelCmHandle(id: 'ch6-dmi1', 'alternateId': 'alt6-dmi1', dmiServiceName: 'dmi1', dmiProperties: dmiProperties, compositeState: readyState),
-                new YangModelCmHandle(id: 'ch8-dmi1', 'alternateId': 'alt8-dmi1', dmiServiceName: 'dmi1', dmiProperties: dmiProperties, compositeState: readyState),
-                new YangModelCmHandle(id: 'ch3-dmi2', 'alternateId': 'alt3-dmi2', dmiServiceName: 'dmi2', dmiProperties: dmiProperties, compositeState: readyState),
-                new YangModelCmHandle(id: 'ch4-dmi2', 'alternateId': 'alt4-dmi2', dmiServiceName: 'dmi2', dmiProperties: dmiProperties, compositeState: readyState),
-                new YangModelCmHandle(id: 'ch7-dmi2', 'alternateId': 'alt7-dmi2', dmiServiceName: 'dmi2', dmiProperties: dmiProperties, compositeState: readyState),
-                new YangModelCmHandle(id: 'non-ready-cm-handle', 'alternateId': 'non-ready-alternate', dmiServiceName: 'dmi2', dmiProperties: dmiProperties, compositeState: advisedState)
+        return [new YangModelCmHandle(id: 'ch1-dmi1', 'alternateId': 'alt1-dmi1', dmiServiceName: 'dmi1', additionalProperties: additionalProperties, compositeState: readyState),
+                new YangModelCmHandle(id: 'ch2-dmi1', 'alternateId': 'alt2-dmi1', dmiServiceName: 'dmi1', additionalProperties: additionalProperties, compositeState: readyState),
+                new YangModelCmHandle(id: 'ch6-dmi1', 'alternateId': 'alt6-dmi1', dmiServiceName: 'dmi1', additionalProperties: additionalProperties, compositeState: readyState),
+                new YangModelCmHandle(id: 'ch8-dmi1', 'alternateId': 'alt8-dmi1', dmiServiceName: 'dmi1', additionalProperties: additionalProperties, compositeState: readyState),
+                new YangModelCmHandle(id: 'ch3-dmi2', 'alternateId': 'alt3-dmi2', dmiServiceName: 'dmi2', additionalProperties: additionalProperties, compositeState: readyState),
+                new YangModelCmHandle(id: 'ch4-dmi2', 'alternateId': 'alt4-dmi2', dmiServiceName: 'dmi2', additionalProperties: additionalProperties, compositeState: readyState),
+                new YangModelCmHandle(id: 'ch7-dmi2', 'alternateId': 'alt7-dmi2', dmiServiceName: 'dmi2', additionalProperties: additionalProperties, compositeState: readyState),
+                new YangModelCmHandle(id: 'non-ready-cm-handle', 'alternateId': 'non-ready-alternate', dmiServiceName: 'dmi2', additionalProperties: additionalProperties, compositeState: advisedState)
         ]
     }
 
     static def getYangModelCmHandlesForOneCmHandle() {
-        def dmiProperties = [new YangModelCmHandle.Property('prop', 'some DMI property')]
+        def additionalProperties = [new YangModelCmHandle.Property('prop', 'some additional property')]
         def readyState = new CompositeStateBuilder().withCmHandleState(READY).withLastUpdatedTimeNow().build()
-        return [new YangModelCmHandle(id: 'ch1-dmi1', dmiServiceName: 'dmi1', moduleSetTag: 'module-set-tag1', dmiProperties: dmiProperties, compositeState: readyState)]
+        return [new YangModelCmHandle(id: 'ch1-dmi1', dmiServiceName: 'dmi1', moduleSetTag: 'module-set-tag1', additionalProperties: additionalProperties, compositeState: readyState)]
     }
 
     def mockAndPopulateErrorMap(errorReportedToClientTopic) {
index 75cad77..d950069 100644 (file)
@@ -34,13 +34,13 @@ class WriteRequestExaminerSpec extends Specification {
     def objectUnderTest = new WriteRequestExaminer(mockAlternateIdMatcher, mockInventoryPersistence)
 
     def setup() {
-        def yangModelCmHandle1 = new YangModelCmHandle(id: 'ch1', dmiServiceName: 'dmiA', dmiProperties: [],
+        def yangModelCmHandle1 = new YangModelCmHandle(id: 'ch1', dmiServiceName: 'dmiA', additionalProperties: [],
             publicProperties: [], compositeState: null, moduleSetTag: '', alternateId: 'fdn1', dataProducerIdentifier: 'p1')
-        def yangModelCmHandle2 = new YangModelCmHandle(id: 'ch2', dmiServiceName: 'dmiA', dmiProperties: [],
+        def yangModelCmHandle2 = new YangModelCmHandle(id: 'ch2', dmiServiceName: 'dmiA', additionalProperties: [],
             publicProperties: [], compositeState: null, moduleSetTag: '', alternateId: 'fdn2', dataProducerIdentifier: 'p1')
-        def yangModelCmHandle3 = new YangModelCmHandle(id: 'ch3', dmiServiceName: 'dmiA', dmiProperties: [],
+        def yangModelCmHandle3 = new YangModelCmHandle(id: 'ch3', dmiServiceName: 'dmiA', additionalProperties: [],
             publicProperties: [], compositeState: null, moduleSetTag: '', alternateId: 'fdn3', dataProducerIdentifier: 'p2')
-        def yangModelCmHandle4 = new YangModelCmHandle(id: 'ch4', dmiServiceName: 'dmiB', dmiProperties: [],
+        def yangModelCmHandle4 = new YangModelCmHandle(id: 'ch4', dmiServiceName: 'dmiB', additionalProperties: [],
             publicProperties: [], compositeState: null, moduleSetTag: '', alternateId: 'fdn4', dataProducerIdentifier: 'p1')
         mockAlternateIdMatcher.getCmHandleIdsByLongestMatchingAlternateIds(_, '/') > ['ch1','ch2','ch3','ch4']
 
index c5c1397..c3f14eb 100644 (file)
@@ -49,25 +49,25 @@ abstract class DmiOperationsBaseSpec extends Specification {
     def static alternateId = 'alt-id-' + cmHandleId
     def static resourceIdentifier = 'parent/child'
 
-    def mockYangModelCmHandleRetrieval(dmiProperties) {
-        populateYangModelCmHandle(dmiProperties, '')
+    def mockYangModelCmHandleRetrieval(additionalProperties) {
+        populateYangModelCmHandle(additionalProperties, '')
         mockInventoryPersistence.getYangModelCmHandle(cmHandleId) >> yangModelCmHandle
     }
 
-    def mockYangModelCmHandleRetrieval(dmiProperties, moduleSetTag) {
-        populateYangModelCmHandle(dmiProperties, moduleSetTag)
+    def mockYangModelCmHandleRetrieval(additionalProperties, moduleSetTag) {
+        populateYangModelCmHandle(additionalProperties, moduleSetTag)
         mockInventoryPersistence.getYangModelCmHandle(cmHandleId) >> yangModelCmHandle
     }
 
-    def mockYangModelCmHandleRetrievalByCmHandleId(dmiProperties) {
-        populateYangModelCmHandle(dmiProperties, '')
+    def mockYangModelCmHandleRetrievalByCmHandleId(additionalProperties) {
+        populateYangModelCmHandle(additionalProperties, '')
         mockInventoryPersistence.getYangModelCmHandles(_) >> [yangModelCmHandle]
     }
 
-    def populateYangModelCmHandle(dmiProperties, moduleSetTag) {
+    def populateYangModelCmHandle(additionalProperties, moduleSetTag) {
         yangModelCmHandle.dmiDataServiceName = dmiServiceName
         yangModelCmHandle.dmiServiceName = dmiServiceName
-        yangModelCmHandle.dmiProperties = dmiProperties
+        yangModelCmHandle.additionalProperties = additionalProperties
         yangModelCmHandle.id = cmHandleId
         yangModelCmHandle.alternateId = alternateId
         yangModelCmHandle.compositeState = new CompositeState()
index cec3acb..e3ebbcd 100644 (file)
@@ -102,11 +102,11 @@ class CmHandleRegistrationServicePropertyHandlerSpec extends Specification {
             'property ignored(value is null)' | ['pub-prop': null]           || [['publicProp3': 'publicValue3'], ['publicProp4': 'publicValue4']]
     }
 
-    def 'Update DMI Properties: #scenario'() {
+    def 'Update Additional Properties: #scenario'() {
         given: 'the CPS service return a CM handle'
             mockInventoryPersistence.getCmHandleDataNodeByCmHandleId(cmHandleId, INCLUDE_ALL_DESCENDANTS) >> cmHandleDataNodeAsCollection
-        and: 'an update cm handle request with DMI properties updates'
-            def cmHandleUpdateRequest = [new NcmpServiceCmHandle(cmHandleId: cmHandleId, dmiProperties: updatedDmiProperties)]
+        and: 'an update cm handle request with additional properties updates'
+            def cmHandleUpdateRequest = [new NcmpServiceCmHandle(cmHandleId: cmHandleId, additionalProperties: updatedAdditionalProperties)]
         when: 'update data node leaves is called with the update request'
             objectUnderTest.updateCmHandleProperties(cmHandleUpdateRequest)
         then: 'replace list method should is called with correct params'
@@ -116,8 +116,8 @@ class CmHandleRegistrationServicePropertyHandlerSpec extends Specification {
                     assert args[1].leaves.containsAll(convertToProperties(expectedPropertiesAfterUpdate))
                 }
             }
-        where: 'following DMI properties updates are made'
-            scenario                          | updatedDmiProperties                || expectedPropertiesAfterUpdate                                                                                           | expectedCallsToReplaceMethod
+        where: 'following additional properties updates are made'
+            scenario                          | updatedAdditionalProperties          || expectedPropertiesAfterUpdate                                                                                           | expectedCallsToReplaceMethod
             'property added'                  | ['newAdditionalProp1': 'add-value'] || [['additionalProp1': 'additionalValue1'], ['additionalProp2': 'additionalValue2'], ['newAdditionalProp1': 'add-value']] | 1
             'property updated'                | ['additionalProp1': 'newValue']     || [['additionalProp2': 'additionalValue2'], ['additionalProp1': 'newValue']]                                              | 1
             'property removed'                | ['additionalProp1': null]           || [['additionalProp2': 'additionalValue2']]                                                                               | 1
@@ -125,7 +125,7 @@ class CmHandleRegistrationServicePropertyHandlerSpec extends Specification {
             'no property changes'             | [:]                                 || [['additionalProp1': 'additionalValue1'], ['additionalProp2': 'additionalValue2']]                                      | 0
     }
 
-    def 'Update CM Handle Properties, remove all properties: #scenario'() {
+    def 'Update CM Handle Properties, remove all public properties: #scenario'() {
         given: 'the CPS service return a CM handle'
             def cmHandleDataNode = new DataNode(xpath: cmHandleXpath, leaves: ['id': cmHandleId], childDataNodes: originalPropertyDataNodes)
             mockInventoryPersistence.getCmHandleDataNodeByCmHandleId(cmHandleId, INCLUDE_ALL_DESCENDANTS) >> [cmHandleDataNode]
@@ -149,7 +149,7 @@ class CmHandleRegistrationServicePropertyHandlerSpec extends Specification {
 
     def '#scenario error leads to #exception when we try to update cmHandle'() {
         given: 'cm handles request'
-            def cmHandleUpdateRequest = [new NcmpServiceCmHandle(cmHandleId: cmHandleId, publicProperties: [:], dmiProperties: [:])]
+            def cmHandleUpdateRequest = [new NcmpServiceCmHandle(cmHandleId: cmHandleId, publicProperties: [:], additionalProperties: [:])]
         and: 'data node cannot be found'
             mockInventoryPersistence.getCmHandleDataNodeByCmHandleId(*_) >> { throw exception }
         when: 'update data node leaves is called using correct parameters'
@@ -172,9 +172,9 @@ class CmHandleRegistrationServicePropertyHandlerSpec extends Specification {
 
     def 'Multiple update operations in a single request'() {
         given: 'cm handles request'
-            def cmHandleUpdateRequest = [new NcmpServiceCmHandle(cmHandleId: cmHandleId, publicProperties: ['publicProp1': "value"], dmiProperties: [:]),
-                                         new NcmpServiceCmHandle(cmHandleId: cmHandleId, publicProperties: ['publicProp1': "value"], dmiProperties: [:]),
-                                         new NcmpServiceCmHandle(cmHandleId: cmHandleId, publicProperties: ['publicProp1': "value"], dmiProperties: [:])]
+            def cmHandleUpdateRequest = [new NcmpServiceCmHandle(cmHandleId: cmHandleId, publicProperties: ['publicProp1': "value"], additionalProperties: [:]),
+                                         new NcmpServiceCmHandle(cmHandleId: cmHandleId, publicProperties: ['publicProp1': "value"], additionalProperties: [:]),
+                                         new NcmpServiceCmHandle(cmHandleId: cmHandleId, publicProperties: ['publicProp1': "value"], additionalProperties: [:])]
         and: 'data node can be found for 1st and 3rd cm-handle but not for 2nd cm-handle'
             mockInventoryPersistence.getCmHandleDataNodeByCmHandleId(*_) >> cmHandleDataNodeAsCollection >> {
                 throw new DataNodeNotFoundException(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR) } >> cmHandleDataNodeAsCollection
index 5e4e738..802f30c 100644 (file)
@@ -76,8 +76,8 @@ class CmHandleRegistrationServiceSpec extends Specification {
     def 'DMI Registration: Create, Update, Delete & Upgrade operations are processed in the right order'() {
         given: 'a registration with operations of all types'
             def dmiRegistration = new DmiPluginRegistration(dmiPlugin: 'my-server')
-            dmiRegistration.setCreatedCmHandles([new NcmpServiceCmHandle(cmHandleId: 'cmhandle-1', publicProperties: ['publicProp1': 'value'], dmiProperties: [:])])
-            dmiRegistration.setUpdatedCmHandles([new NcmpServiceCmHandle(cmHandleId: 'cmhandle-2', publicProperties: ['publicProp1': 'value'], dmiProperties: [:])])
+            dmiRegistration.setCreatedCmHandles([new NcmpServiceCmHandle(cmHandleId: 'cmhandle-1', publicProperties: ['publicProp1': 'value'], additionalProperties: [:])])
+            dmiRegistration.setUpdatedCmHandles([new NcmpServiceCmHandle(cmHandleId: 'cmhandle-2', publicProperties: ['publicProp1': 'value'], additionalProperties: [:])])
             dmiRegistration.setRemovedCmHandles(['cmhandle-3'])
             dmiRegistration.setUpgradedCmHandles(new UpgradedCmHandles(cmHandles: ['cmhandle-4', 'cmhandle-5'], moduleSetTag: moduleSetTagForUpgrade))
         and: 'cm handles 2,3 and 4 already exist in the inventory'
@@ -200,7 +200,7 @@ class CmHandleRegistrationServiceSpec extends Specification {
     def 'Create CM-Handle Successfully: #scenario.'() {
         given: 'a registration without cm-handle properties'
             def dmiPluginRegistration = new DmiPluginRegistration(dmiPlugin: 'my-server')
-            dmiPluginRegistration.createdCmHandles = [new NcmpServiceCmHandle(cmHandleId: 'cmhandle', dmiProperties: dmiProperties, publicProperties: publicProperties)]
+            dmiPluginRegistration.createdCmHandles = [new NcmpServiceCmHandle(cmHandleId: 'cmhandle', additionalProperties: additionalProperties, publicProperties: publicProperties)]
         when: 'registration is updated'
             def response = objectUnderTest.updateDmiRegistration(dmiPluginRegistration)
         then: 'a successful response is received'
@@ -218,11 +218,11 @@ class CmHandleRegistrationServiceSpec extends Specification {
                     }
             }
         where:
-            scenario                          | dmiProperties            | publicProperties               || expectedDmiProperties                      | expectedPublicProperties
-            'with dmi & public properties'    | ['dmi-key': 'dmi-value'] | ['public-key': 'public-value'] || '[{"name":"dmi-key","value":"dmi-value"}]' | '[{"name":"public-key","value":"public-value"}]'
-            'with only public properties'     | [:]                      | ['public-key': 'public-value'] || [:]                                        | '[{"name":"public-key","value":"public-value"}]'
-            'with only dmi properties'        | ['dmi-key': 'dmi-value'] | [:]                            || '[{"name":"dmi-key","value":"dmi-value"}]' | [:]
-            'without dmi & public properties' | [:]                      | [:]                            || [:]                                        | [:]
+            scenario                                 | additionalProperties     | publicProperties               || expectedAdditionalProperties               | expectedPublicProperties
+            'with additional & public properties'    | ['dmi-key': 'dmi-value'] | ['public-key': 'public-value'] || '[{"name":"dmi-key","value":"dmi-value"}]' | '[{"name":"public-key","value":"public-value"}]'
+            'with only public properties'            | [:]                      | ['public-key': 'public-value'] || [:]                                        | '[{"name":"public-key","value":"public-value"}]'
+            'with only dmi properties'               | ['dmi-key': 'dmi-value'] | [:]                            || '[{"name":"dmi-key","value":"dmi-value"}]' | [:]
+            'without additional & public properties' | [:]                      | [:]                            || [:]                                        | [:]
     }
 
     def 'Add CM-Handle #scenario.'() {
index 2adc90c..8ad03ad 100644 (file)
@@ -84,7 +84,7 @@ class InventoryPersistenceImplSpec extends Specification {
                                                       new DataNode(xpath: "/dmi-registry/cm-handles[@id='some cm handle']/public-properties[@name='myPublicProperty']", leaves: ["name":"myPublicProperty","value":"myPublicValue"])]
 
     @Shared
-    def childDataNodesForCmHandleWithDMIProperties = [new DataNode(xpath: "/dmi-registry/cm-handles[@id='some-cm-handle']/additional-properties[@name='myAdditionalProperty']", leaves: ["name":"myAdditionalProperty", "value":"myAdditionalValue"])]
+    def childDataNodesForCmHandleWithAdditionalProperties = [new DataNode(xpath: "/dmi-registry/cm-handles[@id='some-cm-handle']/additional-properties[@name='myAdditionalProperty']", leaves: ["name":"myAdditionalProperty", "value":"myAdditionalValue"])]
 
     @Shared
     def childDataNodesForCmHandleWithPublicProperties = [new DataNode(xpath: "/dmi-registry/cm-handles[@id='some-cm-handle']/public-properties[@name='myPublicProperty']", leaves: ["name":"myPublicProperty","value":"myPublicValue"])]
@@ -104,7 +104,7 @@ class InventoryPersistenceImplSpec extends Specification {
             result.dmiDataServiceName == 'data service name'
             result.dmiModelServiceName == 'model service name'
         and: 'the expected additional properties'
-            result.dmiProperties.name == expectedAdditionalProperties
+            result.additionalProperties.name == expectedAdditionalProperties
         and: 'the expected public properties'
             result.publicProperties.name == expectedPublicProperties
         and: 'the state details are returned'
@@ -112,12 +112,12 @@ class InventoryPersistenceImplSpec extends Specification {
         and: 'the CM Handle ID is validated'
             1 * mockCpsValidator.validateNameCharacters(cmHandleId)
         where: 'the following parameters are used'
-            scenario                    | childDataNodes                                || expectedAdditionalProperties || expectedPublicProperties || expectedCompositeState
-            'no properties'             | []                                            || []                           || []                       || null
-            'DMI and public properties' | childDataNodesForCmHandleWithAllProperties    || ["myAdditionalProperty"]     || ["myPublicProperty"]     || null
-            'just DMI properties'       | childDataNodesForCmHandleWithDMIProperties    || ["myAdditionalProperty"]     || []                       || null
-            'just public properties'    | childDataNodesForCmHandleWithPublicProperties || []                           || ["myPublicProperty"]     || null
-            'with state details'        | childDataNodesForCmHandleWithState            || []                           || []                       || CmHandleState.ADVISED
+            scenario                           | childDataNodes                                    || expectedAdditionalProperties || expectedPublicProperties || expectedCompositeState
+            'no properties'                    | []                                                || []                           || []                       || null
+            'additional and public properties' | childDataNodesForCmHandleWithAllProperties        || ["myAdditionalProperty"]     || ["myPublicProperty"]     || null
+            'just additional properties'       | childDataNodesForCmHandleWithAdditionalProperties || ["myAdditionalProperty"]     || []                       || null
+            'just public properties'           | childDataNodesForCmHandleWithPublicProperties     || []                           || ["myPublicProperty"]     || null
+            'with state details'               | childDataNodesForCmHandleWithState                || []                           || []                       || CmHandleState.ADVISED
     }
 
     def 'Handling missing service names as null.'() {
@@ -238,7 +238,7 @@ class InventoryPersistenceImplSpec extends Specification {
 
     def 'Save Cmhandle'() {
         given: 'cmHandle represented as Yang Model'
-            def yangModelCmHandle = new YangModelCmHandle(id: 'cmhandle', dmiProperties: [], publicProperties: [])
+            def yangModelCmHandle = new YangModelCmHandle(id: 'cmhandle', additionalProperties: [], publicProperties: [])
         when: 'the method to save cmhandle is called'
             objectUnderTest.saveCmHandle(yangModelCmHandle)
         then: 'the data service method to save list elements is called once'
index 69654e3..ff771c1 100644 (file)
@@ -118,11 +118,11 @@ class NetworkCmProxyInventoryFacadeSpec extends Specification {
                 lastUpdateTime: 'some-timestamp',
                 dataSyncEnabled: false,
                 dataStores: dataStores())
-            def dmiProperties = [new YangModelCmHandle.Property('Book', 'Romance Novel')]
+            def additionalProperties = [new YangModelCmHandle.Property('Book', 'Romance Novel')]
             def publicProperties = [new YangModelCmHandle.Property('Public Book', 'Public Romance Novel')]
             def moduleSetTag = 'some-module-set-tag'
             def alternateId = 'some-alternate-id'
-            def yangModelCmHandle = new YangModelCmHandle(id: 'some-cm-handle', dmiServiceName: dmiServiceName, dmiProperties: dmiProperties,
+            def yangModelCmHandle = new YangModelCmHandle(id: 'some-cm-handle', dmiServiceName: dmiServiceName, additionalProperties: additionalProperties,
                  publicProperties: publicProperties, compositeState: compositeState, moduleSetTag: moduleSetTag, alternateId: alternateId)
             1 * mockAlternateIdMatcher.getCmHandleId(cmHandleRef) >> 'some-cm-handle'
             1 * mockInventoryPersistence.getYangModelCmHandle('some-cm-handle') >> yangModelCmHandle
@@ -137,8 +137,8 @@ class NetworkCmProxyInventoryFacadeSpec extends Specification {
             assert result.alternateId == 'some-alternate-id'
         and: 'the cm handle contains the module-set-tag'
             assert result.moduleSetTag == 'some-module-set-tag'
-        and: 'the cm handle contains the DMI Properties'
-            assert result.dmiProperties ==[ Book:'Romance Novel' ]
+        and: 'the cm handle contains the additional Properties'
+            assert result.additionalProperties ==[Book:'Romance Novel' ]
         and: 'the cm handle contains the public Properties'
             assert result.publicProperties == [ "Public Book":'Public Romance Novel' ]
         and: 'the cm handle contains the cm handle composite state'
@@ -153,11 +153,11 @@ class NetworkCmProxyInventoryFacadeSpec extends Specification {
 
     def 'Get cm handle public properties using #scenario'() {
         given: 'a yang modelled cm handle'
-            def dmiProperties = [new YangModelCmHandle.Property('prop', 'some DMI property')]
+            def additionalProperties = [new YangModelCmHandle.Property('prop', 'some additional property')]
             def publicProperties = [new YangModelCmHandle.Property('public prop', 'some public prop')]
             def cmHandleId = 'some-cm-handle'
             def alternateId = 'some-alternate-id'
-            def yangModelCmHandle = new YangModelCmHandle(id:cmHandleId, alternateId: alternateId, dmiServiceName: 'some service name', dmiProperties: dmiProperties, publicProperties: publicProperties)
+            def yangModelCmHandle = new YangModelCmHandle(id:cmHandleId, alternateId: alternateId, dmiServiceName: 'some service name', additionalProperties: additionalProperties, publicProperties: publicProperties)
         and: 'we have corresponding cm handle for the cm handle reference'
             1 * mockAlternateIdMatcher.getCmHandleId(cmHandleRef) >> cmHandleId
         and: 'the system returns this yang modelled cm handle'
@@ -179,11 +179,11 @@ class NetworkCmProxyInventoryFacadeSpec extends Specification {
                 lastUpdateTime: 'some-timestamp',
                 dataSyncEnabled: false,
                 dataStores: dataStores())
-            def dmiProperties = [new YangModelCmHandle.Property('prop', 'some DMI property')]
+            def additionalProperties = [new YangModelCmHandle.Property('prop', 'some DMI property')]
             def publicProperties = [new YangModelCmHandle.Property('public prop', 'some public prop')]
             def cmHandleId = 'some-cm-handle'
             def alternateId = 'some-alternate-id'
-            def yangModelCmHandle = new YangModelCmHandle(id:cmHandleId, alternateId: alternateId, dmiServiceName: 'some service name', dmiProperties: dmiProperties, publicProperties: publicProperties, compositeState: compositeState)
+            def yangModelCmHandle = new YangModelCmHandle(id:cmHandleId, alternateId: alternateId, dmiServiceName: 'some service name', additionalProperties: additionalProperties, publicProperties: publicProperties, compositeState: compositeState)
         and: 'we have corresponding cm handle for the cm handle reference'
             1 * mockAlternateIdMatcher.getCmHandleId(cmHandleRef) >> cmHandleId
         and: 'the system returns this yang modelled cm handle'
index 4735cf3..1d69aab 100644 (file)
@@ -147,11 +147,11 @@ class ParameterizedCmHandleQueryServiceSpec extends Specification {
             1 * mockInventoryPersistence.getCmHandleReferencesWithGivenModules(['some-module-name'], false) >> ['ch1']
         and: 'the inventory service is called with teh correct if and returns a yang model cm handle'
             1 * mockInventoryPersistence.getYangModelCmHandles(['ch1']) >>
-                [new YangModelCmHandle(id: 'abc', dmiProperties: [new YangModelCmHandle.Property('name','value')], publicProperties: [])]
+                [new YangModelCmHandle(id: 'abc', additionalProperties: [new YangModelCmHandle.Property('name','value')], publicProperties: [])]
         and: 'the expected cm handle(s) are returned as NCMP Service cm handles'
             assert result[0] instanceof NcmpServiceCmHandle
             assert result.size() == 1
-            assert result[0].dmiProperties == [name:'value']
+            assert result[0].additionalProperties == [name:'value']
     }
 
     def 'Query cm handle references when the query is empty.'() {
@@ -175,7 +175,7 @@ class ParameterizedCmHandleQueryServiceSpec extends Specification {
         and: 'the inventory persistence returns the cm handle ids of all cm handles'
             cmHandleQueries.getAllCmHandleReferences(false) >> getCmHandleReferencesForDmiRegistry(false)
         and: 'the inventory persistence returns the cm handle details when requested'
-            mockInventoryPersistence.getYangModelCmHandles(_) >> dmiRegistry.childDataNodes.collect { new YangModelCmHandle(id: it.leaves.get("id").toString(), dmiProperties: [], publicProperties: []) }
+            mockInventoryPersistence.getYangModelCmHandles(_) >> dmiRegistry.childDataNodes.collect { new YangModelCmHandle(id: it.leaves.get("id").toString(), additionalProperties: [], publicProperties: []) }
         when: 'the query is executed for both cm handle details'
             def result = objectUnderTest.queryCmHandles(cmHandleQueryParameters).collectList().block()
         then: 'the correct cm handles are returned'
@@ -190,17 +190,17 @@ class ParameterizedCmHandleQueryServiceSpec extends Specification {
             cmHandleQueryParameters.setCmHandleQueryParameters([conditionProperties])
         and: 'the inventoryPersistence returns different CmHandleIds'
             partiallyMockedCmHandleQueries.queryPublicCmHandleProperties(*_) >> cmHandlesWithMatchingPublicProperties
-            partiallyMockedCmHandleQueries.queryCmHandleAdditionalProperties(*_) >> cmHandlesWithMatchingPrivateProperties
+            partiallyMockedCmHandleQueries.queryCmHandleAdditionalProperties(*_) >> cmHandlesWithMatchingAdditionalProperties
         when: 'the query executed'
             def result = objectUnderTestWithPartiallyMockedQueries.queryCmHandleIdsForInventory(cmHandleQueryParameters, false)
         then: 'the expected number of results are returned.'
             assert result.size() == expectedCmHandleIdsSize
         where: 'the following data is used'
-            scenario                                          | conditionName                | cmHandlesWithMatchingPublicProperties | cmHandlesWithMatchingPrivateProperties || expectedCmHandleIdsSize
-            'all properties, only public matching'            | 'hasAllProperties'           | ['h1', 'h2']                          | null                                   || 2
-            'all properties, no matching cm handles'          | 'hasAllProperties'           | []                                    | []                                     || 0
-            'additional properties, some matching cm handles' | 'hasAllAdditionalProperties' | []                                    | ['h1', 'h2']                           || 2
-            'additional properties, no matching cm handles'   | 'hasAllAdditionalProperties' | null                                  | []                                     || 0
+            scenario                                          | conditionName                | cmHandlesWithMatchingPublicProperties | cmHandlesWithMatchingAdditionalProperties || expectedCmHandleIdsSize
+            'all properties, only public matching'            | 'hasAllProperties'           | ['h1', 'h2']                          | null                                      || 2
+            'all properties, no matching cm handles'          | 'hasAllProperties'           | []                                    | []                                        || 0
+            'additional properties, some matching cm handles' | 'hasAllAdditionalProperties' | []                                    | ['h1', 'h2']                              || 2
+            'additional properties, no matching cm handles'   | 'hasAllAdditionalProperties' | null                                  | []                                        || 0
     }
 
     def 'Retrieve alternate ids by different DMI properties.' () {
@@ -260,7 +260,7 @@ class ParameterizedCmHandleQueryServiceSpec extends Specification {
             mockInventoryPersistence.getYangModelCmHandles([expectedCmHandleId]) >> [
                     new YangModelCmHandle(
                             id: expectedCmHandleId,
-                            dmiProperties: [new YangModelCmHandle.Property('name', 'value')],
+                            additionalProperties: [new YangModelCmHandle.Property('name', 'value')],
                             publicProperties: []
                     )
             ]
index 63ab0a9..5dd8ca0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2021-2024 Nordix Foundation
+ *  Copyright (C) 2021-2025 OpenInfra Foundation Europe. 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.
@@ -37,7 +37,7 @@ class YangModelCmHandleSpec extends Specification {
         given: 'a cm handle with properties'
             def ncmpServiceCmHandle = new NcmpServiceCmHandle()
             ncmpServiceCmHandle.cmHandleId = 'cm-handle-id01'
-            ncmpServiceCmHandle.dmiProperties = [myDmiProperty:'value1']
+            ncmpServiceCmHandle.additionalProperties = [myAdditionalProperty:'value1']
             ncmpServiceCmHandle.publicProperties = [myPublicProperty:'value2']
         and: 'with a composite state'
             def compositeState = new CompositeStateBuilder()
@@ -49,14 +49,14 @@ class YangModelCmHandleSpec extends Specification {
         when: 'it is converted to a yang model cm handle'
             def objectUnderTest = YangModelCmHandle.toYangModelCmHandle('', '', '', ncmpServiceCmHandle,'my-module-set-tag', 'my-alternate-id', 'my-data-producer-identifier')
         then: 'the result has the right size'
-            assert objectUnderTest.dmiProperties.size() == 1
+            assert objectUnderTest.additionalProperties.size() == 1
         and: 'the result has the correct values for module set tag, alternate ID, and data producer identifier'
             assert objectUnderTest.moduleSetTag == 'my-module-set-tag'
             assert objectUnderTest.alternateId == 'my-alternate-id'
             assert objectUnderTest.dataProducerIdentifier == 'my-data-producer-identifier'
-        and: 'the DMI property in the result has the correct name and value'
-            assert objectUnderTest.dmiProperties[0].name == 'myDmiProperty'
-            assert objectUnderTest.dmiProperties[0].value == 'value1'
+        and: 'the additional property in the result has the correct name and value'
+            assert objectUnderTest.additionalProperties[0].name == 'myAdditionalProperty'
+            assert objectUnderTest.additionalProperties[0].value == 'value1'
         and: 'the public property in the result has the correct name and value'
             assert objectUnderTest.publicProperties[0].name == 'myPublicProperty'
             assert objectUnderTest.publicProperties[0].value == 'value2'
@@ -89,19 +89,19 @@ class YangModelCmHandleSpec extends Specification {
         given: 'a yang model cm handle'
             def currentYangModelCmHandle = new YangModelCmHandle(id: 'cmhandle',
                 publicProperties: [new YangModelCmHandle.Property('publicProperty1', 'value1')],
-                dmiProperties: [new YangModelCmHandle.Property('dmiProperty1', 'value1')],
+                additionalProperties: [new YangModelCmHandle.Property('additionalProperty1', 'value1')],
                 compositeState: new CompositeState(cmHandleState: CmHandleState.ADVISED, dataSyncEnabled: false))
         when: 'a deep copy is created'
             def yangModelCmhandleDeepCopy = YangModelCmHandle.deepCopyOf(currentYangModelCmHandle)
         and: 'we try to mutate current yang model cm handle'
             currentYangModelCmHandle.id = 'cmhandle-changed'
-            currentYangModelCmHandle.dmiProperties = [new YangModelCmHandle.Property('updatedPublicProperty1', 'value1')]
-            currentYangModelCmHandle.publicProperties = [new YangModelCmHandle.Property('updatedDmiProperty1', 'value1')]
+            currentYangModelCmHandle.additionalProperties = [new YangModelCmHandle.Property('updatedAdditionalProperty1', 'value1')]
+            currentYangModelCmHandle.publicProperties = [new YangModelCmHandle.Property('updatedPublicProperty1', 'value1')]
             currentYangModelCmHandle.compositeState.cmHandleState = CmHandleState.READY
             currentYangModelCmHandle.compositeState.dataSyncEnabled = true
         then: 'there is no change in the deep copied object'
             assert yangModelCmhandleDeepCopy.id == 'cmhandle'
-            assert yangModelCmhandleDeepCopy.dmiProperties == [new YangModelCmHandle.Property('dmiProperty1', 'value1')]
+            assert yangModelCmhandleDeepCopy.additionalProperties == [new YangModelCmHandle.Property('additionalProperty1', 'value1')]
             assert yangModelCmhandleDeepCopy.publicProperties == [new YangModelCmHandle.Property('publicProperty1', 'value1')]
             assert yangModelCmhandleDeepCopy.compositeState.cmHandleState == CmHandleState.ADVISED
             assert yangModelCmhandleDeepCopy.compositeState.dataSyncEnabled == false
index 35d8d7a..4ebfb32 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2021-2025 Nordix Foundation
+ *  Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
  *  Modifications Copyright (C) 2022 Bell Canada
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
@@ -84,9 +84,9 @@ class DmiModelOperationsSpec extends DmiOperationsBaseSpec {
             'no body'      | null
     }
 
-    def 'Retrieving module references, DMI property handling:  #scenario.'() {
+    def 'Retrieving module references, additional property handling:  #scenario.'() {
         given: 'a cm handle'
-            mockYangModelCmHandleRetrieval(dmiProperties)
+            mockYangModelCmHandleRetrieval(additionalProperties)
         and: 'a positive response from DMI service when it is called with tha expected parameters'
             def responseFromDmi = new ResponseEntity<String>(HttpStatus.OK)
             mockDmiRestClient.synchronousPostOperationWithJsonData(MODEL, expectedModulesUrlTemplateWithVariables,
@@ -95,8 +95,8 @@ class DmiModelOperationsSpec extends DmiOperationsBaseSpec {
             def result = objectUnderTest.getModuleReferences(yangModelCmHandle, NO_MODULE_SET_TAG)
         then: 'the result is the response from DMI service'
             assert result == []
-        where: 'the following DMI properties are used'
-            scenario             | dmiProperties               || expectedAdditionalPropertiesInRequest
+        where: 'the following additional properties are used'
+            scenario             | additionalProperties        || expectedAdditionalPropertiesInRequest
             'with properties'    | [yangModelCmHandleProperty] || '{"prop1":"val1"}'
             'without properties' | []                          || '{}'
     }
@@ -135,9 +135,9 @@ class DmiModelOperationsSpec extends DmiOperationsBaseSpec {
             'null array'  | null
     }
 
-    def 'Retrieving yang resources, DMI property handling #scenario.'() {
+    def 'Retrieving yang resources, additional property handling #scenario.'() {
         given: 'a cm handle'
-            mockYangModelCmHandleRetrieval(dmiProperties)
+            mockYangModelCmHandleRetrieval(additionalProperties)
         and: 'a positive response from DMI service when it is called with the expected moduleSetTag, modules and properties'
             def responseFromDmi = new ResponseEntity<>([[moduleName: 'mod1', revision: 'A', yangSource: 'some yang source']], HttpStatus.OK)
             mockDmiRestClient.synchronousPostOperationWithJsonData(MODEL, expectedModuleResourcesUrlTemplateWithVariables,
@@ -147,8 +147,8 @@ class DmiModelOperationsSpec extends DmiOperationsBaseSpec {
             def result = objectUnderTest.getNewYangResourcesFromDmi(yangModelCmHandle, NO_MODULE_SET_TAG, newModuleReferences)
         then: 'the result is the response from DMI service'
             assert result == [mod1:'some yang source']
-        where: 'the following DMI properties are used'
-            scenario                                | dmiProperties               || expectedAdditionalPropertiesInRequest
+        where: 'the following additional properties are used'
+            scenario                                | additionalProperties        || expectedAdditionalPropertiesInRequest
             'with module references and properties' | [yangModelCmHandleProperty] || '{"prop1":"val1"}'
             'without properties'                    | []                          || '{}'
     }
index 004cc52..8b77083 100644 (file)
@@ -70,7 +70,7 @@ class LcmEventsCmHandleStateHandlerImplSpec extends Specification {
     def 'Update and Send Events on State Change #stateChange'() {
         given: 'Cm Handle represented as YangModelCmHandle'
             compositeState = new CompositeState(cmHandleState: fromCmHandleState)
-            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, dmiProperties: [], publicProperties: [], compositeState: compositeState)
+            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, additionalProperties: [], publicProperties: [], compositeState: compositeState)
         when: 'update state is invoked'
             objectUnderTest.updateCmHandleStateBatch(Map.of(yangModelCmHandle, toCmHandleState))
         then: 'state is saved using inventory persistence'
@@ -96,7 +96,7 @@ class LcmEventsCmHandleStateHandlerImplSpec extends Specification {
 
     def 'Update and Send Events on State Change from non-existing to ADVISED'() {
         given: 'Cm Handle represented as YangModelCmHandle'
-            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, dmiProperties: [], publicProperties: [])
+            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, additionalProperties: [], publicProperties: [])
         when: 'update state is invoked'
             objectUnderTest.updateCmHandleStateBatch(Map.of(yangModelCmHandle, ADVISED))
         then: 'CM-handle is saved using inventory persistence'
@@ -111,7 +111,7 @@ class LcmEventsCmHandleStateHandlerImplSpec extends Specification {
         given: 'Cm Handle represented as YangModelCmHandle in LOCKED state'
             compositeState = new CompositeState(cmHandleState: LOCKED,
                 lockReason: CompositeState.LockReason.builder().lockReasonCategory(MODULE_SYNC_FAILED).details('some lock details').build())
-            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, dmiProperties: [], publicProperties: [], compositeState: compositeState)
+            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, additionalProperties: [], publicProperties: [], compositeState: compositeState)
         when: 'update state is invoked'
             objectUnderTest.updateCmHandleStateBatch(Map.of(yangModelCmHandle, ADVISED))
         then: 'state is saved using inventory persistence and old lock reason details are retained'
@@ -130,7 +130,7 @@ class LcmEventsCmHandleStateHandlerImplSpec extends Specification {
     def 'Update and Send Events on State Change to from ADVISED to READY'() {
         given: 'Cm Handle represented as YangModelCmHandle'
             compositeState = new CompositeState(cmHandleState: ADVISED)
-            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, dmiProperties: [], publicProperties: [], compositeState: compositeState)
+            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, additionalProperties: [], publicProperties: [], compositeState: compositeState)
         and: 'global sync flag is set'
             compositeState.setDataSyncEnabled(false)
         when: 'update cmhandle state is invoked'
@@ -152,7 +152,7 @@ class LcmEventsCmHandleStateHandlerImplSpec extends Specification {
     def 'Update cmHandle state from READY to DELETING' (){
         given: 'cm Handle as Yang model'
             compositeState = new CompositeState(cmHandleState: READY)
-            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, dmiProperties: [], publicProperties: [], compositeState: compositeState)
+            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, additionalProperties: [], publicProperties: [], compositeState: compositeState)
         when: 'updating cm handle state to "DELETING"'
             objectUnderTest.updateCmHandleStateBatch(Map.of(yangModelCmHandle, DELETING))
         then: 'the cm handle state is as expected'
@@ -166,7 +166,7 @@ class LcmEventsCmHandleStateHandlerImplSpec extends Specification {
     def 'Update cmHandle state to DELETING to DELETED' (){
         given: 'cm Handle with state "DELETING" as Yang model '
             compositeState = new CompositeState(cmHandleState: DELETING)
-            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, dmiProperties: [], publicProperties: [], compositeState: compositeState)
+            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, additionalProperties: [], publicProperties: [], compositeState: compositeState)
         when: 'updating cm handle state to "DELETED"'
             objectUnderTest.updateCmHandleStateBatch(Map.of(yangModelCmHandle, DELETED))
         then: 'the cm handle state is as expected'
@@ -260,8 +260,8 @@ class LcmEventsCmHandleStateHandlerImplSpec extends Specification {
 
     def setupBatch(type) {
 
-        def yangModelCmHandle1 = new YangModelCmHandle(id: 'cmhandle1', dmiProperties: [], publicProperties: [])
-        def yangModelCmHandle2 = new YangModelCmHandle(id: 'cmhandle2', dmiProperties: [], publicProperties: [])
+        def yangModelCmHandle1 = new YangModelCmHandle(id: 'cmhandle1', additionalProperties: [], publicProperties: [])
+        def yangModelCmHandle2 = new YangModelCmHandle(id: 'cmhandle2', additionalProperties: [], publicProperties: [])
 
         switch (type) {
             case 'NEW':
index 6a95590..df669e6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START========================================================
- *  Copyright (C) 2022-2024 Nordix Foundation
+ *  Copyright (C) 2022-2025 OpenInfra Foundation Europe. 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.
@@ -25,8 +25,8 @@ import spock.lang.Specification
 
 class YangDataConverterSpec extends Specification{
 
-    def 'Convert a cm handle data node with private and public properties.'() {
-        given: 'a datanode with some additional (dmi, private) and public properties'
+    def 'Convert a cm handle data node with additional and public properties.'() {
+        given: 'a datanode with some additional and public properties'
             def dataNodeAdditionalProperties = new DataNode(xpath:'/additional-properties[@name="dmiProp1"]',
                     leaves: ['name': 'dmiProp1', 'value': 'dmiValue1'])
             def dataNodePublicProperties = new DataNode(xpath:'/public-properties[@name="pubProp1"]',
@@ -40,9 +40,9 @@ class YangDataConverterSpec extends Specification{
             assert yangModelCmHandle.dmiServiceName == 'my-dmi'
             assert yangModelCmHandle.moduleSetTag == 'my-tag'
             assert yangModelCmHandle.dataProducerIdentifier == 'my-dpi'
-        and: 'the additional (dmi, private) properties are included'
-            assert yangModelCmHandle.dmiProperties[0].name == 'dmiProp1'
-            assert yangModelCmHandle.dmiProperties[0].value == 'dmiValue1'
+        and: 'the additional properties are included'
+            assert yangModelCmHandle.additionalProperties[0].name == 'dmiProp1'
+            assert yangModelCmHandle.additionalProperties[0].value == 'dmiValue1'
         and: 'the public properties are included'
             assert yangModelCmHandle.publicProperties[0].name == 'pubProp1'
             assert yangModelCmHandle.publicProperties[0].value == 'pubValue1'