4f5fe39fa1c50d4b4e5ec9a28c94570cf96c7e87
[sdc.git] /
1 /*
2  * Copyright © 2016-2017 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * 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
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.openecomp.server.interceptors;
17
18
19 import javax.ws.rs.core.EntityTag;
20 import javax.ws.rs.core.GenericType;
21 import javax.ws.rs.core.Link;
22 import javax.ws.rs.core.MediaType;
23 import javax.ws.rs.core.MultivaluedMap;
24 import javax.ws.rs.core.NewCookie;
25 import javax.ws.rs.core.Response;
26 import java.lang.annotation.Annotation;
27 import java.net.URI;
28 import java.util.Collections;
29 import java.util.Date;
30 import java.util.Locale;
31 import java.util.Map;
32 import java.util.Set;
33
34 public class DefaultOutput extends Response {
35
36   private static final long serialVersionUID = 8061802931931401706L;
37
38   private final int status;
39   private final Object entity;
40   private MultivaluedMap<String, Object> metadata;
41
42   public DefaultOutput(int s0, Object e0) {
43     this.status = s0;
44     this.entity = e0;
45   }
46
47   @Override
48   public Object getEntity() {
49     return entity;
50   }
51
52   @Override
53   public <T> T readEntity(Class<T> asClass) {
54     return null;
55   }
56
57   @Override
58   public <T> T readEntity(GenericType<T> genericType) {
59     return null;
60   }
61
62   @Override
63   public <T> T readEntity(Class<T> asClass, Annotation[] annotations) {
64     return null;
65   }
66
67   @Override
68   public <T> T readEntity(GenericType<T> var1, Annotation[] var2) {
69     return null;
70   }
71
72   @Override
73   public boolean hasEntity() {
74     return false;
75   }
76
77   @Override
78   public boolean bufferEntity() {
79     return false;
80   }
81
82   @Override
83   public void close() {
84     //close() is not implemented for DefaultOutput
85   }
86
87   @Override
88   public MediaType getMediaType() {
89     return null;
90   }
91
92   @Override
93   public Locale getLanguage() {
94     return null;
95   }
96
97   @Override
98   public int getLength() {
99     return 0;
100   }
101
102   @Override
103   public Set<String> getAllowedMethods() {
104     return Collections.emptySet();
105   }
106
107   @Override
108   public Map<String, NewCookie> getCookies() {
109     return null;
110   }
111
112   @Override
113   public EntityTag getEntityTag() {
114     return null;
115   }
116
117   @Override
118   public Date getDate() {
119     return null;
120   }
121
122   @Override
123   public Date getLastModified() {
124     return null;
125   }
126
127   @Override
128   public URI getLocation() {
129     return null;
130   }
131
132   @Override
133   public Set<Link> getLinks() {
134     return Collections.emptySet();
135   }
136
137   @Override
138   public boolean hasLink(String s0) {
139     return false;
140   }
141
142
143   @Override
144   public Link getLink(String s0) {
145     return null;
146   }
147
148   @Override
149   public Link.Builder getLinkBuilder(String s0) {
150     return null;
151   }
152
153   @Override
154   public int getStatus() {
155     return status;
156   }
157
158   @Override
159   public StatusType getStatusInfo() {
160     return null;
161   }
162
163   void addMetadata(MultivaluedMap<String, Object> meta) {
164     this.metadata = meta;
165   }
166
167   @Override
168   public MultivaluedMap<String, Object> getMetadata() {
169     // don't worry about cloning for now
170     return metadata;
171   }
172
173   @Override
174   public MultivaluedMap<String, String> getStringHeaders() {
175     return null;
176   }
177
178   @Override
179   public String getHeaderString(String s0) {
180     return null;
181   }
182
183 }