Use lombok annotations in apex-pdp 22/123022/2
authorJim Hahn <jrh3@att.com>
Fri, 30 Jul 2021 20:06:49 +0000 (16:06 -0400)
committerJim Hahn <jrh3@att.com>
Mon, 2 Aug 2021 13:42:54 +0000 (09:42 -0400)
Updated projects: services-engine through utilities

Issue-ID: POLICY-3391
Change-Id: I35ebb40d86e9bda360f7819516290b3fea88335c
Signed-off-by: Jim Hahn <jrh3@att.com>
37 files changed:
model/utilities/src/main/java/org/onap/policy/apex/model/utilities/CollectionUtils.java
model/utilities/src/main/java/org/onap/policy/apex/model/utilities/DirectoryUtils.java
model/utilities/src/main/java/org/onap/policy/apex/model/utilities/TreeMapUtils.java
model/utilities/src/main/java/org/onap/policy/apex/model/utilities/comparison/KeyDifference.java
model/utilities/src/main/java/org/onap/policy/apex/model/utilities/comparison/KeyedMapDifference.java
model/utilities/src/main/java/org/onap/policy/apex/model/utilities/json/JsonHandler.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexEvent.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexPluginsEventConsumer.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexPluginsEventProducer.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/PeeredReference.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/SynchronousEventCache.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/enevent/ApexEvent2EnEventConverter.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/eventrequestor/EventRequestorConsumer.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/eventrequestor/EventRequestorProducer.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/FileCarrierTechnologyParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/HeaderDelimitedTextBlockReader.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/TextBlock.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/JsonEventProtocolParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEngineServiceHandler.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventMarshaller.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexPolicyStatisticsManager.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EnEventListenerImpl.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterConstants.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/RestPluginCarrierTechnologyParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventhandler/EventHandlerParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolTextCharDelimitedParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolTextTokenDelimitedParameters.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/ApexPeriodicEventGeneratorTest.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImplTest.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterConstants.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/comm/PdpStatusPublisher.java

index 190b270..8ca6d15 100644 (file)
@@ -23,18 +23,16 @@ package org.onap.policy.apex.model.utilities;
 
 import java.util.List;
 import java.util.ListIterator;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 
 /**
  * This is common utility class with static methods for handling collections.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public class CollectionUtils {
-    /**
-     * Private constructor used to prevent sub class instantiation.
-     */
-    private CollectionUtils() {
-    }
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class CollectionUtils {
 
     /**
      * Compare two lists, checks for equality, then for equality on members.
index 011dbb1..cc92d2a 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,6 +23,8 @@
 package org.onap.policy.apex.model.utilities;
 
 import java.io.File;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
@@ -31,16 +34,11 @@ import org.slf4j.ext.XLoggerFactory;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public abstract class DirectoryUtils {
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DirectoryUtils {
     // Get a reference to the logger
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(DirectoryUtils.class);
 
-    /**
-     * Private constructor used to prevent sub class instantiation.
-     */
-    private DirectoryUtils() {
-    }
-
     /**
      * Method to get an empty temporary directory in the system temporary directory on the local machine that will be
      * deleted on (normal) shutdown.
index d48f7f9..6daa686 100644 (file)
@@ -26,6 +26,8 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.NavigableMap;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 
 /**
  * This class provides utility functions for tree maps. A function to find the nearest match in the tree map to an input
@@ -33,14 +35,8 @@ import java.util.NavigableMap;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public class TreeMapUtils {
-
-    /**
-     * This class is a utility class that can't be instantiated.
-     */
-    private TreeMapUtils() {
-        // Private constructor to block subclassing
-    }
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class TreeMapUtils {
 
     /**
      * Find the list of entries that matches a given word, for example "p" will match "put", "policy", and "push".
index 2eb6af8..b01c83d 100644 (file)
@@ -1,25 +1,28 @@
 /*
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.model.utilities.comparison;
 
+import lombok.Getter;
+
 /**
  * This class is used to template key differences for bulk key comparisons in models. It performs a difference check
  * between two keys.
@@ -27,6 +30,7 @@ package org.onap.policy.apex.model.utilities.comparison;
  * @author Liam Fallon (liam.fallon@ericsson.com)
  * @param <K> the generic type
  */
+@Getter
 public class KeyDifference<K> {
     // The keys being compared
     private K leftKey;
@@ -43,24 +47,6 @@ public class KeyDifference<K> {
         this.rightKey = rightKey;
     }
 
-    /**
-     * Gets the left key.
-     *
-     * @return the left key
-     */
-    public K getLeftKey() {
-        return leftKey;
-    }
-
-    /**
-     * Gets the right key.
-     *
-     * @return the right key
-     */
-    public K getRightKey() {
-        return rightKey;
-    }
-
     /**
      * Checks if the left and right keys are equal.
      *
index 91c523e..a070ec9 100644 (file)
@@ -1,19 +1,20 @@
 /*
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -24,6 +25,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.TreeMap;
+import lombok.Getter;
 
 /**
  * This class holds the result of a difference check between two keyed maps. Four results are returned in the class. The
@@ -36,6 +38,7 @@ import java.util.TreeMap;
  * @param <K> the generic type
  * @param <V> the generic type
  */
+@Getter
 public class KeyedMapDifference<K, V> {
     private static final String KEY = "key=";
     private static final String VALUE = ",value=";
@@ -46,43 +49,6 @@ public class KeyedMapDifference<K, V> {
     private Map<K, V> identicalValues = new TreeMap<>();
     private Map<K, List<V>> differentValues = new TreeMap<>();
 
-    /**
-     * Gets the entries that were found only in the left map.
-     *
-     * @return the entries only in the left map
-     */
-    public Map<K, V> getLeftOnly() {
-        return leftOnly;
-    }
-
-    /**
-     * Gets the entries that were found only in the right map.
-     *
-     * @return the entries only in the right map
-     */
-    public Map<K, V> getRightOnly() {
-        return rightOnly;
-    }
-
-    /**
-     * Gets the entries that were identical (keys and values the same) in both maps.
-     *
-     * @return the identical entries
-     */
-    public Map<K, V> getIdenticalValues() {
-        return identicalValues;
-    }
-
-    /**
-     * Gets the entries that had the same key but different values in both maps.
-     *
-     * @return the entries that were different. There are two values in the list of values for each entry. The first
-     *         value is the value that was in the left map and the second value is the value that was in the right map.
-     */
-    public Map<K, List<V>> getDifferentValues() {
-        return differentValues;
-    }
-
     /**
      * Return a string representation of the differences.
      *
@@ -127,7 +93,7 @@ public class KeyedMapDifference<K, V> {
 
     /**
      * Output the entries in a map with entries that are in one side only as a string.
-     * 
+     *
      * @param sideMap the map for the side being checked
      * @param sideMapString the string that represents the map in output strings
      * @param keysOnly if true, just add key information and not entries
@@ -153,7 +119,7 @@ public class KeyedMapDifference<K, V> {
 
     /**
      * Output the differences between two the maps as a string.
-     * 
+     *
      * @param keysOnly if true, just add key information and not entries
      * @return the differences as a string
      */
@@ -185,7 +151,7 @@ public class KeyedMapDifference<K, V> {
 
     /**
      * Output the identical entries in the maps as a string.
-     * 
+     *
      * @param keysOnly if true, just add key information and not entries
      * @return the identical entries as a string
      */
index bc0551c..66e389f 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -33,6 +34,7 @@ import java.io.Reader;
  * @param <P> the generic type
  */
 public class JsonHandler<P> {
+    private static final Gson GSON = new GsonBuilder().serializeNulls().create();
 
     /**
      * This method reads objects of a given class from an input stream.
@@ -42,11 +44,7 @@ public class JsonHandler<P> {
      * @return the object read
      */
     public P read(final Class<P> inputClass, final InputStream inputStream) {
-        // Register the adapters for our carrier technologies and event protocols with GSON
-        final GsonBuilder gsonBuilder = new GsonBuilder();
-
-        final Gson gson = gsonBuilder.serializeNulls().create();
         final Reader jsonResourceReader = new InputStreamReader(inputStream);
-        return gson.fromJson(jsonResourceReader, inputClass);
+        return GSON.fromJson(jsonResourceReader, inputClass);
     }
 }
index 2364d0c..76a1c03 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +28,7 @@ import java.util.Properties;
 import java.util.concurrent.atomic.AtomicLong;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
+import lombok.Setter;
 import lombok.ToString;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 import org.slf4j.Logger;
@@ -119,12 +121,15 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
 
     // An identifier for the current event execution. The default value here will always be unique
     // in a single JVM
+    @Setter
     private long executionId = ApexEvent.getNextExecutionId();
 
     // Event related properties used during processing of this event
+    @Setter
     private Properties executionProperties = new Properties();
 
     // A string holding a message that indicates why processing of this event threw an exception
+    @Setter
     private String exceptionMessage;
 
     /**
@@ -196,36 +201,6 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
         }
     }
 
-    /**
-     * Sets the pass-thru executionID for this event.
-     *
-     * <p>The default value for executionID is unique in the current JVM. For some applications/deployments this
-     * executionID may need to be globally unique
-     *
-     * @param executionId the executionID
-     */
-    public void setExecutionId(final long executionId) {
-        this.executionId = executionId;
-    }
-
-    /**
-     * Set the execution properties for this event.
-     *
-     * @param executionProperties the execution properties to set
-     */
-    public void setExecutionProperties(Properties executionProperties) {
-        this.executionProperties = executionProperties;
-    }
-
-    /**
-     * 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;
-    }
-
     /*
      * Map overrides from here
      */
index 95a263e..aeee839 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,11 +23,13 @@ package org.onap.policy.apex.service.engine.event;
 
 import java.util.EnumMap;
 import java.util.Map;
+import lombok.Getter;
 import org.onap.policy.apex.core.infrastructure.threading.ApplicationThreadFactory;
 import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerPeeredMode;
 
 public abstract class ApexPluginsEventConsumer implements ApexEventConsumer, Runnable {
     // The name for this consumer
+    @Getter
     protected String name = null;
 
     // The peer references for this event handler
@@ -49,14 +52,6 @@ public abstract class ApexPluginsEventConsumer implements ApexEventConsumer, Run
         consumerThread.start();
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String getName() {
-        return name;
-    }
-
     /**
      * {@inheritDoc}.
      */
index d1e9ffd..5f3e5f8 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2020-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,23 +24,17 @@ package org.onap.policy.apex.service.engine.event;
 import java.util.EnumMap;
 import java.util.Map;
 import java.util.Properties;
+import lombok.Getter;
 import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerPeeredMode;
 
 public abstract class ApexPluginsEventProducer implements ApexEventProducer {
     // The name for this producer
+    @Getter
     protected String name = null;
     // The peer references for this event handler
     protected Map<EventHandlerPeeredMode, PeeredReference> peerReferenceMap =
             new EnumMap<>(EventHandlerPeeredMode.class);
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String getName() {
-        return name;
-    }
-
     /**
      * {@inheritDoc}.
      */
index 14ca3f0..1167426 100644 (file)
@@ -1,32 +1,35 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.service.engine.event;
 
+import lombok.Getter;
 import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerPeeredMode;
 
 /**
  * This class holds a reference to an event consumer and producer that have been peered.
- * 
+ *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@Getter
 public class PeeredReference {
     // The consumer putting events into APEX
     private final ApexEventConsumer peeredConsumer;
@@ -36,7 +39,7 @@ public class PeeredReference {
 
     /**
      * Create a peered consumer/producer reference.
-     * 
+     *
      * @param peeredMode the peered mode for which to return the reference
      * @param consumer the consumer that is receiving event
      * @param producer the producer that is sending events
@@ -50,22 +53,4 @@ public class PeeredReference {
         peeredConsumer.setPeeredReference(peeredMode, this);
         peeredProducer.setPeeredReference(peeredMode, this);
     }
-
-    /**
-     * Gets the synchronous consumer putting events into the cache.
-     *
-     * @return the source synchronous consumer
-     */
-    public ApexEventConsumer getPeeredConsumer() {
-        return peeredConsumer;
-    }
-
-    /**
-     * Gets the synchronous producer taking events from the cache.
-     *
-     * @return the synchronous producer that is taking events from the cache
-     */
-    public ApexEventProducer getPeeredProducer() {
-        return peeredProducer;
-    }
 }
index 39c5c2c..5f1dcc9 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +28,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import lombok.Getter;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerPeeredMode;
 import org.slf4j.ext.XLogger;
@@ -51,6 +53,7 @@ public class SynchronousEventCache extends PeeredReference implements Runnable {
     private static final long CACHE_STOP_WAIT_INTERVAL = 10;
 
     // The time in milliseconds to wait for the reply to a sent synchronous event
+    @Getter
     private long synchronousEventTimeout = DEFAULT_SYNCHRONOUS_EVENT_TIMEOUT;
 
     // Map holding outstanding synchronous events
@@ -87,15 +90,6 @@ public class SynchronousEventCache extends PeeredReference implements Runnable {
         synchronousEventCacheThread.start();
     }
 
-    /**
-     * Gets the timeout value for synchronous events.
-     *
-     * @return the synchronous event timeout
-     */
-    public long getSynchronousEventTimeout() {
-        return synchronousEventTimeout;
-    }
-
     /**
      * Cache a synchronized event sent into Apex in the event cache.
      *
index ab54d42..27fa509 100644 (file)
@@ -3,6 +3,7 @@
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  *  Modifications Copyright (C) 2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +25,7 @@ package org.onap.policy.apex.service.engine.event.impl.enevent;
 
 import java.util.ArrayList;
 import java.util.List;
+import lombok.AllArgsConstructor;
 import org.onap.policy.apex.core.engine.engine.ApexEngine;
 import org.onap.policy.apex.core.engine.event.EnEvent;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
@@ -41,20 +43,12 @@ import org.onap.policy.apex.service.engine.event.ApexEventRuntimeException;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@AllArgsConstructor
 public final class ApexEvent2EnEventConverter implements ApexEventConverter {
 
     // The Apex engine with its event definitions
     private final ApexEngine apexEngine;
 
-    /**
-     * Set up the event converter.
-     *
-     * @param apexEngine The engine to use to create events to be converted
-     */
-    public ApexEvent2EnEventConverter(final ApexEngine apexEngine) {
-        this.apexEngine = apexEngine;
-    }
-
     /**
      * {@inheritDoc}.
      */
index f5ceff4..1194a2c 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,6 +27,7 @@ import java.util.Properties;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
+import lombok.Getter;
 import org.onap.policy.apex.core.infrastructure.threading.ApplicationThreadFactory;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.service.engine.event.ApexEventConsumer;
@@ -56,6 +58,7 @@ public class EventRequestorConsumer implements ApexEventConsumer, Runnable {
     private ApexEventReceiver eventReceiver;
 
     // The name for this consumer
+    @Getter
     private String name = null;
 
     // The peer references for this event handler
@@ -70,6 +73,7 @@ public class EventRequestorConsumer implements ApexEventConsumer, Runnable {
     private boolean stopOrderedFlag = false;
 
     // The number of events received to date
+    @Getter
     private int eventsReceived = 0;
 
     @Override
@@ -127,23 +131,6 @@ public class EventRequestorConsumer implements ApexEventConsumer, Runnable {
         consumerThread.start();
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Get the number of events received to date.
-     *
-     * @return the number of events received
-     */
-    public int getEventsReceived() {
-        return eventsReceived;
-    }
-
     /**
      * {@inheritDoc}.
      */
index b1abeb5..36f3b94 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +25,7 @@ package org.onap.policy.apex.service.engine.event.impl.eventrequestor;
 import java.util.EnumMap;
 import java.util.Map;
 import java.util.Properties;
+import lombok.Getter;
 import org.onap.policy.apex.service.engine.event.ApexEventConsumer;
 import org.onap.policy.apex.service.engine.event.ApexEventException;
 import org.onap.policy.apex.service.engine.event.ApexEventProducer;
@@ -46,6 +48,7 @@ public class EventRequestorProducer implements ApexEventProducer {
     private static final Logger LOGGER = LoggerFactory.getLogger(EventRequestorProducer.class);
 
     // The name for this producer
+    @Getter
     private String name = null;
 
     // The peer references for this event handler
@@ -53,6 +56,7 @@ public class EventRequestorProducer implements ApexEventProducer {
             new EnumMap<>(EventHandlerPeeredMode.class);
 
     // The number of events sent
+    @Getter
     private int eventsSent = 0;
 
     /**
@@ -81,23 +85,6 @@ public class EventRequestorProducer implements ApexEventProducer {
         }
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Get the number of events sent to date.
-     *
-     * @return the number of events received
-     */
-    public int getEventsSent() {
-        return eventsSent;
-    }
-
     /**
      * {@inheritDoc}.
      */
index eceb0b4..a859973 100644 (file)
@@ -24,6 +24,7 @@ package org.onap.policy.apex.service.engine.event.impl.filecarrierplugin;
 import java.io.File;
 import lombok.Getter;
 import lombok.Setter;
+import lombok.ToString;
 import org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.consumer.ApexFileEventConsumer;
 import org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.producer.ApexFileEventProducer;
 import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters;
@@ -51,6 +52,7 @@ import org.onap.policy.models.base.Validated;
  */
 @Getter
 @Setter
+@ToString
 public class FileCarrierTechnologyParameters extends CarrierTechnologyParameters {
     // @formatter:off
     /** The label of this carrier technology. */
@@ -85,16 +87,6 @@ public class FileCarrierTechnologyParameters extends CarrierTechnologyParameters
         this.setEventConsumerPluginClass(FILE_EVENT_CONSUMER_PLUGIN_CLASS);
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "FILECarrierTechnologyParameters [fileName=" + fileName + ", standardIO=" + standardIo
-                        + ", standardError=" + standardError + ", streamingMode=" + streamingMode + ", startDelay="
-                        + startDelay + "]";
-    }
-
     /**
      * {@inheritDoc}.
      */
index 67b7cb8..c2f14a2 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,9 +54,6 @@ public class HeaderDelimitedTextBlockReader implements TextBlockReader, Runnable
     private final boolean delimiterAtStart;
     private boolean blockEndTokenUsed;
 
-    // The thread used to read the text from the stream
-    private Thread textConsumputionThread;
-
     // The input stream for text
     private InputStream inputStream;
 
@@ -108,7 +106,7 @@ public class HeaderDelimitedTextBlockReader implements TextBlockReader, Runnable
         this.inputStream = incomingInputStream;
 
         // Configure and start the text reading thread
-        textConsumputionThread = new ApplicationThreadFactory(this.getClass().getName()).newThread(this);
+        Thread textConsumputionThread = new ApplicationThreadFactory(this.getClass().getName()).newThread(this);
         textConsumputionThread.setDaemon(true);
         textConsumputionThread.start();
     }
index 526d9c3..f42182b 100644 (file)
@@ -1,30 +1,36 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.consumer;
 
+import lombok.Getter;
+import lombok.Setter;
+
 /**
  * This class is a bean that holds a block of text read from an incoming text file.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@Getter
+@Setter
 public class TextBlock {
     private boolean endOfText = false;
     private String text;
@@ -39,40 +45,4 @@ public class TextBlock {
         this.endOfText = endOfText;
         this.text = text;
     }
-
-    /**
-     * Checks if is end of text.
-     *
-     * @return true, if checks if is end of text
-     */
-    public boolean isEndOfText() {
-        return endOfText;
-    }
-
-    /**
-     * Sets whether end of text has been reached.
-     *
-     * @param endOfText the end of text flag value
-     */
-    public void setEndOfText(final boolean endOfText) {
-        this.endOfText = endOfText;
-    }
-
-    /**
-     * Gets the text of the text block.
-     *
-     * @return the text of the text block
-     */
-    public String getText() {
-        return text;
-    }
-
-    /**
-     * Sets the text of the text block.
-     *
-     * @param text the text of the text block
-     */
-    public void setText(final String text) {
-        this.text = text;
-    }
 }
index b5aa1cd..51e9b6d 100644 (file)
@@ -1,25 +1,28 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin;
 
+import lombok.Getter;
+import lombok.Setter;
 import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolTextCharDelimitedParameters;
 
 // @formatter:off
@@ -42,10 +45,12 @@ import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolTextCh
  * definition in this field name in the schema, there must be one and only one field in the
  * event definition, the event has a single parameter whose type is the Pojo. This parameter is optional.
  * </ol>
- * 
+ *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
 //@formatter:on
+@Getter
+@Setter
 public class JsonEventProtocolParameters extends EventProtocolTextCharDelimitedParameters {
     /** The label of this event protocol. */
     public static final String JSON_EVENT_PROTOCOL_LABEL = "JSON";
@@ -99,112 +104,4 @@ public class JsonEventProtocolParameters extends EventProtocolTextCharDelimitedP
     public String getName() {
         return this.getLabel();
     }
-
-    /**
-     * Gets the name alias.
-     *
-     * @return the name alias
-     */
-    public String getNameAlias() {
-        return nameAlias;
-    }
-
-    /**
-     * Gets the version alias.
-     *
-     * @return the version alias
-     */
-    public String getVersionAlias() {
-        return versionAlias;
-    }
-
-    /**
-     * Gets the name space alias.
-     *
-     * @return the name space alias
-     */
-    public String getNameSpaceAlias() {
-        return nameSpaceAlias;
-    }
-
-    /**
-     * Gets the source alias.
-     *
-     * @return the source alias
-     */
-    public String getSourceAlias() {
-        return sourceAlias;
-    }
-
-    /**
-     * Gets the target alias.
-     *
-     * @return the target alias
-     */
-    public String getTargetAlias() {
-        return targetAlias;
-    }
-
-    /**
-     * Return the name of the POJO field to use for POJO decoding and encoding.
-     * 
-     * @return the name of the POJO field
-     */
-    public String getPojoField() {
-        return pojoField;
-    }
-
-    /**
-     * Sets the name alias.
-     *
-     * @param nameAlias the new name alias
-     */
-    public void setNameAlias(String nameAlias) {
-        this.nameAlias = nameAlias;
-    }
-
-    /**
-     * Sets the version alias.
-     *
-     * @param versionAlias the new version alias
-     */
-    public void setVersionAlias(String versionAlias) {
-        this.versionAlias = versionAlias;
-    }
-
-    /**
-     * Sets the name space alias.
-     *
-     * @param nameSpaceAlias the new name space alias
-     */
-    public void setNameSpaceAlias(String nameSpaceAlias) {
-        this.nameSpaceAlias = nameSpaceAlias;
-    }
-
-    /**
-     * Sets the source alias.
-     *
-     * @param sourceAlias the new source alias
-     */
-    public void setSourceAlias(String sourceAlias) {
-        this.sourceAlias = sourceAlias;
-    }
-
-    /**
-     * Sets the target alias.
-     *
-     * @param targetAlias the new target alias
-     */
-    public void setTargetAlias(String targetAlias) {
-        this.targetAlias = targetAlias;
-    }
-
-    /**
-     * Sets the POJO field that name for POJO decoding and encoding.
-     * 
-     * @param pojoField The name of the POJO field to use on the event
-     */
-    public void setPojoField(final String pojoField) {
-        this.pojoField = pojoField;
-    }
 }
index ca76a53..6e1311e 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +22,7 @@
 
 package org.onap.policy.apex.service.engine.main;
 
+import lombok.AllArgsConstructor;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.service.engine.event.ApexEvent;
 import org.onap.policy.apex.service.engine.runtime.EngineService;
@@ -32,6 +34,7 @@ import org.slf4j.ext.XLoggerFactory;
  * service and the EngDep service for that engine. It also acts as an event
  * receiver for asynchronous and synchronous events.
  */
+@AllArgsConstructor
 public class ApexEngineServiceHandler {
     // The logger for this class
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(ApexEngineServiceHandler.class);
@@ -39,15 +42,6 @@ public class ApexEngineServiceHandler {
     // The Apex engine service, the Apex engine itself
     private final EngineService apexEngineService;
 
-    /**
-     * Instantiates a new engine holder with its engine service and EngDep service.
-     *
-     * @param apexEngineService the apex engine service
-     */
-    ApexEngineServiceHandler(final EngineService apexEngineService) {
-        this.apexEngineService = apexEngineService;
-    }
-
     /**
      * This method forwards an event to the Apex service.
      *
index 08014f9..71f04d6 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +25,7 @@ package org.onap.policy.apex.service.engine.main;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
+import lombok.Getter;
 import org.onap.policy.apex.core.infrastructure.threading.ApplicationThreadFactory;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.service.engine.event.ApexEvent;
@@ -55,6 +57,7 @@ public class ApexEventMarshaller implements ApexEventListener, Runnable {
     private static final long EVENT_QUEUE_POLL_INTERVAL = 20;
 
     // The name of the marshaler
+    @Getter
     private final String name;
 
     // The engine service and producer parameters
@@ -63,7 +66,9 @@ public class ApexEventMarshaller implements ApexEventListener, Runnable {
 
     // Apex event producer and event converter, all conversions are to and from string
     // representation of events
+    @Getter
     private ApexEventProducer producer;
+    @Getter
     private ApexEventProtocolConverter converter;
 
     // Temporary event holder for events coming out of Apex
@@ -111,33 +116,6 @@ public class ApexEventMarshaller implements ApexEventListener, Runnable {
         marshallerThread.start();
     }
 
-    /**
-     * Gets the name of the marshaler.
-     *
-     * @return the marshaler name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Gets the technology specific producer for this marshaler.
-     *
-     * @return the producer
-     */
-    public ApexEventProducer getProducer() {
-        return producer;
-    }
-
-    /**
-     * Gets the event protocol converter for this marshaler.
-     *
-     * @return the event protocol converter
-     */
-    public ApexEventProtocolConverter getConverter() {
-        return converter;
-    }
-
     /**
      * Callback method called on implementations of this interface when Apex emits an event.
      *
index 4e62f5c..8f3bb85 100644 (file)
@@ -3,6 +3,7 @@
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * 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,7 @@ import java.util.Properties;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
+import lombok.Getter;
 import lombok.NonNull;
 import org.onap.policy.apex.core.infrastructure.threading.ApplicationThreadFactory;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
@@ -66,6 +68,7 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
     private static final long EVENT_QUEUE_POLL_INTERVAL = 20;
 
     // The name of the unmarshaler
+    @Getter
     private final String name;
 
     // The engine service and consumer parameters
@@ -76,7 +79,9 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
     private ApexEngineServiceHandler engineServiceHandler;
 
     // Apex event producer and event converter, all events are sent as string representations
+    @Getter
     private ApexEventConsumer consumer;
+    @Getter
     private ApexEventProtocolConverter converter;
 
     // Temporary event holder for events going into Apex
@@ -131,33 +136,6 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
         unmarshallerThread.start();
     }
 
-    /**
-     * Gets the name of the unmarshaler.
-     *
-     * @return the unmarshaler name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Gets the technology specific consumer for this unmarshaler.
-     *
-     * @return the consumer
-     */
-    public ApexEventConsumer getConsumer() {
-        return consumer;
-    }
-
-    /**
-     * Gets the event protocol converter for this unmarshaler.
-     *
-     * @return the event protocol converter
-     */
-    public ApexEventProtocolConverter getConverter() {
-        return converter;
-    }
-
     /**
      * Connect a synchronous unmarshaler with a synchronous marshaler.
      *
index f49e8cd..1924d9f 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2020-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.apex.service.engine.main;
 
 import java.util.concurrent.atomic.AtomicLong;
+import lombok.NoArgsConstructor;
 import org.onap.policy.common.utils.services.Registry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@NoArgsConstructor
 public class ApexPolicyStatisticsManager {
     private static final Logger LOGGER = LoggerFactory.getLogger(ApexPolicyStatisticsManager.class);
     public static final String REG_APEX_PDP_POLICY_COUNTER = "object:pdp/statistics/policy/counter";
@@ -38,13 +41,6 @@ public class ApexPolicyStatisticsManager {
     private final AtomicLong policyExecutedSuccessCount = new AtomicLong(0);
     private final AtomicLong policyExecutedFailCount = new AtomicLong(0);
 
-    /**
-     * Constructs the object.
-     */
-    public ApexPolicyStatisticsManager() {
-        super();
-    }
-
     /**
      * To get the ApexPolicyStatisticsManager in Registry.
      *
index 877ac85..483c8f5 100644 (file)
@@ -1,25 +1,27 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.service.engine.runtime.impl;
 
+import lombok.AllArgsConstructor;
 import org.onap.policy.apex.core.engine.engine.EnEventListener;
 import org.onap.policy.apex.core.engine.event.EnEvent;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
@@ -36,24 +38,13 @@ import org.onap.policy.apex.service.engine.runtime.ApexEventListener;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@AllArgsConstructor
 public final class EnEventListenerImpl implements EnEventListener {
     // Listener for ApexEvents
-    private ApexEventListener apexEventListener = null;
+    private final ApexEventListener apexEventListener;
 
     // Converter for Engine events to Apex Events
-    private ApexEvent2EnEventConverter apexEnEventConverter = null;
-
-    /**
-     * Instantiates a new listener implementation.
-     *
-     * @param apexEventListener the apex event listener
-     * @param apexEnEventConverter the ApexEvent to enEvent converter
-     */
-    public EnEventListenerImpl(final ApexEventListener apexEventListener,
-            final ApexEvent2EnEventConverter apexEnEventConverter) {
-        this.apexEventListener = apexEventListener;
-        this.apexEnEventConverter = apexEnEventConverter;
-    }
+    private final ApexEvent2EnEventConverter apexEnEventConverter;
 
     /**
      * {@inheritDoc}.
index 22a6a27..dcae42f 100644 (file)
@@ -661,7 +661,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
     public void startPeriodicEvents(final long period) throws ApexException {
         // Check if periodic events are already started
         if (periodicEventGenerator != null) {
-            String message = "Peiodic event geneation already running on engine " + engineServiceKey.getId() + ", "
+            String message = "Periodic event geneation already running on engine " + engineServiceKey.getId() + ", "
                             + periodicEventGenerator.toString();
             LOGGER.warn(message);
             throw new ApexException(message);
@@ -682,8 +682,8 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
     public void stopPeriodicEvents() throws ApexException {
         // Check if periodic events are already started
         if (periodicEventGenerator == null) {
-            LOGGER.warn("Peiodic event geneation not running on engine " + engineServiceKey.getId());
-            throw new ApexException("Peiodic event geneation not running on engine " + engineServiceKey.getId());
+            LOGGER.warn("Periodic event geneation not running on engine " + engineServiceKey.getId());
+            throw new ApexException("Periodic event geneation not running on engine " + engineServiceKey.getId());
         }
 
         // Stop periodic events
index 4cef1e1..1159f2c 100644 (file)
@@ -1,38 +1,35 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.service.parameters;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
 /**
  * This class holds constants used when managing parameter groups in apex.
  */
-public abstract class ApexParameterConstants {
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ApexParameterConstants {
     public static final String MAIN_GROUP_NAME = "APEX_PARAMETERS";
     public static final String ENGINE_SERVICE_GROUP_NAME = "ENGINE_SERVICE_PARAMETERS";
     public static final String EVENT_HANDLER_GROUP_NAME = "EVENT_HANDLER_PARAMETERS";
-
-    /**
-     * Private default constructor to prevent subclassing.
-     */
-    private ApexParameterConstants() {
-        // Prevents subclassing
-    }
-
 }
index 503d4c5..7515de8 100644 (file)
@@ -21,6 +21,8 @@
 
 package org.onap.policy.apex.service.parameters.carriertechnology;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 import org.onap.policy.common.parameters.ParameterGroupImpl;
 import org.onap.policy.common.parameters.ParameterRuntimeException;
 import org.onap.policy.common.parameters.annotations.ClassName;
@@ -40,6 +42,7 @@ import org.onap.policy.common.parameters.annotations.NotNull;
  */
 @NotNull
 @NotBlank
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
 public abstract class CarrierTechnologyParameters extends ParameterGroupImpl {
 
     // The carrier technology label
@@ -50,14 +53,6 @@ public abstract class CarrierTechnologyParameters extends ParameterGroupImpl {
     private @ClassName String eventProducerPluginClass = null;
     private @ClassName String eventConsumerPluginClass = null;
 
-    /**
-     * Constructor to create a carrier technology parameters instance with the name of a sub class of this class and
-     * register the instance with the parameter service.
-     */
-    protected CarrierTechnologyParameters() {
-        super();
-    }
-
     /**
      * Gets the label of the carrier technology.
      *
index 2c5c4c0..9e47926 100644 (file)
@@ -32,6 +32,7 @@ import java.util.regex.PatternSyntaxException;
 import javax.ws.rs.core.MultivaluedHashMap;
 import javax.ws.rs.core.MultivaluedMap;
 import lombok.Getter;
+import lombok.NoArgsConstructor;
 import lombok.Setter;
 import org.apache.commons.lang3.StringUtils;
 import org.onap.policy.common.parameters.BeanValidationResult;
@@ -64,6 +65,7 @@ import org.slf4j.LoggerFactory;
 //@formatter:on
 @Setter
 @Getter
+@NoArgsConstructor
 public class RestPluginCarrierTechnologyParameters extends CarrierTechnologyParameters {
     // Get a reference to the logger
     private static final Logger LOGGER = LoggerFactory.getLogger(RestPluginCarrierTechnologyParameters.class);
@@ -96,14 +98,6 @@ public class RestPluginCarrierTechnologyParameters extends CarrierTechnologyPara
     protected String[][] httpHeaders = null;
     protected String httpCodeFilter = DEFAULT_HTTP_CODE_FILTER;
 
-    /**
-     * Constructor to create a REST carrier technology parameters instance and
-     * register the instance with the parameter service.
-     */
-    public RestPluginCarrierTechnologyParameters() {
-        super();
-    }
-
     /**
      * Check if http headers have been set for the REST request.
      *
index 7fb4584..98fc73f 100644 (file)
@@ -23,6 +23,9 @@ package org.onap.policy.apex.service.parameters.eventhandler;
 
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
 import org.onap.policy.apex.service.parameters.ApexParameterConstants;
 import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters;
 import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolParameters;
@@ -55,12 +58,17 @@ import org.slf4j.LoggerFactory;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@Getter
+@ToString
 public class EventHandlerParameters implements ParameterGroup {
     // Get a reference to the logger
     private static final Logger LOGGER = LoggerFactory.getLogger(EventHandlerParameters.class);
 
+    @Setter
     private String name = null;
+    @Setter
     private @NotNull @Valid CarrierTechnologyParameters carrierTechnologyParameters = null;
+    @Setter
     private @NotNull @Valid EventProtocolParameters eventProtocolParameters = null;
     private boolean synchronousMode = false;
     private String synchronousPeer = null;
@@ -68,7 +76,9 @@ public class EventHandlerParameters implements ParameterGroup {
     private boolean requestorMode = false;
     private String requestorPeer = null;
     private long requestorTimeout = 0;
+    @Setter
     private String eventName = null;
+    @Setter
     private String eventNameFilter = null;
 
     /**
@@ -81,24 +91,6 @@ public class EventHandlerParameters implements ParameterGroup {
         this.name = ApexParameterConstants.EVENT_HANDLER_GROUP_NAME;
     }
 
-    /**
-     * Gets the name of the event handler.
-     *
-     * @return the event handler name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Sets the name of the event handler.
-     *
-     * @param name the event handler name
-     */
-    public void setName(final String name) {
-        this.name = name;
-    }
-
     /**
      * Checks if the name of the event handler is set.
      *
@@ -108,42 +100,6 @@ public class EventHandlerParameters implements ParameterGroup {
         return !(name == null || name.trim().length() == 0);
     }
 
-    /**
-     * Gets the carrier technology parameters of the event handler.
-     *
-     * @return the carrierTechnologyParameters of the event handler
-     */
-    public CarrierTechnologyParameters getCarrierTechnologyParameters() {
-        return carrierTechnologyParameters;
-    }
-
-    /**
-     * Sets the carrier technology parameters of the event handler.
-     *
-     * @param carrierTechnologyParameters the carrierTechnologyParameters to set
-     */
-    public void setCarrierTechnologyParameters(final CarrierTechnologyParameters carrierTechnologyParameters) {
-        this.carrierTechnologyParameters = carrierTechnologyParameters;
-    }
-
-    /**
-     * Gets the event protocol parameters of the event handler.
-     *
-     * @return the eventProtocolParameters
-     */
-    public EventProtocolParameters getEventProtocolParameters() {
-        return eventProtocolParameters;
-    }
-
-    /**
-     * Sets the event protocol parameters.
-     *
-     * @param eventProtocolParameters the eventProtocolParameters to set
-     */
-    public void setEventProtocolParameters(final EventProtocolParameters eventProtocolParameters) {
-        this.eventProtocolParameters = eventProtocolParameters;
-    }
-
     /**
      * Checks if the event handler is in the given peered mode.
      *
@@ -261,24 +217,6 @@ public class EventHandlerParameters implements ParameterGroup {
         return eventName != null;
     }
 
-    /**
-     * Gets the event name for this event handler.
-     *
-     * @return the event name
-     */
-    public String getEventName() {
-        return eventName;
-    }
-
-    /**
-     * Sets the event name for this event handler.
-     *
-     * @param eventName the event name
-     */
-    public void setEventName(final String eventName) {
-        this.eventName = eventName;
-    }
-
     /**
      * Check if event name filtering is being used.
      *
@@ -288,24 +226,6 @@ public class EventHandlerParameters implements ParameterGroup {
         return eventNameFilter != null;
     }
 
-    /**
-     * Gets the event name filter for this event handler.
-     *
-     * @return the event name filter
-     */
-    public String getEventNameFilter() {
-        return eventNameFilter;
-    }
-
-    /**
-     * Sets the event name filter for this event handler.
-     *
-     * @param eventNameFilter the event name filter
-     */
-    public void setEventNameFilter(final String eventNameFilter) {
-        this.eventNameFilter = eventNameFilter;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -325,71 +245,4 @@ public class EventHandlerParameters implements ParameterGroup {
 
         return result;
     }
-
-    /**
-     * Check if we're using synchronous mode.
-     *
-     * @return true if if we're using synchronous mode
-     */
-    public boolean isSynchronousMode() {
-        return synchronousMode;
-    }
-
-    /**
-     * The synchronous peer for this event handler.
-     *
-     * @return the synchronous peer for this event handler
-     */
-    public String getSynchronousPeer() {
-        return synchronousPeer;
-    }
-
-    /**
-     * Get the timeout for synchronous operations.
-     *
-     * @return the timeout for synchronous operations
-     */
-    public long getSynchronousTimeout() {
-        return synchronousTimeout;
-    }
-
-    /**
-     * Check if this event handler will use requestor mode.
-     *
-     * @return true if this event handler will use requestor mode
-     */
-    public boolean isRequestorMode() {
-        return requestorMode;
-    }
-
-    /**
-     * The requestor peer for this event handler.
-     *
-     * @return the requestor peer for this event handler
-     */
-    public String getRequestorPeer() {
-        return requestorPeer;
-    }
-
-    /**
-     * Get the requestor timeout.
-     *
-     * @return the requestorTimeout.
-     */
-    public long getRequestorTimeout() {
-        return requestorTimeout;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "EventHandlerParameters [name=" + name + ", carrierTechnologyParameters=" + carrierTechnologyParameters
-                        + ", eventProtocolParameters=" + eventProtocolParameters + ", synchronousMode="
-                        + synchronousMode + ", synchronousPeer=" + synchronousPeer + ", synchronousTimeout="
-                        + synchronousTimeout + ", requestorMode=" + requestorMode + ", requestorPeer=" + requestorPeer
-                        + ", requestorTimeout=" + requestorTimeout + ", eventName=" + eventName + ", eventNameFilter="
-                        + eventNameFilter + "]";
-    }
 }
index 1fd8e74..fe59486 100644 (file)
 
 package org.onap.policy.apex.service.parameters.eventprotocol;
 
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
 import org.onap.policy.common.parameters.ParameterGroupImpl;
 import org.onap.policy.common.parameters.ParameterRuntimeException;
 import org.onap.policy.common.parameters.annotations.ClassName;
@@ -42,6 +46,9 @@ import org.onap.policy.common.parameters.annotations.NotNull;
  */
 @NotNull
 @NotBlank
+@Getter
+@ToString
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
 public abstract class EventProtocolParameters extends ParameterGroupImpl {
     // The event protocol label
     private String label = null;
@@ -49,23 +56,6 @@ public abstract class EventProtocolParameters extends ParameterGroupImpl {
     // Event protocol converter plugin class for this event protocol
     private @ClassName String eventProtocolPluginClass;
 
-    /**
-     * Constructor to create an event protocol parameters instance with the name of a sub class of this class and
-     * register the instance with the parameter service.
-     */
-    protected EventProtocolParameters() {
-        super();
-    }
-
-    /**
-     * Gets the label of the event protocol.
-     *
-     * @return the label of the event protocol
-     */
-    public String getLabel() {
-        return label;
-    }
-
     /**
      * Sets the label of the event protocol.
      *
@@ -75,15 +65,6 @@ public abstract class EventProtocolParameters extends ParameterGroupImpl {
         this.label = label.replaceAll("\\s+", "");
     }
 
-    /**
-     * Gets the event event protocol plugin class.
-     *
-     * @return the event event protocol plugin class
-     */
-    public String getEventProtocolPluginClass() {
-        return eventProtocolPluginClass;
-    }
-
     /**
      * Sets the event event protocol plugin class.
      *
@@ -93,15 +74,6 @@ public abstract class EventProtocolParameters extends ParameterGroupImpl {
         this.eventProtocolPluginClass = eventProtocolPluginClass.replaceAll("\\s+", "");
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "CarrierTechnologyParameters [label=" + label + ", EventProtocolPluginClass=" + eventProtocolPluginClass
-                        + "]";
-    }
-
     @Override
     public String getName() {
         return this.getLabel();
index 3875d4a..d13059f 100644 (file)
 
 package org.onap.policy.apex.service.parameters.eventprotocol;
 
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.common.parameters.ValidationStatus;
 
@@ -36,63 +41,15 @@ import org.onap.policy.common.parameters.ValidationStatus;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@Getter
+@Setter
+@ToString(callSuper = true)
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
 public abstract class EventProtocolTextCharDelimitedParameters extends EventProtocolParameters {
     // The starting and ending character delimiter
     private char startChar = '\0';
     private char endChar = '\0';
 
-    /**
-     * Constructor to create an event protocol parameters instance with the name of a sub class of this class.
-     */
-    protected EventProtocolTextCharDelimitedParameters() {
-        super();
-    }
-
-    /**
-     * Gets the start character that delimits the start of text blocks.
-     *
-     * @return the start char
-     */
-    public char getStartChar() {
-        return startChar;
-    }
-
-    /**
-     * Sets the start character that delimits the start of text blocks.
-     *
-     * @param startChar the start character
-     */
-    public void setStartChar(final char startChar) {
-        this.startChar = startChar;
-    }
-
-    /**
-     * Gets the end character that delimits the end of text blocks.
-     *
-     * @return the end character
-     */
-    public char getEndChar() {
-        return endChar;
-    }
-
-    /**
-     * Sets the end character that delimits the end of text blocks.
-     *
-     * @param endChar the end character
-     */
-    public void setEndChar(final char endChar) {
-        this.endChar = endChar;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "EventProtocolTextCharDelimitedParameters {" + super.toString() + "} [startChar=" + startChar
-                        + ", endChar=" + endChar + "]";
-    }
-
     /**
      * {@inheritDoc}.
      */
index 3288330..deb827a 100644 (file)
 
 package org.onap.policy.apex.service.parameters.eventprotocol;
 
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
 import org.onap.policy.common.parameters.annotations.NotBlank;
 import org.onap.policy.common.parameters.annotations.NotNull;
 
@@ -40,79 +45,13 @@ import org.onap.policy.common.parameters.annotations.NotNull;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@Getter
+@Setter
+@ToString
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
 public abstract class EventProtocolTextTokenDelimitedParameters extends EventProtocolParameters {
     // The delimiter token for text blocks
     private @NotNull @NotBlank String startDelimiterToken = null;
     private String endDelimiterToken = null;
     private boolean delimiterAtStart = true;
-
-    /**
-     * Constructor to create an event protocol parameters instance with the name of a sub class of this class.
-     */
-    protected EventProtocolTextTokenDelimitedParameters() {
-        super();
-    }
-
-    /**
-     * Gets the start delimiter token that delimits events in the text.
-     *
-     * @return the start delimiter token
-     */
-    public String getStartDelimiterToken() {
-        return startDelimiterToken;
-    }
-
-    /**
-     * Sets the start delimiter token that delimits events in the text.
-     *
-     * @param startDelimiterToken
-     *        delimiterToken the delimiter token
-     */
-    public void setStartDelimiterToken(final String startDelimiterToken) {
-        this.startDelimiterToken = startDelimiterToken;
-    }
-
-    /**
-     * Gets the end delimiter token that delimits events in the text.
-     *
-     * @return the end delimiter token
-     */
-    public String getEndDelimiterToken() {
-        return endDelimiterToken;
-    }
-
-    /**
-     * Sets the end delimiter token that delimits events in the text.
-     *
-     * @param endDelimiterToken
-     *        delimiterToken the delimiter token
-     */
-    public void setEndDelimiterToken(final String endDelimiterToken) {
-        this.endDelimiterToken = endDelimiterToken;
-    }
-
-    /**
-     * Check if there must be a delimiter at the start of the first text block.
-     *
-     * @return true if there must be a delimiter at the start of the text block
-     */
-    public boolean isDelimiterAtStart() {
-        return delimiterAtStart;
-    }
-
-    /**
-     * Sets if there has to be a delimiter at the start of the first text block.
-     *
-     * @param delimiterAtStart
-     *        true if there must be a delimiter at the start of the text block
-     */
-    public void setDelimiterAtStart(boolean delimiterAtStart) {
-        this.delimiterAtStart = delimiterAtStart;
-    }
-
-    @Override
-    public String toString() {
-        return "EventProtocolTextTokenDelimitedParameters [startDelimiterToken=" + startDelimiterToken
-                        + ", endDelimiterToken=" + endDelimiterToken + ", delimiterAtStart=" + delimiterAtStart + "]";
-    }
 }
index e40e570..ee72e6e 100644 (file)
@@ -1,6 +1,7 @@
 /*
  *  ============LICENSE_START=======================================================
  *  Copyright (C) 2021. Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  *  ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,7 +34,8 @@ public class ApexPeriodicEventGeneratorTest {
     public void run() throws ApexEventException {
 
         final EngineServiceEventInterface engineServiceEventInterface = Mockito.mock(EngineServiceEventInterface.class);
-        final int period = random.nextInt(200);
+        // don't want the timer to fire, so make it wait at least two seconds
+        final int period = random.nextInt(2000) + 2000;
         final ApexPeriodicEventGenerator generator = new ApexPeriodicEventGenerator(engineServiceEventInterface,
             period);
 
index 3fe96a6..ed1afe4 100644 (file)
@@ -3,6 +3,7 @@
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -243,13 +244,13 @@ public class EngineServiceImplTest {
         esImpl.startPeriodicEvents(100000);
 
         assertThatThrownBy(() -> esImpl.startPeriodicEvents(100000)).isInstanceOf(ApexException.class)
-            .hasMessage("Peiodic event geneation already running on engine Engine:0.0.1, ApexPeriodicEventGenerator "
+            .hasMessage("Periodic event geneation already running on engine Engine:0.0.1, ApexPeriodicEventGenerator "
                 + "[period=100000, firstEventTime=0, lastEventTime=0, eventCount=0]");
 
         esImpl.stopPeriodicEvents();
 
         assertThatThrownBy(() -> esImpl.stopPeriodicEvents()).isInstanceOf(ApexException.class)
-            .hasMessage("Peiodic event geneation not running on engine Engine:0.0.1");
+            .hasMessage("Periodic event geneation not running on engine Engine:0.0.1");
 
         assertThatThrownBy(() -> esImpl.clear(null)).isInstanceOf(ApexException.class)
             .hasMessage("engine key must be specified and may not be null");
@@ -395,7 +396,7 @@ public class EngineServiceImplTest {
             esImpl.startPeriodicEvents(100000);
             fail("test should throw an exception");
         } catch (ApexException apEx) {
-            assertEquals("Peiodic event geneation already running on engine Engine:0.0.1, ApexPeriodicEventGenerator "
+            assertEquals("Periodic event geneation already running on engine Engine:0.0.1, ApexPeriodicEventGenerator "
                     + "[period=100000, firstEventTime=0, lastEventTime=0, eventCount=0]", apEx.getMessage());
         }
 
@@ -404,7 +405,7 @@ public class EngineServiceImplTest {
             esImpl.stopPeriodicEvents();
             fail("test should throw an exception");
         } catch (ApexException apEx) {
-            assertEquals("Peiodic event geneation not running on engine Engine:0.0.1", apEx.getMessage());
+            assertEquals("Periodic event geneation not running on engine Engine:0.0.1", apEx.getMessage());
         }
 
         try {
index abd8d44..7a91c29 100644 (file)
@@ -53,7 +53,8 @@ import org.slf4j.LoggerFactory;
 public class ApexStarterActivator {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(ApexStarterActivator.class);
-    private final ApexStarterParameterGroup apexStarterParameterGroup;
+    @Getter
+    private final ApexStarterParameterGroup parameterGroup;
     private List<TopicSink> topicSinks; // topics to which apex-pdp sends pdp status
     private List<TopicSource> topicSources; // topics to which apex-pdp listens to for messages from pap.
     private static final String[] MSG_TYPE_NAMES = { "messageName" };
@@ -99,7 +100,7 @@ public class ApexStarterActivator {
         instanceId = NetworkUtil.genUniqueName("apex");
         LOGGER.debug("ApexStarterActivator initializing with instance id: {}", instanceId);
         try {
-            this.apexStarterParameterGroup = apexStarterParameterGroup;
+            this.parameterGroup = apexStarterParameterGroup;
             this.msgDispatcher = new MessageTypeDispatcher(MSG_TYPE_NAMES);
         } catch (final RuntimeException e) {
             throw new ApexStarterRunTimeException(e);
@@ -204,15 +205,6 @@ public class ApexStarterActivator {
         }
     }
 
-    /**
-     * Get the parameters used by the activator.
-     *
-     * @return apexStarterParameterGroup the parameters of the activator
-     */
-    public ApexStarterParameterGroup getParameterGroup() {
-        return apexStarterParameterGroup;
-    }
-
     /**
      * Registers the dispatcher with the topic source(s).
      */
index 2481f4e..d00e02e 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.apex.services.onappf;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
 /**
  * Names of various items contained in the Registry.
  */
-public class ApexStarterConstants {
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ApexStarterConstants {
     // Registry keys
     public static final String REG_APEX_STARTER_ACTIVATOR = "object:activator/apex_starter";
     public static final String REG_PDP_STATUS_OBJECT = "object:pdp/status";
@@ -31,8 +36,4 @@ public class ApexStarterConstants {
     public static final String REG_PDP_STATUS_PUBLISHER = "object:pdp/status/publisher";
     public static final String REG_APEX_PDP_TOPIC_SINKS = "object:apex/pdp/topic/sinks";
     public static final String REG_APEX_ENGINE_HANDLER = "object:engine/apex/handler";
-
-    private ApexStarterConstants() {
-        super();
-    }
 }
index c9362bc..2976f82 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
- *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,6 +23,7 @@
 package org.onap.policy.apex.services.onappf;
 
 import java.util.Arrays;
+import lombok.Getter;
 import org.onap.policy.apex.service.engine.main.ApexPolicyStatisticsManager;
 import org.onap.policy.apex.services.onappf.exception.ApexStarterException;
 import org.onap.policy.apex.services.onappf.exception.ApexStarterRunTimeException;
@@ -44,7 +45,8 @@ public class ApexStarterMain {
     private static final Logger LOGGER = LoggerFactory.getLogger(ApexStarterMain.class);
 
     private ApexStarterActivator activator;
-    private ApexStarterParameterGroup parameterGroup;
+    @Getter
+    private ApexStarterParameterGroup parameters;
 
     /**
      * Instantiates the ApexStarter.
@@ -68,10 +70,10 @@ public class ApexStarterMain {
             arguments.validate();
 
             // Read the parameters
-            parameterGroup = new ApexStarterParameterHandler().getParameters(arguments);
+            parameters = new ApexStarterParameterHandler().getParameters(arguments);
 
             // create the activator
-            activator = new ApexStarterActivator(parameterGroup);
+            activator = new ApexStarterActivator(parameters);
             Registry.register(ApexStarterConstants.REG_APEX_STARTER_ACTIVATOR, activator);
             Registry.register(ApexPolicyStatisticsManager.REG_APEX_PDP_POLICY_COUNTER,
                 new ApexPolicyStatisticsManager());
@@ -92,15 +94,6 @@ public class ApexStarterMain {
         LOGGER.info(successMsg);
     }
 
-    /**
-     * Get the parameters specified in JSON.
-     *
-     * @return parameterGroup the parameters
-     */
-    public ApexStarterParameterGroup getParameters() {
-        return parameterGroup;
-    }
-
 
     /**
      * Shut down Execution.
@@ -109,7 +102,7 @@ public class ApexStarterMain {
      */
     public void shutdown() throws ApexStarterException {
         // clear the parameterGroup variable
-        parameterGroup = null;
+        parameters = null;
 
         // clear the apex starter activator
         if (activator != null && activator.isAlive()) {
index 6c1b645..dcd3683 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +24,7 @@ package org.onap.policy.apex.services.onappf.comm;
 import java.util.List;
 import java.util.Timer;
 import java.util.TimerTask;
+import lombok.Getter;
 import org.onap.policy.apex.services.onappf.handler.PdpMessageHandler;
 import org.onap.policy.common.endpoints.event.comm.TopicSink;
 import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
@@ -41,6 +43,7 @@ public class PdpStatusPublisher extends TimerTask {
 
     private TopicSinkClient topicSinkClient;
     private Timer timer;
+    @Getter
     private long interval;
 
     /**
@@ -71,15 +74,6 @@ public class PdpStatusPublisher extends TimerTask {
         timer.purge();
     }
 
-    /**
-     * Get the current time interval used by the timer task.
-     *
-     * @return interval the current time interval
-     */
-    public long getInterval() {
-        return interval;
-    }
-
     /**
      * Method to send pdp status message to pap on demand.
      *