From 87be30582d1db37bee7c6b456c0c5c3ca9584963 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 4 Sep 2018 17:24:15 +0100 Subject: Fix checkstyle issues in apex model basic CHeckstyle issues in apex model basic and knock on changes in other apex modules. Issue-ID: POLICY-1034 Change-Id: I65823f5e2e344526abc74b0812877113acb056ec Signed-off-by: liamfallon --- .../monitoring/rest/ApexMonitoringRestResource.java | 16 ++++++++-------- .../apex/client/monitoring/rest/ParameterCheck.java | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'client/client-monitoring/src') diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java index 6a614f326..85465a14b 100644 --- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java +++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java @@ -105,9 +105,9 @@ public class ApexMonitoringRestResource { final JsonObject responseObject = new JsonObject(); // Engine Service data - responseObject.addProperty("engine_id", engineServiceFacade.getKey().getID()); + responseObject.addProperty("engine_id", engineServiceFacade.getKey().getId()); responseObject.addProperty("model_id", - engineServiceFacade.getApexModelKey() != null ? engineServiceFacade.getApexModelKey().getID() + engineServiceFacade.getApexModelKey() != null ? engineServiceFacade.getApexModelKey().getId() : "Not Set"); responseObject.addProperty("server", hostName); responseObject.addProperty("port", Integer.toString(port)); @@ -121,23 +121,23 @@ public class ApexMonitoringRestResource { final JsonObject engineStatusObject = new JsonObject(); final AxEngineModel axEngineModel = engineServiceFacade.getEngineStatus(engineKey); engineStatusObject.addProperty("timestamp", axEngineModel.getTimeStampString()); - engineStatusObject.addProperty("id", engineKey.getID()); + engineStatusObject.addProperty("id", engineKey.getId()); engineStatusObject.addProperty("status", axEngineModel.getState().toString()); engineStatusObject.addProperty("last_message", axEngineModel.getStats().getTimeStampString()); engineStatusObject.addProperty("up_time", axEngineModel.getStats().getUpTime() / 1000L); engineStatusObject.addProperty("policy_executions", axEngineModel.getStats().getEventCount()); engineStatusObject.addProperty("last_policy_duration", gson.toJson( - getValuesFromCache(host, engineKey.getID() + "_last_policy_duration", + getValuesFromCache(host, engineKey.getId() + "_last_policy_duration", axEngineModel.getTimestamp(), axEngineModel.getStats().getLastExecutionTime()), List.class)); engineStatusObject.addProperty("average_policy_duration", - gson.toJson(getValuesFromCache(host, engineKey.getID() + "_average_policy_duration", + gson.toJson(getValuesFromCache(host, engineKey.getId() + "_average_policy_duration", axEngineModel.getTimestamp(), (long) axEngineModel.getStats().getAverageExecutionTime()), List.class)); engineStatusList.add(engineStatusObject); } catch (final ApexException e) { - LOGGER.warn("Error getting status of engine with ID " + engineKey.getID() + "
", e); + LOGGER.warn("Error getting status of engine with ID " + engineKey.getId() + "
", e); } } responseObject.add("status", engineStatusList); @@ -149,12 +149,12 @@ public class ApexMonitoringRestResource { final String engineInfo = engineServiceFacade.getEngineInfo(engineKey); if (engineInfo != null && !engineInfo.trim().isEmpty()) { final JsonObject engineContextObject = new JsonObject(); - engineContextObject.addProperty("id", engineKey.getID()); + engineContextObject.addProperty("id", engineKey.getId()); engineContextObject.addProperty("engine_info", engineInfo); engineContextList.add(engineContextObject); } } catch (final ApexException e) { - LOGGER.warn("Error getting runtime information of engine with ID " + engineKey.getID() + "
", e); + LOGGER.warn("Error getting runtime information of engine with ID " + engineKey.getId() + "
", e); } } responseObject.add("context", engineContextList); diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java index 5bc40c8db..c8eb5ad66 100644 --- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java +++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java @@ -154,7 +154,7 @@ public final class ParameterCheck { */ public static ParameterCheck.StartStop getStartStop(final Map parameterMap, final AxArtifactKey engineKey) { - final String startStopPar = AXARTIFACTKEY_PAR + '#' + engineKey.getID(); + final String startStopPar = AXARTIFACTKEY_PAR + '#' + engineKey.getId(); if (!parameterMap.containsKey(startStopPar)) { LOGGER.warn("parameter \"" + startStopPar + "\" not found"); return null; -- cgit 1.2.3-korg