diff options
author | Ajith Sreekumar <ajith.sreekumar@bell.ca> | 2021-09-03 10:03:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-09-03 10:03:30 +0000 |
commit | 29fc6f31180fbbc48d75a3bb1ac97d4b00883e5c (patch) | |
tree | 7eacad4b7df2772ec101715128f72a0fc645f611 /participant/participant-intermediary/src/main | |
parent | adb8255b9706e09127d77bc072bef4e8b3a27cf1 (diff) | |
parent | f1a24cb3c4514092fde0a9f114ffa43d637ce175 (diff) |
Merge "Fix sonars in clamp"
Diffstat (limited to 'participant/participant-intermediary/src/main')
4 files changed, 13 insertions, 13 deletions
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/ParticipantIntermediaryApi.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/ParticipantIntermediaryApi.java index 2ca14fdea..7292f8ddc 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/ParticipantIntermediaryApi.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/ParticipantIntermediaryApi.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +34,6 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantStatistics; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantMessageType; import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; -import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; /** * This interface is used by participant implementations to use the participant intermediary. diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java index f6d7cd161..f8ef8d506 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +39,6 @@ import org.onap.policy.clamp.controlloop.participant.intermediary.api.ControlLoo import org.onap.policy.clamp.controlloop.participant.intermediary.api.ParticipantIntermediaryApi; import org.onap.policy.clamp.controlloop.participant.intermediary.handler.ParticipantHandler; import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; -import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; import org.springframework.stereotype.Component; /** @@ -124,8 +124,7 @@ public class ParticipantIntermediaryApiImpl implements ParticipantIntermediaryAp @Override public ControlLoopElement updateControlLoopElementState(UUID id, ControlLoopOrderedState currentState, ControlLoopState newState, ParticipantMessageType messageType) { - return participantHandler.getControlLoopHandler().updateControlLoopElementState(id, currentState, newState, - messageType); + return participantHandler.getControlLoopHandler().updateControlLoopElementState(id, currentState, newState); } @Override diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/comm/ParticipantMessagePublisher.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/comm/ParticipantMessagePublisher.java index 2941e9fd8..79d62623c 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/comm/ParticipantMessagePublisher.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/comm/ParticipantMessagePublisher.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,6 +43,7 @@ import org.springframework.stereotype.Component; @Component public class ParticipantMessagePublisher implements Publisher { private static final Logger LOGGER = LoggerFactory.getLogger(ParticipantMessagePublisher.class); + private static final String NOT_ACTIVE_TEXT = "Not Active!"; private boolean active = false; private TopicSinkClient topicSinkClient; @@ -67,7 +69,7 @@ public class ParticipantMessagePublisher implements Publisher { */ public void sendParticipantStatus(final ParticipantStatus participantStatus) { if (!active) { - throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, "Not Active!"); + throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, NOT_ACTIVE_TEXT); } topicSinkClient.send(participantStatus); LOGGER.debug("Sent Participant Status message to CLAMP - {}", participantStatus); @@ -80,7 +82,7 @@ public class ParticipantMessagePublisher implements Publisher { */ public void sendParticipantRegister(final ParticipantRegister participantRegister) { if (!active) { - throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, "Not Active!"); + throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, NOT_ACTIVE_TEXT); } topicSinkClient.send(participantRegister); LOGGER.debug("Sent Participant Register message to CLAMP - {}", participantRegister); @@ -93,7 +95,7 @@ public class ParticipantMessagePublisher implements Publisher { */ public void sendParticipantDeregister(final ParticipantDeregister participantDeregister) { if (!active) { - throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, "Not Active!"); + throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, NOT_ACTIVE_TEXT); } topicSinkClient.send(participantDeregister); LOGGER.debug("Sent Participant Deregister message to CLAMP - {}", participantDeregister); @@ -106,7 +108,7 @@ public class ParticipantMessagePublisher implements Publisher { */ public void sendParticipantUpdateAck(final ParticipantUpdateAck participantUpdateAck) { if (!active) { - throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, "Not Active!"); + throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, NOT_ACTIVE_TEXT); } topicSinkClient.send(participantUpdateAck); LOGGER.debug("Sent Participant Update Ack message to CLAMP - {}", participantUpdateAck); @@ -119,7 +121,7 @@ public class ParticipantMessagePublisher implements Publisher { */ public void sendControlLoopAck(final ControlLoopAck controlLoopAck) { if (!active) { - throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, "Not Active!"); + throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, NOT_ACTIVE_TEXT); } topicSinkClient.send(controlLoopAck); LOGGER.debug("Sent ControlLoop Update/StateChange Ack to runtime - {}", controlLoopAck); @@ -132,7 +134,7 @@ public class ParticipantMessagePublisher implements Publisher { */ public void sendHeartbeat(final ParticipantStatus participantStatus) { if (!active) { - throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, "Not Active!"); + throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, NOT_ACTIVE_TEXT); } topicSinkClient.send(participantStatus); LOGGER.debug("Sent Participant heartbeat to CLAMP - {}", participantStatus); diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandler.java index 8b4c61dca..9cd032a54 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandler.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandler.java @@ -1,8 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. - * ================================================================================ - * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,7 +97,7 @@ public class ControlLoopHandler { * @return controlLoopElement the updated controlloop element */ public ControlLoopElement updateControlLoopElementState(UUID id, ControlLoopOrderedState orderedState, - ControlLoopState newState, ParticipantMessageType messageType) { + ControlLoopState newState) { if (id == null) { LOGGER.warn("Cannot update Control loop element state, id is null"); |