Replaced all tabs with spaces in java and pom.xml
[so.git] / adapters / mso-openstack-adapters / src / main / java / org / onap / so / vdu / utils / VduInfo.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.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 (instantiate, query, delete).
30  */
31
32 public class VduInfo {
33     // Set defaults for everything
34     private String vduInstanceId = "";
35     private String vduInstanceName = "";
36     private VduStatus status = VduStatus.NOTFOUND;
37     private Map<String, Object> outputs = new HashMap<>();
38     private Map<String, Object> inputs = new HashMap<>();
39     private String lastAction;
40     private String actionStatus;
41     private String errorMessage;
42
43     public VduInfo() {}
44
45     // Add more constructors as appropriate
46     //
47
48     public VduInfo(String id, Map<String, Object> outputs) {
49         this.vduInstanceId = id;
50         if (outputs != null)
51             this.outputs = outputs;
52     }
53
54     public VduInfo(String id) {
55         this.vduInstanceId = id;
56     }
57
58     public VduInfo(String id, VduStatus status) {
59         this.vduInstanceId = id;
60         this.status = status;
61     }
62
63     public String getVnfInstanceId() {
64         return vduInstanceId;
65     }
66
67     public void setVnfInstanceId(String id) {
68         this.vduInstanceId = id;
69     }
70
71     public String getVnfInstanceName() {
72         return vduInstanceName;
73     }
74
75     public void setVnfInstanceName(String name) {
76         this.vduInstanceName = name;
77     }
78
79     public VduStatus getStatus() {
80         return status;
81     }
82
83     public void setStatus(VduStatus status) {
84         this.status = status;
85     }
86
87     public Map<String, Object> getOutputs() {
88         return outputs;
89     }
90
91     public void setOutputs(Map<String, Object> outputs) {
92         this.outputs = outputs;
93     }
94
95     public Map<String, Object> getInputs() {
96         return inputs;
97     }
98
99     public void setInputs(Map<String, Object> inputs) {
100         this.inputs = inputs;
101     }
102
103     public String getLastAction() {
104         return lastAction;
105     }
106
107     public String getActionStatus() {
108         return actionStatus;
109     }
110
111     public String getErrorMessage() {
112         return errorMessage;
113     }
114
115     @Override
116     public String toString() {
117         return "VduInfo {" + "id='" + vduInstanceId + '\'' + "name='" + vduInstanceName + '\'' + ", inputs='" + inputs
118                 + '\'' + ", outputs='" + outputs + '\'' + ", lastAction='" + lastAction + '\'' + ", status='" + status
119                 + '\'' + ", errorMessage='" + errorMessage + '\'' + '}';
120     }
121
122 }
123