8b59a180102d210827cfca5d40aeab0b436f7c56
[policy/clamp.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * Copyright (C) 2021 Nordix Foundation.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.clamp.controlloop.models.messages.dmaap.participant;
22
23 import java.util.UUID;
24 import lombok.Getter;
25 import lombok.Setter;
26 import lombok.ToString;
27 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
28
29 /**
30  * Class to represent participant Ack message.
31  */
32 @Getter
33 @Setter
34 @ToString
35 public class ParticipantAckMessage {
36
37     // The responseTo field should match the original request id in the request.
38     private UUID responseTo;
39
40     // Result: Success/Fail.
41     private Boolean result;
42
43     // Message indicating reason for failure
44     private String message;
45
46     private ParticipantMessageType messageType;
47
48     /**
49      * Participant Type, or {@code null} for messages from participants.
50      */
51     private ToscaConceptIdentifier participantType;
52
53     /**
54      * Participant ID, or {@code null} for messages from participants.
55      */
56     private ToscaConceptIdentifier participantId;
57
58     /**
59      * Constructor for instantiating a participant ack message class.
60      *
61      * @param messageType the message type
62      */
63     public ParticipantAckMessage(final ParticipantMessageType messageType) {
64         this.messageType = messageType;
65     }
66
67     /**
68      * Constructs the object, making a deep copy.
69      *
70      * @param source source from which to copy
71      */
72     public ParticipantAckMessage(ParticipantAckMessage source) {
73         this.responseTo = source.responseTo;
74         this.result = source.result;
75         this.message = source.message;
76         this.messageType = source.messageType;
77         this.participantType = source.participantType;
78         this.participantId = source.participantId;
79     }
80 }