Fix more spelling mistakes 67/141967/1
authorToineSiebelink <toine.siebelink@est.tech>
Tue, 2 Sep 2025 09:13:32 +0000 (10:13 +0100)
committerToineSiebelink <toine.siebelink@est.tech>
Tue, 2 Sep 2025 09:13:32 +0000 (10:13 +0100)
- Remove time stamp formatting from comments (its OK in code)
  (also reused existing formatter utility)
- added . (full stops) separators in counter names to make them acceptable words

Issue-ID: CPS-2972
Change-Id: I6ee457fac880edd35b141b8c8b785208ca338e48
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/models/CompositeState.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/cmavc/CmAvcEventConsumer.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/EventDateTimeFormatter.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/CmDataSubscriptionModelLoader.java

index e02be31..bef06ad 100644 (file)
@@ -23,13 +23,13 @@ package org.onap.cps.ncmp.api.inventory.models;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import java.time.OffsetDateTime;
-import java.time.format.DateTimeFormatter;
 import lombok.Builder;
 import lombok.Data;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
 import org.onap.cps.ncmp.api.inventory.DataStoreSyncState;
+import org.onap.cps.ncmp.impl.utils.EventDateTimeFormatter;
 
 /**
  * State Model to store state corresponding to the Yang resource dmi-registry model.
@@ -55,11 +55,6 @@ public class CompositeState {
     @JsonProperty("datastores")
     private DataStores dataStores;
 
-    /**
-     * Date and Time in the format of yyyy-MM-dd'T'HH:mm:ss.SSSZ
-     */
-    private static final DateTimeFormatter dateTimeFormatter =
-            DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
 
     /**
      * Composite State copy constructor.
@@ -117,10 +112,10 @@ public class CompositeState {
     /**
      * The date and time format used for the cm handle sync state.
      *
-     * @return the date and time in the format of yyyy-MM-dd'T'HH:mm:ss.SSSZ
+     * @return the date and time in the ISO standard format
      */
     public static String nowInSyncTimeFormat() {
-        return dateTimeFormatter.format(OffsetDateTime.now());
+        return EventDateTimeFormatter.ISO_TIMESTAMP_FORMATTER.format(OffsetDateTime.now());
     }
 
     /**
index b18c7f9..d136bce 100644 (file)
@@ -66,7 +66,7 @@ public class CmAvcEventConsumer {
      */
     @KafkaListener(topics = "${app.dmi.cm-events.topic}",
             containerFactory = "cloudEventConcurrentKafkaListenerContainerFactory")
-    @Timed(value = "cps.ncmp.cmnotifications.consumeandforward", description = "Time taken to forward CM AVC events")
+    @Timed(value = "cps.ncmp.cm.notifications.consume.and.forward", description = "Time taken to forward CM AVC events")
     public void consumeAndForward(final ConsumerRecord<String, CloudEvent> cmAvcEventAsConsumerRecord) {
         if (isEventFromOnapDmiPlugin(cmAvcEventAsConsumerRecord.headers())) {
             processCmAvcEventChanges(cmAvcEventAsConsumerRecord);
index 9284c0f..56c4028 100644 (file)
@@ -27,9 +27,7 @@ import org.apache.commons.lang3.StringUtils;
 
 public interface EventDateTimeFormatter {
 
-    String ISO_TIMESTAMP_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
-
-    DateTimeFormatter ISO_TIMESTAMP_FORMATTER = DateTimeFormatter.ofPattern(ISO_TIMESTAMP_PATTERN);
+    DateTimeFormatter ISO_TIMESTAMP_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
 
     /**
      * Gets current date time.
index 5b93c18..4b8a95c 100644 (file)
@@ -34,10 +34,10 @@ import org.springframework.stereotype.Service;
 @Service
 public class CmDataSubscriptionModelLoader extends AbstractModelLoader {
 
-    private static final String MODEL_FILENAME = "cm-data-job-subscriptions@2025-07-16.yang";
-    private static final String SCHEMASET_NAME = "cm-data-job-subscriptions";
+    private static final String MODEL_FILE_NAME = "cm-data-job-subscriptions@2025-07-16.yang";
+    private static final String SCHEMA_SET_NAME = "cm-data-job-subscriptions";
     private static final String ANCHOR_NAME = "cm-data-job-subscriptions";
-    private static final String REGISTRY_DATANODE_NAME = "dataJob";
+    private static final String REGISTRY_DATA_NODE_NAME = "dataJob";
 
     public CmDataSubscriptionModelLoader(final CpsDataspaceService cpsDataspaceService,
             final CpsModuleService cpsModuleService, final CpsAnchorService cpsAnchorService,
@@ -53,9 +53,9 @@ public class CmDataSubscriptionModelLoader extends AbstractModelLoader {
 
     private void onboardSubscriptionModels() {
         createDataspace(NCMP_DATASPACE_NAME);
-        createSchemaSet(NCMP_DATASPACE_NAME, SCHEMASET_NAME, MODEL_FILENAME);
-        createAnchor(NCMP_DATASPACE_NAME, SCHEMASET_NAME, ANCHOR_NAME);
-        createTopLevelDataNode(NCMP_DATASPACE_NAME, ANCHOR_NAME, REGISTRY_DATANODE_NAME);
+        createSchemaSet(NCMP_DATASPACE_NAME, SCHEMA_SET_NAME, MODEL_FILE_NAME);
+        createAnchor(NCMP_DATASPACE_NAME, SCHEMA_SET_NAME, ANCHOR_NAME);
+        createTopLevelDataNode(NCMP_DATASPACE_NAME, ANCHOR_NAME, REGISTRY_DATA_NODE_NAME);
     }
 
 }