Add E2 setup response message
[portal/ric-dashboard.git] / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / model / E2SetupResponse.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 AT&T Intellectual Property and Nokia
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 package org.oransc.ric.portal.dashboard.model;
21
22 import java.time.Instant;
23
24 import org.oransc.ric.e2mgr.client.model.SetupRequest;
25
26 import com.fasterxml.jackson.annotation.JsonProperty;
27
28 /**
29  * Response to an E2 Manager setupRequest message carries the original
30  * information plus request type, timestamp and HTTP response code.
31  */
32 public class E2SetupResponse extends SetupRequest implements IDashboardResponse {
33
34         public E2SetupResponse() {
35         }
36
37         public E2SetupResponse(E2SetupRequestType type, SetupRequest request, int responseCode) {
38                 super.ranName(request.getRanName()).ranIp(request.getRanIp()).ranPort(request.getRanPort());
39                 this.requestType = type;
40                 this.timeStamp = Instant.now();
41                 this.responseCode = responseCode;
42         }
43
44         @JsonProperty("requestType")
45         private E2SetupRequestType requestType = null;
46
47         public SetupRequest requestType(E2SetupRequestType type) {
48                 this.requestType = type;
49                 return this;
50         }
51
52         /**
53          * Get requestType
54          * 
55          * @return requestType
56          **/
57         public E2SetupRequestType getRequestType() {
58                 return requestType;
59         }
60
61         public void setRequestType(E2SetupRequestType type) {
62                 this.requestType = type;
63         }
64
65         @JsonProperty("timeStamp")
66         private Instant timeStamp = null;
67
68         public SetupRequest timeStamp(Instant timeStamp) {
69                 this.timeStamp = timeStamp;
70                 return this;
71         }
72
73         /**
74          * Get timeStamp
75          * 
76          * @return timeStamp
77          **/
78         public Instant getTimeStamp() {
79                 return timeStamp;
80         }
81
82         public void setTimeStamp(Instant timeStamp) {
83                 this.timeStamp = timeStamp;
84         }
85
86         @JsonProperty("responseCode")
87         private Integer responseCode = null;
88
89         public SetupRequest responseCode(Integer responseCode) {
90                 this.responseCode = responseCode;
91                 return this;
92         }
93
94         /**
95          * Get responseCode
96          * 
97          * @return responseCode
98          **/
99         public Integer getResponseCode() {
100                 return responseCode;
101         }
102
103         public void setResponseCode(Integer responseCode) {
104                 this.responseCode = responseCode;
105         }
106
107 }