summaryrefslogtreecommitdiffstats
path: root/models/src/main/java
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2021-06-16 12:08:01 +0100
committerliamfallon <liam.fallon@est.tech>2021-06-17 15:51:34 +0100
commit2d186df9e3ed47599dbc86c2f435f7884535398c (patch)
treed77b85e48927ad072248e784c7b99b12205f4e0b /models/src/main/java
parent17f5d3c97e47064407452122bc6cb801e43df5f9 (diff)
Clean up CLAMP Sonar and checkstyle issues
This commit cleans up sonar and checkstyle issues identified in the CLAMP repository. Issue-ID: POLICY-3206 Change-Id: I16b61bbe771cc17de15183a24b2a5e82a8d35872 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models/src/main/java')
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoop.java12
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipant.java10
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProvider.java2
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProvider.java6
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProvider.java4
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProvider.java4
6 files changed, 19 insertions, 19 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoop.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoop.java
index cac405abd..2a2cde2ae 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoop.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoop.java
@@ -26,7 +26,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
@@ -76,11 +75,8 @@ public class JpaControlLoop extends PfConcept implements PfAuthorative<ControlLo
// @formatter:off
@VerifyKey
@NotNull
- @AttributeOverrides({
- @AttributeOverride(name = "name", column = @Column(name = "definition_name")),
- @AttributeOverride(name = "version", column = @Column(name = "definition_version"))
- }
- )
+ @AttributeOverride(name = "name", column = @Column(name = "definition_name"))
+ @AttributeOverride(name = "version", column = @Column(name = "definition_version"))
private PfConceptKey definition;
// @formatter:on
@@ -158,7 +154,7 @@ public class JpaControlLoop extends PfConcept implements PfAuthorative<ControlLo
@Override
public ControlLoop toAuthorative() {
- ControlLoop controlLoop = new ControlLoop();
+ var controlLoop = new ControlLoop();
controlLoop.setName(getKey().getName());
controlLoop.setVersion(getKey().getVersion());
@@ -184,7 +180,7 @@ public class JpaControlLoop extends PfConcept implements PfAuthorative<ControlLo
this.elements = new LinkedHashMap<>(controlLoop.getElements().size());
for (Entry<UUID, ControlLoopElement> elementEntry : controlLoop.getElements().entrySet()) {
- JpaControlLoopElement jpaControlLoopElement = new JpaControlLoopElement();
+ var jpaControlLoopElement = new JpaControlLoopElement();
jpaControlLoopElement.setKey(new PfReferenceKey(getKey(), elementEntry.getValue().getId().toString()));
jpaControlLoopElement.fromAuthorative(elementEntry.getValue());
this.elements.put(elementEntry.getKey(), jpaControlLoopElement);
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipant.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipant.java
index 69b565266..4d49683bf 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipant.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipant.java
@@ -23,7 +23,6 @@ package org.onap.policy.clamp.controlloop.models.controlloop.persistence.concept
import java.io.Serializable;
import java.util.List;
import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
@@ -66,11 +65,8 @@ public class JpaParticipant extends PfConcept implements PfAuthorative<Participa
// @formatter:off
@VerifyKey
@NotNull
- @AttributeOverrides({
- @AttributeOverride(name = "name", column = @Column(name = "definition_name")),
- @AttributeOverride(name = "version", column = @Column(name = "definition_version"))
- }
- )
+ @AttributeOverride(name = "name", column = @Column(name = "definition_name"))
+ @AttributeOverride(name = "version", column = @Column(name = "definition_version"))
private PfConceptKey definition;
// @formatter:on
@@ -142,7 +138,7 @@ public class JpaParticipant extends PfConcept implements PfAuthorative<Participa
@Override
public Participant toAuthorative() {
- Participant participant = new Participant();
+ var participant = new Participant();
participant.setName(key.getName());
participant.setVersion(key.getVersion());
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProvider.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProvider.java
index 00eab8f69..f8f1f4145 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProvider.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProvider.java
@@ -121,10 +121,12 @@ public class ClElementStatisticsProvider extends AbstractModelsProvider {
* Get filtered clElement statistics.
*
* @param name the clElement name for the statistics to get
+ * @param version the clElement version for the statistics to get
* @param startTimeStamp startTimeStamp to filter statistics
* @param endTimeStamp endTimeStamp to filter statistics
* @param sortOrder sortOrder to query database
* @param getRecordNum Total query count from database
+ * @param filterMap the filters to apply to the get operation
* @return the clElement statistics found
* @throws PfModelException on errors getting policies
*/
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProvider.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProvider.java
index 5317bb31d..7c34a6654 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProvider.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProvider.java
@@ -162,13 +162,13 @@ public class ControlLoopProvider extends AbstractModelsProvider {
* @param name the name of the control loop to delete
* @param version the version of the control loop to delete
* @return the control loop deleted
- * @throws PfModelException on errors deleting the control loop
+ * @throws PfModelRuntimeException on errors deleting the control loop
*/
public ControlLoop deleteControlLoop(@NonNull final String name, @NonNull final String version) {
var controlLoopKey = new PfConceptKey(name, version);
- JpaControlLoop jpaDeleteControlLoop = getPfDao().get(JpaControlLoop.class, controlLoopKey);
+ var jpaDeleteControlLoop = getPfDao().get(JpaControlLoop.class, controlLoopKey);
if (jpaDeleteControlLoop == null) {
String errorMessage =
@@ -210,6 +210,8 @@ public class ControlLoopProvider extends AbstractModelsProvider {
/**
* Convert JPA control loop list to an authorative control loop list.
*
+ * @param <T> the type of TOSCA entity
+ * @param <J> the type of JPA TOSCA entity
* @param jpaEntityList the list to convert
* @return the authorative list
*/
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProvider.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProvider.java
index c569cadd8..2ccc5d3c1 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProvider.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProvider.java
@@ -133,7 +133,7 @@ public class ParticipantProvider extends AbstractModelsProvider {
* @param name the name of the participant to delete
* @param version the version of the participant to get
* @return the participant deleted
- * @throws PfModelException on errors deleting participants
+ * @throws PfModelRuntimeException on errors deleting participants
*/
public Participant deleteParticipant(@NonNull final String name, @NonNull final String version) {
@@ -155,7 +155,7 @@ public class ParticipantProvider extends AbstractModelsProvider {
/**
* Convert JPA participant list to an authorative participant list.
*
- * @param foundParticipants the list to convert
+ * @param jpaParticipantList the list to convert
* @return the authorative list
*/
private List<Participant> asParticipantList(List<JpaParticipant> jpaParticipantList) {
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProvider.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProvider.java
index 137af3a5e..a7216ed7f 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProvider.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProvider.java
@@ -54,6 +54,8 @@ public class ParticipantStatisticsProvider extends AbstractModelsProvider {
* Get Participant statistics.
*
* @param name the name of the participant statistics to get, null to get all stats
+ * @param version the version of the participant statistics to get, null to get all stats for a name
+ * @param timestamp the time stamp for the stats to get
* @return the participant statistics found
* @throws PfModelException on errors getting participant statistics
*/
@@ -77,10 +79,12 @@ public class ParticipantStatisticsProvider extends AbstractModelsProvider {
* Get filtered participant statistics.
*
* @param name the participant name for the statistics to get
+ * @param version the participant version for the statistics to get
* @param startTimeStamp startTimeStamp to filter statistics
* @param endTimeStamp endTimeStamp to filter statistics
* @param sortOrder sortOrder to query database
* @param getRecordNum Total query count from database
+ * @param filterMap the filters to apply to the get operation
* @return the participant statistics found
* @throws PfModelException on errors getting policies
*/