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.openecomp.mso.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
30 * (instantiate, query, delete).
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;
47 // Add more constructors as appropriate
50 public VduInfo (String id, Map<String,Object> outputs) {
51 this.vduInstanceId = id;
52 if (outputs != null) this.outputs = outputs;
55 public VduInfo (String id) {
56 this.vduInstanceId = id;
59 public VduInfo (String id, VduStatus status) {
60 this.vduInstanceId = id;
64 public String getVnfInstanceId() {
68 public void setVnfInstanceId (String id) {
69 this.vduInstanceId = id;
72 public String getVnfInstanceName() {
73 return vduInstanceName;
76 public void setVnfInstanceName (String name) {
77 this.vduInstanceName = name;
80 public VduStatus getStatus() {
84 public void setStatus (VduStatus status) {
88 public Map<String,Object> getOutputs () {
92 public void setOutputs (Map<String,Object> outputs) {
93 this.outputs = outputs;
96 public Map<String,Object> getInputs () {
100 public void setInputs (Map<String,Object> inputs) {
101 this.inputs = inputs;
104 public String getLastAction() {
108 public String getActionStatus() {
112 public String getErrorMessage() {
117 public String toString() {
119 "id='" + vduInstanceId + '\'' +
120 "name='" + vduInstanceName + '\'' +
121 ", inputs='" + inputs + '\'' +
122 ", outputs='" + outputs + '\'' +
123 ", lastAction='" + lastAction + '\'' +
124 ", status='" + status + '\'' +
125 ", errorMessage='" + errorMessage + '\'' +