2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.vdu.utils;
24 import java.util.HashMap;
27 * This Java bean class relays VDU status information in a cloud-agnostic format.
29 * This bean is returned by all implementors of the MsoVduUtils interface operations (instantiate, query, delete).
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;
45 // Add more constructors as appropriate
48 public VduInfo(String id, Map<String, Object> outputs) {
49 this.vduInstanceId = id;
51 this.outputs = outputs;
54 public VduInfo(String id) {
55 this.vduInstanceId = id;
58 public VduInfo(String id, VduStatus status) {
59 this.vduInstanceId = id;
63 public String getVnfInstanceId() {
67 public void setVnfInstanceId(String id) {
68 this.vduInstanceId = id;
71 public String getVnfInstanceName() {
72 return vduInstanceName;
75 public void setVnfInstanceName(String name) {
76 this.vduInstanceName = name;
79 public VduStatus getStatus() {
83 public void setStatus(VduStatus status) {
87 public Map<String, Object> getOutputs() {
91 public void setOutputs(Map<String, Object> outputs) {
92 this.outputs = outputs;
95 public Map<String, Object> getInputs() {
99 public void setInputs(Map<String, Object> inputs) {
100 this.inputs = inputs;
103 public String getLastAction() {
107 public String getActionStatus() {
111 public String getErrorMessage() {
116 public String toString() {
117 return "VduInfo {" + "id='" + vduInstanceId + '\'' + "name='" + vduInstanceName + '\'' + ", inputs='" + inputs
118 + '\'' + ", outputs='" + outputs + '\'' + ", lastAction='" + lastAction + '\'' + ", status='" + status
119 + '\'' + ", errorMessage='" + errorMessage + '\'' + '}';