diff options
4 files changed, 24 insertions, 23 deletions
diff --git a/src/main/java/org/onap/music/datastore/jsonobjects/JsonDelete.java b/src/main/java/org/onap/music/datastore/jsonobjects/JsonDelete.java index 7ea691f0..8312e637 100644 --- a/src/main/java/org/onap/music/datastore/jsonobjects/JsonDelete.java +++ b/src/main/java/org/onap/music/datastore/jsonobjects/JsonDelete.java @@ -304,8 +304,8 @@ public class JsonDelete { } private class RowIdentifier { - public String primarKeyValue; - public StringBuilder rowIdString; + private String primarKeyValue; + private StringBuilder rowIdString; @SuppressWarnings("unused") public PreparedQueryObject queryObject; // the string with all the row // identifiers separated by AND diff --git a/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java b/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java index cf4b2bc9..fbfc0de6 100644 --- a/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java +++ b/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java @@ -32,7 +32,6 @@ import org.onap.music.eelf.logging.EELFLoggerDelegate; import org.onap.music.eelf.logging.format.AppMessages; import org.onap.music.eelf.logging.format.ErrorSeverity; import org.onap.music.eelf.logging.format.ErrorTypes; -import org.onap.music.exceptions.MusicLockingException; import org.onap.music.exceptions.MusicQueryException; import org.onap.music.exceptions.MusicServiceException; import org.onap.music.main.MusicUtil; @@ -68,7 +67,7 @@ public class MusicHealthCheck { result = getAdminKeySpace(consistency, randomUUID); } } catch (MusicServiceException e1) { - logger.error(EELFLoggerDelegate.errorLogger, e1.getMessage(), AppMessages.UNKNOWNERROR, ErrorSeverity.ERROR, ErrorTypes.UNKNOWN); + logger.error(EELFLoggerDelegate.errorLogger, e1.getMessage(), AppMessages.UNKNOWNERROR, ErrorSeverity.ERROR, ErrorTypes.UNKNOWN, e1); } catch (MusicQueryException e1) { logger.error(EELFLoggerDelegate.errorLogger, e1.getMessage(), AppMessages.UNKNOWNERROR, ErrorSeverity.ERROR, ErrorTypes.UNKNOWN,e1); } @@ -80,7 +79,6 @@ public class MusicHealthCheck { try { cleanHealthCheckId(randomUUID); } catch (MusicServiceException | MusicQueryException e) { - // TODO Auto-generated catch block logger.error("Error while cleaning healthcheck record id...", e); } if (result) { diff --git a/src/main/java/org/onap/music/eelf/logging/MusicLoggingServletFilter.java b/src/main/java/org/onap/music/eelf/logging/MusicLoggingServletFilter.java index 7eca73e1..0f078a97 100644 --- a/src/main/java/org/onap/music/eelf/logging/MusicLoggingServletFilter.java +++ b/src/main/java/org/onap/music/eelf/logging/MusicLoggingServletFilter.java @@ -4,6 +4,8 @@ * =================================================================== * Copyright (c) 2017 AT&T Intellectual Property * =================================================================== + * Modifications Copyright (C) 2019 IBM + * =================================================================== * 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 @@ -107,44 +109,44 @@ public class MusicLoggingServletFilter implements Filter { .collect(Collectors.toMap(entry -> entry.getKey().toUpperCase(), entry -> entry.getValue())); // Enable/disable keys are present in /opt/app/music/etc/music.properties - if (Boolean.valueOf(MusicUtil.getTransIdRequired()) + if (MusicUtil.getTransIdRequired() && !upperCaseHeaderMap.containsKey(TRANSACTION_ID.toUpperCase())) { populateError(httpResponse, "Transaction id '" + TRANSACTION_ID + "' required on http header"); return; } else { populateMDCAndResponseHeader(upperCaseHeaderMap, TRANSACTION_ID, "transactionId", - Boolean.valueOf(MusicUtil.getTransIdRequired()), httpResponse); + MusicUtil.getTransIdRequired(), httpResponse); } - if (Boolean.valueOf(MusicUtil.getConversationIdRequired()) + if (MusicUtil.getConversationIdRequired() && !upperCaseHeaderMap.containsKey(CONVERSATION_ID.toUpperCase())) { populateError(httpResponse, "Conversation Id '" + CONVERSATION_ID + "' required on http header"); return; } else { populateMDCAndResponseHeader(upperCaseHeaderMap, CONVERSATION_ID, "conversationId", - Boolean.valueOf(MusicUtil.getConversationIdRequired()), httpResponse); + MusicUtil.getConversationIdRequired(), httpResponse); } - if (Boolean.valueOf(MusicUtil.getMessageIdRequired()) + if (MusicUtil.getMessageIdRequired() && !upperCaseHeaderMap.containsKey(MESSAGE_ID.toUpperCase())) { populateError(httpResponse, "Message Id '" + MESSAGE_ID + "' required on http header"); return; } else { populateMDCAndResponseHeader(upperCaseHeaderMap, MESSAGE_ID, "messageId", - Boolean.valueOf(MusicUtil.getMessageIdRequired()), httpResponse); + MusicUtil.getMessageIdRequired(), httpResponse); } - if (Boolean.valueOf(MusicUtil.getClientIdRequired()) + if (MusicUtil.getClientIdRequired() && !upperCaseHeaderMap.containsKey(CLIENT_ID.toUpperCase())) { populateError(httpResponse, "Client Id '" + CLIENT_ID + "' required on http header"); return; } else { populateMDCAndResponseHeader(upperCaseHeaderMap, CLIENT_ID, "clientId", - Boolean.valueOf(MusicUtil.getClientIdRequired()), httpResponse); + MusicUtil.getClientIdRequired(), httpResponse); } } diff --git a/src/main/java/org/onap/music/response/jsonobjects/JsonResponse.java b/src/main/java/org/onap/music/response/jsonobjects/JsonResponse.java index f0793dc2..5ae49f5d 100644 --- a/src/main/java/org/onap/music/response/jsonobjects/JsonResponse.java +++ b/src/main/java/org/onap/music/response/jsonobjects/JsonResponse.java @@ -3,6 +3,8 @@ * org.onap.music * =================================================================== * Copyright (c) 2017 AT&T Intellectual Property + * + * Modifications Copyright (C) 2019 IBM. * =================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,6 +60,15 @@ public class JsonResponse { private String lockLease; private boolean isLockHolders=false; + /** + * Create a JSONLock Response + * Use setters to provide more information as in + * JsonLockResponse(ResultType.SUCCESS).setMessage("We did it").setLock(mylockname) + * @param status + */ + public JsonResponse(ResultType status) { + this.status = status; + } public boolean isLockHolders() { return isLockHolders; @@ -68,16 +79,6 @@ public class JsonResponse { return this; } - /** - * Create a JSONLock Response - * Use setters to provide more information as in - * JsonLockResponse(ResultType.SUCCESS).setMessage("We did it").setLock(mylockname) - * @param status - */ - public JsonResponse(ResultType status) { - this.status = status; - } - /** * * @return |