diff options
author | edyta <edyta.krukowska@nokia.com> | 2020-04-17 15:02:08 +0200 |
---|---|---|
committer | edyta <edyta.krukowska@nokia.com> | 2020-04-17 15:02:08 +0200 |
commit | 4f31da1340af41cbef81621999c7e3ad63d02b21 (patch) | |
tree | a71639a1ec1393f544b9ecc7670b209fc9198cb0 /pnfsimulator/src/main | |
parent | 8566d36ed85a784d4f552f4b0e0dffc472deca34 (diff) |
Fix sonar issue EventJob
Issue-ID: INT-1517
Signed-off-by: Edyta Krukowska <edyta.krukowska@nokia.com>
Change-Id: I973fe6d5854d50d93a6bf874d3066b6137a6012b
Diffstat (limited to 'pnfsimulator/src/main')
-rw-r--r-- | pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/scheduler/EventJob.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/scheduler/EventJob.java b/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/scheduler/EventJob.java index c4b40fc..6e4411d 100644 --- a/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/scheduler/EventJob.java +++ b/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/scheduler/EventJob.java @@ -69,24 +69,25 @@ public class EventJob implements Job { LOGGER.error("Could not send event as client is not available"); } } + private Optional<HttpClientAdapter> getHttpClientAdapter(JobDataMap jobDataMap, String vesUrl) { HttpClientAdapter adapter = null; try { adapter = (HttpClientAdapter) (jobDataMap.containsKey(CLIENT_ADAPTER) ? jobDataMap.get(CLIENT_ADAPTER) : - new HttpClientAdapterImpl(vesUrl, new SSLAuthenticationHelper())); + new HttpClientAdapterImpl(vesUrl, new SSLAuthenticationHelper())); } catch (MalformedURLException e) { LOGGER.error("Invalid format of vesServerUr: {}", vesUrl); - } catch (IOException | GeneralSecurityException e){ + } catch (IOException | GeneralSecurityException e) { LOGGER.error("Invalid configuration of client certificate"); } return Optional.ofNullable(adapter); } private void logEventDetails(String templateName, String vesUrl, String body, String jobKey) { - LOGGER.info(String.format("Job %s:Sending event to %s from template %s", - jobKey, vesUrl, templateName)); + LOGGER.info("Job {}:Sending event to {} from template {}", + jobKey, vesUrl, templateName); if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("Job %s: Request body %s", jobKey, body)); + LOGGER.debug("Job {}: Request body {}", jobKey, body); } } |