be0bfb2c55998c4e9047b5d14c87cf5d64a67b5f
[policy/apex-pdp.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
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.apex.core.protocols.engdep.messages;
22
23 import java.util.Collection;
24
25 import org.onap.policy.apex.core.protocols.Message;
26 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
27
28 /**
29  * The Class Response is a message that holds the response by an Apex engine to another Actino message sent to that
30  * engine.
31  *
32  * @author Liam Fallon (liam.fallon@ericsson.com)
33  */
34 public class EngineServiceInfoResponse extends Response {
35     private static final long serialVersionUID = -7895025789667402067L;
36
37     // The engine service key
38     private AxArtifactKey engineServiceKey;
39
40     // The engines under the control of this engine service
41     private AxArtifactKey[] engineKeyArray;
42
43     // The engine service key
44     private AxArtifactKey apexModelKey;
45
46     /**
47      * Instantiates a new EngineServiceInfoResponse message.
48      *
49      * @param targetKey the target key of the entity that asked for the action that triggered this response message
50      * @param successful the successful if the action in the triggering message worked
51      * @param responseTo the message to which this message is a response
52      */
53     public EngineServiceInfoResponse(final AxArtifactKey targetKey, final boolean successful,
54             final Message responseTo) {
55         super(targetKey, successful, null, responseTo);
56     }
57
58     /**
59      * Instantiates a new EngineServiceInfoResponse message.
60      *
61      * @param targetKey the target key of the entity that asked for the action that triggered this response message
62      * @param successful the successful if the action in the triggering message worked
63      * @param messageData the message data which may indicate specific conditions for the response
64      * @param responseTo the message to which this message is a response
65      */
66     public EngineServiceInfoResponse(final AxArtifactKey targetKey, final boolean successful, final String messageData,
67             final Message responseTo) {
68         super(targetKey, successful, messageData, responseTo);
69     }
70
71     /**
72      * Gets the engine service key.
73      *
74      * @return the engine service key
75      */
76     public AxArtifactKey getEngineServiceKey() {
77         return engineServiceKey;
78     }
79
80     /**
81      * Sets the engine service key.
82      *
83      * @param engineServiceKey the engine service key
84      */
85     public void setEngineServiceKey(final AxArtifactKey engineServiceKey) {
86         this.engineServiceKey = engineServiceKey;
87     }
88
89     /**
90      * Gets the engine key array.
91      *
92      * @return the engine key array
93      */
94     public AxArtifactKey[] getEngineKeyArray() {
95         return engineKeyArray;
96     }
97
98     /**
99      * Sets the engine key array.
100      *
101      * @param engineKeyCollection the engine key array
102      */
103     public void setEngineKeyArray(final Collection<AxArtifactKey> engineKeyCollection) {
104         engineKeyArray = engineKeyCollection.toArray(new AxArtifactKey[engineKeyCollection.size()]);
105     }
106
107     /**
108      * Gets the apex model key.
109      *
110      * @return the apex model key
111      */
112     public AxArtifactKey getApexModelKey() {
113         return apexModelKey;
114     }
115
116     /**
117      * Sets the apex model key.
118      *
119      * @param apexModelKey the apex model key
120      */
121     public void setApexModelKey(final AxArtifactKey apexModelKey) {
122         this.apexModelKey = apexModelKey;
123     }
124 }