Use lombok in apex-pdp #4 45/123045/3
authorJim Hahn <jrh3@att.com>
Mon, 2 Aug 2021 19:56:00 +0000 (15:56 -0400)
committerJim Hahn <jrh3@att.com>
Fri, 6 Aug 2021 16:24:38 +0000 (12:24 -0400)
Updated model, testsuites, and tools.

Issue-ID: POLICY-3391
Change-Id: I187d84380661f5d4222967c1c5f004c318d65982
Signed-off-by: Jim Hahn <jrh3@att.com>
31 files changed:
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexApiResult.java
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ApexModelImpl.java
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbum.java [new file with mode: 0644]
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumBuilder.java [deleted file]
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumFacade.java
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/CreatePolicyStateTaskRef.java [new file with mode: 0644]
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/CreatePolicyStateTaskRefBuilder.java [deleted file]
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/KeyInformationFacade.java
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/PolicyFacade.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/EventGenerator.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsEventProducer.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsEventSubscriber.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestInitialContextFactory.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/KafkaEventProducer.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/KafkaEventSubscriber.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/sampletypes/Foo.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/websocket/WebSocketEventProducerClient.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/websocket/WebSocketEventProducerServer.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/websocket/WebSocketEventSubscriberClient.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/websocket/WebSocketEventSubscriberServer.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/DummyApexEventConsumer.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/DummyApexEventProducer.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/RunTestEvent.java
testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatch.java
testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStats.java
testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpoint.java
testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorStats.java
testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/InputEvent.java
testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/OutputEvent.java
tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/KeyInfoGetter.java
tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/SchemaUtils.java

index 9fdb471..d05d410 100644 (file)
@@ -32,11 +32,13 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlEnum;
 import javax.xml.bind.annotation.XmlRootElement;
+import lombok.Setter;
 
 /**
  * The Class ApexEditorAPIResult return the result of and messages from all model API method calls on the
  * {@link ApexModel} API.
  */
+@Setter
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 public class ApexApiResult {
@@ -177,15 +179,6 @@ public class ApexApiResult {
         return result;
     }
 
-    /**
-     * Sets the result status of an API operation.
-     *
-     * @param result the result status
-     */
-    public void setResult(final Result result) {
-        this.result = result;
-    }
-
     /**
      * Gets the list of messages returned by an API operation.
      *
@@ -197,15 +190,6 @@ public class ApexApiResult {
         return messages;
     }
 
-    /**
-     * Sets the list of messages to return as a result of an API operation.
-     *
-     * @param messages the list of messages to return as a result of an API operation
-     */
-    public void setMessages(final List<String> messages) {
-        this.messages = messages;
-    }
-
     /**
      * Gets all the messages returned by an API operation as a single string.
      *
index 67083bf..05976c6 100644 (file)
 package org.onap.policy.apex.model.modelapi.impl;
 
 import java.util.Properties;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.modelapi.ApexApiResult;
 import org.onap.policy.apex.model.modelapi.ApexApiResult.Result;
@@ -37,6 +41,7 @@ import org.slf4j.LoggerFactory;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class ApexModelImpl implements ApexModel {
 
     public static final String FIELDS_DEPRECATED_WARN_MSG =
@@ -46,6 +51,8 @@ public final class ApexModelImpl implements ApexModel {
     private static final Logger LOGGER = LoggerFactory.getLogger(ApexModelImpl.class);
 
     // The policy model being acted upon
+    @Getter
+    @Setter
     private AxPolicyModel policyModel = new AxPolicyModel();
 
     // The file name for the loaded file
@@ -87,13 +94,6 @@ public final class ApexModelImpl implements ApexModel {
         // @formatter:on
     }
 
-    /**
-     * Constructor, prevents this class being sub-classed.
-     */
-    private ApexModelImpl() {
-        // Private constructor to block subclassing
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -321,9 +321,9 @@ public final class ApexModelImpl implements ApexModel {
     public ApexApiResult createContextAlbum(final String name, final String version, final String scope,
             final String writable, final String contextSchemaName, final String contextSchemaVersion, final String uuid,
             final String description) {
-        return contextAlbumFacade.createContextAlbum(new ContextAlbumBuilder().setName(name).setVersion(version)
-                .setScope(scope).setWritable(writable).setContextSchemaName(contextSchemaName)
-                .setContextSchemaVersion(contextSchemaVersion).setUuid(uuid).setDescription(description));
+        return contextAlbumFacade.createContextAlbum(ContextAlbum.builder().name(name).version(version)
+                .scope(scope).writable(writable).contextSchemaName(contextSchemaName)
+                .contextSchemaVersion(contextSchemaVersion).uuid(uuid).description(description).build());
     }
     // CHECKSTYLE:ON: checkstyle:parameterNumber
 
@@ -335,9 +335,9 @@ public final class ApexModelImpl implements ApexModel {
     public ApexApiResult updateContextAlbum(final String name, final String version, final String scope,
             final String writable, final String contextSchemaName, final String contextSchemaVersion, final String uuid,
             final String description) {
-        return contextAlbumFacade.updateContextAlbum(new ContextAlbumBuilder().setName(name).setVersion(version)
-                .setScope(scope).setWritable(writable).setContextSchemaName(contextSchemaName)
-                .setContextSchemaVersion(contextSchemaVersion).setUuid(uuid).setDescription(description));
+        return contextAlbumFacade.updateContextAlbum(ContextAlbum.builder().name(name).version(version)
+                .scope(scope).writable(writable).contextSchemaName(contextSchemaName)
+                .contextSchemaVersion(contextSchemaVersion).uuid(uuid).description(description).build());
     }
     // CHECKSTYLE:ON: checkstyle:parameterNumber
 
@@ -702,9 +702,9 @@ public final class ApexModelImpl implements ApexModel {
     public ApexApiResult createPolicyStateTaskRef(final String name, final String version, final String stateName,
             final String taskLocalName, final String taskName, final String taskVersion, final String outputType,
             final String outputName) {
-        return policyFacade.createPolicyStateTaskRef(new CreatePolicyStateTaskRefBuilder().setName(name)
-                .setVersion(version).setStateName(stateName).setTaskLocalName(taskLocalName).setTaskName(taskName)
-                .setTaskVersion(taskVersion).setOutputType(outputType).setOutputName(outputName));
+        return policyFacade.createPolicyStateTaskRef(CreatePolicyStateTaskRef.builder().name(name)
+                .version(version).stateName(stateName).taskLocalName(taskLocalName).taskName(taskName)
+                .taskVersion(taskVersion).outputType(outputType).outputName(outputName).build());
     }
     // CHECKSTYLE:ON: checkstyle:parameterNumber
 
@@ -884,22 +884,6 @@ public final class ApexModelImpl implements ApexModel {
         return modelHandlerFacade.mergeWithString(otherModelString, keepOriginal);
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public AxPolicyModel getPolicyModel() {
-        return policyModel;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public void setPolicyModel(final AxPolicyModel policyModel) {
-        this.policyModel = policyModel;
-    }
-
     /**
      * {@inheritDoc}.
      */
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbum.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbum.java
new file mode 100644 (file)
index 0000000..5a42ed1
--- /dev/null
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Samsung Electronics Co., Ltd. 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.
+ * 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.modelapi.impl;
+
+import lombok.Builder;
+import lombok.Getter;
+
+@Getter
+@Builder
+public class ContextAlbum {
+    private String name;
+    private String version;
+    private String scope;
+    private String writable;
+    private String contextSchemaName;
+    private String contextSchemaVersion;
+    private String uuid;
+    private String description;
+}
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumBuilder.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumBuilder.java
deleted file mode 100644 (file)
index 937a16e..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Samsung Electronics Co., Ltd. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * 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.modelapi.impl;
-
-public class ContextAlbumBuilder {
-    private String name;
-    private String version;
-    private String scope;
-    private String writable;
-    private String contextSchemaName;
-    private String contextSchemaVersion;
-    private String uuid;
-    private String description;
-
-    public String getName() {
-        return name;
-    }
-
-    public ContextAlbumBuilder setName(String name) {
-        this.name = name;
-        return this;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public ContextAlbumBuilder setVersion(String version) {
-        this.version = version;
-        return this;
-    }
-
-    public String getScope() {
-        return scope;
-    }
-
-    public ContextAlbumBuilder setScope(String scope) {
-        this.scope = scope;
-        return this;
-    }
-
-    public String getWritable() {
-        return writable;
-    }
-
-    public ContextAlbumBuilder setWritable(String writable) {
-        this.writable = writable;
-        return this;
-    }
-
-    public String getContextSchemaName() {
-        return contextSchemaName;
-    }
-
-    public ContextAlbumBuilder setContextSchemaName(String contextSchemaName) {
-        this.contextSchemaName = contextSchemaName;
-        return this;
-    }
-
-    public String getContextSchemaVersion() {
-        return contextSchemaVersion;
-    }
-
-    public ContextAlbumBuilder setContextSchemaVersion(String contextSchemaVersion) {
-        this.contextSchemaVersion = contextSchemaVersion;
-        return this;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public ContextAlbumBuilder setUuid(String uuid) {
-        this.uuid = uuid;
-        return this;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public ContextAlbumBuilder setDescription(String description) {
-        this.description = description;
-        return this;
-    }
-}
index 826fb92..a78444d 100644 (file)
@@ -3,6 +3,7 @@
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Samsung Electronics Co., Ltd.
  *  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.
@@ -79,7 +80,7 @@ public class ContextAlbumFacade {
      * @return result of the operation
      */
     // CHECKSTYLE:OFF: checkstyle:parameterNumber
-    public ApexApiResult createContextAlbum(ContextAlbumBuilder builder) {
+    public ApexApiResult createContextAlbum(ContextAlbum builder) {
         try {
             final AxArtifactKey key = new AxArtifactKey();
             key.setName(builder.getName());
@@ -131,7 +132,7 @@ public class ContextAlbumFacade {
      * @return result of the operation
      */
     // CHECKSTYLE:OFF: checkstyle:parameterNumber
-    public ApexApiResult updateContextAlbum(ContextAlbumBuilder builder) {
+    public ApexApiResult updateContextAlbum(ContextAlbum builder) {
         try {
             final AxContextAlbum contextAlbum =
                     apexModel.getPolicyModel().getAlbums().get(builder.getName(), builder.getVersion());
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/CreatePolicyStateTaskRef.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/CreatePolicyStateTaskRef.java
new file mode 100644 (file)
index 0000000..a6e4c33
--- /dev/null
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Samsung Electronics Co., Ltd. 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.modelapi.impl;
+
+import lombok.Builder;
+import lombok.Getter;
+
+@Getter
+@Builder
+public class CreatePolicyStateTaskRef {
+    private String name;
+    private String version;
+    private String stateName;
+    private String taskLocalName;
+    private String taskName;
+    private String taskVersion;
+    private String outputType;
+    private String outputName;
+}
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/CreatePolicyStateTaskRefBuilder.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/CreatePolicyStateTaskRefBuilder.java
deleted file mode 100644 (file)
index f56c24f..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Samsung Electronics Co., Ltd. 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.modelapi.impl;
-
-public class CreatePolicyStateTaskRefBuilder {
-    private String name;
-    private String version;
-    private String stateName;
-    private String taskLocalName;
-    private String taskName;
-    private String taskVersion;
-    private String outputType;
-    private String outputName;
-
-    public String getName() {
-        return name;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public String getStateName() {
-        return stateName;
-    }
-
-    public String getTaskLocalName() {
-        return taskLocalName;
-    }
-
-    public String getTaskName() {
-        return taskName;
-    }
-
-    public String getTaskVersion() {
-        return taskVersion;
-    }
-
-    public String getOutputType() {
-        return outputType;
-    }
-
-    public String getOutputName() {
-        return outputName;
-    }
-
-    public CreatePolicyStateTaskRefBuilder setName(String name) {
-        this.name = name;
-        return this;
-    }
-
-    public CreatePolicyStateTaskRefBuilder setVersion(String version) {
-        this.version = version;
-        return this;
-    }
-
-    public CreatePolicyStateTaskRefBuilder setStateName(String stateName) {
-        this.stateName = stateName;
-        return this;
-    }
-
-    public CreatePolicyStateTaskRefBuilder setTaskLocalName(String taskLocalName) {
-        this.taskLocalName = taskLocalName;
-        return this;
-    }
-
-    public CreatePolicyStateTaskRefBuilder setTaskName(String taskName) {
-        this.taskName = taskName;
-        return this;
-    }
-
-    public CreatePolicyStateTaskRefBuilder setTaskVersion(String taskVersion) {
-        this.taskVersion = taskVersion;
-        return this;
-    }
-
-    public CreatePolicyStateTaskRefBuilder setOutputType(String outputType) {
-        this.outputType = outputType;
-        return this;
-    }
-
-    public CreatePolicyStateTaskRefBuilder setOutputName(String outputName) {
-        this.outputName = outputName;
-        return this;
-    }
-}
index 82fc86a..b76bfdc 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=========================================================
  */
@@ -23,6 +24,7 @@ package org.onap.policy.apex.model.modelapi.impl;
 import java.util.Properties;
 import java.util.Set;
 import java.util.UUID;
+import lombok.AllArgsConstructor;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
@@ -35,6 +37,7 @@ import org.onap.policy.apex.model.modelapi.ApexModel;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@AllArgsConstructor
 public class KeyInformationFacade {
     private static final String CONCEPT = "concept ";
     private static final String CONCEPT_S = "concept(s) ";
@@ -51,20 +54,6 @@ public class KeyInformationFacade {
     // JSON output on list/delete if set
     private final boolean jsonMode;
 
-    /**
-     * Constructor to create a key information facade for the Model API.
-     *
-     * @param apexModel the apex model
-     * @param apexProperties Properties for the model
-     * @param jsonMode set to true to return JSON strings in list and delete operations, otherwise
-     *        set to false
-     */
-    public KeyInformationFacade(final ApexModel apexModel, final Properties apexProperties, final boolean jsonMode) {
-        this.apexModel = apexModel;
-        this.apexProperties = apexProperties;
-        this.jsonMode = jsonMode;
-    }
-
     /**
      * Create key information.
      *
index c36e7e8..4d0999a 100644 (file)
@@ -3,6 +3,7 @@
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Nordix Foundation.
  *  Modifications Copyright (C) 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.
@@ -1042,7 +1043,7 @@ public class PolicyFacade {
      * @param builder builder for the state task reference
      * @return result of the operation
      */
-    public ApexApiResult createPolicyStateTaskRef(CreatePolicyStateTaskRefBuilder builder) {
+    public ApexApiResult createPolicyStateTaskRef(CreatePolicyStateTaskRef builder) {
         try {
             Assertions.argumentNotNull(builder.getStateName(), STATE_NAME_MAY_NOT_BE_NULL);
             Assertions.argumentNotNull(builder.getOutputName(), "outputName may not be null");
index 98aeb5a..0417b73 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.
@@ -21,6 +22,7 @@
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.events;
 
 import java.util.Random;
+import lombok.Getter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -32,6 +34,7 @@ import org.slf4j.LoggerFactory;
 public class EventGenerator {
     private static final Logger LOGGER = LoggerFactory.getLogger(EventGenerator.class);
 
+    @Getter
     private static int nextEventNo = 0;
 
     /**
@@ -602,13 +605,4 @@ public class EventGenerator {
             return;
         }
     }
-
-    /**
-     * Gets the next event no.
-     *
-     * @return the next event no
-     */
-    public static int getNextEventNo() {
-        return nextEventNo;
-    }
 }
index 516384d..a626ff5 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.
@@ -28,6 +29,7 @@ import javax.jms.Message;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.Topic;
+import lombok.Getter;
 import org.apache.activemq.command.ActiveMQTopic;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.service.engine.event.ApexEventRuntimeException;
@@ -48,6 +50,7 @@ public class JmsEventProducer implements Runnable {
     private final int eventCount;
     private final boolean sendObjects;
     private final long eventInterval;
+    @Getter
     private long eventsSentCount = 0;
 
     private final Thread producerThread;
@@ -139,15 +142,6 @@ public class JmsEventProducer implements Runnable {
         LOGGER.debug("{} : completed, number of events sent", this.getClass().getName(), eventsSentCount);
     }
 
-    /**
-     * Gets the events sent count.
-     *
-     * @return the events sent count
-     */
-    public long getEventsSentCount() {
-        return eventsSentCount;
-    }
-
     /**
      * Shutdown.
      */
index 0cb4104..2bdacb6 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.
@@ -30,6 +31,7 @@ import javax.jms.ObjectMessage;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
+import lombok.Getter;
 import org.apache.activemq.command.ActiveMQTopic;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.service.engine.event.ApexEventException;
@@ -47,6 +49,7 @@ public class JmsEventSubscriber implements Runnable {
     private static final Logger LOGGER = LoggerFactory.getLogger(JmsEventSubscriber.class);
 
     private final String topic;
+    @Getter
     private long eventsReceivedCount = 0;
 
     private final Thread subscriberThread;
@@ -112,15 +115,6 @@ public class JmsEventSubscriber implements Runnable {
                 eventsReceivedCount);
     }
 
-    /**
-     * Gets the events received count.
-     *
-     * @return the events received count
-     */
-    public long getEventsReceivedCount() {
-        return eventsReceivedCount;
-    }
-
     /**
      * Shutdown.
      *
index 77df460..071c426 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.
@@ -24,25 +25,18 @@ import java.util.Hashtable;
 import javax.naming.Context;
 import javax.naming.NamingException;
 import javax.naming.spi.InitialContextFactory;
+import lombok.NoArgsConstructor;
 
 /**
  * A factory for creating TestInitialContext objects.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@NoArgsConstructor
 public class TestInitialContextFactory implements InitialContextFactory {
 
     private final Context context = new TestContext();
 
-    /**
-     * Instantiates a new test initial context factory.
-     *
-     * @throws NamingException the naming exception
-     */
-    public TestInitialContextFactory() throws NamingException {
-        // Default constructor
-    }
-
     /**
      * {@inheritDoc}.
      */
index 2339368..2b90642 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.
@@ -23,6 +24,7 @@ package org.onap.policy.apex.testsuites.integration.uservice.adapt.kafka;
 
 import com.salesforce.kafka.test.junit4.SharedKafkaTestResource;
 import java.time.Duration;
+import lombok.Getter;
 import org.apache.kafka.clients.producer.Producer;
 import org.apache.kafka.clients.producer.ProducerRecord;
 import org.apache.kafka.common.serialization.StringSerializer;
@@ -45,6 +47,7 @@ public class KafkaEventProducer implements Runnable {
     private final int eventCount;
     private final boolean xmlEvents;
     private final long eventInterval;
+    @Getter
     private long eventsSentCount = 0;
 
     private final Thread producerThread;
@@ -127,15 +130,6 @@ public class KafkaEventProducer implements Runnable {
         LOGGER.debug("{}: completed", KafkaEventProducer.class.getName());
     }
 
-    /**
-     * Gets the events sent count.
-     *
-     * @return the events sent count
-     */
-    public long getEventsSentCount() {
-        return eventsSentCount;
-    }
-
     /**
      * Shutdown.
      */
index 6da35d5..5a6696d 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.
@@ -25,6 +26,7 @@ import com.salesforce.kafka.test.junit4.SharedKafkaTestResource;
 import java.time.Duration;
 import java.util.Arrays;
 import java.util.Properties;
+import lombok.Getter;
 import org.apache.kafka.clients.consumer.ConsumerRecord;
 import org.apache.kafka.clients.consumer.ConsumerRecords;
 import org.apache.kafka.clients.consumer.KafkaConsumer;
@@ -46,6 +48,7 @@ public class KafkaEventSubscriber implements Runnable {
     private static final Duration POLL_DURATION = Duration.ofMillis(100);
 
     private final String topic;
+    @Getter
     private long eventsReceivedCount = 0;
 
     KafkaConsumer<String, String> consumer;
@@ -99,15 +102,6 @@ public class KafkaEventSubscriber implements Runnable {
         LOGGER.debug("{}: event reception completed", KafkaEventSubscriber.class.getName());
     }
 
-    /**
-     * Gets the events received count.
-     *
-     * @return the events received count
-     */
-    public long getEventsReceivedCount() {
-        return eventsReceivedCount;
-    }
-
     /**
      * Shutdown.
      */
index 2d6ab46..d911a9a 100644 (file)
@@ -1,45 +1,38 @@
 /*-
  * ============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.testsuites.integration.uservice.adapt.sampletypes;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
 public class Foo {
     private String bar;
 
-    public String getBar() {
-        return bar;
-    }
-
-    public void setBar(final String bar) {
-        this.bar = bar;
-    }
-
-    public Foo(final String bar) {
-        this();
-        this.bar = bar;
-    }
-
-    public Foo() {
-        super();
-    }
-
     @Override
     public String toString() {
         return "Foo [bar=(String)\"" + bar + "\"]";
index ffb8f1e..6ffdeea 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.
@@ -21,6 +22,7 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.websocket;
 
+import lombok.Getter;
 import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
 import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageClient;
 import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageListener;
@@ -40,6 +42,7 @@ public class WebSocketEventProducerClient implements WsStringMessageListener {
     private final int eventCount;
     private final boolean xmlEvents;
     private final long eventInterval;
+    @Getter
     private long eventsSentCount = 0;
 
     WsStringMessageClient client;
@@ -95,15 +98,6 @@ public class WebSocketEventProducerClient implements WsStringMessageListener {
         LOGGER.debug("{}: completed", WebSocketEventProducerClient.class.getName());
     }
 
-    /**
-     * Gets the events sent count.
-     *
-     * @return the events sent count
-     */
-    public long getEventsSentCount() {
-        return eventsSentCount;
-    }
-
     /**
      * Shutdown.
      */
index ec3112c..1bdb56e 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.
@@ -21,6 +22,7 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.websocket;
 
+import lombok.Getter;
 import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
 import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageListener;
 import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageServer;
@@ -39,6 +41,7 @@ public class WebSocketEventProducerServer implements WsStringMessageListener {
     private final int eventCount;
     private final boolean xmlEvents;
     private final long eventInterval;
+    @Getter
     private long eventsSentCount = 0;
 
     WsStringMessageServer server;
@@ -92,15 +95,6 @@ public class WebSocketEventProducerServer implements WsStringMessageListener {
         LOGGER.debug("{}: event sending completed", WebSocketEventProducerServer.class.getName());
     }
 
-    /**
-     * Gets the events sent count.
-     *
-     * @return the events sent count
-     */
-    public long getEventsSentCount() {
-        return eventsSentCount;
-    }
-
     /**
      * Shutdown.
      */
index 7fe2d43..23d32e2 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.
@@ -21,6 +22,7 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.websocket;
 
+import lombok.Getter;
 import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
 import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageClient;
 import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageListener;
@@ -34,6 +36,7 @@ public class WebSocketEventSubscriberClient implements WsStringMessageListener {
     private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketEventSubscriberClient.class);
 
     private final int port;
+    @Getter
     private long eventsReceivedCount = 0;
 
     private final WsStringMessageClient client;
@@ -62,15 +65,6 @@ public class WebSocketEventSubscriberClient implements WsStringMessageListener {
         eventsReceivedCount++;
     }
 
-    /**
-     * Gets the events received count.
-     *
-     * @return the events received count
-     */
-    public long getEventsReceivedCount() {
-        return eventsReceivedCount;
-    }
-
     /**
      * Shutdown.
      */
index d36ce96..41291a4 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.
@@ -21,6 +22,7 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.websocket;
 
+import lombok.Getter;
 import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
 import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageListener;
 import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageServer;
@@ -34,6 +36,7 @@ public class WebSocketEventSubscriberServer implements WsStringMessageListener {
     private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketEventSubscriberServer.class);
 
     private final int port;
+    @Getter
     private long eventsReceivedCount = 0;
 
     private final WsStringMessageServer server;
@@ -63,15 +66,6 @@ public class WebSocketEventSubscriberServer implements WsStringMessageListener {
         eventsReceivedCount++;
     }
 
-    /**
-     * Gets the events received count.
-     *
-     * @return the events received count
-     */
-    public long getEventsReceivedCount() {
-        return eventsReceivedCount;
-    }
-
     /**
      * Shutdown.
      */
index 1dc6f13..226756b 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
  *  Modifications Copyright (C) 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.
@@ -27,6 +28,7 @@ import java.io.IOException;
 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.ApexEventReceiver;
@@ -50,6 +52,7 @@ public class DummyApexEventConsumer implements ApexEventConsumer {
     private ApexEventReceiver eventReceiver;
 
     // The name for this consumer
+    @Getter
     private String name = null;
 
     // The peer references for this event handler
@@ -81,14 +84,6 @@ public class DummyApexEventConsumer implements ApexEventConsumer {
         new Thread(new RunTestEventSender()).start();
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String getName() {
-        return name;
-    }
-
     /**
      * {@inheritDoc}.
      */
index 5aebc22..b22b258 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.
@@ -26,6 +27,7 @@ import java.io.IOException;
 import java.util.EnumMap;
 import java.util.Map;
 import java.util.Properties;
+import lombok.Getter;
 import org.onap.policy.apex.service.engine.event.ApexEventException;
 import org.onap.policy.apex.service.engine.event.ApexEventProducer;
 import org.onap.policy.apex.service.engine.event.ApexEventRuntimeException;
@@ -50,6 +52,7 @@ public class DummyApexEventProducer implements ApexEventProducer {
     private DummyCarrierTechnologyParameters dummyProducerProperties;
 
     // The name for this producer
+    @Getter
     private String name = null;
 
     // The peer references for this event handler
@@ -72,14 +75,6 @@ public class DummyApexEventProducer implements ApexEventProducer {
         new File(dummyProducerProperties.getPropertyFileName()).delete();
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String getName() {
-        return name;
-    }
-
     /**
      * {@inheritDoc}.
      */
index fc4e508..e35bda6 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.
@@ -21,6 +22,7 @@
 package org.onap.policy.apex.testsuites.integration.uservice.executionproperties;
 
 import lombok.Data;
+import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 
@@ -31,11 +33,13 @@ import org.onap.policy.common.utils.coder.StandardCoder;
  */
 @Data
 public class RunTestEvent {
+    private static final Coder coder = new StandardCoder();
+
     private String testToRun;
     private String propertyFileName;
 
     public String toJson() throws CoderException {
-        return new StandardCoder().encode(this);
+        return coder.encode(this);
     }
 
     /**
@@ -45,7 +49,7 @@ public class RunTestEvent {
      * @throws CoderException on JSON exceptions
      */
     public void fromJson(final String jsonString) throws CoderException {
-        RunTestEvent jsonTestEvent = new StandardCoder().decode(jsonString, RunTestEvent.class);
+        RunTestEvent jsonTestEvent = coder.decode(jsonString, RunTestEvent.class);
         this.testToRun = jsonTestEvent.testToRun;
         this.propertyFileName = jsonTestEvent.propertyFileName;
     }
index 95d3ad8..99f480b 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -23,6 +24,7 @@ package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicInteger;
+import lombok.Getter;
 import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.InputEvent;
 import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.OutputEvent;
 
@@ -32,11 +34,14 @@ import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.even
 public class EventBatch {
     private static AtomicInteger nextBatchNumber = new AtomicInteger();
 
+    @Getter
     private final int batchNumber = nextBatchNumber.getAndIncrement();
     private final Map<Integer, InputEvent>  inputEventMap  = new ConcurrentHashMap<>();
     private final Map<Integer, OutputEvent> outputEventMap = new ConcurrentHashMap<>();
 
+    @Getter
     private final int batchSize;
+    @Getter
     private final String apexClient;
 
     /**
@@ -83,18 +88,6 @@ public class EventBatch {
         return jsonBuilder.toString();
     }
 
-    public int getBatchNumber() {
-        return batchNumber;
-    }
-
-    public int getBatchSize() {
-        return batchSize;
-    }
-
-    public String getApexClient() {
-        return apexClient;
-    }
-
     /**
      * Get the event slogan.
      *
index 930e2af..fa5083e 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 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.
@@ -22,6 +23,7 @@
 package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator;
 
 import java.util.List;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.apache.commons.lang3.tuple.Pair;
 import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.OutputEvent;
@@ -29,6 +31,7 @@ import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.even
 /**
  * This POJO class returns statistics on a event batch execution in Apex.
  */
+@Getter
 public class EventBatchStats {
     private final int batchNumber;
     private final int batchSize;
@@ -183,56 +186,4 @@ public class EventBatchStats {
 
         return new ImmutablePair<>(roundTrip, apexExecution);
     }
-
-    public int getBatchNumber() {
-        return batchNumber;
-    }
-
-    public int getBatchSize() {
-        return batchSize;
-    }
-
-    public String getApexClient() {
-        return apexClient;
-    }
-
-    public long getEventsNotSent() {
-        return eventsNotSent;
-    }
-
-    public long getEventsSent() {
-        return eventsSent;
-    }
-
-    public long getEventsNotReceived() {
-        return eventsNotReceived;
-    }
-
-    public long getEventsReceived() {
-        return eventsReceived;
-    }
-
-    public long getAverageRoundTripNano() {
-        return averageRoundTripNano;
-    }
-
-    public long getShortestRoundTripNano() {
-        return shortestRoundTripNano;
-    }
-
-    public long getLongestRoundTripNano() {
-        return longestRoundTripNano;
-    }
-
-    public long getAverageApexExecutionNano() {
-        return averageApexExecutionNano;
-    }
-
-    public long getShortestApexExecutionNano() {
-        return shortestApexExecutionNano;
-    }
-
-    public long getLongestApexExecutionNano() {
-        return longestApexExecutionNano;
-    }
 }
index 1b35587..6cbee69 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 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.
@@ -30,6 +31,9 @@ import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.core.Response;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
 import org.glassfish.grizzly.http.server.Request;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.OutputEvent;
@@ -53,6 +57,8 @@ public class EventGeneratorEndpoint {
     private static ConcurrentHashMap<Integer, EventBatch> batchMap = new ConcurrentHashMap<>();
 
     // Flag indicating that event processing has finished
+    @Getter(AccessLevel.PROTECTED)
+    @Setter(AccessLevel.PROTECTED)
     private static boolean finished = false;
 
     // The current HTTP request
@@ -163,17 +169,4 @@ public class EventGeneratorEndpoint {
     protected static void clearEventGenerationStats() {
         batchMap.clear();
     }
-
-    /**
-     * Check if event generation has finished.
-     *
-     * @return true if event generation has finished
-     */
-    protected static boolean isFinished() {
-        return finished;
-    }
-
-    protected static void setFinished(boolean finished) {
-        EventGeneratorEndpoint.finished = finished;
-    }
 }
index 9d926e2..9cdb331 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -24,11 +25,13 @@ import com.google.gson.GsonBuilder;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import lombok.Getter;
 
 /**
  * This class creates statistics for the event generator's current status.
  */
 public class EventGeneratorStats {
+    @Getter
     private final EventBatchStats totalStats;
     private final List<EventBatchStats> batchStatsList = new ArrayList<>();
 
@@ -51,8 +54,4 @@ public class EventGeneratorStats {
     public String getStatsAsJsonString() {
         return new GsonBuilder().setPrettyPrinting().create().toJson(this);
     }
-
-    public EventBatchStats getTotalStats() {
-        return totalStats;
-    }
 }
index 2cccc7d..d24405b 100644 (file)
 
 package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events;
 
+import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.google.gson.annotations.SerializedName;
 import java.util.Random;
+import lombok.Getter;
+import lombok.Setter;
 
 /**
  * This class is a POJO representing an input event for load testing.
  */
+@Getter
+@Setter
 public class InputEvent {
+    private static final Gson gson = new GsonBuilder().setPrettyPrinting().create();
+
     private String nameSpace = "org.onap.policy.apex.sample.events";
     private String name;
     private String version = "0.0.1";
@@ -61,86 +68,12 @@ public class InputEvent {
         testTemperature = rand.nextDouble() * 1000;
     }
 
-    public String getNameSpace() {
-        return nameSpace;
-
-    }
-
-    public void setNameSpace(String nameSpace) {
-        this.nameSpace = nameSpace;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    public String getSource() {
-        return source;
-    }
-
-    public void setSource(String source) {
-        this.source = source;
-    }
-
-    public String getTarget() {
-        return target;
-    }
-
-
-    public void setTarget(String target) {
-        this.target = target;
-    }
-
-    public String getTestSlogan() {
-        return testSlogan;
-    }
-
-    public void setTestSlogan(String testSlogan) {
-        this.testSlogan = testSlogan;
-    }
-
-    public int getTestMatchCase() {
-        return testMatchCase;
-    }
-
-    public void setTestMatchCase(int testMatchCase) {
-        this.testMatchCase = testMatchCase;
-    }
-
-    public long getTestTimestamp() {
-        return testTimestamp;
-    }
-
-    public void setTestTimestamp(long testTimestamp) {
-        this.testTimestamp = testTimestamp;
-    }
-
-    public double getTestTemperature() {
-        return testTemperature;
-    }
-
-    public void setTestTemperature(double testTemperature) {
-        this.testTemperature = testTemperature;
-    }
-
     /**
      * Get a JSON representation of the input event.
      *
      * @return the event in JSON format
      */
     public String asJson() {
-        return new GsonBuilder().setPrettyPrinting().create().toJson(this);
+        return gson.toJson(this);
     }
 }
index 0350b3f..fe7829c 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
 package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events;
 
 import com.google.gson.annotations.SerializedName;
+import lombok.Getter;
+import lombok.Setter;
 
 /**
  * This class is a POJO representing an output event for load testing.
  */
+@Getter
+@Setter
 public class OutputEvent extends InputEvent {
     @SerializedName(value = "TestMatchCaseSelected")
     private int testMatchCaseSelected;
@@ -52,78 +57,6 @@ public class OutputEvent extends InputEvent {
 
     private long testReceviedTimestamp = System.nanoTime();
 
-    public int getTestMatchCaseSelected() {
-        return testMatchCaseSelected;
-    }
-
-    public void setTestMatchCaseSelected(int testMatchCaseSelected) {
-        this.testMatchCaseSelected = testMatchCaseSelected;
-    }
-
-    public long getTestMatchStateTime() {
-        return testMatchStateTime;
-    }
-
-    public void setTestMatchStateTime(long testMatchStateTime) {
-        this.testMatchStateTime = testMatchStateTime;
-    }
-
-    public int getTestEstablishCaseSelected() {
-        return testEstablishCaseSelected;
-    }
-
-    public void setTestEstablishCaseSelected(int testEstablishCaseSelected) {
-        this.testEstablishCaseSelected = testEstablishCaseSelected;
-    }
-
-    public long getTestEstablishStateTime() {
-        return testEstablishStateTime;
-    }
-
-    public void setTestEstablishStateTime(long testEstablishStateTime) {
-        this.testEstablishStateTime = testEstablishStateTime;
-    }
-
-    public int getTestDecideCaseSelected() {
-        return testDecideCaseSelected;
-    }
-
-    public void setTestDecideCaseSelected(int testDecideCaseSelected) {
-        this.testDecideCaseSelected = testDecideCaseSelected;
-    }
-
-    public long getTestDecideStateTime() {
-        return testDecideStateTime;
-    }
-
-    public void setTestDecideStateTime(long testDecideStateTime) {
-        this.testDecideStateTime = testDecideStateTime;
-    }
-
-    public int getTestActCaseSelected() {
-        return testActCaseSelected;
-    }
-
-    public void setTestActCaseSelected(int testActCaseSelected) {
-        this.testActCaseSelected = testActCaseSelected;
-    }
-
-    public long getTestActStateTime() {
-        return testActStateTime;
-    }
-
-    public void setTestActStateTime(long testActStateTime) {
-        this.testActStateTime = testActStateTime;
-    }
-
-    public long getTestReceviedTimestamp() {
-        return testReceviedTimestamp;
-    }
-
-    public void setTestReceviedTimestamp(long testReceviedTimestamp) {
-        this.testReceviedTimestamp = testReceviedTimestamp;
-    }
-
     public int findBatchNumber() {
         return Integer.valueOf(getTestSlogan().substring(0, getTestSlogan().indexOf('-')));
     }
index 2376769..cb68db3 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.
@@ -20,6 +21,7 @@
 
 package org.onap.policy.apex.tools.model.generator;
 
+import lombok.AllArgsConstructor;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
@@ -30,21 +32,12 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
  *
  * @author John Keeney (john.keeney@ericsson.com)
  */
-
+@AllArgsConstructor
 public class KeyInfoGetter {
 
     /** The policy model for the getters. */
     private final AxPolicyModel model;
 
-    /**
-     * Creates a new key getter.
-     *
-     * @param model the policy model to use
-     */
-    public KeyInfoGetter(final AxPolicyModel model) {
-        this.model = model;
-    }
-
     /**
      * Returns the key name as string.
      *
index 9d0e83c..484eaa6 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.
@@ -25,6 +26,8 @@ import java.util.Arrays;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 import org.apache.avro.AvroRuntimeException;
 import org.apache.avro.Schema;
 import org.apache.avro.Schema.Field;
@@ -41,15 +44,9 @@ import org.onap.policy.apex.service.engine.event.ApexEventException;
  *
  * @author John Keeney (john.keeney@ericsson.com)
  */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class SchemaUtils {
 
-    /**
-     * Private constructor to avoid instantiation.
-     */
-    private SchemaUtils() {
-        // Private constructor to block subclassing
-    }
-
     /**
      * Returns the schema for an event.
      *