From 8c178b15ff4c514ba07edd5aea039945b290e1c6 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Wed, 21 Jun 2023 11:41:02 +0100 Subject: Add Timeuot support in prime/deprime Issue-ID: POLICY-4734 Change-Id: I581610bb1a025e76a5af77e1deb2cd7b97ce7101 Signed-off-by: FrancescoFioraEst --- .../dmaap/participant/ParticipantAckMessage.java | 1 + .../participant/ParticipantResponseStatus.java | 42 ---------------------- .../persistence/provider/AcTypeStateResolver.java | 7 ++++ 3 files changed, 8 insertions(+), 42 deletions(-) delete mode 100644 models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantResponseStatus.java (limited to 'models/src') diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantAckMessage.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantAckMessage.java index 3182332d5..56e506470 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantAckMessage.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantAckMessage.java @@ -79,6 +79,7 @@ public class ParticipantAckMessage { public ParticipantAckMessage(ParticipantAckMessage source) { this.responseTo = source.responseTo; this.result = source.result; + this.stateChangeResult = source.stateChangeResult; this.message = source.message; this.messageType = source.messageType; this.participantId = source.participantId; diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantResponseStatus.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantResponseStatus.java deleted file mode 100644 index cb0307742..000000000 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantResponseStatus.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.models.acm.messages.dmaap.participant; - -/** - * Class to hold the possible values for participant response status. - */ -public enum ParticipantResponseStatus { - - /** - * participant operation was successful. - */ - SUCCESS, - - /** - * participant operation failed. - */ - FAIL, - - /** - * periodic response. - */ - PERIODIC -} diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcTypeStateResolver.java b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcTypeStateResolver.java index f1c930955..d80615626 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcTypeStateResolver.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcTypeStateResolver.java @@ -39,6 +39,7 @@ public class AcTypeStateResolver { private static final String DEPRIMING = AcTypeState.DEPRIMING.toString(); private static final String NO_ERROR = StateChangeResult.NO_ERROR.name(); private static final String FAILED = StateChangeResult.FAILED.name(); + private static final String TIMEOUT = StateChangeResult.TIMEOUT.name(); /** * Construct. @@ -57,6 +58,12 @@ public class AcTypeStateResolver { this.graph.put(new String[] {DEPRIME, PRIMING, FAILED}, PrimeOrder.DEPRIME); this.graph.put(new String[] {DEPRIME, DEPRIMING, FAILED}, PrimeOrder.DEPRIME); this.graph.put(new String[] {PRIME, DEPRIMING, FAILED}, PrimeOrder.PRIME); + + // timeout + this.graph.put(new String[] {PRIME, PRIMING, TIMEOUT}, PrimeOrder.PRIME); + this.graph.put(new String[] {DEPRIME, PRIMING, TIMEOUT}, PrimeOrder.DEPRIME); + this.graph.put(new String[] {DEPRIME, DEPRIMING, TIMEOUT}, PrimeOrder.DEPRIME); + this.graph.put(new String[] {PRIME, DEPRIMING, TIMEOUT}, PrimeOrder.PRIME); } /** -- cgit 1.2.3-korg