diff options
Diffstat (limited to 'participant/participant-intermediary')
3 files changed, 0 insertions, 132 deletions
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/comm/ParticipantStateChangeListener.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/comm/ParticipantStateChangeListener.java deleted file mode 100644 index ec6548a7c..000000000 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/comm/ParticipantStateChangeListener.java +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. - * ================================================================================ - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.clamp.controlloop.participant.intermediary.comm; - -import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantStateChange; -import org.onap.policy.clamp.controlloop.participant.intermediary.handler.ParticipantHandler; -import org.springframework.stereotype.Component; - -/** - * Listener for Participant State Change messages sent by CLAMP. - * - */ -@Component -public class ParticipantStateChangeListener extends ParticipantListener<ParticipantStateChange> { - - /** - * Constructs the object. - * - * @param participantHandler the handler for managing the state of the participant - */ - public ParticipantStateChangeListener(final ParticipantHandler participantHandler) { - super(ParticipantStateChange.class, participantHandler, participantHandler::handleParticipantStateChange); - } -} diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/IntermediaryActivator.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/IntermediaryActivator.java index 38674896b..68ee93f4f 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/IntermediaryActivator.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/IntermediaryActivator.java @@ -30,7 +30,6 @@ import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ControlLo import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ParticipantDeregisterAckListener; import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ParticipantHealthCheckListener; import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ParticipantRegisterAckListener; -import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ParticipantStateChangeListener; import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ParticipantUpdateListener; import org.onap.policy.clamp.controlloop.participant.intermediary.parameters.ParticipantParameters; import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; @@ -120,9 +119,6 @@ public class IntermediaryActivator extends ServiceManagerContainer implements Cl private void registerMsgDispatcher() { MessageTypeDispatcher msgDispatcher = applicationContext.getBean(MessageTypeDispatcher.class); - msgDispatcher.register(ParticipantMessageType.PARTICIPANT_STATE_CHANGE.name(), - applicationContext.getBean(ParticipantStateChangeListener.class)); - msgDispatcher.register(ParticipantMessageType.PARTICIPANT_HEALTH_CHECK.name(), applicationContext.getBean(ParticipantHealthCheckListener.class)); diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java index 4842c3edd..5b9b74092 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java @@ -42,7 +42,6 @@ import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.Parti import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantRegisterAck; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantResponseDetails; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantResponseStatus; -import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantStateChange; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantStatus; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdate; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdateAck; @@ -98,46 +97,6 @@ public class ParticipantHandler implements Closeable { } /** - * Method which handles a participant state change event from clamp. - * - * @param stateChangeMsg participant state change message - */ - public void handleParticipantStateChange(final ParticipantStateChange stateChangeMsg) { - - if (!stateChangeMsg.appliesTo(participantType, participantId)) { - return; - } - - var response = new ParticipantResponseDetails(stateChangeMsg); - - switch (stateChangeMsg.getState()) { - case PASSIVE: - handlePassiveState(response); - break; - case ACTIVE: - handleActiveState(response); - break; - case SAFE: - handleSafeState(response); - break; - case TEST: - handleTestState(response); - break; - case TERMINATED: - handleTerminatedState(response); - break; - default: - LOGGER.debug("StateChange message has no state, state is null {}", stateChangeMsg.getParticipantId()); - response.setResponseStatus(ParticipantResponseStatus.FAIL); - response.setResponseMessage( - "StateChange message has invalid state for participantId " + stateChangeMsg.getParticipantId()); - break; - } - - sender.sendResponse(response); - } - - /** * Method which handles a participant health check event from clamp. * * @param healthCheckMsg participant health check message @@ -168,51 +127,6 @@ public class ParticipantHandler implements Closeable { controlLoopHandler.handleControlLoopStateChange(stateChangeMsg); } - /** - * Method to handle when the new state from participant is active. - * - * @param response participant response - */ - private void handleActiveState(final ParticipantResponseDetails response) { - handleStateChange(ParticipantState.ACTIVE, response); - } - - /** - * Method to handle when the new state from participant is passive. - * - * @param response participant response - */ - private void handlePassiveState(final ParticipantResponseDetails response) { - handleStateChange(ParticipantState.PASSIVE, response); - } - - /** - * Method to handle when the new state from participant is safe. - * - * @param response participant response - */ - private void handleSafeState(final ParticipantResponseDetails response) { - handleStateChange(ParticipantState.SAFE, response); - } - - /** - * Method to handle when the new state from participant is TEST. - * - * @param response participant response - */ - private void handleTestState(final ParticipantResponseDetails response) { - handleStateChange(ParticipantState.TEST, response); - } - - /** - * Method to handle when the new state from participant is Terminated. - * - * @param response participant response - */ - private void handleTerminatedState(final ParticipantResponseDetails response) { - handleStateChange(ParticipantState.TERMINATED, response); - } - private void handleStateChange(ParticipantState newParticipantState, ParticipantResponseDetails response) { if (state.equals(newParticipantState)) { response.setResponseStatus(ParticipantResponseStatus.SUCCESS); |