diff options
Diffstat (limited to 'models-sim/policy-models-sim-pdp/src/main')
7 files changed, 21 insertions, 21 deletions
diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorActivator.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorActivator.java index 1bc2ff72d..31d5b4120 100644 --- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorActivator.java +++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorActivator.java @@ -52,8 +52,8 @@ public class PdpSimulatorActivator { private static final Logger LOGGER = LoggerFactory.getLogger(PdpSimulatorActivator.class); private final PdpSimulatorParameterGroup pdpSimulatorParameterGroup; - private List<TopicSink> topicSinks; // topics to which pdp sends pdp status - private List<TopicSource> topicSources; // topics to which pdp listens to for messages from pap. + private final List<TopicSink> topicSinks; // topics to which pdp sends pdp status + private final List<TopicSource> topicSources; // topics to which pdp listens to for messages from pap. private static final String[] MSG_TYPE_NAMES = { "messageName" }; /* @@ -70,7 +70,7 @@ public class PdpSimulatorActivator { /** * Used to manage the services. */ - private ServiceManager manager; + private final ServiceManager manager; @Getter diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorMain.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorMain.java index 1441ba37f..88d1b2686 100644 --- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorMain.java +++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorMain.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2021 Nordix Foundation. + * Copyright (C) 2019-2021, 2023 Nordix Foundation. * Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -132,7 +132,7 @@ public class PdpSimulatorMain { activator.terminate(); } } catch (final PdpSimulatorException e) { - LOGGER.warn("error occured during shut down of the pdp simulator service", e); + LOGGER.warn("error occurred during shut down of the pdp simulator service", e); } } } diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/comm/PdpStatusPublisher.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/comm/PdpStatusPublisher.java index 6be59b100..69b25dddd 100644 --- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/comm/PdpStatusPublisher.java +++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/comm/PdpStatusPublisher.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019, 2023 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -41,10 +41,10 @@ public class PdpStatusPublisher extends TimerTask { private static final Logger LOGGER = LoggerFactory.getLogger(PdpStatusPublisher.class); - private TopicSinkClient topicSinkClient; - private Timer timer; + private final TopicSinkClient topicSinkClient; + private final Timer timer; @Getter - private long interval; + private final long interval; /** * Constructor for instantiating PdpStatusPublisher. diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpMessageHandler.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpMessageHandler.java index ae028dd32..ad1a32d7b 100644 --- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpMessageHandler.java +++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpMessageHandler.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2021 Nordix Foundation. + * Copyright (C) 2019-2021, 2023 Nordix Foundation. * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -101,8 +101,8 @@ public class PdpMessageHandler { * * @return PdpResponseDetails */ - public PdpResponseDetails createPdpResonseDetails(final String requestId, final PdpResponseStatus status, - final String responseMessage) { + public PdpResponseDetails createPdpResponseDetails(final String requestId, final PdpResponseStatus status, + final String responseMessage) { final var pdpResponseDetails = new PdpResponseDetails(); pdpResponseDetails.setResponseTo(requestId); pdpResponseDetails.setResponseStatus(status); diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpStateChangeMessageHandler.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpStateChangeMessageHandler.java index 4f9804f7e..23df912e2 100644 --- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpStateChangeMessageHandler.java +++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpStateChangeMessageHandler.java @@ -81,16 +81,16 @@ public class PdpStateChangeMessageHandler { final PdpStatus pdpStatusContext, final PdpMessageHandler pdpMessageHandler) { PdpResponseDetails pdpResponseDetails = null; if (pdpStatusContext.getState().equals(PdpState.ACTIVE)) { - pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(), + pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(), PdpResponseStatus.SUCCESS, "Pdp already in active state"); } else { final List<ToscaPolicy> policies = Registry.get(PdpSimulatorConstants.REG_PDP_TOSCA_POLICY_LIST); if (policies.isEmpty()) { pdpStatusContext.setState(PdpState.ACTIVE); - pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(), + pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(), PdpResponseStatus.SUCCESS, "State changed to active. No policies found."); } else { - pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(), + pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(), PdpResponseStatus.SUCCESS, "Pdp started. State changed to active."); pdpStatusContext.setState(PdpState.ACTIVE); } @@ -110,10 +110,10 @@ public class PdpStateChangeMessageHandler { final PdpStatus pdpStatusContext, final PdpMessageHandler pdpMessageHandler) { PdpResponseDetails pdpResponseDetails = null; if (pdpStatusContext.getState().equals(PdpState.PASSIVE)) { - pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(), + pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(), PdpResponseStatus.SUCCESS, "Pdp already in passive state"); } else { - pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(), + pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(), PdpResponseStatus.SUCCESS, "Pdp state changed from Active to Passive."); pdpStatusContext.setState(PdpState.PASSIVE); } diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpUpdateMessageHandler.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpUpdateMessageHandler.java index a90f74fba..60f7c1461 100644 --- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpUpdateMessageHandler.java +++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpUpdateMessageHandler.java @@ -56,7 +56,7 @@ public class PdpUpdateMessageHandler { final var pdpStatusPublisher = Registry.get(PdpSimulatorConstants.REG_PDP_STATUS_PUBLISHER, PdpStatusPublisher.class); if (checkIfAlreadyHandled(pdpUpdateMsg, pdpStatusContext)) { - pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpUpdateMsg.getRequestId(), + pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(), PdpResponseStatus.SUCCESS, "Pdp already updated"); } else { if (null != pdpUpdateMsg.getPdpHeartbeatIntervalMs() && pdpUpdateMsg.getPdpHeartbeatIntervalMs() > 0 @@ -74,12 +74,12 @@ public class PdpUpdateMessageHandler { .collect(Collectors.toList())); if (pdpStatusContext.getState().equals(PdpState.ACTIVE) && !pdpUpdateMsg.getPoliciesToBeDeployed().isEmpty()) { - pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpUpdateMsg.getRequestId(), + pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(), PdpResponseStatus.SUCCESS, "Pdp engine started and policies are running."); } Registry.registerOrReplace(PdpSimulatorConstants.REG_PDP_TOSCA_POLICY_LIST, policies); if (null == pdpResponseDetails) { - pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpUpdateMsg.getRequestId(), + pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(), PdpResponseStatus.SUCCESS, "Pdp update successful."); } } diff --git a/models-sim/policy-models-sim-pdp/src/main/package/docker/Dockerfile b/models-sim/policy-models-sim-pdp/src/main/package/docker/Dockerfile index d1a68ae30..d13fe8e35 100644 --- a/models-sim/policy-models-sim-pdp/src/main/package/docker/Dockerfile +++ b/models-sim/policy-models-sim-pdp/src/main/package/docker/Dockerfile @@ -23,7 +23,7 @@ # Docker file to build an image that runs the PDP simulator on Java 8 in alpine # -FROM onap/policy-jre-alpine:3.0.0-SNAPSHOT +FROM onap/policy-jre-alpine:3.0.1-SNAPSHOT LABEL maintainer="Policy Team" |