a42caa5ee1e98333048ae40e31286ae7b9c36882
[aai/data-router.git] / src / main / java / org / onap / aai / datarouter / entity / PolicyResponse.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright © 2017 Amdocs
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  */
23 package org.onap.aai.datarouter.entity;
24
25 /**
26  * Provides information about the level of success of a policy execution against a routed query.
27  */
28 public class PolicyResponse {
29
30   private ResponseType responseType;
31
32   private String responseData;
33
34   private int httpResponseCode;
35
36   public PolicyResponse(ResponseType responseType, String responseData) {
37     super();
38     this.responseType = responseType;
39     this.responseData = responseData;
40   }
41
42   public ResponseType getResponseType() {
43     return responseType;
44   }
45
46   public String getResponseData() {
47     return responseData;
48   }
49
50
51   public int getHttpResponseCode() {
52     return httpResponseCode;
53   }
54
55   public void setHttpResponseCode(int httpResponseCode) {
56     this.httpResponseCode = httpResponseCode;
57   }
58
59   @Override
60   public String toString() {
61     return "PolicyResponse [responseType=" + responseType + ", responseData=" + responseData
62         + ", httpResponseCode=" + httpResponseCode + "]";
63   }
64
65
66
67   public enum ResponseType {
68     SUCCESS, PARTIAL_SUCCESS, FAILURE;
69   }
70 }