com.jn.agileway.jaxrs.rr.JaxrsHttpResponse Maven / Gradle / Ivy
package com.jn.agileway.jaxrs.rr;
import com.jn.agileway.http.rr.HttpResponse;
import javax.ws.rs.container.ContainerResponseContext;
import java.util.Collection;
public class JaxrsHttpResponse implements HttpResponse {
private ContainerResponseContext containerResponse;
public JaxrsHttpResponse(ContainerResponseContext context) {
this.containerResponse = context;
}
public ContainerResponseContext getContainerResponse() {
return this.containerResponse;
}
@Override
public void addHeader(String name, String value) {
// unsupported
}
@Override
public String getHeader(String name) {
return this.containerResponse.getHeaderString(name);
}
@Override
public Collection getHeaderNames() {
return this.containerResponse.getHeaders().keySet();
}
@Override
public Collection getHeaders(String name) {
return this.containerResponse.getStringHeaders().get(name);
}
@Override
public int getStatusCode() {
return this.containerResponse.getStatus();
}
}