Merge "Fix NPE & other issues"
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / service / MicroserviceServiceImpl.java
index 2bb5ecd..9d9fde3 100644 (file)
@@ -4,6 +4,8 @@
  * ===================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
  *
  * Unless otherwise specified, all software contained herein is licensed
  * under the Apache License, Version 2.0 (the "License");
@@ -50,6 +52,8 @@ import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
 import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
 import org.onap.portalsdk.core.service.DataAccessService;
 import org.onap.portalsdk.core.util.SystemProperties;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -134,7 +138,6 @@ public class MicroserviceServiceImpl implements MicroserviceService {
                        dataAccessService.executeNamedQuery("deleteMicroservice", params, null);
 
                } catch (Exception e) {
-                       e.printStackTrace();
                        logger.error(EELFLoggerDelegate.errorLogger, "deleteMicroservice failed", e);
                        throw e;
                }
@@ -196,7 +199,7 @@ public class MicroserviceServiceImpl implements MicroserviceService {
                if (encryptedPwd != null && !encryptedPwd.isEmpty()) {
                        try {
                                result = CipherUtil.decryptPKC(encryptedPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                                               KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
                        } catch (Exception e) {
                                logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
                                throw e;
@@ -210,7 +213,7 @@ public class MicroserviceServiceImpl implements MicroserviceService {
                if (decryptedPwd != null && !decryptedPwd.isEmpty()) {
                        try {
                                result = CipherUtil.encryptPKC(decryptedPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                                               KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
                        } catch (Exception e) {
                                logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword failed", e);
                                throw e;