Merge "Fixes in MoxyStrategy"
authorJames Forsyth <jf2512@att.com>
Thu, 1 Feb 2018 17:30:36 +0000 (17:30 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 1 Feb 2018 17:30:36 +0000 (17:30 +0000)
aai-core/src/main/java/org/onap/aai/db/schema/AuditOXM.java
aai-core/src/main/java/org/onap/aai/introspection/Introspector.java
aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java

index 0a3650f..5ebfeb2 100644 (file)
@@ -106,15 +106,8 @@ public class AuditOXM extends Auditor {
                        for (int i = 0; i < list.getLength(); i++) {
                                result.add(list.item(i).getAttributes().getNamedItem("name").getNodeValue());
                        }
-               } catch (ParserConfigurationException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               } catch (SAXException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               } catch (IOException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
+               } catch (ParserConfigurationException | SAXException | IOException e) {
+                       LOGGER.error(e.getMessage());
                }
 
                result.remove("EdgePropNames");
index fa8be86..16680a8 100644 (file)
@@ -82,7 +82,7 @@ public abstract class Introspector implements Cloneable {
                                this.set(convertedName, clazz.newInstance());
                                result = this.get(convertedName);
                        } catch (DynamicException | InstantiationException | IllegalAccessException e) {
-                               
+                               LOGGER.warn(e.getMessage(),e);
                        }
                }
 
@@ -106,7 +106,7 @@ public abstract class Introspector implements Cloneable {
                                this.set(convertedName, clazz.newInstance());
                                value = this.get(convertedName);
                        } catch (DynamicException | InstantiationException | IllegalAccessException e) {
-                               
+                               LOGGER.warn(e.getMessage(),e);
                        }
                }
                if (value != null) {
@@ -138,7 +138,7 @@ public abstract class Introspector implements Cloneable {
                                this.set(convertedName, clazz.newInstance());
                                value = this.get(convertedName);
                        } catch (DynamicException | InstantiationException | IllegalAccessException e) {
-                               
+                               LOGGER.warn(e.getMessage(),e);
                        }
                }
                
index db8a7d0..d36e39b 100644 (file)
@@ -21,6 +21,8 @@
  */
 package org.onap.aai.introspection;
 
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
 import org.json.simple.JSONObject;
 import org.onap.aai.schema.enums.ObjectMetadata;
 import org.onap.aai.schema.enums.PropertyMetadata;
@@ -32,6 +34,7 @@ import java.util.Set;
 import java.util.UUID;
 
 public class JSONStrategy extends Introspector {
+       private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(JSONStrategy.class);
 
        private JSONObject json = null;
        private String namedType = "";
@@ -158,6 +161,7 @@ public class JSONStrategy extends Introspector {
                try {
                        return this.getClass(name).newInstance();
                } catch (InstantiationException | IllegalAccessException e) {
+            LOGGER.error(e.getMessage(),e);
                        return null;
                }
        }
@@ -167,6 +171,7 @@ public class JSONStrategy extends Introspector {
                try {
                        return this.getGenericTypeClass(name).newInstance();
                } catch (InstantiationException | IllegalAccessException e) {
+            LOGGER.error(e.getMessage(),e);
                        return null;
                }
        }
index 5deb48a..9d15f09 100644 (file)
@@ -106,13 +106,13 @@ public class HttpsAuthClient{
                                char[] pwd = keystore_password.toCharArray();
                                ks.load(fin, pwd);
                                kmf.init(ks, pwd);
+                               ctx.init(kmf.getKeyManagers(), null, null);
                        } catch (Exception e) {
                                System.out.println("Error setting up kmf: exiting");
                                e.printStackTrace();
                                System.exit(1);
                        }
 
-                       ctx.init(kmf.getKeyManagers(), null, null);
                        config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, 
                                                                                new HTTPSProperties( new HostnameVerifier() {
                                @Override