/** * Creates a producer that can be used to transmit the given response message. If the response * message encloses an {@link HttpEntity} it is also expected to implement {@link * HttpAsyncContentProducer}. * * @param response response message. */ public BasicAsyncResponseProducer(final HttpResponse response) { super(); Args.notNull(response, "HTTP response"); this.response = response; final HttpEntity entity = response.getEntity(); if (entity != null) { if (entity instanceof HttpAsyncContentProducer) { this.producer = (HttpAsyncContentProducer) entity; } else { this.producer = new EntityAsyncContentProducer(entity); } } else { this.producer = null; } }
@Override public HeaderIterator headerIterator() { return original.headerIterator(); }
@Override public void removeHeaders(final String name) { original.removeHeaders(name); }
@Override public void setEntity(final HttpEntity entity) { original.setEntity(entity); }
@Override public void setReasonPhrase(final String reason) throws IllegalStateException { original.setReasonPhrase(reason); }
@Override public void setStatusLine(final ProtocolVersion ver, final int code, final String reason) { original.setStatusLine(ver, code, reason); }
@Override public void setStatusLine(final StatusLine statusline) { original.setStatusLine(statusline); }
@Override @Deprecated public void setParams(final HttpParams params) { original.setParams(params); }
@Override public Header[] getAllHeaders() { return original.getAllHeaders(); }
@Override public Header getLastHeader(final String name) { return original.getLastHeader(name); }
@Override public Header[] getHeaders(final String name) { return original.getHeaders(name); }
@Override public boolean containsHeader(final String name) { return original.containsHeader(name); }
@Override public ProtocolVersion getProtocolVersion() { return original.getProtocolVersion(); }
@Override public void setLocale(final Locale loc) { original.setLocale(loc); }
@Override public Locale getLocale() { return original.getLocale(); }
@Override public HeaderIterator headerIterator(final String name) { return original.headerIterator(name); }
@Override @Deprecated public HttpParams getParams() { return original.getParams(); }
@Override public void addHeader(final Header header) { original.addHeader(header); }
@Override public StatusLine getStatusLine() { return original.getStatusLine(); }
@Override public void setHeader(final Header header) { original.setHeader(header); }
@Override public void setStatusLine(final ProtocolVersion ver, final int code) { original.setStatusLine(ver, code); }
@Override public void setHeader(final String name, final String value) { original.setHeader(name, value); }
@Override public void setStatusCode(final int code) throws IllegalStateException { original.setStatusCode(code); }
@Override public void setHeaders(final Header[] headers) { original.setHeaders(headers); }
@Override public HttpEntity getEntity() { return original.getEntity(); }
@Override public void removeHeader(final Header header) { original.removeHeader(header); }