3646b292c5b903b0766ea9d3d42c04014bec6402
[so.git] / adapters / mso-vnf-adapter / src / main / java / org / openecomp / mso / vdu / utils / VduInfo.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * OPENECOMP - MSO
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.openecomp.mso.vdu.utils;
22
23 import java.util.Map;
24 import java.util.HashMap;
25
26 /*
27  * This Java bean class relays VDU status information in a cloud-agnostic format.
28  * 
29  * This bean is returned by all implementors of the MsoVduUtils interface operations
30  * (instantiate, query, delete).
31  */
32
33 public class VduInfo {
34         // Set defaults for everything
35         private String vduInstanceId = "";
36         private String vduInstanceName = "";
37         private VduStatus status = VduStatus.NOTFOUND;
38         private Map<String,Object> outputs = new HashMap<>();
39         private Map<String,Object> inputs = new HashMap<>();
40         private String lastAction;
41         private String actionStatus;
42         private String errorMessage;
43         
44         public VduInfo () {
45         }
46
47         // Add more constructors as appropriate
48         //
49         
50         public VduInfo (String id, Map<String,Object> outputs) {
51                 this.vduInstanceId = id;
52                 if (outputs != null)  this.outputs = outputs;
53         }
54         
55         public VduInfo (String id) {
56                 this.vduInstanceId = id;
57         }
58         
59         public VduInfo (String id, VduStatus status) {
60                 this.vduInstanceId = id;
61                 this.status = status;
62         }
63         
64         public String getVnfInstanceId() {
65                 return vduInstanceId;
66         }
67         
68         public void setVnfInstanceId (String id) {
69                 this.vduInstanceId = id;
70         }
71         
72         public String getVnfInstanceName() {
73                 return vduInstanceName;
74         }
75         
76         public void setVnfInstanceName (String name) {
77                 this.vduInstanceName = name;
78         }
79         
80         public VduStatus getStatus() {
81                 return status;
82         }
83         
84         public void setStatus (VduStatus status) {
85                 this.status = status;
86         }
87         
88         public Map<String,Object> getOutputs () {
89                 return outputs;
90         }
91         
92         public void setOutputs (Map<String,Object> outputs) {
93                 this.outputs = outputs;
94         }
95         
96         public Map<String,Object> getInputs () {
97                 return inputs;
98         }
99         
100         public void setInputs (Map<String,Object> inputs) {
101                 this.inputs = inputs;
102         }
103
104         public String getLastAction() {
105                 return lastAction;
106         }
107
108         public String getActionStatus() {
109                 return actionStatus;
110         }
111
112         public String getErrorMessage() {
113                 return errorMessage;
114         }
115
116         @Override
117     public String toString() {
118         return "VduInfo {" +
119                 "id='" + vduInstanceId + '\'' +
120                 "name='" + vduInstanceName + '\'' +
121                 ", inputs='" + inputs + '\'' +
122                 ", outputs='" + outputs + '\'' +
123                 ", lastAction='" + lastAction + '\'' +
124                 ", status='" + status + '\'' +
125                 ", errorMessage='" + errorMessage + '\'' +
126                 '}';
127     }
128
129 }
130