diff options
Diffstat (limited to 'certServiceClient/src')
4 files changed, 9 insertions, 8 deletions
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/AppExitHandler.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/AppExitHandler.java index caeca37e..0bb983ed 100644 --- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/AppExitHandler.java +++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/AppExitHandler.java @@ -26,8 +26,8 @@ public class AppExitHandler { private static final Logger LOGGER = LoggerFactory.getLogger(AppExitHandler.class); public void exit(ExitStatus exitStatus) { - LOGGER.info(String.format("Application exits with following exit code: %s and message: %s", - exitStatus.getExitCodeValue(), exitStatus.getMessage())); + LOGGER.info("Application exits with following exit code: {} and message: {}", + exitStatus.getExitCodeValue(), exitStatus.getMessage()); System.exit(exitStatus.getExitCodeValue()); } } diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/KeyPairFactory.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/KeyPairFactory.java index 988d37d8..85b85ff3 100644 --- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/KeyPairFactory.java +++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/KeyPairFactory.java @@ -28,7 +28,7 @@ import java.security.NoSuchAlgorithmException; public class KeyPairFactory { - private final Logger LOGGER = LoggerFactory.getLogger(KeyPairFactory.class); + private final static Logger LOGGER = LoggerFactory.getLogger(KeyPairFactory.class); private final String encryptionAlgorithm; private final int keySize; @@ -42,8 +42,8 @@ public class KeyPairFactory { LOGGER.info("KeyPair generation started with algorithm: {} and key size: {}", encryptionAlgorithm, keySize); return createKeyPairGenerator().generateKeyPair(); } catch (NoSuchAlgorithmException e) { - LOGGER.error("Generation of KeyPair failed, exception message: {}" , e.getMessage()); - throw new KeyPairGenerationException(e); + String errorMessage = String.format("Generation of KeyPair failed, exception message: %s", e.getMessage()); + throw new KeyPairGenerationException(errorMessage); } } diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/Password.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/Password.java index f0ee419c..09c65ca6 100644 --- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/Password.java +++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/Password.java @@ -21,7 +21,7 @@ package org.onap.aaf.certservice.client.certification.conversion; class Password { - private final static String PASSWORD_PATTERN = "[\\w$#]{16,}"; + private static final String PASSWORD_PATTERN = "[\\w$#]{16,}"; private final String password; Password(String password) { diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/KeyPairGenerationException.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/KeyPairGenerationException.java index d03c819d..ec6fbb9c 100644 --- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/KeyPairGenerationException.java +++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/KeyPairGenerationException.java @@ -24,10 +24,11 @@ import org.onap.aaf.certservice.client.api.ExitableException; public class KeyPairGenerationException extends ExitableException { private static final ExitStatus EXIT_STATUS = ExitStatus.KEY_PAIR_GENERATION_EXCEPTION; - public KeyPairGenerationException(Throwable e) { - super(e); + public KeyPairGenerationException(String errorMessage) { + super(errorMessage); } + public ExitStatus applicationExitStatus() { return EXIT_STATUS; } |