aboutsummaryrefslogtreecommitdiffstats
path: root/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java')
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java74
1 files changed, 14 insertions, 60 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 d4b212421..29802e06d 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
@@ -31,6 +31,8 @@ import java.util.Map;
import java.util.Properties;
import java.util.Random;
import java.util.Set;
+import lombok.AccessLevel;
+import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.onap.policy.apex.core.engine.monitoring.EventMonitor;
@@ -49,6 +51,9 @@ import org.slf4j.ext.XLoggerFactory;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
public class EnEvent extends HashMap<String, Object> {
private static final long serialVersionUID = 6311863111866294637L;
@@ -58,37 +63,31 @@ public class EnEvent extends HashMap<String, Object> {
// Repeasted string constants
private static final String NULL_KEYS_ILLEGAL = "null keys are illegal on method parameter \"key\"";
+ /*
+ * This is not used for encryption/security, thus disabling sonar.
+ */
+ private static Random rand = new Random(System.nanoTime()); // NOSONAR
+
// The definition of this event in the Apex model
+ @Setter(AccessLevel.NONE)
+ @EqualsAndHashCode.Include
private final AxEvent axEvent;
// The event monitor for this event
+ @Getter(AccessLevel.NONE)
private final transient EventMonitor eventMonitor = new EventMonitor();
// The stack of execution of this event, used for monitoring
- @Getter
- @Setter
private AxConcept[] userArtifactStack;
- /*
- * This is not used for encryption/security, thus disabling sonar.
- */
- private static Random rand = new Random(System.nanoTime()); // NOSONAR
-
// An identifier for the current event execution. The default value here will always be a random
- // number, and should
- // be reset
- @Getter
- @Setter
+ // number, and should be reset
private long executionId = rand.nextLong();
// Event related properties used during processing of this event
- @Getter
- @Setter
private Properties executionProperties = new Properties();
// A string holding a message that indicates why processing of this event threw an exception
- @Getter
- @Setter
private String exceptionMessage;
/**
@@ -116,15 +115,6 @@ public class EnEvent extends HashMap<String, Object> {
}
/**
- * Gets the event definition of this event.
- *
- * @return the event definition
- */
- public AxEvent getAxEvent() {
- return axEvent;
- }
-
- /**
* Get the name of the event.
*
* @return the event name
@@ -298,40 +288,4 @@ public class EnEvent extends HashMap<String, Object> {
return "EnEvent [axEvent=" + axEvent + ", userArtifactStack=" + Arrays.toString(userArtifactStack) + ", map="
+ super.toString() + "]";
}
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + axEvent.hashCode();
- return result;
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (!(obj instanceof EnEvent)) {
- return false;
- }
- EnEvent other = (EnEvent) obj;
- if (axEvent == null) {
- if (other.axEvent != null) {
- return false;
- }
- } else if (!axEvent.equals(other.axEvent)) {
- return false;
- }
- return true;
- }
}