2 * Copyright © 2016-2017 European Support Limited
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.openecomp.server.interceptors;
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;
28 import java.util.Collections;
29 import java.util.Date;
30 import java.util.Locale;
34 public class DefaultOutput extends Response {
36 private static final long serialVersionUID = 8061802931931401706L;
38 private final int status;
39 private final Object entity;
40 private MultivaluedMap<String, Object> metadata;
42 public DefaultOutput(int s0, Object e0) {
48 public Object getEntity() {
53 public <T> T readEntity(Class<T> asClass) {
58 public <T> T readEntity(GenericType<T> genericType) {
63 public <T> T readEntity(Class<T> asClass, Annotation[] annotations) {
68 public <T> T readEntity(GenericType<T> var1, Annotation[] var2) {
73 public boolean hasEntity() {
78 public boolean bufferEntity() {
84 //close() is not implemented for DefaultOutput
88 public MediaType getMediaType() {
93 public Locale getLanguage() {
98 public int getLength() {
103 public Set<String> getAllowedMethods() {
104 return Collections.emptySet();
108 public Map<String, NewCookie> getCookies() {
113 public EntityTag getEntityTag() {
118 public Date getDate() {
123 public Date getLastModified() {
128 public URI getLocation() {
133 public Set<Link> getLinks() {
134 return Collections.emptySet();
138 public boolean hasLink(String s0) {
144 public Link getLink(String s0) {
149 public Link.Builder getLinkBuilder(String s0) {
154 public int getStatus() {
159 public StatusType getStatusInfo() {
163 void addMetadata(MultivaluedMap<String, Object> meta) {
164 this.metadata = meta;
168 public MultivaluedMap<String, Object> getMetadata() {
169 // don't worry about cloning for now
174 public MultivaluedMap<String, String> getStringHeaders() {
179 public String getHeaderString(String s0) {