42ab4b3a97df3ab14885d9d6f2e5c30e1cb38278
[dcaegen2/collectors/datafile.git] /
1 /*-
2  * ============LICENSE_START======================================================================
3  * Copyright (C) 2020 Nokia. All rights reserved.
4  * ===============================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6  * in compliance with the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software distributed under the License
11  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12  * or implied. See the License for the specific language governing permissions and limitations under
13  * the License.
14  * ============LICENSE_END========================================================================
15  */
16 package org.onap.dcaegen2.collectors.datafile.http;
17
18 import io.netty.handler.codec.http.HttpHeaders;
19 import io.netty.handler.codec.http.HttpMethod;
20 import io.netty.handler.codec.http.HttpResponseStatus;
21 import io.netty.handler.codec.http.HttpVersion;
22 import io.netty.handler.codec.http.cookie.Cookie;
23 import reactor.netty.http.client.HttpClientResponse;
24 import reactor.util.context.Context;
25 import reactor.util.context.ContextView;
26
27 import java.util.Map;
28 import java.util.Set;
29
30 public class HttpClientResponseHelper {
31
32     public static final HttpClientResponse RESPONSE_OK = new HttpClientResponse() {
33
34         @Override
35         public Map<CharSequence, Set<Cookie>> cookies() {
36             return null;
37         }
38
39         @Override
40         public boolean isKeepAlive() {
41             return false;
42         }
43
44         @Override
45         public boolean isWebsocket() {
46             return false;
47         }
48
49         @Override
50         public HttpMethod method() {
51             return null;
52         }
53
54         @Override
55         public String fullPath() {
56             return null;
57         }
58
59         @Override
60         public String uri() {
61             return null;
62         }
63
64         @Override
65         public HttpVersion version() {
66             return null;
67         }
68
69         @Override
70         public Context currentContext() {
71             return null;
72         }
73
74         @Override
75         public ContextView currentContextView() {
76             return null;
77         }
78
79         @Override
80         public String[] redirectedFrom() {
81             return new String[0];
82         }
83
84         @Override
85         public HttpHeaders requestHeaders() {
86             return null;
87         }
88
89         @Override
90         public String resourceUrl() {
91             return null;
92         }
93
94         @Override
95         public HttpHeaders responseHeaders() {
96             return null;
97         }
98
99         @Override
100         public HttpResponseStatus status() {
101             return HttpResponseStatus.OK;
102         }
103     };
104
105     public static final HttpClientResponse RESPONSE_ANY_NO_OK = new HttpClientResponse() {
106
107         @Override
108         public Map<CharSequence, Set<Cookie>> cookies() {
109             return null;
110         }
111
112         @Override
113         public boolean isKeepAlive() {
114             return false;
115         }
116
117         @Override
118         public boolean isWebsocket() {
119             return false;
120         }
121
122         @Override
123         public HttpMethod method() {
124             return null;
125         }
126
127         @Override
128         public String fullPath() {
129             return null;
130         }
131
132         @Override
133         public String uri() {
134             return null;
135         }
136
137         @Override
138         public HttpVersion version() {
139             return null;
140         }
141
142         @Override public Context currentContext() {
143             return null;
144         }
145
146         @Override public ContextView currentContextView() {
147             return null;
148         }
149
150         @Override public String[] redirectedFrom() {
151             return new String[0];
152         }
153
154         @Override public HttpHeaders requestHeaders() {
155             return null;
156         }
157
158         @Override public String resourceUrl() {
159             return null;
160         }
161
162         @Override public HttpHeaders responseHeaders() {
163             return null;
164         }
165
166         @Override public HttpResponseStatus status() {
167             return HttpResponseStatus.NOT_IMPLEMENTED;
168         }
169     };
170 }