028ec9ec8d65e299c577cd7fe59c71975b4e07b6
[so.git] / adapters / mso-adapters-rest-interface / src / main / java / org / onap / so / openstack / beans / StackInfo.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.openstack.beans;
22
23
24 import java.util.HashMap;
25 import java.util.Map;
26
27 /*
28  * This Java bean class relays Heat stack status information to ActiveVOS processes.
29  * 
30  * This bean is returned by all Heat-specific adapter operations (create, query, delete)
31  */
32
33 public class StackInfo {
34         // Set defaults for everything
35         private String name = "";
36         private String canonicalName = "";
37         private HeatStatus status = HeatStatus.UNKNOWN;
38         private String statusMessage = "";
39         private Map<String,Object> outputs = new HashMap<>();
40         private Map<String,Object> parameters = new HashMap<>();
41
42         public StackInfo () {
43         }
44         
45         public StackInfo (String name, HeatStatus status, String statusMessage, Map<String,Object> outputs) {
46                 this.name = name;
47                 this.canonicalName = name;      // Don't have an ID, so just use name
48
49                 this.status = status;
50                 if (statusMessage != null)  this.statusMessage = statusMessage;
51                 if (outputs != null)  this.outputs = outputs;
52         }
53         
54         public StackInfo (String name, HeatStatus status) {
55                 this.name = name;
56                 this.canonicalName = name;      // Don't have an ID, so just use name
57                 this.status = status;
58         }
59         
60         public String getName() {
61                 return name;
62         }
63         
64         public void setName (String name) {
65                 this.name = name;
66         }
67         
68         public String getCanonicalName() {
69                 return canonicalName;
70         }
71         
72         public void setCanonicalName (String name) {
73                 this.canonicalName = name;
74         }
75         
76         public HeatStatus getStatus() {
77                 return status;
78         }
79         
80         public void setStatus (HeatStatus status) {
81                 this.status = status;
82         }
83         
84         public String getStatusMessage() {
85                 return statusMessage;
86         }
87         
88         public void setStatusMessage (String statusMessage) {
89                 this.statusMessage = statusMessage;
90         }
91         
92         public Map<String,Object> getOutputs () {
93                 return outputs;
94         }
95         
96         public void setOutputs (Map<String,Object> outputs) {
97                 this.outputs = outputs;
98         }
99         
100         public Map<String,Object> getParameters () {
101                 return parameters;
102         }
103         
104         public void setParameters (Map<String,Object> parameters) {
105                 this.parameters = parameters;
106         }
107         
108 }
109