Address sonar violations related to hazelcast 05/140105/3
authormpriyank <priyank.maheshwari@est.tech>
Wed, 29 Jan 2025 09:12:40 +0000 (09:12 +0000)
committermpriyank <priyank.maheshwari@est.tech>
Wed, 29 Jan 2025 10:19:44 +0000 (10:19 +0000)
- Supressing warning caused by deprecation of RestApiConfig in hazelcast
  5.5 community version , which will be removed in 6.0 so created https://lf-onap.atlassian.net/browse/CPS-2599
  to address the issues
- Other sonar fixes

Issue-ID: CPS-2594
Change-Id: I2e95cd851eae74d8bbb4535cfbaed1dc1ef89543
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cache/HazelcastCacheConfig.java
cps-service/src/main/java/org/onap/cps/api/model/DataNode.java
cps-service/src/main/java/org/onap/cps/api/model/DeltaReport.java
docs/admin-guide.rst

index 75007e2..5a6e1ce 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START========================================================
- *  Copyright (C) 2023-2024 Nordix Foundation
+ *  Copyright (C) 2023-2025 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -130,6 +130,10 @@ public class HazelcastCacheConfig {
         }
     }
 
+    /*Note: Need to keep this for the meantime as Hazelcast community version 5.5 has marked RestApiConfig
+    for removal in future version and we have clients relying on these endpoints.
+    https://lf-onap.atlassian.net/browse/CPS-2599 created to address the issue. */
+    @SuppressWarnings("squid:S5738")
     protected void exposeClusterInformation(final Config config) {
         config.getNetworkConfig().getRestApiConfig().setEnabled(true)
                 .enableGroups(RestEndpointGroup.HEALTH_CHECK, RestEndpointGroup.CLUSTER_READ);
index be55970..6597aa3 100644 (file)
@@ -28,17 +28,17 @@ import java.util.Collections;
 import java.util.Map;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
+import lombok.NoArgsConstructor;
 import lombok.Setter;
 
 @Setter
 @Getter
 @EqualsAndHashCode
+@NoArgsConstructor
 public class DataNode implements Serializable {
 
     private static final long serialVersionUID = 1482619410918597467L;
 
-    public DataNode() {}
-
     private String dataspace;
     private String schemaSetName;
     private String anchorName;
index 77d8d77..761c6ad 100644 (file)
@@ -24,19 +24,19 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import java.io.Serializable;
 import java.util.Map;
 import lombok.Getter;
+import lombok.NoArgsConstructor;
 import lombok.Setter;
 
 @Setter
 @Getter
 @JsonInclude(JsonInclude.Include.NON_NULL)
+@NoArgsConstructor
 public class DeltaReport {
 
     public static final String CREATE_ACTION = "create";
     public static final String REMOVE_ACTION = "remove";
     public static final String REPLACE_ACTION = "replace";
 
-    public DeltaReport() {}
-
     private String action;
     private String xpath;
     private Map<String, Serializable> sourceData;
index 7e71a07..156a5df 100644 (file)
@@ -238,6 +238,8 @@ On demand heap dump and thread dump generation using the below endpoints.
 
 Hazelcast
 ---------
+.. note::
+   The below endpoints will be removed from hazelcast community version in the future release.
 
 Hazelcast cluster state and health check can be seen using the below endpoints