Replace getCaononicalName() with getName() in code base 97/98897/2
authorliamfallon <liam.fallon@est.tech>
Wed, 27 Nov 2019 13:32:45 +0000 (13:32 +0000)
committerliamfallon <liam.fallon@est.tech>
Thu, 28 Nov 2019 11:06:05 +0000 (11:06 +0000)
Issue-ID: POLICY-1861
Change-Id: Iccbdcbc5b5978305c56ab74c01a52a562697bee1
Signed-off-by: liamfallon <liam.fallon@est.tech>
45 files changed:
client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestMain.java
client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorMain.java
client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestMain.java
client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestMain.java
context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java
core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/impl/ExecutorFactoryImpl.java
examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AadmDomainModelSaver.java
examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelSaver.java
examples/examples-myfirstpolicy/src/main/java/org/onap/policy/apex/examples/myfirstpolicy/model/MfpDomainModelSaver.java
examples/examples-pcvs/src/main/java/org/onap/policy/apex/examples/pcvs/model/PcvsDomainModelSaver.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/impl/DefaultApexDao.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/service/ModelService.java
model/utilities/src/main/java/org/onap/policy/apex/model/utilities/typeutils/TypeBuilder.java
plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroBytesObjectMapper.java
plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroDirectObjectMapper.java
plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java
plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelperParameters.java
plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroStringObjectMapper.java
plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/test/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaFixedTest.java
plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/test/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelperMarshalTest.java
plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/test/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelperUnmarshalTest.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-jms/src/main/java/org/onap/policy/apex/plugins/event/carrier/jms/ApexJmsConsumer.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-jms/src/main/java/org/onap/policy/apex/plugins/event/carrier/jms/ApexJmsProducer.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-kafka/src/main/java/org/onap/policy/apex/plugins/event/carrier/kafka/ApexKafkaConsumer.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorCarrierTechnologyParameters.java
plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JmsObjectEventConverter.java
plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-yaml/src/main/java/org/onap/policy/apex/plugins/event/protocol/yaml/Apex2YamlEventConverter.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventConsumerFactory.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventProducerFactory.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventProtocolFactory.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JsonEventConverter.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParametersJsonAdapter.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperEventProducer.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperEventSubscriber.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaver.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/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/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

index b7d566c..6ba8d83 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,7 +40,10 @@ public class ApexDeploymentRestMain {
 
     // Services state
     public enum ServicesState {
-        STOPPED, READY, INITIALIZING, RUNNING
+        STOPPED,
+        READY,
+        INITIALIZING,
+        RUNNING
     }
 
     private ServicesState state = ServicesState.STOPPED;
@@ -72,12 +76,12 @@ public class ApexDeploymentRestMain {
         } catch (final ApexDeploymentRestParameterException e) {
             throw new ApexDeploymentRestParameterException(
                             REST_ENDPOINT_PREFIX + this.toString() + ") parameter error, " + e.getMessage() + '\n'
-                                            + parser.getHelp(ApexDeploymentRestMain.class.getCanonicalName()), e);
+                                            + parser.getHelp(ApexDeploymentRestMain.class.getName()),
+                            e);
         }
 
         if (parameters.isHelpSet()) {
-            throw new ApexDeploymentRestParameterException(
-                            parser.getHelp(ApexDeploymentRestMain.class.getCanonicalName()));
+            throw new ApexDeploymentRestParameterException(parser.getHelp(ApexDeploymentRestMain.class.getName()));
         }
 
         // Validate the parameters
@@ -85,7 +89,7 @@ public class ApexDeploymentRestMain {
         if (validationMessage.length() > 0) {
             throw new ApexDeploymentRestParameterException(
                             REST_ENDPOINT_PREFIX + this.toString() + ") parameters invalid, " + validationMessage + '\n'
-                                            + parser.getHelp(ApexDeploymentRestMain.class.getCanonicalName()));
+                                            + parser.getHelp(ApexDeploymentRestMain.class.getName()));
         }
 
         state = ServicesState.READY;
@@ -131,7 +135,8 @@ public class ApexDeploymentRestMain {
             String message = REST_ENDPOINT_PREFIX + this.toString() + ") failed at with error: " + e.getMessage();
             outStream.println(message);
             LOGGER.warn(message, e);
-        } finally {
+        }
+        finally {
             if (apexDeploymentRest != null) {
                 apexDeploymentRest.shutdown();
                 apexDeploymentRest = null;
index b7e1f97..558cbad 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -82,18 +83,18 @@ public class ApexEditorMain {
             parameters = parser.parse(args);
         } catch (final ApexEditorParameterException e) {
             throw new ApexEditorParameterException(REST_ENDPOINT_PREFIX + this.toString() + ") parameter error, "
-                            + e.getMessage() + '\n' + parser.getHelp(ApexEditorMain.class.getCanonicalName()), e);
+                            + e.getMessage() + '\n' + parser.getHelp(ApexEditorMain.class.getName()), e);
         }
 
         if (parameters.isHelpSet()) {
-            throw new ApexEditorParameterException(parser.getHelp(ApexEditorMain.class.getCanonicalName()));
+            throw new ApexEditorParameterException(parser.getHelp(ApexEditorMain.class.getName()));
         }
 
         // Validate the parameters
         final String validationMessage = parameters.validate();
         if (validationMessage.length() > 0) {
             throw new ApexEditorParameterException(REST_ENDPOINT_PREFIX + this.toString() + ") parameters invalid, "
-                            + validationMessage + '\n' + parser.getHelp(ApexEditorMain.class.getCanonicalName()));
+                            + validationMessage + '\n' + parser.getHelp(ApexEditorMain.class.getName()));
         }
 
         state = EditorState.READY;
@@ -139,7 +140,8 @@ public class ApexEditorMain {
             String message = REST_ENDPOINT_PREFIX + this.toString() + ") failed at with error: " + e.getMessage();
             outStream.println(message);
             LOGGER.warn(message, e);
-        } finally {
+        }
+        finally {
             if (apexEditor != null) {
                 apexEditor.shutdown();
                 apexEditor = null;
index df877ba..856aa6b 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -82,11 +83,11 @@ public class ApexServicesRestMain {
             parameters = parser.parse(args);
         } catch (final ApexServicesRestParameterException e) {
             throw new ApexServicesRestParameterException(REST_ENDPOINT_PREFIX + this.toString() + ") parameter error, "
-                            + e.getMessage() + '\n' + parser.getHelp(ApexServicesRestMain.class.getCanonicalName()), e);
+                            + e.getMessage() + '\n' + parser.getHelp(ApexServicesRestMain.class.getName()), e);
         }
 
         if (parameters.isHelpSet()) {
-            throw new ApexServicesRestParameterException(parser.getHelp(ApexServicesRestMain.class.getCanonicalName()));
+            throw new ApexServicesRestParameterException(parser.getHelp(ApexServicesRestMain.class.getName()));
         }
 
         // Validate the parameters
@@ -94,7 +95,7 @@ public class ApexServicesRestMain {
         if (validationMessage.length() > 0) {
             throw new ApexServicesRestParameterException(
                             REST_ENDPOINT_PREFIX + this.toString() + ") parameters invalid, " + validationMessage + '\n'
-                                            + parser.getHelp(ApexServicesRestMain.class.getCanonicalName()));
+                                            + parser.getHelp(ApexServicesRestMain.class.getName()));
         }
 
         state = EditorState.READY;
@@ -140,7 +141,8 @@ public class ApexServicesRestMain {
             String message = REST_ENDPOINT_PREFIX + this.toString() + ") failed at with error: " + e.getMessage();
             outStream.println(message);
             LOGGER.warn(message, e);
-        } finally {
+        }
+        finally {
             if (apexServices != null) {
                 apexServices.shutdown();
                 apexServices = null;
@@ -195,7 +197,7 @@ public class ApexServicesRestMain {
             }
         }
     }
-    
+
     /**
      * Main method, main entry point for command.
      *
index 468fd5a..abc30ce 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,7 +40,10 @@ public class ApexMonitoringRestMain {
 
     // Services state
     public enum ServicesState {
-        STOPPED, READY, INITIALIZING, RUNNING
+        STOPPED,
+        READY,
+        INITIALIZING,
+        RUNNING
     }
 
     private ServicesState state = ServicesState.STOPPED;
@@ -72,12 +76,12 @@ public class ApexMonitoringRestMain {
         } catch (final ApexMonitoringRestParameterException e) {
             throw new ApexMonitoringRestParameterException(
                             REST_ENDPOINT_PREFIX + this.toString() + ") parameter error, " + e.getMessage() + '\n'
-                                            + parser.getHelp(ApexMonitoringRestMain.class.getCanonicalName()), e);
+                                            + parser.getHelp(ApexMonitoringRestMain.class.getName()),
+                            e);
         }
 
         if (parameters.isHelpSet()) {
-            throw new ApexMonitoringRestParameterException(
-                            parser.getHelp(ApexMonitoringRestMain.class.getCanonicalName()));
+            throw new ApexMonitoringRestParameterException(parser.getHelp(ApexMonitoringRestMain.class.getName()));
         }
 
         // Validate the parameters
@@ -85,7 +89,7 @@ public class ApexMonitoringRestMain {
         if (validationMessage.length() > 0) {
             throw new ApexMonitoringRestParameterException(
                             REST_ENDPOINT_PREFIX + this.toString() + ") parameters invalid, " + validationMessage + '\n'
-                                            + parser.getHelp(ApexMonitoringRestMain.class.getCanonicalName()));
+                                            + parser.getHelp(ApexMonitoringRestMain.class.getName()));
         }
 
         state = ServicesState.READY;
@@ -131,7 +135,8 @@ public class ApexMonitoringRestMain {
             String message = REST_ENDPOINT_PREFIX + this.toString() + ") failed at with error: " + e.getMessage();
             outStream.println(message);
             LOGGER.warn(message, e);
-        } finally {
+        }
+        finally {
             if (apexMonitoringRest != null) {
                 apexMonitoringRest.shutdown();
                 apexMonitoringRest = null;
index c4b1a02..ca1fa78 100644 (file)
@@ -123,7 +123,7 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
             return schemaClass.newInstance();
         } catch (final Exception e) {
             final String returnString = userKey.getId() + ": could not create an instance of class \""
-                            + schemaClass.getCanonicalName() + "\" using the default constructor \""
+                            + schemaClass.getName() + "\" using the default constructor \""
                             + schemaClass.getSimpleName() + "()\"";
             LOGGER.warn(returnString, e);
             throw new ContextRuntimeException(returnString, e);
@@ -150,7 +150,7 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
             return stringConstructor.newInstance(stringValue);
         } catch (final Exception e) {
             final String returnString = userKey.getId() + ": could not create an instance of class \""
-                            + schemaClass.getCanonicalName() + "\" using the string constructor \""
+                            + schemaClass.getName() + "\" using the string constructor \""
                             + schemaClass.getSimpleName() + "(String)\"";
             LOGGER.warn(returnString, e);
             throw new ContextRuntimeException(returnString);
index a8fedf2..b36e008 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -119,9 +120,9 @@ public class JavaSchemaHelper extends AbstractSchemaHelper {
         }
 
         final String returnString = getUserKey().getId() + ": the object \"" + incomingObject + "\" of type \""
-                        + incomingObject.getClass().getCanonicalName()
-                        + "\" is not an instance of JsonObject and is not assignable to \""
-                        + getSchemaClass().getCanonicalName() + "\"";
+                        + incomingObject.getClass().getName()
+                        + "\" is not an instance of JsonObject and is not assignable to \"" + getSchemaClass().getName()
+                        + "\"";
         LOGGER.warn(returnString);
         throw new ContextRuntimeException(returnString);
     }
@@ -167,8 +168,8 @@ public class JavaSchemaHelper extends AbstractSchemaHelper {
             return getGson().toJson(schemaObject);
         } else {
             final String returnString = getUserKey().getId() + ": object \"" + schemaObject.toString()
-                            + "\" of class \"" + schemaObject.getClass().getCanonicalName()
-                            + "\" not compatible with class \"" + getSchemaClass().getCanonicalName() + "\"";
+                            + "\" of class \"" + schemaObject.getClass().getName() + "\" not compatible with class \""
+                            + getSchemaClass().getName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
@@ -224,8 +225,8 @@ public class JavaSchemaHelper extends AbstractSchemaHelper {
             return stringConstructor.newInstance(object.toString());
         } catch (final Exception e) {
             final String returnString = getUserKey().getId() + ": object \"" + object.toString() + "\" of class \""
-                            + object.getClass().getCanonicalName() + "\" not compatible with class \""
-                            + getSchemaClass().getCanonicalName() + "\"";
+                            + object.getClass().getName() + "\" not compatible with class \""
+                            + getSchemaClass().getName() + "\"";
             LOGGER.warn(returnString, e);
             throw new ContextRuntimeException(returnString);
         }
@@ -233,7 +234,7 @@ public class JavaSchemaHelper extends AbstractSchemaHelper {
 
     /**
      * Get a GSON instance that has the correct adaptation included.
-     * 
+     *
      * @return the GSON instance
      */
     private Gson getGson() {
@@ -244,11 +245,11 @@ public class JavaSchemaHelper extends AbstractSchemaHelper {
 
         JavaSchemaHelperParameters javaSchemaHelperParmeters = (JavaSchemaHelperParameters) schemaParameters
                         .getSchemaHelperParameterMap().get("Java");
-        
+
         if (javaSchemaHelperParmeters == null) {
             javaSchemaHelperParmeters = new JavaSchemaHelperParameters();
         }
-        
+
         for (JavaSchemaHelperJsonAdapterParameters jsonAdapterEntry : javaSchemaHelperParmeters.getJsonAdapters()
                         .values()) {
 
index 6565060..ca80db9 100644 (file)
@@ -193,7 +193,7 @@ public class ExecutorFactoryImpl implements ExecutorFactory {
         // executor class
         if (executorClass == null) {
             final String errorMessage = "Executor plugin class not defined for \"" + logicFlavour
-                            + "\" executor of type \"" + executorSuperClass.getCanonicalName() + "\"";
+                            + "\" executor of type \"" + executorSuperClass.getName() + "\"";
             LOGGER.error(errorMessage);
             throw new StateMachineRuntimeException(errorMessage);
         }
@@ -204,7 +204,7 @@ public class ExecutorFactoryImpl implements ExecutorFactory {
             executorObject = executorClass.newInstance();
         } catch (InstantiationException | IllegalAccessException e) {
             final String errorMessage = "Instantiation error on \"" + logicFlavour + "\" executor of type \""
-                            + executorClass.getCanonicalName() + "\"";
+                            + executorClass.getName() + "\"";
             LOGGER.error(errorMessage, e);
             throw new StateMachineRuntimeException(errorMessage, e);
         }
@@ -212,7 +212,7 @@ public class ExecutorFactoryImpl implements ExecutorFactory {
         // Check the class is the correct type of executor
         if (!(executorSuperClass.isAssignableFrom(executorObject.getClass()))) {
             final String errorMessage = "Executor on \"" + logicFlavour + "\" of type \"" + executorClass
-                            + "\" is not an instance of \"" + executorSuperClass.getCanonicalName() + "\"";
+                            + "\" is not an instance of \"" + executorSuperClass.getName() + "\"";
 
             LOGGER.error(errorMessage);
             throw new StateMachineRuntimeException(errorMessage);
index 60eee45..492769d 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,7 +39,8 @@ public final class AadmDomainModelSaver {
     /**
      * Private default constructor to prevent subclassing.
      */
-    private AadmDomainModelSaver() {}
+    private AadmDomainModelSaver() {
+    }
 
     /**
      * Write the AADM model to args[0].
@@ -48,14 +50,14 @@ public final class AadmDomainModelSaver {
      */
     public static void main(final String[] args) throws ApexException {
         if (args.length != 1) {
-            LOGGER.error("usage: " + AadmDomainModelSaver.class.getCanonicalName() + " modelDirectory");
+            LOGGER.error("usage: " + AadmDomainModelSaver.class.getName() + " modelDirectory");
             return;
         }
 
         // Save Java model
         final AxPolicyModel aadmPolicyModel = new AadmDomainModelFactory().getAadmPolicyModel();
-        final ApexModelSaver<AxPolicyModel> aadmModelSaver =
-                new ApexModelSaver<>(AxPolicyModel.class, aadmPolicyModel, args[0]);
+        final ApexModelSaver<AxPolicyModel> aadmModelSaver = new ApexModelSaver<>(AxPolicyModel.class, aadmPolicyModel,
+                        args[0]);
         aadmModelSaver.apexModelWriteJson();
         aadmModelSaver.apexModelWriteXml();
     }
index 4949edd..83a42ac 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -50,21 +51,21 @@ public final class AdaptiveDomainModelSaver {
      */
     public static void main(final String[] args) throws ApexException {
         if (args.length != 1) {
-            LOGGER.error("usage: " + AdaptiveDomainModelSaver.class.getCanonicalName() + " modelDirectory");
+            LOGGER.error("usage: " + AdaptiveDomainModelSaver.class.getName() + " modelDirectory");
             return;
         }
 
         // Save Anomaly Detection model
         final AxPolicyModel adPolicyModel = new AdaptiveDomainModelFactory().getAnomalyDetectionPolicyModel();
-        final ApexModelSaver<AxPolicyModel> adModelSaver =
-                        new ApexModelSaver<>(AxPolicyModel.class, adPolicyModel, args[0]);
+        final ApexModelSaver<AxPolicyModel> adModelSaver = new ApexModelSaver<>(AxPolicyModel.class, adPolicyModel,
+                        args[0]);
         adModelSaver.apexModelWriteJson();
         adModelSaver.apexModelWriteXml();
 
         // Save Auto Learn model
         final AxPolicyModel alPolicyModel = new AdaptiveDomainModelFactory().getAutoLearnPolicyModel();
-        final ApexModelSaver<AxPolicyModel> alModelSaver =
-                        new ApexModelSaver<>(AxPolicyModel.class, alPolicyModel, args[0]);
+        final ApexModelSaver<AxPolicyModel> alModelSaver = new ApexModelSaver<>(AxPolicyModel.class, alPolicyModel,
+                        args[0]);
         alModelSaver.apexModelWriteJson();
         alModelSaver.apexModelWriteXml();
     }
index 1a18a7e..d2469f2 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,7 +37,8 @@ public final class MfpDomainModelSaver {
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(MfpDomainModelSaver.class);
 
     /** Private constructor to prevent instantiation. */
-    private MfpDomainModelSaver() {}
+    private MfpDomainModelSaver() {
+    }
 
     /**
      * Write the MyFirstPolicy model to args[0].
@@ -46,14 +48,14 @@ public final class MfpDomainModelSaver {
      */
     public static void main(final String[] args) throws ApexException {
         if (args.length != 1) {
-            LOGGER.error("usage: " + MfpDomainModelSaver.class.getCanonicalName() + " modelDirectory");
+            LOGGER.error("usage: " + MfpDomainModelSaver.class.getName() + " modelDirectory");
             return;
         }
 
         // Save Java model
         AxPolicyModel mfpPolicyModel = new MfpDomainModelFactory().getMfp1PolicyModel();
-        ApexModelSaver<AxPolicyModel> mfpModelSaver =
-                new ApexModelSaver<>(AxPolicyModel.class, mfpPolicyModel, args[0] + "/1/");
+        ApexModelSaver<AxPolicyModel> mfpModelSaver = new ApexModelSaver<>(AxPolicyModel.class, mfpPolicyModel,
+                        args[0] + "/1/");
         mfpModelSaver.apexModelWriteJson();
         mfpModelSaver.apexModelWriteXml();
 
index 1d8381a..02b1077 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -47,8 +48,7 @@ public final class PcvsDomainModelSaver {
      */
     public static void main(final String[] args) throws ApexException {
         if (args.length != 2) {
-            LOGGER.error("usage: " + PcvsDomainModelSaver.class.getCanonicalName()
-                            + " workingDirectory modelDirectory");
+            LOGGER.error("usage: " + PcvsDomainModelSaver.class.getName() + " workingDirectory modelDirectory");
             return;
         }
 
index 693284d..375d7f0 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -119,7 +120,8 @@ public class DefaultApexDao implements ApexDao {
             mg.getTransaction().begin();
             mg.merge(obj);
             mg.getTransaction().commit();
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -137,7 +139,8 @@ public class DefaultApexDao implements ApexDao {
             mg.getTransaction().begin();
             mg.remove(mg.contains(obj) ? obj : mg.merge(obj));
             mg.getTransaction().commit();
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -156,7 +159,8 @@ public class DefaultApexDao implements ApexDao {
             mg.createQuery(DELETE_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_NAME + key.getName()
                             + AND_C_KEY_VERSION + key.getVersion() + "'", someClass).executeUpdate();
             mg.getTransaction().commit();
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -176,7 +180,8 @@ public class DefaultApexDao implements ApexDao {
                             + key.getParentKeyName() + AND_C_KEY_PARENT_KEY_VERSION + key.getParentKeyVersion()
                             + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'", someClass).executeUpdate();
             mg.getTransaction().commit();
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -196,7 +201,8 @@ public class DefaultApexDao implements ApexDao {
                 mg.merge(t);
             }
             mg.getTransaction().commit();
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -216,7 +222,8 @@ public class DefaultApexDao implements ApexDao {
                 mg.remove(mg.contains(t) ? t : mg.merge(t));
             }
             mg.getTransaction().commit();
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -241,7 +248,8 @@ public class DefaultApexDao implements ApexDao {
                                 .executeUpdate();
             }
             mg.getTransaction().commit();
-        } finally {
+        }
+        finally {
             mg.close();
         }
         return deletedCount;
@@ -266,7 +274,8 @@ public class DefaultApexDao implements ApexDao {
                                 + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'", someClass).executeUpdate();
             }
             mg.getTransaction().commit();
-        } finally {
+        }
+        finally {
             mg.close();
         }
         return deletedCount;
@@ -282,7 +291,8 @@ public class DefaultApexDao implements ApexDao {
             mg.getTransaction().begin();
             mg.createQuery(DELETE_FROM + someClass.getSimpleName() + " c ", someClass).executeUpdate();
             mg.getTransaction().commit();
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -305,13 +315,14 @@ public class DefaultApexDao implements ApexDao {
                     t.copyTo(clonedT);
                     return clonedT;
                 } catch (final Exception e) {
-                    LOGGER.warn("Could not clone object of class \"" + someClass.getCanonicalName() + "\"", e);
+                    LOGGER.warn("Could not clone object of class \"" + someClass.getName() + "\"", e);
                     return null;
                 }
             } else {
                 return null;
             }
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -333,13 +344,14 @@ public class DefaultApexDao implements ApexDao {
                     t.copyTo(clonedT);
                     return clonedT;
                 } catch (final Exception e) {
-                    LOGGER.warn("Could not clone object of class \"" + someClass.getCanonicalName() + "\"", e);
+                    LOGGER.warn("Could not clone object of class \"" + someClass.getName() + "\"", e);
                     return null;
                 }
             } else {
                 return null;
             }
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -355,7 +367,8 @@ public class DefaultApexDao implements ApexDao {
         final EntityManager mg = getEntityManager();
         try {
             return mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + " c", someClass).getResultList();
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -373,7 +386,8 @@ public class DefaultApexDao implements ApexDao {
             return mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
                             + parentKey.getName() + AND_C_KEY_PARENT_KEY_VERSION + parentKey.getVersion() + "'",
                             someClass).getResultList();
-        } finally {
+        }
+        finally {
             mg.close();
         }
     }
@@ -391,7 +405,8 @@ public class DefaultApexDao implements ApexDao {
         try {
             ret = mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_NAME + key.getName()
                             + AND_C_KEY_VERSION + key.getVersion() + "'", someClass).getResultList();
-        } finally {
+        }
+        finally {
             mg.close();
         }
         if (ret == null || ret.isEmpty()) {
@@ -418,7 +433,8 @@ public class DefaultApexDao implements ApexDao {
             ret = mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
                             + key.getParentKeyName() + AND_C_KEY_PARENT_KEY_VERSION + key.getParentKeyVersion()
                             + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'", someClass).getResultList();
-        } finally {
+        }
+        finally {
             mg.close();
         }
         if (ret == null || ret.isEmpty()) {
@@ -443,7 +459,8 @@ public class DefaultApexDao implements ApexDao {
             ret = mg.merge(obj);
             mg.flush();
             mg.getTransaction().commit();
-        } finally {
+        }
+        finally {
             mg.close();
         }
         return ret;
@@ -462,7 +479,8 @@ public class DefaultApexDao implements ApexDao {
         try {
             size = mg.createQuery("SELECT COUNT(c) FROM " + someClass.getSimpleName() + " c", Long.class)
                             .getSingleResult();
-        } finally {
+        }
+        finally {
             mg.close();
         }
         return size;
index 1e922b8..251d92a 100644 (file)
@@ -1,19 +1,20 @@
 /*
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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,9 +34,9 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
  * chains in modules such as the Apex engine and editor. The model service makes the model and concept definitions
  * available statically.
  *
- * <p>Note that the use of the model service means that only a single Apex model of a particular type may exist in
- * Apex (particularly the engine) at any time. Of course the model in a JVM can be changed at any time provided all
- * users of the model are stopped and restarted in an orderly manner.
+ * <p>Note that the use of the model service means that only a single Apex model of a particular type may exist in Apex
+ * (particularly the engine) at any time. Of course the model in a JVM can be changed at any time provided all users of
+ * the model are stopped and restarted in an orderly manner.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -82,8 +83,7 @@ public abstract class ModelService {
         final M model = (M) modelMap.get(modelClass);
 
         if (model == null) {
-            throw new ApexRuntimeException(
-                            "Model for " + modelClass.getCanonicalName() + " not found in model service");
+            throw new ApexRuntimeException("Model for " + modelClass.getName() + " not found in model service");
         }
 
         return model;
index ecda86f..5f75bca 100644 (file)
@@ -1,19 +1,20 @@
 /*
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -47,8 +48,8 @@ public final class TypeBuilder {
      */
     public static Type build(final String type) {
         if (type == null || type.length() == 0) {
-            throw new IllegalArgumentException("Blank type string passed to " + TypeBuilder.class.getCanonicalName()
-                            + ".build(String type)");
+            throw new IllegalArgumentException(
+                            "Blank type string passed to " + TypeBuilder.class.getName() + ".build(String type)");
         }
 
         try {
index d8d0d8c..fa17a22 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -87,9 +88,9 @@ public class AvroBytesObjectMapper implements AvroObjectMapper {
     public Object mapFromAvro(final Object avroObject) {
         // The Avro object should be a Utf8 object
         if (!(avroObject instanceof ByteBuffer)) {
-            final String returnString =
-                    userKey.getId() + ": object \"" + avroObject + "\" of class \"" + avroObject.getClass()
-                            + "\" cannot be decoded to an object of class \"" + schemaClass.getCanonicalName() + "\"";
+            final String returnString = userKey.getId() + ": object \"" + avroObject + "\" of class \""
+                            + avroObject.getClass() + "\" cannot be decoded to an object of class \""
+                            + schemaClass.getName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
@@ -111,7 +112,7 @@ public class AvroBytesObjectMapper implements AvroObjectMapper {
     public Object mapToAvro(final Object object) {
         if (object == null) {
             final String returnString = userKey.getId() + ": cannot encode a null object of class \""
-                    + schemaClass.getCanonicalName() + "\"";
+                            + schemaClass.getName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
@@ -119,7 +120,7 @@ public class AvroBytesObjectMapper implements AvroObjectMapper {
         // The incoming object should be a byte array
         if (!(object instanceof byte[])) {
             final String returnString = userKey.getId() + ": object \"" + object + "\" of class \"" + object.getClass()
-                    + "\" cannot be decoded to an object of class \"" + schemaClass.getCanonicalName() + "\"";
+                            + "\" cannot be decoded to an object of class \"" + schemaClass.getName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
index f627651..f9ec4ed 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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,8 +34,8 @@ import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
 /**
- * This class does direct mapping from Avro classes to Java classes, used for Avro primitive types
- * that directly produce Java objects.
+ * This class does direct mapping from Avro classes to Java classes, used for Avro primitive types that directly produce
+ * Java objects.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -117,9 +118,9 @@ public class AvroDirectObjectMapper implements AvroObjectMapper {
         // It is legal for the schema class to be null, if the Avro schema has a "null" type then
         // the decoded object is always returned as a null
         if (!schemaClass.isAssignableFrom(avroObject.getClass())) {
-            final String returnString =
-                            userKey.getId() + ": object \"" + avroObject + "\" of class \"" + avroObject.getClass()
-                            + "\" cannot be decoded to an object of class \"" + schemaClass.getCanonicalName() + "\"";
+            final String returnString = userKey.getId() + ": object \"" + avroObject + "\" of class \""
+                            + avroObject.getClass() + "\" cannot be decoded to an object of class \""
+                            + schemaClass.getName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
@@ -135,7 +136,7 @@ public class AvroDirectObjectMapper implements AvroObjectMapper {
         // Null values are only allowed if the schema class is null
         if (object == null && schemaClass != null) {
             final String returnString = userKey.getId() + ": cannot encode a null object of class \""
-                            + schemaClass.getCanonicalName() + "\"";
+                            + schemaClass.getName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
index 723aefd..9484130 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -152,7 +153,7 @@ public class AvroSchemaHelper extends AbstractSchemaHelper {
 
     /**
      * Create an instance of a sub type of this type.
-     * 
+     *
      * @param schema the Avro schema of the the type
      * @param subInstanceType the sub type
      * @param foundTypes types we have already found
@@ -188,7 +189,7 @@ public class AvroSchemaHelper extends AbstractSchemaHelper {
 
     /**
      * Instantiate a sub instance of a type.
-     * 
+     *
      * @param subInstanceType the type of the sub instance to create
      * @param subSchema the sub schema we have received
      * @param foundTypes types we have already found
@@ -245,7 +246,7 @@ public class AvroSchemaHelper extends AbstractSchemaHelper {
 
     /**
      * Check that the incoming object is a string, the incoming object must be a string containing Json.
-     * 
+     *
      * @param object incoming object
      * @return object as String
      */
@@ -258,8 +259,8 @@ public class AvroSchemaHelper extends AbstractSchemaHelper {
             }
         } catch (final ClassCastException e) {
             final String returnString = getUserKey().getId() + OBJECT_TAG + object + "\" of type \""
-                            + (object != null ? object.getClass().getCanonicalName() : "null")
-                            + "\" must be assignable to \"" + getSchemaClass().getCanonicalName()
+                            + (object != null ? object.getClass().getName() : "null") + "\" must be assignable to \""
+                            + getSchemaClass().getName()
                             + "\" or be a Json string representation of it for Avro unmarshalling";
             LOGGER.warn(returnString, e);
             throw new ContextRuntimeException(returnString);
@@ -268,7 +269,7 @@ public class AvroSchemaHelper extends AbstractSchemaHelper {
 
     /**
      * Get a string object.
-     * 
+     *
      * @param object the string object
      * @return the string
      */
index 5a8fac4..4f3fe0c 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -29,10 +30,9 @@ import org.onap.policy.apex.context.parameters.SchemaHelperParameters;
  */
 public class AvroSchemaHelperParameters extends SchemaHelperParameters {
     /**
-     * The Default Constructor sets the {@link AvroSchemaHelper} as the schema helper class for Avro
-     * schemas.
+     * The Default Constructor sets the {@link AvroSchemaHelper} as the schema helper class for Avro schemas.
      */
     public AvroSchemaHelperParameters() {
-        this.setSchemaHelperPluginClass(AvroSchemaHelper.class.getCanonicalName());
+        this.setSchemaHelperPluginClass(AvroSchemaHelper.class.getName());
     }
 }
index 46e6c43..f664006 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -86,9 +87,9 @@ public class AvroStringObjectMapper implements AvroObjectMapper {
     public Object mapFromAvro(final Object avroObject) {
         // The Avro object should be a Utf8 object
         if (!(avroObject instanceof Utf8)) {
-            final String returnString =
-                    userKey.getId() + ": object \"" + avroObject + "\" of class \"" + avroObject.getClass()
-                            + "\" cannot be decoded to an object of class \"" + schemaClass.getCanonicalName() + "\"";
+            final String returnString = userKey.getId() + ": object \"" + avroObject + "\" of class \""
+                            + avroObject.getClass() + "\" cannot be decoded to an object of class \""
+                            + schemaClass.getName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
@@ -103,7 +104,7 @@ public class AvroStringObjectMapper implements AvroObjectMapper {
     public Object mapToAvro(final Object object) {
         if (object == null) {
             final String returnString = userKey.getId() + ": cannot encode a null object of class \""
-                    + schemaClass.getCanonicalName() + "\"";
+                            + schemaClass.getName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
index 7fb417c..ee742a8 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -103,7 +104,7 @@ public class AvroSchemaFixedTest {
             fail("Test should throw an exception here");
         } catch (final Exception e) {
             assertEquals("AvroTest:0.0.1: could not create an instance "
-                            + "of class \"org.apache.avro.generic.GenericData.Fixed\" "
+                            + "of class \"org.apache.avro.generic.GenericData$Fixed\" "
                             + "using the default constructor \"Fixed()\"", e.getMessage());
         }
 
index 6d3ebb3..7785739 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -320,7 +321,7 @@ public class AvroSchemaHelperMarshalTest {
             fail("Test should throw an exception here");
         } catch (final Exception e) {
             assertTrue(e.getMessage()
-                            .startsWith("AvroTest:0.0.1: cannot encode a null object of class \"java.lang.Byte[]\""));
+                            .startsWith("AvroTest:0.0.1: cannot encode a null object of class \"[Ljava.lang.Byte;\""));
         }
     }
 }
index a8711e0..fee21ae 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -395,7 +396,7 @@ public class AvroSchemaHelperUnmarshalTest {
             schemaHelper.createNewInstance();
             fail("test should throw an exception here");
         } catch (final Exception e) {
-            assertEquals("AvroTest:0.0.1: could not create an instance of class \"java.lang.Byte[]\" "
+            assertEquals("AvroTest:0.0.1: could not create an instance of class \"[Ljava.lang.Byte;\" "
                             + "using the default constructor \"Byte[]()\"", e.getMessage());
         }
         final byte[] newBytes = (byte[]) schemaHelper.createNewInstance("\"hello\"");
index d23e52f..cbabab3 100644 (file)
@@ -87,7 +87,7 @@ public class ApexJmsConsumer implements MessageListener, ApexEventConsumer, Runn
         // Check and get the JMS Properties
         if (!(consumerParameters.getCarrierTechnologyParameters() instanceof JmsCarrierTechnologyParameters)) {
             final String errorMessage = "specified consumer properties of type \""
-                    + consumerParameters.getCarrierTechnologyParameters().getClass().getCanonicalName()
+                    + consumerParameters.getCarrierTechnologyParameters().getClass().getName()
                     + "\" are not applicable to a JMS consumer";
             LOGGER.warn(errorMessage);
             throw new ApexEventException(errorMessage);
index 4bd7be5..46b503e 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -80,13 +81,13 @@ public class ApexJmsProducer implements ApexEventProducer {
      */
     @Override
     public void init(final String producerName, final EventHandlerParameters producerParameters)
-            throws ApexEventException {
+                    throws ApexEventException {
         this.name = producerName;
 
         // Check and get the JMS Properties
         if (!(producerParameters.getCarrierTechnologyParameters() instanceof JmsCarrierTechnologyParameters)) {
-            final String errorMessage =
-                    "specified producer properties are not applicable to a JMS producer (" + this.name + ")";
+            final String errorMessage = "specified producer properties are not applicable to a JMS producer ("
+                            + this.name + ")";
             LOGGER.warn(errorMessage);
             throw new ApexEventException(errorMessage);
         }
@@ -102,13 +103,13 @@ public class ApexJmsProducer implements ApexEventProducer {
             // Check if we actually got a connection factory
             if (connectionFactory == null) {
                 throw new IllegalArgumentException(
-                        "JMS context lookup of \"" + jmsProducerProperties.getConnectionFactory()
-                                + "\" returned null for producer (" + this.name + ")");
+                                "JMS context lookup of \"" + jmsProducerProperties.getConnectionFactory()
+                                                + "\" returned null for producer (" + this.name + ")");
             }
         } catch (final Exception e) {
             final String errorMessage = "lookup of JMS connection factory  \""
-                    + jmsProducerProperties.getConnectionFactory() + "\" failed for JMS producer properties \""
-                    + jmsProducerProperties.getJmsConsumerProperties() + FOR_PRODUCER_TAG + this.name + ")";
+                            + jmsProducerProperties.getConnectionFactory() + "\" failed for JMS producer properties \""
+                            + jmsProducerProperties.getJmsConsumerProperties() + FOR_PRODUCER_TAG + this.name + ")";
             LOGGER.warn(errorMessage, e);
             throw new ApexEventException(errorMessage, e);
         }
@@ -121,12 +122,12 @@ public class ApexJmsProducer implements ApexEventProducer {
             // Check if we actually got a topic
             if (jmsOutgoingTopic == null) {
                 throw new IllegalArgumentException("JMS context lookup of \"" + jmsProducerProperties.getProducerTopic()
-                        + "\" returned null for producer (" + this.name + ")");
+                                + "\" returned null for producer (" + this.name + ")");
             }
         } catch (final Exception e) {
             final String errorMessage = "lookup of JMS topic  \"" + jmsProducerProperties.getProducerTopic()
-                    + "\" failed for JMS producer properties \"" + jmsProducerProperties.getJmsProducerProperties()
-                    + FOR_PRODUCER_TAG + this.name + ")";
+                            + "\" failed for JMS producer properties \""
+                            + jmsProducerProperties.getJmsProducerProperties() + FOR_PRODUCER_TAG + this.name + ")";
             LOGGER.warn(errorMessage, e);
             throw new ApexEventException(errorMessage, e);
         }
@@ -134,11 +135,11 @@ public class ApexJmsProducer implements ApexEventProducer {
         // Create and start a connection to the JMS server
         try {
             connection = connectionFactory.createConnection(jmsProducerProperties.getSecurityPrincipal(),
-                    jmsProducerProperties.getSecurityCredentials());
+                            jmsProducerProperties.getSecurityCredentials());
             connection.start();
         } catch (final Exception e) {
             final String errorMessage = "connection to JMS server failed for JMS properties \""
-                    + jmsProducerProperties.getJmsConsumerProperties() + FOR_PRODUCER_TAG + this.name + ")";
+                            + jmsProducerProperties.getJmsConsumerProperties() + FOR_PRODUCER_TAG + this.name + ")";
             LOGGER.warn(errorMessage, e);
             throw new ApexEventException(errorMessage, e);
         }
@@ -148,7 +149,7 @@ public class ApexJmsProducer implements ApexEventProducer {
             jmsSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         } catch (final Exception e) {
             final String errorMessage = "creation of session to JMS server failed for JMS properties \""
-                    + jmsProducerProperties.getJmsConsumerProperties() + FOR_PRODUCER_TAG + this.name + ")";
+                            + jmsProducerProperties.getJmsConsumerProperties() + FOR_PRODUCER_TAG + this.name + ")";
             LOGGER.warn(errorMessage, e);
             throw new ApexEventException(errorMessage, e);
         }
@@ -157,8 +158,8 @@ public class ApexJmsProducer implements ApexEventProducer {
         try {
             messageProducer = jmsSession.createProducer(jmsOutgoingTopic);
         } catch (final Exception e) {
-            final String errorMessage =
-                    "creation of producer for sending events " + "to JMS server failed for JMS properties \""
+            final String errorMessage = "creation of producer for sending events "
+                            + "to JMS server failed for JMS properties \""
                             + jmsProducerProperties.getJmsConsumerProperties() + "\"";
             LOGGER.warn(errorMessage, e);
             throw new ApexEventException(errorMessage, e);
@@ -194,10 +195,10 @@ public class ApexJmsProducer implements ApexEventProducer {
      */
     @Override
     public void sendEvent(final long executionId, final Properties executionProperties, final String eventname,
-            final Object eventObject) {
+                    final Object eventObject) {
         // Check if this is a synchronized event, if so we have received a reply
-        final SynchronousEventCache synchronousEventCache =
-                (SynchronousEventCache) peerReferenceMap.get(EventHandlerPeeredMode.SYNCHRONOUS);
+        final SynchronousEventCache synchronousEventCache = (SynchronousEventCache) peerReferenceMap
+                        .get(EventHandlerPeeredMode.SYNCHRONOUS);
         if (synchronousEventCache != null) {
             synchronousEventCache.removeCachedEventToApexIfExists(executionId);
         }
@@ -205,7 +206,7 @@ public class ApexJmsProducer implements ApexEventProducer {
         // Check if the object to be sent is serializable
         if (!Serializable.class.isAssignableFrom(eventObject.getClass())) {
             final String errorMessage = COULD_NOT_SEND_PREFIX + eventname + JMS_MESSAGE_PRODUCER_TAG + this.name
-                    + ", object of type \"" + eventObject.getClass().getCanonicalName() + "\" is not serializable";
+                            + ", object of type \"" + eventObject.getClass().getName() + "\" is not serializable";
             LOGGER.warn(errorMessage);
             throw new ApexEventRuntimeException(errorMessage);
         }
@@ -220,7 +221,7 @@ public class ApexJmsProducer implements ApexEventProducer {
                 jmsMessage = jmsSession.createObjectMessage((Serializable) eventObject);
             } catch (final Exception e) {
                 final String errorMessage = COULD_NOT_SEND_PREFIX + eventname + JMS_MESSAGE_PRODUCER_TAG + this.name
-                        + ", could not create JMS Object Message for object \"" + eventObject;
+                                + ", could not create JMS Object Message for object \"" + eventObject;
                 LOGGER.warn(errorMessage, e);
                 throw new ApexEventRuntimeException(errorMessage);
             }
@@ -230,7 +231,7 @@ public class ApexJmsProducer implements ApexEventProducer {
                 jmsMessage = jmsSession.createTextMessage(eventObject.toString());
             } catch (final Exception e) {
                 final String errorMessage = COULD_NOT_SEND_PREFIX + eventname + JMS_MESSAGE_PRODUCER_TAG + this.name
-                        + ", could not create JMS Text Message for object \"" + eventObject;
+                                + ", could not create JMS Text Message for object \"" + eventObject;
                 LOGGER.warn(errorMessage, e);
                 throw new ApexEventRuntimeException(errorMessage);
             }
@@ -240,7 +241,7 @@ public class ApexJmsProducer implements ApexEventProducer {
             messageProducer.send(jmsMessage);
         } catch (final Exception e) {
             final String errorMessage = COULD_NOT_SEND_PREFIX + eventname + JMS_MESSAGE_PRODUCER_TAG + this.name
-                    + ", send failed for object \"" + eventObject;
+                            + ", send failed for object \"" + eventObject;
             LOGGER.warn(errorMessage, e);
             throw new ApexEventRuntimeException(errorMessage);
         }
index 17738f1..a99258a 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -71,28 +72,28 @@ public class ApexKafkaConsumer implements ApexEventConsumer, Runnable {
      */
     @Override
     public void init(final String consumerName, final EventHandlerParameters consumerParameters,
-            final ApexEventReceiver incomingEventReceiver) throws ApexEventException {
+                    final ApexEventReceiver incomingEventReceiver) throws ApexEventException {
         this.eventReceiver = incomingEventReceiver;
         this.name = consumerName;
 
         // Check and get the Kafka Properties
         if (!(consumerParameters.getCarrierTechnologyParameters() instanceof KafkaCarrierTechnologyParameters)) {
             LOGGER.warn("specified consumer properties of type \""
-                    + consumerParameters.getCarrierTechnologyParameters().getClass().getCanonicalName()
-                    + "\" are not applicable to a Kafka consumer");
+                            + consumerParameters.getCarrierTechnologyParameters().getClass().getName()
+                            + "\" are not applicable to a Kafka consumer");
             throw new ApexEventException("specified consumer properties of type \""
-                    + consumerParameters.getCarrierTechnologyParameters().getClass().getCanonicalName()
-                    + "\" are not applicable to a Kafka consumer");
+                            + consumerParameters.getCarrierTechnologyParameters().getClass().getName()
+                            + "\" are not applicable to a Kafka consumer");
         }
-        kafkaConsumerProperties =
-                (KafkaCarrierTechnologyParameters) consumerParameters.getCarrierTechnologyParameters();
+        kafkaConsumerProperties = (KafkaCarrierTechnologyParameters) consumerParameters
+                        .getCarrierTechnologyParameters();
 
         // Kick off the Kafka consumer
         kafkaConsumer = new KafkaConsumer<>(kafkaConsumerProperties.getKafkaConsumerProperties());
         kafkaConsumer.subscribe(kafkaConsumerProperties.getConsumerTopicListAsCollection());
         if (LOGGER.isDebugEnabled()) {
             LOGGER.debug("event receiver for " + this.getClass().getName() + ":" + this.name + " subscribed to topics: "
-                    + kafkaConsumerProperties.getConsumerTopicList());
+                            + kafkaConsumerProperties.getConsumerTopicList());
         }
     }
 
@@ -142,14 +143,14 @@ public class ApexKafkaConsumer implements ApexEventConsumer, Runnable {
         kafkaConsumer.subscribe(kafkaConsumerProperties.getConsumerTopicListAsCollection());
         if (LOGGER.isDebugEnabled()) {
             LOGGER.debug("event receiver for " + this.getClass().getName() + ":" + this.name + " subscribed to topics: "
-                    + kafkaConsumerProperties.getConsumerTopicList());
+                            + kafkaConsumerProperties.getConsumerTopicList());
         }
 
         // The endless loop that receives events over Kafka
         while (consumerThread.isAlive() && !stopOrderedFlag) {
             try {
-                final ConsumerRecords<String, String> records =
-                        kafkaConsumer.poll(kafkaConsumerProperties.getConsumerPollDuration());
+                final ConsumerRecords<String, String> records = kafkaConsumer
+                                .poll(kafkaConsumerProperties.getConsumerPollDuration());
                 for (final ConsumerRecord<String, String> record : records) {
                     traceIfTraceEnabled(record);
                     eventReceiver.receiveEvent(new Properties(), record.value());
@@ -172,7 +173,7 @@ public class ApexKafkaConsumer implements ApexEventConsumer, Runnable {
     private void traceIfTraceEnabled(final ConsumerRecord<String, String> record) {
         if (LOGGER.isTraceEnabled()) {
             LOGGER.trace("event received for {} for forwarding to Apex engine : {} {}",
-                    this.getClass().getName() + ":" + this.name, record.key(), record.value());
+                            this.getClass().getName() + ":" + this.name, record.key(), record.value());
         }
     }
 
index 81aa1a7..e66ff60 100644 (file)
@@ -77,11 +77,11 @@ public class RestRequestorCarrierTechnologyParameters extends CarrierTechnologyP
 
     /** The producer plugin class for the REST carrier technology. */
     public static final String RESTREQUSTOR_EVENT_PRODUCER_PLUGIN_CLASS =
-            ApexRestRequestorProducer.class.getCanonicalName();
+            ApexRestRequestorProducer.class.getName();
 
     /** The consumer plugin class for the REST carrier technology. */
     public static final String RESTREQUSTOR_EVENT_CONSUMER_PLUGIN_CLASS =
-            ApexRestRequestorConsumer.class.getCanonicalName();
+            ApexRestRequestorConsumer.class.getName();
 
     /** The default HTTP method for request events. */
     public static final HttpMethod DEFAULT_REQUESTOR_HTTP_METHOD = HttpMethod.GET;
index fe11cdc..958a25d 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,7 +61,7 @@ public final class Apex2JmsObjectEventConverter implements ApexEventProtocolConv
         // on both sides of Apex
         if (!(parameters instanceof JmsObjectEventProtocolParameters)) {
             final String errormessage = "specified Event Protocol Parameters properties of type \""
-                            + parameters.getClass().getCanonicalName() + "\" are not applicable to a "
+                            + parameters.getClass().getName() + "\" are not applicable to a "
                             + Apex2JmsObjectEventConverter.class.getName() + " converter";
             LOGGER.error(errormessage);
         } else {
index 17c5359..d4c2519 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -270,7 +271,7 @@ public class Apex2YamlEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Get the event header name space.
-     * 
+     *
      * @param yamlMap the YAML map to read from
      * @param eventDefinition the event definition
      * @return the event header name space
@@ -293,7 +294,7 @@ public class Apex2YamlEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Get the event header source.
-     * 
+     *
      * @param yamlMap the YAML map to read from
      * @param eventDefinition the event definition
      * @return the event header source
@@ -310,7 +311,7 @@ public class Apex2YamlEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Get the event header target.
-     * 
+     *
      * @param yamlMap the YAML map to read from
      * @param eventDefinition the event definition
      * @return the event header target
@@ -349,7 +350,7 @@ public class Apex2YamlEventConverter implements ApexEventProtocolConverter {
         if (!(yamlField instanceof String)) {
             // The element is not a string so throw an error
             throw new ApexEventRuntimeException("field \"" + fieldName + "\" with type \""
-                            + yamlField.getClass().getCanonicalName() + "\" is not a string value");
+                            + yamlField.getClass().getName() + "\" is not a string value");
         }
 
         final String fieldValueString = (String) yamlField;
index 5c44f2d..30a44e0 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -40,13 +41,12 @@ public class EventConsumerFactory {
      * Create an event consumer of the required type for the specified consumer technology.
      *
      * @param name the name of the consumer
-     * @param consumerParameters The parameters for the Apex engine, we use the technology type of
-     *        the required consumer
+     * @param consumerParameters The parameters for the Apex engine, we use the technology type of the required consumer
      * @return the event consumer
      * @throws ApexEventException on errors creating the Apex event consumer
      */
     public ApexEventConsumer createConsumer(final String name, final EventHandlerParameters consumerParameters)
-            throws ApexEventException {
+                    throws ApexEventException {
         // Get the carrier technology parameters
         final CarrierTechnologyParameters technologyParameters = consumerParameters.getCarrierTechnologyParameters();
 
@@ -57,8 +57,8 @@ public class EventConsumerFactory {
             consumerPluginObject = Class.forName(consumerPluginClass).newInstance();
         } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
             final String errorMessage = "could not create an Apex event consumer for \"" + name
-                    + "\" for the carrier technology \"" + technologyParameters.getLabel()
-                    + "\", specified event consumer plugin class \"" + consumerPluginClass + "\" not found";
+                            + "\" for the carrier technology \"" + technologyParameters.getLabel()
+                            + "\", specified event consumer plugin class \"" + consumerPluginClass + "\" not found";
             LOGGER.error(errorMessage, e);
             throw new ApexEventException(errorMessage, e);
         }
@@ -66,9 +66,9 @@ public class EventConsumerFactory {
         // Check the class is an event consumer
         if (!(consumerPluginObject instanceof ApexEventConsumer)) {
             final String errorMessage = "could not create an Apex event consumer \"" + name
-                    + "\" for the carrier technology \"" + technologyParameters.getLabel()
-                    + "\", specified event consumer plugin class \"" + consumerPluginClass
-                    + "\" is not an instance of \"" + ApexEventConsumer.class.getCanonicalName() + "\"";
+                            + "\" for the carrier technology \"" + technologyParameters.getLabel()
+                            + "\", specified event consumer plugin class \"" + consumerPluginClass
+                            + "\" is not an instance of \"" + ApexEventConsumer.class.getName() + "\"";
             LOGGER.error(errorMessage);
             throw new ApexEventException(errorMessage);
         }
index 727f779..349a6e3 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -45,7 +46,7 @@ public class EventProducerFactory {
      * @throws ApexEventException on errors creating the Apex event producer
      */
     public ApexEventProducer createProducer(final String name, final EventHandlerParameters producerParameters)
-            throws ApexEventException {
+                    throws ApexEventException {
         // Get the carrier technology parameters
         final CarrierTechnologyParameters technologyParameters = producerParameters.getCarrierTechnologyParameters();
 
@@ -56,8 +57,8 @@ public class EventProducerFactory {
             producerPluginObject = Class.forName(producerPluginClass).newInstance();
         } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
             final String errorMessage = "could not create an Apex event producer for Producer \"" + name
-                    + "\" for the carrier technology \"" + technologyParameters.getLabel()
-                    + "\", specified event producer plugin class \"" + producerPluginClass + "\" not found";
+                            + "\" for the carrier technology \"" + technologyParameters.getLabel()
+                            + "\", specified event producer plugin class \"" + producerPluginClass + "\" not found";
             LOGGER.error(errorMessage, e);
             throw new ApexEventException(errorMessage, e);
         }
@@ -65,9 +66,9 @@ public class EventProducerFactory {
         // Check the class is an event producer
         if (!(producerPluginObject instanceof ApexEventProducer)) {
             final String errorMessage = "could not create an Apex event producer for Producer \"" + name
-                    + "\" for the carrier technology \"" + technologyParameters.getLabel()
-                    + "\", specified event producer plugin class \"" + producerPluginClass
-                    + "\" is not an instance of \"" + ApexEventProducer.class.getCanonicalName() + "\"";
+                            + "\" for the carrier technology \"" + technologyParameters.getLabel()
+                            + "\", specified event producer plugin class \"" + producerPluginClass
+                            + "\" is not an instance of \"" + ApexEventProducer.class.getName() + "\"";
             LOGGER.error(errorMessage);
             throw new ApexEventException(errorMessage);
         }
index 85c5bf0..b2a6f47 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -27,8 +28,8 @@ import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
 /**
- * This factory class uses the Apex event protocol parameters to create and return an instance of
- * the correct Apex event protocol converter plugin for the specified event protocol.
+ * This factory class uses the Apex event protocol parameters to create and return an instance of the correct Apex event
+ * protocol converter plugin for the specified event protocol.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -37,16 +38,15 @@ public class EventProtocolFactory {
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(EventProtocolFactory.class);
 
     /**
-     * Create an event converter that converts between an
-     * {@link org.onap.policy.apex.service.engine.event.ApexEvent} and the specified event protocol.
+     * Create an event converter that converts between an {@link org.onap.policy.apex.service.engine.event.ApexEvent}
+     * and the specified event protocol.
      *
      * @param name the name of the event protocol
-     * @param eventProtocolParameters the event protocol parameters defining what to convert from
-     *        and to
+     * @param eventProtocolParameters the event protocol parameters defining what to convert from and to
      * @return The event converter for converting events to and from Apex format
      */
     public ApexEventProtocolConverter createConverter(final String name,
-            final EventProtocolParameters eventProtocolParameters) {
+                    final EventProtocolParameters eventProtocolParameters) {
         // Get the class for the event protocol plugin using reflection
         final String eventProtocolPluginClass = eventProtocolParameters.getEventProtocolPluginClass();
         Object eventProtocolPluginObject = null;
@@ -54,9 +54,9 @@ public class EventProtocolFactory {
             eventProtocolPluginObject = Class.forName(eventProtocolPluginClass).newInstance();
         } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
             final String errorMessage = "could not create an Apex event protocol converter for \"" + name
-                    + "\" for the protocol \"" + eventProtocolParameters.getLabel()
-                    + "\", specified event protocol converter plugin class \"" + eventProtocolPluginClass
-                    + "\" not found";
+                            + "\" for the protocol \"" + eventProtocolParameters.getLabel()
+                            + "\", specified event protocol converter plugin class \"" + eventProtocolPluginClass
+                            + "\" not found";
             LOGGER.error(errorMessage, e);
             throw new ApexEventRuntimeException(errorMessage, e);
         }
@@ -64,9 +64,9 @@ public class EventProtocolFactory {
         // Check the class is an event consumer
         if (!(eventProtocolPluginObject instanceof ApexEventProtocolConverter)) {
             final String errorMessage = "could not create an Apex event protocol converter for \"" + name
-                    + "\" for the protocol \"" + eventProtocolParameters.getLabel()
-                    + "\", specified event protocol converter plugin class \"" + eventProtocolPluginClass
-                    + "\" is not an instance of \"" + ApexEventProtocolConverter.class.getCanonicalName() + "\"";
+                            + "\" for the protocol \"" + eventProtocolParameters.getLabel()
+                            + "\", specified event protocol converter plugin class \"" + eventProtocolPluginClass
+                            + "\" is not an instance of \"" + ApexEventProtocolConverter.class.getName() + "\"";
             LOGGER.error(errorMessage);
             throw new ApexEventRuntimeException(errorMessage);
         }
index b1c62b2..ad05080 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -124,7 +125,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Decode a list of Apex events.
-     * 
+     *
      * @param eventName the name of the incoming events
      * @param jsonEventString the JSON representation of the event list
      * @param decodedJsonObject The JSON list object
@@ -175,10 +176,9 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
         }
     }
 
-    /**
     /**
      * Serialise an Apex event to a JSON string field by field.
-     * 
+     *
      * @param apexEvent the event to Serialise
      * @return the Serialise event as JSON
      * @throws ApexEventException exceptions on marshaling to JSON
@@ -207,8 +207,8 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
 
             if (!apexEvent.containsKey(fieldName)) {
                 if (!eventField.getOptional()) {
-                    final String errorMessage = ERROR_CODING + eventDefinition.getId() + " event to Json. "
-                                    + "Field \"" + fieldName + "\" is missing, but is mandatory. Fields: " + apexEvent;
+                    final String errorMessage = ERROR_CODING + eventDefinition.getId() + " event to Json. " + "Field \""
+                                    + fieldName + "\" is missing, but is mandatory. Fields: " + apexEvent;
                     LOGGER.debug(errorMessage);
                     throw new ApexEventRuntimeException(errorMessage);
                 }
@@ -229,7 +229,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Serialise an Apex event to a JSON string as a single POJO.
-     * 
+     *
      * @param apexEvent the event to Serialise
      * @return the Serialise event as JSON
      * @throws ApexEventException exceptions on marshaling to JSON
@@ -268,7 +268,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
         // Get the schema helper
         final SchemaHelper fieldSchemaHelper = new SchemaHelperFactory()
                         .createSchemaHelper(pojoFieldDefinition.getKey(), pojoFieldDefinition.getSchema());
-        
+
         return fieldSchemaHelper.marshal2String(fieldValue);
     }
 
@@ -322,7 +322,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Decode an Apex event field by field.
-     * 
+     *
      * @param jsonObject the JSON representation of the event
      * @param apexEvent the incoming event header
      * @param eventDefinition the definition of the event from the model
@@ -358,7 +358,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Decode an Apex event as a single POJO.
-     * 
+     *
      * @param jsonObject the JSON representation of the event
      * @param apexEvent the incoming event header
      * @param eventDefinition the definition of the event from the model
@@ -439,7 +439,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Determine the name field of the event header.
-     * 
+     *
      * @param jsonObject the event in JSON format
      * @param parameterEventName the configured event name from the parameters
      * @return the event name to use on the event header
@@ -468,7 +468,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Determine the version field of the event header.
-     * 
+     *
      * @param jsonObject the event in JSON format
      * @return the event version
      */
@@ -481,7 +481,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Determine the name space field of the event header.
-     * 
+     *
      * @param jsonObject the event in JSON format
      * @param eventName the name of the event
      * @param eventDefinition the definition of the event structure
@@ -505,7 +505,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Determine the source field of the event header.
-     * 
+     *
      * @param jsonObject the event in JSON format
      * @param eventDefinition the definition of the event structure
      * @return the event version
@@ -522,7 +522,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
 
     /**
      * Determine the target field of the event header.
-     * 
+     *
      * @param jsonObject the event in JSON format
      * @param eventDefinition the definition of the event structure
      * @return the event version
@@ -565,7 +565,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter {
         } catch (final Exception e) {
             // The element is not a string so throw an error
             throw new ApexEventRuntimeException("field \"" + fieldName + "\" with type \""
-                            + jsonField.getClass().getCanonicalName() + "\" is not a string value", e);
+                            + jsonField.getClass().getName() + "\" is not a string value", e);
         }
 
         // Is regular expression checking required
index 902322c..1b8daca 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -266,8 +267,8 @@ public class EngineServiceParametersJsonAdapter
             parameters = context.deserialize(parametersObject, Class.forName(parameterClassName));
         } catch (JsonParseException | ClassNotFoundException e) {
             final String returnMessage = "failed to deserialize the parameters for \"" + parametersLabel + "\" "
-                            + "to parameter class \"" + parameterClassName + "\"\n" + e.getClass().getCanonicalName()
-                            + ": " + e.getMessage();
+                            + "to parameter class \"" + parameterClassName + "\"\n" + e.getClass().getName() + ": "
+                            + e.getMessage();
             LOGGER.error(returnMessage, e);
             throw new ParameterRuntimeException(returnMessage, e);
         }
index a188901..a87f942 100644 (file)
@@ -80,7 +80,7 @@ public class SuperDooperEventProducer implements ApexEventProducer {
     @Override
     public void sendEvent(final long executionId, final Properties executionProperties, final String eventName,
             final Object event) {
-        LOGGER.info("Sending Event: " + this.getClass().getCanonicalName() + ":" + this.name + " ... event ("
+        LOGGER.info("Sending Event: " + this.getClass().getName() + ":" + this.name + " ... event ("
                 + eventName + ") : " + event);
     }
 
index 6c5d551..c945480 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -35,13 +36,14 @@ public class SuperDooperEventSubscriber implements ApexEventConsumer {
 
     private String name;
 
-    public SuperDooperEventSubscriber() {}
+    public SuperDooperEventSubscriber() {
+    }
 
     @Override
     public void init(final String name, final EventHandlerParameters consumerParameters,
-            final ApexEventReceiver apexEventReceiver) throws ApexEventException {
+                    final ApexEventReceiver apexEventReceiver) throws ApexEventException {
         this.name = name;
-        LOGGER.info("Initialising Apex Consumer: " + this.getClass().getCanonicalName() + ":" + this.name);
+        LOGGER.info("Initialising Apex Consumer: " + this.getClass().getName() + ":" + this.name);
     }
 
     @Override
@@ -61,7 +63,8 @@ public class SuperDooperEventSubscriber implements ApexEventConsumer {
      * {@inheritDoc}.
      */
     @Override
-    public void setPeeredReference(final EventHandlerPeeredMode peeredMode, final PeeredReference peeredReference) {}
+    public void setPeeredReference(final EventHandlerPeeredMode peeredMode, final PeeredReference peeredReference) {
+    }
 
     @Override
     public void start() {
@@ -70,6 +73,7 @@ public class SuperDooperEventSubscriber implements ApexEventConsumer {
     }
 
     @Override
-    public void stop() {}
+    public void stop() {
+    }
 
 }
index 8eb8857..d7aba2d 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 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=========================================================
  */
@@ -49,21 +50,21 @@ public final class SampleDomainModelSaver {
      */
     public static void main(final String[] args) throws ApexException {
         if (args.length != 1) {
-            LOGGER.error("usage: " + SampleDomainModelSaver.class.getCanonicalName() + " modelDirectory");
+            LOGGER.error("usage: " + SampleDomainModelSaver.class.getName() + " modelDirectory");
             return;
         }
 
         // Save Java model
         final AxPolicyModel javaPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JAVA");
-        final ApexModelSaver<AxPolicyModel> javaModelSaver = new ApexModelSaver<>(AxPolicyModel.class,
-                        javaPolicyModel, args[0]);
+        final ApexModelSaver<AxPolicyModel> javaModelSaver = new ApexModelSaver<>(AxPolicyModel.class, javaPolicyModel,
+                        args[0]);
         javaModelSaver.apexModelWriteJson();
         javaModelSaver.apexModelWriteXml();
 
         // Save Javascript model
         final AxPolicyModel javascriptPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JAVASCRIPT");
-        final ApexModelSaver<AxPolicyModel> javascriptModelSaver = new ApexModelSaver<>(
-                        AxPolicyModel.class, javascriptPolicyModel, args[0]);
+        final ApexModelSaver<AxPolicyModel> javascriptModelSaver = new ApexModelSaver<>(AxPolicyModel.class,
+                        javascriptPolicyModel, args[0]);
         javascriptModelSaver.apexModelWriteJson();
         javascriptModelSaver.apexModelWriteXml();
 
@@ -83,8 +84,8 @@ public final class SampleDomainModelSaver {
 
         // Save MVEL model
         final AxPolicyModel mvelPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("MVEL");
-        final ApexModelSaver<AxPolicyModel> mvelModelSaver = new ApexModelSaver<>(AxPolicyModel.class,
-                        mvelPolicyModel, args[0]);
+        final ApexModelSaver<AxPolicyModel> mvelModelSaver = new ApexModelSaver<>(AxPolicyModel.class, mvelPolicyModel,
+                        args[0]);
         mvelModelSaver.apexModelWriteJson();
         mvelModelSaver.apexModelWriteXml();
     }
index 7367b02..3baa147 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -120,8 +121,7 @@ public class JmsEventProducer implements Runnable {
      */
     private void sendEventsToTopic(final Session jmsSession, final MessageProducer jmsProducer) throws JMSException {
 
-        LOGGER.debug("{} : sending events to JMS server, event count {}", this.getClass().getCanonicalName(),
-                        eventCount);
+        LOGGER.debug("{} : sending events to JMS server, event count {}", this.getClass().getName(), eventCount);
 
         for (int i = 0; i < eventCount; i++) {
             ThreadUtilities.sleep(eventInterval);
@@ -135,7 +135,7 @@ public class JmsEventProducer implements Runnable {
             jmsProducer.send(jmsMessage);
             eventsSentCount++;
         }
-        LOGGER.debug("{} : completed, number of events sent", this.getClass().getCanonicalName(), eventsSentCount);
+        LOGGER.debug("{} : completed, number of events sent", this.getClass().getName(), eventsSentCount);
     }
 
     /**
@@ -151,13 +151,13 @@ public class JmsEventProducer implements Runnable {
      * Shutdown.
      */
     public void shutdown() {
-        LOGGER.debug("{} : stopping", this.getClass().getCanonicalName());
+        LOGGER.debug("{} : stopping", this.getClass().getName());
         stopFlag = true;
 
         while (producerThread.isAlive()) {
             ThreadUtilities.sleep(10);
         }
-        LOGGER.debug("{} : stopped", this.getClass().getCanonicalName());
+        LOGGER.debug("{} : stopped", this.getClass().getName());
     }
 
 }
index 2fd1746..5140d71 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -94,7 +95,7 @@ public class JmsEventSubscriber implements Runnable {
                         ((TextMessage) message).getText();
                     } else {
                         throw new ApexEventException("unknowm message \"" + message + "\" of type \""
-                                        + message.getClass().getCanonicalName() + "\" received");
+                                        + message.getClass().getName() + "\" received");
                     }
                     eventsReceivedCount++;
                 } catch (final Exception e) {
@@ -106,7 +107,7 @@ public class JmsEventSubscriber implements Runnable {
             throw new ApexEventRuntimeException("JMS event consumption failed", e);
         }
 
-        LOGGER.debug("{} : event reception completed", this.getClass().getCanonicalName());
+        LOGGER.debug("{} : event reception completed", this.getClass().getName());
     }
 
     /**
@@ -131,7 +132,7 @@ public class JmsEventSubscriber implements Runnable {
         }
 
         connection.close();
-        LOGGER.debug("{} : stopped", this.getClass().getCanonicalName());
+        LOGGER.debug("{} : stopped", this.getClass().getName());
     }
 
 }
index e0f5c23..c214b72 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -107,11 +108,11 @@ public class KafkaEventProducer implements Runnable {
      */
     private void sendEventsToTopic(final Producer<String, String> producer) {
         LOGGER.debug("{} : sending events to Kafka server, event count {}, xmlEvents {}",
-                        KafkaEventProducer.class.getCanonicalName(), eventCount, xmlEvents);
+                        KafkaEventProducer.class.getName(), eventCount, xmlEvents);
 
         for (int i = 0; i < eventCount; i++) {
-            LOGGER.debug("{} : waiting {} milliseconds before sending next event",
-                            KafkaEventProducer.class.getCanonicalName(), eventInterval);
+            LOGGER.debug("{} : waiting {} milliseconds before sending next event", KafkaEventProducer.class.getName(),
+                            eventInterval);
             ThreadUtilities.sleep(eventInterval);
 
             String eventString = null;
@@ -125,7 +126,7 @@ public class KafkaEventProducer implements Runnable {
             eventsSentCount++;
             LOGGER.debug("****** Sent event No. {} ******", eventsSentCount);
         }
-        LOGGER.debug("{}: completed", KafkaEventProducer.class.getCanonicalName());
+        LOGGER.debug("{}: completed", KafkaEventProducer.class.getName());
     }
 
     /**
@@ -141,7 +142,7 @@ public class KafkaEventProducer implements Runnable {
      * Shutdown.
      */
     public void shutdown() {
-        LOGGER.debug("{} : stopping", KafkaEventProducer.class.getCanonicalName());
+        LOGGER.debug("{} : stopping", KafkaEventProducer.class.getName());
 
         stopFlag = true;
 
@@ -149,6 +150,6 @@ public class KafkaEventProducer implements Runnable {
             ThreadUtilities.sleep(10);
         }
 
-        LOGGER.debug("{} : stopped", KafkaEventProducer.class.getCanonicalName());
+        LOGGER.debug("{} : stopped", KafkaEventProducer.class.getName());
     }
 }
index da2cc33..1bb2e80 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -80,8 +81,8 @@ public class KafkaEventSubscriber implements Runnable {
      */
     @Override
     public void run() {
-        LOGGER.debug("{}: receiving events from Kafka server  on topic {}",
-                        KafkaEventSubscriber.class.getCanonicalName(), topic);
+        LOGGER.debug("{}: receiving events from Kafka server  on topic {}", KafkaEventSubscriber.class.getName(),
+                        topic);
 
         while (subscriberThread.isAlive() && !subscriberThread.isInterrupted()) {
             try {
@@ -97,7 +98,7 @@ public class KafkaEventSubscriber implements Runnable {
             }
         }
 
-        LOGGER.debug("{}: event reception completed", KafkaEventSubscriber.class.getCanonicalName());
+        LOGGER.debug("{}: event reception completed", KafkaEventSubscriber.class.getName());
     }
 
     /**
@@ -120,6 +121,6 @@ public class KafkaEventSubscriber implements Runnable {
         }
 
         consumer.close();
-        LOGGER.debug("{} : stopped", KafkaEventSubscriber.class.getCanonicalName());
+        LOGGER.debug("{} : stopped", KafkaEventSubscriber.class.getName());
     }
 }
index 023ff99..ffb8f1e 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -64,8 +65,8 @@ public class WebSocketEventProducerClient implements WsStringMessageListener {
         client = new WsStringMessageClient(host, port);
         client.start(this);
 
-        LOGGER.debug("{}: host {}, port {}, event count {}, xmlEvents {}",
-                        WebSocketEventProducerClient.class.getCanonicalName(), host, port, eventCount, xmlEvents);
+        LOGGER.debug("{}: host {}, port {}, event count {}, xmlEvents {}", WebSocketEventProducerClient.class.getName(),
+                        host, port, eventCount, xmlEvents);
     }
 
     /**
@@ -73,11 +74,11 @@ public class WebSocketEventProducerClient implements WsStringMessageListener {
      */
     public void sendEvents() {
         LOGGER.debug("{}: sending events on host {}, port {}, event count {}, xmlEvents {}",
-                        WebSocketEventProducerClient.class.getCanonicalName(), host, port, eventCount, xmlEvents);
+                        WebSocketEventProducerClient.class.getName(), host, port, eventCount, xmlEvents);
 
         for (int i = 0; i < eventCount; i++) {
             LOGGER.debug("{}: waiting {} milliseconds before sending next event",
-                            WebSocketEventProducerClient.class.getCanonicalName(), eventInterval);
+                            WebSocketEventProducerClient.class.getName(), eventInterval);
             ThreadUtilities.sleep(eventInterval);
 
             String eventString = null;
@@ -88,10 +89,10 @@ public class WebSocketEventProducerClient implements WsStringMessageListener {
             }
             client.sendString(eventString);
             eventsSentCount++;
-            LOGGER.debug("{}:  host {}, port {}, sent event {}", WebSocketEventProducerClient.class.getCanonicalName(),
-                            host, port, eventString);
+            LOGGER.debug("{}:  host {}, port {}, sent event {}", WebSocketEventProducerClient.class.getName(), host,
+                            port, eventString);
         }
-        LOGGER.debug("{}: completed", WebSocketEventProducerClient.class.getCanonicalName());
+        LOGGER.debug("{}: completed", WebSocketEventProducerClient.class.getName());
     }
 
     /**
@@ -108,7 +109,7 @@ public class WebSocketEventProducerClient implements WsStringMessageListener {
      */
     public void shutdown() {
         client.stop();
-        LOGGER.debug("{}: stopped", WebSocketEventProducerClient.class.getCanonicalName());
+        LOGGER.debug("{}: stopped", WebSocketEventProducerClient.class.getName());
     }
 
     /**
@@ -116,8 +117,8 @@ public class WebSocketEventProducerClient implements WsStringMessageListener {
      */
     @Override
     public void receiveString(final String eventString) {
-        LOGGER.debug("{}:  host {}, port {}, received event {}", WebSocketEventProducerServer.class.getCanonicalName(),
-                        host, port, eventString);
+        LOGGER.debug("{}:  host {}, port {}, received event {}", WebSocketEventProducerServer.class.getName(), host,
+                        port, eventString);
     }
 
     /**
index 11438d9..ec3112c 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -61,8 +62,8 @@ public class WebSocketEventProducerServer implements WsStringMessageListener {
         server = new WsStringMessageServer(port);
         server.start(this);
 
-        LOGGER.debug("{}: port {}, event count {}, xmlEvents {}", WebSocketEventProducerServer.class.getCanonicalName(),
-                        port, eventCount, xmlEvents);
+        LOGGER.debug("{}: port {}, event count {}, xmlEvents {}", WebSocketEventProducerServer.class.getName(), port,
+                        eventCount, xmlEvents);
     }
 
     /**
@@ -70,11 +71,11 @@ public class WebSocketEventProducerServer implements WsStringMessageListener {
      */
     public void sendEvents() {
         LOGGER.debug("{}: sending events on port {}, event count {}, xmlEvents {}",
-                        WebSocketEventProducerServer.class.getCanonicalName(), port, eventCount, xmlEvents);
+                        WebSocketEventProducerServer.class.getName(), port, eventCount, xmlEvents);
 
         for (int i = 0; i < eventCount; i++) {
             LOGGER.debug("{}: waiting {} milliseconds before sending next event",
-                            WebSocketEventProducerServer.class.getCanonicalName(), eventInterval);
+                            WebSocketEventProducerServer.class.getName(), eventInterval);
             ThreadUtilities.sleep(eventInterval);
 
             String eventString = null;
@@ -85,11 +86,10 @@ public class WebSocketEventProducerServer implements WsStringMessageListener {
             }
             server.sendString(eventString);
             eventsSentCount++;
-            LOGGER.debug("{}: port {}, sent event {}", WebSocketEventProducerServer.class.getCanonicalName(), port,
-                            eventString);
+            LOGGER.debug("{}: port {}, sent event {}", WebSocketEventProducerServer.class.getName(), port, eventString);
         }
 
-        LOGGER.debug("{}: event sending completed", WebSocketEventProducerServer.class.getCanonicalName());
+        LOGGER.debug("{}: event sending completed", WebSocketEventProducerServer.class.getName());
     }
 
     /**
@@ -106,7 +106,7 @@ public class WebSocketEventProducerServer implements WsStringMessageListener {
      */
     public void shutdown() {
         server.stop();
-        LOGGER.debug("{}: stopped", WebSocketEventProducerServer.class.getCanonicalName());
+        LOGGER.debug("{}: stopped", WebSocketEventProducerServer.class.getName());
     }
 
     /**
@@ -114,8 +114,7 @@ public class WebSocketEventProducerServer implements WsStringMessageListener {
      */
     @Override
     public void receiveString(final String eventString) {
-        LOGGER.debug("{}: port {}, received event {}", WebSocketEventProducerServer.class.getCanonicalName(), port,
-                        eventString);
+        LOGGER.debug("{}: port {}, received event {}", WebSocketEventProducerServer.class.getName(), port, eventString);
     }
 
     /**
index 5cd8712..7fe2d43 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,7 +57,7 @@ public class WebSocketEventSubscriberClient implements WsStringMessageListener {
      */
     @Override
     public void receiveString(final String eventString) {
-        LOGGER.debug("{}: port {}, received event {}", WebSocketEventSubscriberClient.class.getCanonicalName(), port,
+        LOGGER.debug("{}: port {}, received event {}", WebSocketEventSubscriberClient.class.getName(), port,
                         eventString);
         eventsReceivedCount++;
     }
@@ -75,7 +76,7 @@ public class WebSocketEventSubscriberClient implements WsStringMessageListener {
      */
     public void shutdown() {
         client.stop();
-        LOGGER.debug("{}: stopped", WebSocketEventSubscriberServer.class.getCanonicalName());
+        LOGGER.debug("{}: stopped", WebSocketEventSubscriberServer.class.getName());
     }
 
     /**
index 48d2217..d36ce96 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -49,7 +50,7 @@ public class WebSocketEventSubscriberServer implements WsStringMessageListener {
         server = new WsStringMessageServer(port);
         server.start(this);
 
-        LOGGER.debug("{}: port {}, waiting for events", WebSocketEventSubscriberServer.class.getCanonicalName(), port);
+        LOGGER.debug("{}: port {}, waiting for events", WebSocketEventSubscriberServer.class.getName(), port);
     }
 
     /**
@@ -57,7 +58,7 @@ public class WebSocketEventSubscriberServer implements WsStringMessageListener {
      */
     @Override
     public void receiveString(final String eventString) {
-        LOGGER.debug("{}: port {}, received event {}", WebSocketEventSubscriberServer.class.getCanonicalName(), port,
+        LOGGER.debug("{}: port {}, received event {}", WebSocketEventSubscriberServer.class.getName(), port,
                         eventString);
         eventsReceivedCount++;
     }
@@ -76,7 +77,7 @@ public class WebSocketEventSubscriberServer implements WsStringMessageListener {
      */
     public void shutdown() {
         server.stop();
-        LOGGER.debug("{} : stopped", WebSocketEventSubscriberServer.class.getCanonicalName());
+        LOGGER.debug("{} : stopped", WebSocketEventSubscriberServer.class.getName());
     }
 
     /**
index e5a88a3..dc5cce8 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  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.
@@ -59,22 +60,21 @@ public class DummyApexEventConsumer implements ApexEventConsumer {
 
     @Override
     public void init(final String consumerName, final EventHandlerParameters consumerParameters,
-            final ApexEventReceiver incomingEventReceiver) throws ApexEventException {
+                    final ApexEventReceiver incomingEventReceiver) throws ApexEventException {
         this.eventReceiver = incomingEventReceiver;
         this.name = consumerName;
 
-
         // Check and get the properties
         if (!(consumerParameters.getCarrierTechnologyParameters() instanceof DummyCarrierTechnologyParameters)) {
             String message = "specified consumer properties of type \""
-                    + consumerParameters.getCarrierTechnologyParameters().getClass().getCanonicalName()
-                    + "\" are not applicable to a dummy consumer";
+                            + consumerParameters.getCarrierTechnologyParameters().getClass().getName()
+                            + "\" are not applicable to a dummy consumer";
             LOGGER.warn(message);
             throw new ApexEventException(message);
         }
 
-        dummyConsumerProperties =
-                (DummyCarrierTechnologyParameters) consumerParameters.getCarrierTechnologyParameters();
+        dummyConsumerProperties = (DummyCarrierTechnologyParameters) consumerParameters
+                        .getCarrierTechnologyParameters();
     }
 
     @Override
@@ -107,7 +107,8 @@ public class DummyApexEventConsumer implements ApexEventConsumer {
     }
 
     @Override
-    public void stop() {}
+    public void stop() {
+    }
 
     private class RunTestEventSender implements Runnable {
         @Override
@@ -117,7 +118,7 @@ public class DummyApexEventConsumer implements ApexEventConsumer {
                 executionProperties.load(new FileInputStream(new File(dummyConsumerProperties.getPropertyFileName())));
             } catch (IOException e1) {
                 String message = "reading of executor properties for testing failed from file: "
-                        + dummyConsumerProperties.getPropertyFileName();
+                                + dummyConsumerProperties.getPropertyFileName();
                 LOGGER.warn(message);
                 throw new ApexEventRuntimeException(message);
             }