## org.mortbay.jetty.client
Class CachedExchange

    java.lang.Object
      org.mortbay.jetty.client.HttpExchange
          org.mortbay.jetty.client.CachedExchange

Direct Known Subclasses:
  ContentExchange, HttpExchange.CachedExchange, MkcolExchange

    public class CachedExchange

extends HttpExchange

An exchange that caches response status and fields for later use.

Author:
  gregw

Nested Class Summary

Nested classes/interfaces inherited from class org.mortbay.jetty.client.HttpExchange
`HttpExchange.CachedExchange, HttpExchange.ContentExchange`

Field Summary
`protected HttpFields` `_responseFields`
`protected int` `_responseStatus`

Fields inherited from class org.mortbay.jetty.client.HttpExchange
`STATUS_COMPLETED, STATUS_EXCEPTED, STATUS_EXPIRED, STATUS_PARSING_CONTENT, STATUS_PARSING_HEADERS, STATUS_SENDING_REQUEST, STATUS_START, STATUS_WAITING_FOR_COMMIT, STATUS_WAITING_FOR_CONNECTION, STATUS_WAITING_FOR_RESPONSE`

Constructor Summary
`CachedExchange(boolean cacheFields)`

Method Summary
`HttpFields` `getResponseFields()`
`int` `getResponseStatus()`
`protected void` `onResponseHeader(Buffer name, Buffer value)` Called for each response header received
`protected void` `onResponseStatus(Buffer version, int status, Buffer reason)` Called when a response status line has been received.

Methods inherited from class org.mortbay.jetty.client.HttpExchange

`addRequestHeader, addRequestHeader, cancel, configureListeners, getAddress, getEventListener, getMethod, getRequestContent, getRequestContentChunk, getRequestContentSource, getRequestFields, getRetryStatus, getScheme, getStatus, getURI, getVersion, isDone, onConnectionFailed, onException, onExpire, onRequestCommitted, onRequestComplete, onResponseComplete, onResponseContent, onResponseHeaderComplete, onRetry, reset, setAddress, setConfigureListeners, setEventListener, setMethod, setRequestContent, setRequestContentSource, setRequestContentType, setRequestHeader, setRequestHeader, setRetryStatus, setScheme, setURI, setURL, setVersion, setVersion, toString, waitForDone, waitForStatus`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### _responseStatus

    protected int _responseStatus

### _responseFields

    protected HttpFields _responseFields

Constructor Detail

### CachedExchange

    public CachedExchange(boolean cacheFields)

Method Detail

### getResponseStatus

    public int getResponseStatus()

### getResponseFields

    public HttpFields getResponseFields()

### onResponseStatus

    protected void onResponseStatus(Buffer version,
                                    int status,
                                    Buffer reason)
                             throws IOException

  Description copied from class: `HttpExchange`
  Called when a response status line has been received.

  Overrides:
    `onResponseStatus` in class `HttpExchange`
  Parameters:
    `version` - HTTP version
    `status` - HTTP status code
    `reason` - HTTP status code reason string
  Throws:
    `IOException`

### onResponseHeader

    protected void onResponseHeader(Buffer name,
                                    Buffer value)
                             throws IOException

  Description copied from class: `HttpExchange`
  Called for each response header received

  Overrides:
    `onResponseHeader` in class `HttpExchange`
  Parameters:
    `name` - header name
    `value` - header value
  Throws:
    `IOException`

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.