Merge "Performance tests of alternate-id/module-set-tag lookup"
authorToine Siebelink <toine.siebelink@est.tech>
Thu, 14 Mar 2024 15:17:57 +0000 (15:17 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 14 Mar 2024 15:17:57 +0000 (15:17 +0000)
25 files changed:
cps-ncmp-events/src/main/resources/schemas/lcm/lcm-event-schema-v1.json
cps-ncmp-rest/docs/openapi/components.yaml
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapperSpec.groovy
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServicePropertyHandler.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionNcmpOutEventMapper.java [new file with mode: 0644]
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCreator.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/YangDataConverter.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/InventoryModelLoader.java
cps-ncmp-service/src/main/resources/models/dmi-registry@2024-02-23.yang [moved from cps-ncmp-service/src/main/resources/models/dmi-registry@2023-11-27.yang with 94% similarity]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServicePropertyHandlerSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionNcmpOutEventMapperSpec.groovy [new file with mode: 0644]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCreatorSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/inventory/sync/ModuleSyncServiceSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilderSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandleSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/InventoryModelLoaderSpec.groovy
docs/api/swagger/ncmp/openapi-inventory.yaml
docs/api/swagger/ncmp/openapi.yaml
integration-test/src/test/groovy/org/onap/cps/integration/performance/base/NcmpPerfTestBase.groovy
integration-test/src/test/resources/data/ncmp-registry/dmi-registry@2024-02-23.yang [moved from integration-test/src/test/resources/data/ncmp-registry/dmi-registry@2023-11-27.yang with 94% similarity]

index e687303..bd0d90d 100644 (file)
           "description": "alternative id for cmHandle (e.g. 3GPP FDN)",
           "type": "string"
         },
+        "moduleSetTag": {
+          "description": "module set tag for cmHandle",
+          "type": "string"
+        },
+        "dataProducerIdentifier": {
+          "description": "data producer identifier for cmHandle",
+          "type": "string"
+        },
         "oldValues": {
           "$ref": "#/definitions/Values"
         },
index cd77eff..0ad453a 100644 (file)
@@ -143,6 +143,9 @@ components:
         alternateId:
           type: string
           example: "my-alternate-id"
+        dataProducerIdentifier:
+          type: string
+          example: "my-data-producer-identifier"
     RestCmHandleProperties:
       type: object
       additionalProperties:
@@ -252,6 +255,15 @@ components:
           $ref: '#/components/schemas/CmHandleCompositeState'
         trustLevel:
           $ref: '#/components/schemas/CmHandleTrustLevel'
+        moduleSetTag:
+          type: string
+          example: my-module-set-tag
+        alternateId:
+          type: string
+          example: my-alternate-id
+        dataProducerIdentifier:
+          type: string
+          example: my-data-producer-identifier
     CmHandlePublicProperties:
       type: object
       items:
index b567ba2..66c1591 100755 (executable)
@@ -398,6 +398,9 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
         if (cmHandleCurrentTrustLevel != null) {
             restOutputCmHandle.setTrustLevel(cmHandleCurrentTrustLevel.toString());
         }
+        restOutputCmHandle.setModuleSetTag(ncmpServiceCmHandle.getModuleSetTag());
+        restOutputCmHandle.setAlternateId(ncmpServiceCmHandle.getAlternateId());
+        restOutputCmHandle.setDataProducerIdentifier(ncmpServiceCmHandle.getDataProducerIdentifier());
         return restOutputCmHandle;
     }
 
index 0bc0c1e..b5f61ad 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2022-2023 Nordix Foundation
+ *  Copyright (C) 2022-2024 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -41,7 +41,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,
-                publicCmHandleProperties: registrationPublicProperties, trustLevel: registrationTrustLevel, alternateId: 'my-alternate-id', moduleSetTag: 'my-module-set-tag')
+                publicCmHandleProperties: registrationPublicProperties, trustLevel: registrationTrustLevel, alternateId: 'my-alternate-id', moduleSetTag: 'my-module-set-tag', dataProducerIdentifier: 'my-data-producer-identifier')
             def restDmiPluginRegistration = new RestDmiPluginRegistration(
                 createdCmHandles: [inputRestCmHandle])
         when: 'to plugin dmi registration is called'
@@ -53,10 +53,11 @@ class NcmpRestInputMapperSpec extends Specification {
         and: '(empty) properties are converted correctly'
             result.createdCmHandles[0].dmiProperties == mappedDmiProperties
             result.createdCmHandles[0].publicProperties == mappedPublicProperties
-            result.createdCmHandles[0].registrationTrustLevel == mappedTrustLevel
-        and: 'alternate ID and module set tag converted correctly'
+        and: 'other fields are mapped correctly'
             result.createdCmHandles[0].alternateId == 'my-alternate-id'
             result.createdCmHandles[0].moduleSetTag == 'my-module-set-tag'
+            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
index dba2b30..616492d 100644 (file)
@@ -357,9 +357,11 @@ class NetworkCmProxyControllerSpec extends Specification {
             def cmHandle2 = new NcmpServiceCmHandle()
             cmHandle2.cmHandleId = 'ch-2'
             cmHandle2.publicProperties = [color: 'green']
+            cmHandle2.alternateId = 'someAlternateId'
+            cmHandle2.moduleSetTag = 'someModuleSetTag'
+            cmHandle2.dataProducerIdentifier = 'someDataProducerIdentifier'
             mockNetworkCmProxyDataService.executeCmHandleSearch(_) >> [cmHandle1, cmHandle2]
         and: 'map for trust level per cmHandle has value for only one cm handle'
-//            trustLevelPerCmHandle.get('') >> { TrustLevel.NONE }
               trustLevelPerCmHandle.put('ch-1', TrustLevel.NONE)
         when: 'the searches api is invoked'
             def response = mvc.perform(post(searchesEndpoint)
@@ -368,7 +370,7 @@ class NetworkCmProxyControllerSpec extends Specification {
         then: 'response status returns OK'
             response.status == HttpStatus.OK.value()
         and: 'the expected response content is returned'
-            response.contentAsString == '[{"cmHandle":"ch-1","publicCmHandleProperties":[{"color":"yellow"}],"state":null,"trustLevel":"NONE"},{"cmHandle":"ch-2","publicCmHandleProperties":[{"color":"green"}],"state":null,"trustLevel":null}]'
+            response.contentAsString == '[{"cmHandle":"ch-1","publicCmHandleProperties":[{"color":"yellow"}],"state":null,"trustLevel":"NONE","moduleSetTag":null,"alternateId":null,"dataProducerIdentifier":null},{"cmHandle":"ch-2","publicCmHandleProperties":[{"color":"green"}],"state":null,"trustLevel":null,"moduleSetTag":"someModuleSetTag","alternateId":"someAlternateId","dataProducerIdentifier":"someDataProducerIdentifier"}]'
     }
 
     def 'Get complete Cm Handle details by Cm Handle id.'() {
@@ -452,7 +454,7 @@ class NetworkCmProxyControllerSpec extends Specification {
                             .contentType(MediaType.APPLICATION_JSON)
                             .content(jsonString)).andReturn().response
         then: 'an empty cm handle identifier is returned'
-            response.contentAsString == '[{"cmHandle":"ch-1","publicCmHandleProperties":[{"color":"yellow"}],"state":null,"trustLevel":"COMPLETE"},{"cmHandle":"ch-2","publicCmHandleProperties":[{"color":"green"}],"state":null,"trustLevel":"NONE"}]'
+            response.contentAsString == '[{"cmHandle":"ch-1","publicCmHandleProperties":[{"color":"yellow"}],"state":null,"trustLevel":"COMPLETE","moduleSetTag":null,"alternateId":null,"dataProducerIdentifier":null},{"cmHandle":"ch-2","publicCmHandleProperties":[{"color":"green"}],"state":null,"trustLevel":"NONE","moduleSetTag":null,"alternateId":null,"dataProducerIdentifier":null}]'
     }
 
     def 'Query for cm handles matching query parameters'() {
index 4c905bf..6ab6eab 100755 (executable)
@@ -459,7 +459,8 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService
             dmiPluginRegistration.getDmiModelPlugin(),
             ncmpServiceCmHandle,
             ncmpServiceCmHandle.getModuleSetTag(),
-            ncmpServiceCmHandle.getAlternateId());
+            ncmpServiceCmHandle.getAlternateId(),
+            ncmpServiceCmHandle.getDataProducerIdentifier());
     }
 
     private void processTrustLevels(final Collection<NcmpServiceCmHandle> cmHandlesToBeCreated,
index 3d15291..f861910 100644 (file)
@@ -47,6 +47,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.onap.cps.api.CpsDataService;
 import org.onap.cps.ncmp.api.impl.inventory.InventoryPersistence;
 import org.onap.cps.ncmp.api.impl.utils.AlternateIdChecker;
+import org.onap.cps.ncmp.api.impl.utils.YangDataConverter;
+import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle;
 import org.onap.cps.ncmp.api.models.CmHandleRegistrationResponse;
 import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
 import org.onap.cps.spi.exceptions.DataNodeNotFoundException;
@@ -55,6 +57,7 @@ import org.onap.cps.spi.model.DataNode;
 import org.onap.cps.spi.model.DataNodeBuilder;
 import org.onap.cps.utils.JsonObjectMapper;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 @Slf4j
 @Service
@@ -110,7 +113,9 @@ public class NetworkCmProxyDataServicePropertyHandler {
 
     private void processUpdates(final DataNode existingCmHandleDataNode,
                                 final NcmpServiceCmHandle updatedNcmpServiceCmHandle) {
-        updateAlternateId(updatedNcmpServiceCmHandle);
+        setAndUpdateCmHandleField(
+            updatedNcmpServiceCmHandle.getCmHandleId(), "alternate-id", updatedNcmpServiceCmHandle.getAlternateId());
+        updateDataProducerIdentifier(existingCmHandleDataNode, updatedNcmpServiceCmHandle);
         if (!updatedNcmpServiceCmHandle.getPublicProperties().isEmpty()) {
             updateProperties(existingCmHandleDataNode, PUBLIC_PROPERTY,
                 updatedNcmpServiceCmHandle.getPublicProperties());
@@ -120,17 +125,24 @@ public class NetworkCmProxyDataServicePropertyHandler {
         }
     }
 
-    private void updateAlternateId(final NcmpServiceCmHandle updatedNcmpServiceCmHandle) {
-        final String updatedAlternateId = updatedNcmpServiceCmHandle.getAlternateId();
-        final String cmHandleId = updatedNcmpServiceCmHandle.getCmHandleId();
-        final Map<String, String> cmHandleProperties = new HashMap<>(2);
-        cmHandleProperties.put("id", cmHandleId);
-        cmHandleProperties.put("alternate-id", updatedAlternateId);
-        final Map<String, Map<String, String>> dmiRegistryProperties = new HashMap<>(1);
-        dmiRegistryProperties.put("cm-handles", cmHandleProperties);
-        cpsDataService.updateNodeLeaves(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, NCMP_DMI_REGISTRY_PARENT,
-                jsonObjectMapper.asJsonString(dmiRegistryProperties), OffsetDateTime.now());
-        log.debug("Updating alternateId for cmHandle {} with value : {})", cmHandleId, updatedAlternateId);
+    private void updateDataProducerIdentifier(final DataNode cmHandleDataNode,
+                                              final NcmpServiceCmHandle ncmpServiceCmHandle) {
+        final String newDataProducerIdentifier = ncmpServiceCmHandle.getDataProducerIdentifier();
+        if (StringUtils.hasText(newDataProducerIdentifier)) {
+            final YangModelCmHandle yangModelCmHandle =
+                YangDataConverter.convertCmHandleToYangModel(cmHandleDataNode);
+            final String existingDataProducerIdentifier = yangModelCmHandle.getDataProducerIdentifier();
+            if (StringUtils.hasText(existingDataProducerIdentifier)) {
+                if (!existingDataProducerIdentifier.equals(newDataProducerIdentifier)) {
+                    log.warn("Unable to update dataProducerIdentifier for cmHandle {}. "
+                            + "Value for dataProducerIdentifier has been set previously.",
+                        ncmpServiceCmHandle.getCmHandleId());
+                }
+            } else {
+                setAndUpdateCmHandleField(
+                    yangModelCmHandle.getId(), "data-producer-identifier", newDataProducerIdentifier);
+            }
+        }
     }
 
     private void updateProperties(final DataNode existingCmHandleDataNode, final PropertyType propertyType,
@@ -202,6 +214,18 @@ public class NetworkCmProxyDataServicePropertyHandler {
         return new DataNodeBuilder().withXpath(xpath).withLeaves(ImmutableMap.copyOf(updatedLeaves)).build();
     }
 
+    private void setAndUpdateCmHandleField(final String cmHandleIdToUpdate, final String fieldName,
+                                           final String newFieldValue) {
+        final Map<String, Map<String, String>> dmiRegistryData = new HashMap<>(1);
+        final Map<String, String> cmHandleData = new HashMap<>(2);
+        cmHandleData.put("id", cmHandleIdToUpdate);
+        cmHandleData.put(fieldName, newFieldValue);
+        dmiRegistryData.put("cm-handles", cmHandleData);
+        cpsDataService.updateNodeLeaves(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, NCMP_DMI_REGISTRY_PARENT,
+                jsonObjectMapper.asJsonString(dmiRegistryData), OffsetDateTime.now());
+        log.debug("Updating {} for cmHandle {} with value : {})", fieldName, cmHandleIdToUpdate, newFieldValue);
+    }
+
     enum PropertyType {
         DMI_PROPERTY("additional-properties"), PUBLIC_PROPERTY("public-properties");
 
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionNcmpOutEventMapper.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionNcmpOutEventMapper.java
new file mode 100644 (file)
index 0000000..668f451
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.cps.ncmp.api.impl.events.cmsubscription.mapper;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import lombok.RequiredArgsConstructor;
+import org.onap.cps.ncmp.api.impl.events.cmsubscription.model.CmNotificationSubscriptionStatus;
+import org.onap.cps.ncmp.api.impl.events.cmsubscription.model.DmiCmNotificationSubscriptionDetails;
+import org.onap.cps.ncmp.api.impl.events.cmsubscription.model.DmiCmNotificationSubscriptionPredicate;
+import org.onap.cps.ncmp.events.cmsubscription_merge1_0_0.ncmp_to_client.CmNotificationSubscriptionNcmpOutEvent;
+import org.onap.cps.ncmp.events.cmsubscription_merge1_0_0.ncmp_to_client.Data;
+import org.springframework.stereotype.Component;
+
+@Component
+@RequiredArgsConstructor
+public class CmNotificationSubscriptionNcmpOutEventMapper {
+
+    /**
+     * Mapper to form a response for the client for the Cm Notification Subscription.
+     *
+     * @param subscriptionId                          Cm Notification Subscription Id
+     * @param dmiCmNotificationSubscriptionDetailsMap contains CmNotificationSubscriptionDetails per dmi plugin
+     * @return CmNotificationSubscriptionNcmpOutEvent to sent back to the client
+     */
+    public CmNotificationSubscriptionNcmpOutEvent toCmNotificationSubscriptionNcmpOutEvent(final String subscriptionId,
+            final Map<String, DmiCmNotificationSubscriptionDetails> dmiCmNotificationSubscriptionDetailsMap) {
+
+        final CmNotificationSubscriptionNcmpOutEvent cmNotificationSubscriptionNcmpOutEvent =
+                new CmNotificationSubscriptionNcmpOutEvent();
+        final Data cmSubscriptionData = new Data();
+        cmSubscriptionData.setSubscriptionId(subscriptionId);
+        populateCmNotificationSubscriptionNcmpOutEventWithCmHandleIds(dmiCmNotificationSubscriptionDetailsMap,
+                cmSubscriptionData);
+        cmNotificationSubscriptionNcmpOutEvent.setData(cmSubscriptionData);
+
+        return cmNotificationSubscriptionNcmpOutEvent;
+    }
+
+    private void populateCmNotificationSubscriptionNcmpOutEventWithCmHandleIds(
+            final Map<String, DmiCmNotificationSubscriptionDetails> dmiCmNotificationSubscriptionDetailsMap,
+            final Data cmSubscriptionData) {
+
+        final List<String> acceptedCmHandleIds = new ArrayList<>();
+        final List<String> pendingCmHandleIds = new ArrayList<>();
+        final List<String> rejectedCmHandleIds = new ArrayList<>();
+
+        dmiCmNotificationSubscriptionDetailsMap.forEach((dmiPluginName, dmiCmNotificationSubscriptionDetails) -> {
+            final CmNotificationSubscriptionStatus cmNotificationSubscriptionStatus =
+                    dmiCmNotificationSubscriptionDetails.getCmNotificationSubscriptionStatus();
+            final List<DmiCmNotificationSubscriptionPredicate> dmiCmNotificationSubscriptionPredicates =
+                    dmiCmNotificationSubscriptionDetails.getDmiCmNotificationSubscriptionPredicates();
+
+            switch (cmNotificationSubscriptionStatus) {
+                case ACCEPTED -> acceptedCmHandleIds.addAll(
+                        extractCmHandleIds(dmiCmNotificationSubscriptionPredicates));
+                case PENDING -> pendingCmHandleIds.addAll(extractCmHandleIds(dmiCmNotificationSubscriptionPredicates));
+                default -> rejectedCmHandleIds.addAll(extractCmHandleIds(dmiCmNotificationSubscriptionPredicates));
+            }
+        });
+
+        cmSubscriptionData.setAcceptedTargets(acceptedCmHandleIds);
+        cmSubscriptionData.setPendingTargets(pendingCmHandleIds);
+        cmSubscriptionData.setRejectedTargets(rejectedCmHandleIds);
+
+    }
+
+    private List<String> extractCmHandleIds(
+            final List<DmiCmNotificationSubscriptionPredicate> dmiCmNotificationSubscriptionPredicates) {
+        final List<String> cmHandleIds = new ArrayList<>();
+        dmiCmNotificationSubscriptionPredicates.forEach(dmiCmNotificationSubscriptionPredicate -> cmHandleIds.addAll(
+                dmiCmNotificationSubscriptionPredicate.getTargetCmHandleIds()));
+
+        return cmHandleIds;
+    }
+
+}
index 23d508b..fa27be1 100644 (file)
@@ -96,6 +96,8 @@ public class LcmEventsCreator {
         final Event event = new Event();
         event.setCmHandleId(eventCorrelationId);
         event.setAlternateId(targetNcmpServiceCmHandle.getAlternateId());
+        event.setModuleSetTag(targetNcmpServiceCmHandle.getModuleSetTag());
+        event.setDataProducerIdentifier(targetNcmpServiceCmHandle.getDataProducerIdentifier());
         final CmHandleValuesHolder cmHandleValuesHolder =
                 LcmEventsCreatorHelper.determineEventValues(targetNcmpServiceCmHandle, existingNcmpServiceCmHandle,
                         lcmEventType);
index 3954142..07b9289 100644 (file)
@@ -56,6 +56,7 @@ public class YangDataConverter {
         ncmpServiceCmHandle.setCompositeState(yangModelCmHandle.getCompositeState());
         ncmpServiceCmHandle.setModuleSetTag(yangModelCmHandle.getModuleSetTag());
         ncmpServiceCmHandle.setAlternateId(yangModelCmHandle.getAlternateId());
+        ncmpServiceCmHandle.setDataProducerIdentifier(yangModelCmHandle.getDataProducerIdentifier());
         setDmiProperties(dmiProperties, ncmpServiceCmHandle);
         setPublicProperties(publicProperties, ncmpServiceCmHandle);
         return ncmpServiceCmHandle;
@@ -89,7 +90,8 @@ public class YangDataConverter {
                 (String) cmHandleDataNode.getLeaves().get("dmi-model-service-name"),
                 ncmpServiceCmHandle,
                 (String) cmHandleDataNode.getLeaves().get("module-set-tag"),
-                (String) cmHandleDataNode.getLeaves().get("alternate-id")
+                (String) cmHandleDataNode.getLeaves().get("alternate-id"),
+                (String) cmHandleDataNode.getLeaves().get("data-producer-identifier")
         );
     }
 
index b2758d9..2ca2b2e 100644 (file)
@@ -70,6 +70,9 @@ public class YangModelCmHandle {
     @JsonProperty("alternate-id")
     private String alternateId;
 
+    @JsonProperty("data-producer-identifier")
+    private String dataProducerIdentifier;
+
     @JsonProperty("additional-properties")
     private List<Property> dmiProperties;
 
@@ -95,6 +98,7 @@ public class YangModelCmHandle {
                 original.getPublicProperties() == null ? null : new ArrayList<>(original.getPublicProperties());
         copy.moduleSetTag = original.getModuleSetTag();
         copy.alternateId = original.getAlternateId();
+        copy.dataProducerIdentifier = original.getDataProducerIdentifier();
         return copy;
     }
 
@@ -105,6 +109,9 @@ public class YangModelCmHandle {
      * @param dmiDataServiceName  dmi data service name
      * @param dmiModelServiceName dmi model service name
      * @param ncmpServiceCmHandle the cm handle
+     * @param moduleSetTag moduleSetTag
+     * @param alternateId alternateId
+     * @param dataProducerIdentifier dataProducerIdentifier
      * @return instance of yangModelCmHandle
      */
     public static YangModelCmHandle toYangModelCmHandle(final String dmiServiceName,
@@ -112,7 +119,8 @@ public class YangModelCmHandle {
                                                         final String dmiModelServiceName,
                                                         final NcmpServiceCmHandle ncmpServiceCmHandle,
                                                         final String moduleSetTag,
-                                                        final String alternateId) {
+                                                        final String alternateId,
+                                                        final String dataProducerIdentifier) {
         final YangModelCmHandle yangModelCmHandle = new YangModelCmHandle();
         yangModelCmHandle.setId(ncmpServiceCmHandle.getCmHandleId());
         yangModelCmHandle.setDmiServiceName(dmiServiceName);
@@ -120,6 +128,8 @@ public class YangModelCmHandle {
         yangModelCmHandle.setDmiModelServiceName(dmiModelServiceName);
         yangModelCmHandle.setModuleSetTag(moduleSetTag == null ? StringUtils.EMPTY : moduleSetTag);
         yangModelCmHandle.setAlternateId(alternateId == null ? StringUtils.EMPTY : alternateId);
+        yangModelCmHandle.setDataProducerIdentifier(
+            dataProducerIdentifier == null ? StringUtils.EMPTY : dataProducerIdentifier);
         yangModelCmHandle.setDmiProperties(asYangModelCmHandleProperties(ncmpServiceCmHandle.getDmiProperties()));
         yangModelCmHandle.setPublicProperties(asYangModelCmHandleProperties(
                 ncmpServiceCmHandle.getPublicProperties()));
index 4989878..676eebc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2021-2023 Nordix Foundation
+ *  Copyright (C) 2021-2024 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -60,4 +60,7 @@ public class NcmpServiceCmHandle {
 
     @JsonSetter(nulls = Nulls.AS_EMPTY)
     private String alternateId;
+
+    @JsonSetter(nulls = Nulls.AS_EMPTY)
+    private String dataProducerIdentifier;
 }
index 01bfc2b..d0d63ab 100644 (file)
@@ -34,8 +34,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class InventoryModelLoader extends AbstractModelLoader {
 
-    private static final String NEW_MODEL_FILE_NAME = "dmi-registry@2023-11-27.yang";
-    private static final String NEW_SCHEMA_SET_NAME = "dmi-registry-2023-11-27";
+    private static final String NEW_MODEL_FILE_NAME = "dmi-registry@2024-02-23.yang";
+    private static final String NEW_SCHEMA_SET_NAME = "dmi-registry-2024-02-23";
 
     public InventoryModelLoader(final CpsDataspaceService cpsDataspaceService,
                                 final CpsModuleService cpsModuleService,
@@ -8,6 +8,11 @@ module dmi-registry {
 
   contact "toine.siebelink@est.tech";
 
+  revision "2024-02-23" {
+      description
+      "Added data-producer-identifier";
+    }
+
   revision "2023-11-27" {
     description
     "Added alternate-id";
@@ -91,6 +96,9 @@ module dmi-registry {
       leaf alternate-id {
         type string;
       }
+      leaf data-producer-identifier {
+        type string;
+      }
 
       list additional-properties {
         key "name";
index cbed417..2607727 100644 (file)
 
 package org.onap.cps.ncmp.api.impl
 
+import ch.qos.logback.classic.Level
+import ch.qos.logback.classic.Logger
+import ch.qos.logback.classic.spi.ILoggingEvent
+import ch.qos.logback.core.read.ListAppender
 import com.fasterxml.jackson.databind.ObjectMapper
 import org.onap.cps.api.CpsDataService
 import org.onap.cps.ncmp.api.impl.inventory.InventoryPersistence
@@ -32,6 +36,7 @@ import org.onap.cps.spi.exceptions.DataValidationException
 import org.onap.cps.spi.model.DataNode
 import org.onap.cps.spi.model.DataNodeBuilder
 import org.onap.cps.utils.JsonObjectMapper
+import org.slf4j.LoggerFactory
 import spock.lang.Specification
 
 import static org.onap.cps.ncmp.api.NcmpResponseStatus.CM_HANDLES_NOT_FOUND
@@ -49,12 +54,21 @@ class NetworkCmProxyDataServicePropertyHandlerSpec extends Specification {
     def mockAlternateIdChecker = Mock(AlternateIdChecker)
 
     def objectUnderTest = new NetworkCmProxyDataServicePropertyHandler(mockInventoryPersistence, mockCpsDataService, jsonObjectMapper, mockAlternateIdChecker)
+    def logger = Spy(ListAppender<ILoggingEvent>)
 
-    def setup() {
+    void setup() {
+        def setupLogger = ((Logger) LoggerFactory.getLogger(NetworkCmProxyDataServicePropertyHandler.class))
+        setupLogger.addAppender(logger)
+        setupLogger.setLevel(Level.DEBUG)
+        logger.start()
         // Always accept all alternate IDs
         mockAlternateIdChecker.getIdsOfCmHandlesWithRejectedAlternateId(*_) >> []
     }
 
+    void cleanup() {
+        ((Logger) LoggerFactory.getLogger(NetworkCmProxyDataServicePropertyHandler.class)).detachAndStopAllAppenders()
+    }
+
     def static cmHandleId = 'myHandle1'
     def static cmHandleXpath = "/dmi-registry/cm-handles[@id='${cmHandleId}']"
 
@@ -223,6 +237,42 @@ class NetworkCmProxyDataServicePropertyHandlerSpec extends Specification {
             assert response[0].cmHandle == cmHandleId
     }
 
+    def 'Update CM Handle data producer identifier from #scenario'() {
+        given: 'an existing cm handle with no data producer identifier'
+            DataNode existingCmHandleDataNode = new DataNode(xpath: cmHandleXpath, leaves: ['id': 'cmHandleId','data-producer-identifier': oldDataProducerIdentifier])
+        and: 'an update request with a new data producer identifier'
+            def ncmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, dataProducerIdentifier: 'someDataProducerIdentifier')
+        when: 'data producer identifier updated'
+            objectUnderTest.updateDataProducerIdentifier(existingCmHandleDataNode, ncmpServiceCmHandle)
+        then: 'the update node leaves method is invoked once'
+            1 * mockCpsDataService.updateNodeLeaves('NCMP-Admin', 'ncmp-dmi-registry', '/dmi-registry', _, _) >> { args ->
+                assert args[3].contains('someDataProducerIdentifier')
+            }
+        and: 'correct information is logged'
+            def lastLoggingEvent = logger.list[0]
+            assert lastLoggingEvent.level == Level.DEBUG
+            assert lastLoggingEvent.formattedMessage.contains('Updating data-producer-identifier')
+        where: 'the following scenarios are attempted'
+            scenario             | oldDataProducerIdentifier
+            'null to something'  | null
+            'blank to something' | ''
+    }
+
+    def 'Update CM Handle data producer identifier from some data producer identifier to another data producer identifier'() {
+        given: 'an existing cm handle with a data producer identifier'
+            DataNode existingCmHandleDataNode = new DataNode(xpath: cmHandleXpath, leaves: ['id': 'cmHandleId', 'data-producer-identifier': 'someDataProducerIdentifier'])
+        and: 'an update request with a new data producer identifier'
+            def ncmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, dataProducerIdentifier: 'someNewDataProducerIdentifier')
+        when: 'update data producer identifier is called with the update request'
+            objectUnderTest.updateDataProducerIdentifier(existingCmHandleDataNode, ncmpServiceCmHandle)
+        then: 'the update node leaves method is not invoked'
+            0 * mockCpsDataService.updateNodeLeaves(*_)
+        and: 'correct information is logged'
+            def lastLoggingEvent = logger.list[0]
+            assert lastLoggingEvent.level == Level.WARN
+            assert lastLoggingEvent.formattedMessage.contains('Unable to update dataProducerIdentifier')
+    }
+
     def convertToProperties(expectedPropertiesAfterUpdateAsMap) {
         def properties = [].withDefault { [:] }
         expectedPropertiesAfterUpdateAsMap.forEach(property ->
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionNcmpOutEventMapperSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionNcmpOutEventMapperSpec.groovy
new file mode 100644 (file)
index 0000000..93bb480
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.cps.ncmp.api.impl.events.cmsubscription.mapper
+
+import org.onap.cps.ncmp.api.impl.events.cmsubscription.model.CmNotificationSubscriptionStatus
+import org.onap.cps.ncmp.api.impl.events.cmsubscription.model.DmiCmNotificationSubscriptionDetails
+import org.onap.cps.ncmp.api.impl.events.cmsubscription.model.DmiCmNotificationSubscriptionPredicate
+import org.onap.cps.ncmp.api.impl.operations.DatastoreType
+import spock.lang.Specification
+
+class CmNotificationSubscriptionNcmpOutEventMapperSpec extends Specification {
+
+    static Map<String, DmiCmNotificationSubscriptionDetails> dmiCmNotificationSubscriptionDetailsMap
+
+    def objectUnderTest = new CmNotificationSubscriptionNcmpOutEventMapper()
+
+    def setup() {
+        def dmiCmNotificationSubscriptionPredicateA = new DmiCmNotificationSubscriptionPredicate(['ch-A'] as Set, DatastoreType.PASSTHROUGH_RUNNING, ['/a'] as Set)
+        def dmiCmNotificationSubscriptionPredicateB = new DmiCmNotificationSubscriptionPredicate(['ch-B'] as Set, DatastoreType.PASSTHROUGH_OPERATIONAL, ['/b'] as Set)
+        def dmiCmNotificationSubscriptionPredicateC = new DmiCmNotificationSubscriptionPredicate(['ch-C'] as Set, DatastoreType.PASSTHROUGH_OPERATIONAL, ['/c'] as Set)
+        dmiCmNotificationSubscriptionDetailsMap = ['dmi-1': new DmiCmNotificationSubscriptionDetails([dmiCmNotificationSubscriptionPredicateA], CmNotificationSubscriptionStatus.PENDING),
+                                                   'dmi-2': new DmiCmNotificationSubscriptionDetails([dmiCmNotificationSubscriptionPredicateB], CmNotificationSubscriptionStatus.ACCEPTED),
+                                                   'dmi-3': new DmiCmNotificationSubscriptionDetails([dmiCmNotificationSubscriptionPredicateC], CmNotificationSubscriptionStatus.REJECTED)
+        ]
+    }
+
+    def 'Check for Cm Notification Subscription Outgoing event mapping'() {
+        when: 'we try to map the event to send it to client'
+            def result = objectUnderTest.toCmNotificationSubscriptionNcmpOutEvent('test-subscription', dmiCmNotificationSubscriptionDetailsMap)
+        then: 'event is mapped correctly for the subscription'
+            result.data.subscriptionId == 'test-subscription'
+        and: 'the cm handle ids are part of correct list'
+            result.data.pendingTargets == ['ch-A']
+            result.data.acceptedTargets == ['ch-B']
+            result.data.rejectedTargets == ['ch-C']
+    }
+}
index b7c3b87..bef2963 100644 (file)
@@ -174,18 +174,20 @@ class LcmEventsCreatorSpec extends Specification {
             assert result.eventId != null
     }
 
-    def 'Map the LcmEvent for alternate IDs when #scenario'() {
-        given: 'NCMP cm handle details with current and old alternate IDs'
-            def existingNcmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, alternateId: existingAlternateId, compositeState: new CompositeState(dataSyncEnabled: false))
-            def targetNcmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, alternateId: targetAlternateId, compositeState: new CompositeState(dataSyncEnabled: false))
+    def 'Map the LcmEvent for alternate ID, data producer identifier, and module set tag when they contain #scenario'() {
+        given: 'NCMP cm handle details with current and old values for alternate ID, module set tag, and data producer identifier'
+            def existingNcmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, alternateId: existingAlternateId, moduleSetTag: existingModuleSetTag, dataProducerIdentifier: existingDataProducerIdentifier, compositeState: new CompositeState(dataSyncEnabled: false))
+            def targetNcmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, alternateId: targetAlternateId, moduleSetTag: targetModuleSetTag, dataProducerIdentifier: targetDataProducerIdentifier, compositeState: new CompositeState(dataSyncEnabled: false))
         when: 'the event is populated'
             def result = objectUnderTest.populateLcmEvent(cmHandleId, targetNcmpServiceCmHandle, existingNcmpServiceCmHandle)
-        then: 'the alternate ID is present or is an empty string in the payload'
-            assert result.event.alternateId == expectedEventAlternateId
-        where: 'the following alternate IDs are provided'
-            scenario                                      | existingAlternateId | targetAlternateId || expectedEventAlternateId
-            'same new and old alternate ID'               | 'someAlternateId'   | 'someAlternateId' || 'someAlternateId'
-            'blank new and old alternate ID'              | ''                  | ''                || ''
-            'new alternate id and blank old alternate ID' | ''                  | 'someAlternateId' || 'someAlternateId'
+        then: 'the alternate ID, module set tag, and data producer identifier are present or are an empty string in the payload'
+            assert result.event.alternateId == targetAlternateId
+            assert result.event.moduleSetTag == targetModuleSetTag
+            assert result.event.dataProducerIdentifier == targetDataProducerIdentifier
+        where: 'the following values are provided for the alternate ID, module set tag, and data producer identifier'
+            scenario                                     | existingAlternateId | targetAlternateId | existingModuleSetTag | targetModuleSetTag | existingDataProducerIdentifier | targetDataProducerIdentifier
+            'same target and existing values'            | 'someAlternateId'   | 'someAlternateId' | 'someModuleSetTag'   | 'someModuleSetTag' | 'someDataProducerIdentifier'   | 'someDataProducerIdentifier'
+            'blank target and existing values'           | ''                  | ''                | ''                   | ''                 | ''                             | ''
+            'new target value and blank existing values' | ''                  | 'someAlternateId' | ''                   | 'someAlternateId'  | ''                             | 'someDataProducerIdentifier'
     }
 }
\ No newline at end of file
index 0c60e88..cb933fa 100644 (file)
@@ -64,7 +64,7 @@ class ModuleSyncServiceSpec extends Specification {
             def ncmpServiceCmHandle = new NcmpServiceCmHandle()
             ncmpServiceCmHandle.setCompositeState(new CompositeStateBuilder().withCmHandleState(CmHandleState.ADVISED).build())
             ncmpServiceCmHandle.cmHandleId = 'ch-1'
-            def yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle('some service name', '', '', ncmpServiceCmHandle, moduleSetTag, '')
+            def yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle('some service name', '', '', ncmpServiceCmHandle, moduleSetTag, '', '')
         and: 'DMI operations returns some module references'
             def moduleReferences =  [ new ModuleReference('module1','1'), new ModuleReference('module2','2') ]
             mockDmiModelOperations.getModuleReferences(yangModelCmHandle) >> moduleReferences
@@ -93,7 +93,7 @@ class ModuleSyncServiceSpec extends Specification {
             ncmpServiceCmHandle.setCompositeState(new CompositeStateBuilder().withLockReason(MODULE_UPGRADE, 'Upgrade to ModuleSetTag: tag-1').build())
             def dmiServiceName = 'some service name'
             ncmpServiceCmHandle.cmHandleId = 'upgraded-ch'
-            def yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle(dmiServiceName, '', '', ncmpServiceCmHandle,'tag-1', '')
+            def yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle(dmiServiceName, '', '', ncmpServiceCmHandle,'tag-1', '', '')
         and: 'some module references'
             def moduleReferences =  [ new ModuleReference('module1','1') ]
         and: 'DMI operations returns some module references for upgraded cm handle'
@@ -127,7 +127,7 @@ class ModuleSyncServiceSpec extends Specification {
             ncmpServiceCmHandle.setCompositeState(new CompositeStateBuilder()
                 .withLockReason(MODULE_UPGRADE, 'Upgrade to ModuleSetTag: targetModuleSetTag').build())
             ncmpServiceCmHandle.setCmHandleId('cmHandleId-1')
-            def yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle('some service name', '', '', ncmpServiceCmHandle, 'targetModuleSetTag', '')
+            def yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle('some service name', '', '', ncmpServiceCmHandle, 'targetModuleSetTag', '', '')
             mockCmHandleQueries.cmHandleHasState('cmHandleId-1', CmHandleState.READY) >> true
         and: 'the module service returns some module references'
             def moduleReferences = [new ModuleReference('module1', '1'), new ModuleReference('module2', '2')]
index c83a540..fbf2c3d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2022-2023 Nordix Foundation
+ *  Copyright (C) 2022-2024 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import spock.lang.Specification
 class DmiServiceUrlBuilderSpec extends Specification {
 
     static YangModelCmHandle yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle('dmiServiceName',
-        'dmiDataServiceName', 'dmiModuleServiceName', new NcmpServiceCmHandle(cmHandleId: 'some-cm-handle-id'),'my-module-set-tag', 'my-alternate-id')
+        'dmiDataServiceName', 'dmiModuleServiceName', new NcmpServiceCmHandle(cmHandleId: 'some-cm-handle-id'),'my-module-set-tag', 'my-alternate-id', 'my-data-producer-identifier')
 
     NcmpConfiguration.DmiProperties dmiProperties = new NcmpConfiguration.DmiProperties()
 
index 493db8c..cfc6ffd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2021-2023 Nordix Foundation
+ *  Copyright (C) 2021-2024 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -47,12 +47,13 @@ class YangModelCmHandleSpec extends Specification {
                 .withOperationalDataStores(DataStoreSyncState.SYNCHRONIZED, 'some-sync-time').build()
             ncmpServiceCmHandle.setCompositeState(compositeState)
         when: 'it is converted to a yang model cm handle'
-            def objectUnderTest = YangModelCmHandle.toYangModelCmHandle('', '', '', ncmpServiceCmHandle,'my-module-set-tag', 'my-alternate-id')
+            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
-        and: 'the result has the correct values for module set tag and alternate ID'
+        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'
@@ -67,7 +68,7 @@ class YangModelCmHandleSpec extends Specification {
     def 'Resolve DMI service name: #scenario and #requiredService service require.'() {
         given: 'a yang model cm handle'
             def objectUnderTest = YangModelCmHandle.toYangModelCmHandle(dmiServiceName, dmiDataServiceName,
-                    dmiModelServiceName, new NcmpServiceCmHandle(cmHandleId: 'cm-handle-id-1'),'', '')
+                    dmiModelServiceName, new NcmpServiceCmHandle(cmHandleId: 'cm-handle-id-1'),'', '', '')
         expect:
             assert objectUnderTest.resolveDmiServiceName(requiredService) == expectedService
         where:
index a365327..cd659bb 100644 (file)
@@ -52,7 +52,7 @@ class InventoryModelLoaderSpec extends Specification {
     def loggingListAppender
 
     void setup() {
-        expectedYangResourceToContentMap = objectUnderTest.createYangResourcesToContentMap('dmi-registry@2023-11-27.yang')
+        expectedYangResourceToContentMap = objectUnderTest.createYangResourcesToContentMap('dmi-registry@2024-02-23.yang')
         logger.setLevel(Level.DEBUG)
         loggingListAppender = new ListAppender()
         logger.addAppender(loggingListAppender)
@@ -71,9 +71,9 @@ class InventoryModelLoaderSpec extends Specification {
         when: 'the application is ready'
             objectUnderTest.onApplicationEvent(Mock(ApplicationReadyEvent))
         then: 'the module service is used to create the new schema set from the correct resource'
-            1 * mockCpsModuleService.createSchemaSet(NCMP_DATASPACE_NAME, 'dmi-registry-2023-11-27', expectedYangResourceToContentMap)
+            1 * mockCpsModuleService.createSchemaSet(NCMP_DATASPACE_NAME, 'dmi-registry-2024-02-23', expectedYangResourceToContentMap)
         and: 'the admin service is used to update the anchor'
-            1 * mockCpsAnchorService.updateAnchorSchemaSet(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, 'dmi-registry-2023-11-27')
+            1 * mockCpsAnchorService.updateAnchorSchemaSet(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, 'dmi-registry-2024-02-23')
         and: 'No schema sets are being removed by the module service (yet)'
             0 * mockCpsModuleService.deleteSchemaSet(NCMP_DATASPACE_NAME, _, _)
     }
index ff9f4ba..8a6c13e 100644 (file)
@@ -222,6 +222,7 @@ components:
         updatedCmHandles:
         - cmHandle: my-cm-handle
           alternateId: my-alternate-id
+          dataProducerIdentifier: my-data-producer-identifier
           publicCmHandleProperties:
             key: my-property
           cmHandleProperties:
@@ -230,6 +231,7 @@ components:
           trustLevel: COMPLETE
         - cmHandle: my-cm-handle
           alternateId: my-alternate-id
+          dataProducerIdentifier: my-data-producer-identifier
           publicCmHandleProperties:
             key: my-property
           cmHandleProperties:
@@ -239,6 +241,7 @@ components:
         createdCmHandles:
         - cmHandle: my-cm-handle
           alternateId: my-alternate-id
+          dataProducerIdentifier: my-data-producer-identifier
           publicCmHandleProperties:
             key: my-property
           cmHandleProperties:
@@ -247,6 +250,7 @@ components:
           trustLevel: COMPLETE
         - cmHandle: my-cm-handle
           alternateId: my-alternate-id
+          dataProducerIdentifier: my-data-producer-identifier
           publicCmHandleProperties:
             key: my-property
           cmHandleProperties:
@@ -302,6 +306,7 @@ components:
       example:
         cmHandle: my-cm-handle
         alternateId: my-alternate-id
+        dataProducerIdentifier: my-data-producer-identifier
         publicCmHandleProperties:
           key: my-property
         cmHandleProperties:
@@ -334,6 +339,9 @@ components:
         alternateId:
           example: my-alternate-id
           type: string
+        dataProducerIdentifier:
+          example: my-data-producer-identifier
+          type: string
       required:
       - cmHandle
       type: object
index 9203b6d..da0b0b3 100644 (file)
@@ -1871,6 +1871,8 @@ components:
     RestOutputCmHandle:
       example:
         cmHandle: my-cm-handle1
+        alternateId: my-alternate-id
+        dataProducerIdentifier: my-data-producer-identifier
         publicCmHandleProperties:
         - key: Book Type
         - key: Book Type
@@ -1889,6 +1891,7 @@ components:
             details: locked due to failure in module sync
           lastUpdateTime: 2022-12-31T20:30:40.000+0000
         trustLevel: COMPLETE
+        moduleSetTag: my-module-set-tag
       properties:
         cmHandle:
           example: my-cm-handle1
@@ -1906,6 +1909,15 @@ components:
           description: Current trust level of the relevant CM handle ID.
           example: COMPLETE
           type: string
+        moduleSetTag:
+          example: my-module-set-tag
+          type: string
+        alternateId:
+          example: my-alternate-id
+          type: string
+        dataProducerIdentifier:
+          example: my-data-producer-identifier
+          type: string
       title: CM handle Details
       type: object
     CmHandlePublicProperties:
index 09b4c5c..4b39e53 100644 (file)
@@ -64,7 +64,7 @@ class NcmpPerfTestBase extends PerfTestBase {
     }
 
     def createRegistrySchemaSet() {
-        def modelAsString = readResourceDataFile('ncmp-registry/dmi-registry@2023-11-27.yang')
+        def modelAsString = readResourceDataFile('ncmp-registry/dmi-registry@2024-02-23.yang')
         cpsModuleService.createSchemaSet(NCMP_PERFORMANCE_TEST_DATASPACE, REGISTRY_SCHEMA_SET, [registry: modelAsString])
     }
 
@@ -8,6 +8,11 @@ module dmi-registry {
 
   contact "toine.siebelink@est.tech";
 
+  revision "2024-02-23" {
+      description
+      "Added data-producer-identifier";
+    }
+
   revision "2023-11-27" {
     description
     "Added alternateId";
@@ -91,6 +96,9 @@ module dmi-registry {
       leaf alternate-id {
         type string;
       }
+      leaf data-producer-identifier {
+        type string;
+      }
 
       list additional-properties {
         key "name";