aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-07-01 09:01:19 +0000
committerliamfallon <liam.fallon@est.tech>2019-07-01 09:01:19 +0000
commitf08984b16abf954b7b351f21a3822e21d9d4f7c2 (patch)
tree1dc21cf3240864f37efe304a75c8055d89f48662 /core
parentc4baac8a79b0ca6340693ae47f9c424f3612e3bd (diff)
Fix issues from Checkstyle reviews
Use lombok on fields in EnEvent. Remove unnecessary code in BBS WebClient class Address Sonar issue in Execurot class Issue-ID: POLICY-1791 Change-Id: If07dc4529b121f8bfcd6ab1ae6c9def4774f9f4d Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'core')
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java92
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/Executor.java4
2 files changed, 15 insertions, 81 deletions
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java
index d53fdf8ff..95ea6b5d2 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +31,9 @@ import java.util.Properties;
import java.util.Random;
import java.util.Set;
+import lombok.Getter;
+import lombok.Setter;
+
import org.onap.policy.apex.core.engine.monitoring.EventMonitor;
import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
@@ -62,6 +66,8 @@ public class EnEvent extends HashMap<String, Object> {
private final transient EventMonitor eventMonitor = new EventMonitor();
// The stack of execution of this event, used for monitoring
+ @Getter
+ @Setter
private AxConcept[] userArtifactStack;
private static Random rand = new Random(System.nanoTime());
@@ -69,12 +75,18 @@ public class EnEvent extends HashMap<String, Object> {
// An identifier for the current event execution. The default value here will always be a random
// number, and should
// be reset
+ @Getter
+ @Setter
private long executionId = rand.nextLong();
// Event related properties used during processing of this event
+ @Getter
+ @Setter
private Properties executionProperties;
// A string holding a message that indicates why processing of this event threw an exception
+ @Getter
+ @Setter
private String exceptionMessage;
/**
@@ -138,86 +150,6 @@ public class EnEvent extends HashMap<String, Object> {
}
/**
- * Get the currently set value for the ExecutionID for this event. A ExecutionID in an EnEvent
- * is used identify all EnEvents (input, internal and output events) used in a single Engine
- * invocation. Therefore, a ExecutionID can be used to match which output event is the result of
- * a particular input event. The default initialized value for the ExecutionID is always unique
- * in a single JVM.
- *
- * @return the currently set value for the ExecutionID for this event.
- */
- public long getExecutionId() {
- return executionId;
- }
-
- /**
- * Set the value for the ExecutionID for this event. A ExecutionID in an EnEvent is used
- * identify all EnEvents (input, internal and output events) used in a single Engine invocation.
- * Therefore, a ExecutionID can be used to match which output event is the result of a
- * particular input event. The default initialised value for the ExecutionID is always unique in
- * a single JVM.
- *
- * @param executionId the new value for the ExecutionID for this event.
- */
- public void setExecutionId(final long executionId) {
- this.executionId = executionId;
- }
-
- /**
- * Get the event execution properties.
- *
- * @return the event execution properties
- */
- public Properties getExecutionProperties() {
- return executionProperties;
- }
-
- /**
- * Set the event execution properties.
- *
- * @param executionProperties the execution properties to set
- */
- public void setExecutionProperties(Properties executionProperties) {
- this.executionProperties = executionProperties;
- }
-
- /**
- * Gets the exception message explaining why processing of this event to fail.
- *
- * @return the exception message
- */
- public String getExceptionMessage() {
- return exceptionMessage;
- }
-
- /**
- * Sets the exception message explaining why processing of this event to fail.
- *
- * @param exceptionMessage the exception message
- */
- public void setExceptionMessage(final String exceptionMessage) {
- this.exceptionMessage = exceptionMessage;
- }
-
- /**
- * Get the user artifact stack of the event.
- *
- * @return the event user artifact stack
- */
- public AxConcept[] getUserArtifactStack() {
- return userArtifactStack;
- }
-
- /**
- * Store the user artifact stack of the event.
- *
- * @param usedArtifactStackArray the event user artifact stack
- */
- public void setUserArtifactStack(final AxConcept[] usedArtifactStackArray) {
- userArtifactStack = usedArtifactStackArray;
- }
-
- /**
* {@inheritDoc}.
*/
@Override
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/Executor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/Executor.java
index fa0b40e77..cb0cfabc4 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/Executor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/Executor.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -113,7 +114,8 @@ public interface Executor<I, O, S, C> {
*
* @return The parent executor of this executor
*/
- Executor<?, ?, ?, ?> getParent();
+ @SuppressWarnings("rawtypes")
+ Executor getParent();
/**
* Get the subject of the executor.