Fix compilation issue due to generic Exception
[policy/engine.git] / LogParser / src / main / java / org / onap / xacml / parser / ParseLog.java
index 1dbe125..5ead822 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * LogParser
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,10 +46,10 @@ import java.util.regex.Pattern;
 import java.util.stream.Stream;
 
 import org.apache.log4j.Logger;
-import org.onap.policy.common.im.AdministrativeStateException;
 import org.onap.policy.common.im.IntegrityMonitor;
-import org.onap.policy.common.im.StandbyStatusException;
+import org.onap.policy.common.im.IntegrityMonitorException;
 import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.utils.CryptoUtils;
 import org.onap.xacml.parser.LogEntryObject.LOGTYPE;
 
 /**
@@ -578,10 +578,8 @@ public class ParseLog {
                if (im!=null){
                        try {
                                im.startTransaction();
-                       } catch (AdministrativeStateException e) {
-                               logger.error("Error received" + e);                             
-                       } catch (StandbyStatusException ex) {
-                               logger.error("Error received" + ex);
+                       } catch (IntegrityMonitorException e) {
+                               logger.error("Error received" + e);
                        }
                }
                returnLogValue = pullOutLogValues(line, type);
@@ -808,7 +806,8 @@ public class ParseLog {
                                        jdbcUrl = config.getProperty("JDBC_URL").replace("'", "");
                                        jdbcUser = config.getProperty("JDBC_USER");
                                        jdbcDriver =  config.getProperty("JDBC_DRIVER");
-                                       jdbcPassword = config.getProperty("JDBC_PASSWORD");
+                                       jdbcPassword = CryptoUtils.decryptTxtNoExStr(config.getProperty("JDBC_PASSWORD", ""));
+                                       config.setProperty("javax.persistence.jdbc.password", CryptoUtils.decryptTxtNoExStr(config.getProperty("javax.persistence.jdbc.password", "")));
                                        return config;
 
                                } catch (IOException e) {