diff options
Diffstat (limited to 'controlloop/common/eventmanager/src/main')
3 files changed, 13 insertions, 5 deletions
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/drl/legacy/ControlLoopParams.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/drl/legacy/ControlLoopParams.java index 3eac66112..014ccd497 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/drl/legacy/ControlLoopParams.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/drl/legacy/ControlLoopParams.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +21,7 @@ package org.onap.policy.controlloop.drl.legacy; +import java.io.Serial; import java.io.Serializable; import lombok.Data; import lombok.NoArgsConstructor; @@ -29,6 +31,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; @NoArgsConstructor public class ControlLoopParams implements Serializable { + @Serial private static final long serialVersionUID = 970755684770982776L; private String closedLoopControlName; diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ClEventManagerWithEvent.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ClEventManagerWithEvent.java index 5a0352bfe..bb322f825 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ClEventManagerWithEvent.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ClEventManagerWithEvent.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +21,7 @@ package org.onap.policy.controlloop.eventmanager; +import java.io.Serial; import java.util.HashMap; import lombok.AccessLevel; import lombok.Getter; @@ -40,20 +42,20 @@ import org.slf4j.LoggerFactory; * Manager for a single control loop event. Once this has been created, the event can be * retracted from working memory. */ +@Getter public abstract class ClEventManagerWithEvent<T extends Step> extends ClEventManagerWithOutcome<T> implements StepContext { private static final Logger logger = LoggerFactory.getLogger(ClEventManagerWithEvent.class); + @Serial private static final long serialVersionUID = -1216568161322872641L; public enum NewEventStatus { FIRST_ONSET, SUBSEQUENT_ONSET, FIRST_ABATEMENT, SUBSEQUENT_ABATEMENT, SYNTAX_ERROR } - @Getter private final VirtualControlLoopEvent event; - @Getter @Setter(AccessLevel.PROTECTED) private VirtualControlLoopEvent abatement = null; diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java index 354567cd8..f93b2acf5 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +21,7 @@ package org.onap.policy.controlloop.eventmanager; +import java.io.Serial; import java.io.Serializable; import java.time.Instant; import java.util.Deque; @@ -61,6 +63,7 @@ import org.slf4j.LoggerFactory; public class ControlLoopEventManager implements StepContext, Serializable { private static final Logger logger = LoggerFactory.getLogger(ControlLoopEventManager.class); + @Serial private static final long serialVersionUID = -1216568161322872641L; /** @@ -81,7 +84,7 @@ public class ControlLoopEventManager implements StepContext, Serializable { * otherwise. This will be {@code false} if this object is reconstituted from a * persistent store or by transfer from another server. */ - private transient boolean createdByThisJvmInstance; + private final transient boolean createdByThisJvmInstance; private final transient EventManagerServices services; @@ -115,7 +118,7 @@ public class ControlLoopEventManager implements StepContext, Serializable { /** * Set of properties used while processing the event. */ - private Map<String, Serializable> properties = new ConcurrentHashMap<>(); + private final Map<String, Serializable> properties = new ConcurrentHashMap<>(); /** * Unprocessed outcomes from the operations. Outcomes are added to this each time the @@ -192,7 +195,7 @@ public class ControlLoopEventManager implements StepContext, Serializable { */ private long detmControlLoopTimeoutMs() { // validation checks preclude null or 0 timeout values in the policy - Integer timeout = processor.getPolicy().getProperties().getTimeout(); + int timeout = processor.getPolicy().getProperties().getTimeout(); return TimeUnit.MILLISECONDS.convert(timeout, TimeUnit.SECONDS); } |