bad0f5e20bd0eb99d0f254c276102fed3ff51d9a
[ccsdk/sli.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : SLI
4  * ================================================================================
5  * Copyright (C) 2021 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  *
19  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.ccsdk.sli.adaptors.ansible.model;
24
25 /**
26  * Simple class to store code and message returned by POST/GET to an Ansible Server
27  */
28 public class AnsibleResult {
29
30     private static final String EMPTY_VALUE = "UNKNOWN";
31
32     private int statusCode;
33     private String statusMessage;
34     private String results;
35     private String output;
36     private String serverIp;
37     private String configData;
38
39     public AnsibleResult() {
40         this(-1, EMPTY_VALUE, EMPTY_VALUE);
41     }
42
43     public AnsibleResult(int code, String message) {
44         this(code, message, EMPTY_VALUE);
45     }
46
47     public AnsibleResult(int code, String message, String result) {
48         statusCode = code;
49         statusMessage = message;
50         results = result;
51     }
52
53     public AnsibleResult(int code, String message, String result, String outputData) {
54         statusCode = code;
55         statusMessage = message;
56         results = result;
57         output = outputData;
58     }
59
60     public String getOutput() {
61         return output;
62     }
63
64     public void setOutput(String output) {
65         this.output = output;
66     }
67
68     void set(int code, String message, String results, String output) {
69         this.statusCode = code;
70         this.statusMessage = message;
71         this.results = results;
72         this.output = output;
73     }
74
75     public int getStatusCode() {
76         return this.statusCode;
77     }
78
79     public void setStatusCode(int code) {
80         this.statusCode = code;
81     }
82
83     public String getStatusMessage() {
84         return this.statusMessage;
85     }
86
87     public void setStatusMessage(String message) {
88         this.statusMessage = message;
89     }
90
91     public String getResults() {
92         return this.results;
93     }
94
95     public void setResults(String results) {
96         this.results = results;
97     }
98
99     public String getServerIp() {
100         return this.serverIp;
101     }
102
103     public void setServerIp(String serverIp) {
104         this.serverIp = serverIp;
105     }
106
107     public String getConfigData() {
108         return this.configData;
109     }
110
111     public void setConfigData(String configData) {
112         this.configData = configData;
113     }
114
115 }