org.openid4java.util
Class HttpCache.DefaultHttpResponse

java.lang.Object
  extended by org.openid4java.util.HttpCache.DefaultHttpResponse
All Implemented Interfaces:
HttpResponse
Enclosing class:
HttpCache

private static class HttpCache.DefaultHttpResponse
extends java.lang.Object
implements HttpResponse


Field Summary
private  java.lang.String _body
          The HTTP response body.
private  boolean _bodySizeExceeded
          Flag to indicate if the HTTP response size exceeded the maximum allowed by the (default) HttpRequestOptions.
private  java.lang.String _finalUri
          The final URI from where the document was obtained, after following redirects.
private  int _maxRedirectsFollowed
          The maximum HTTP redirects limit that was configured when this HTTP response was obtained.
private  java.util.Map _responseHeaders
          Map of header names List of Header objects of the HTTP response.
private  int _statusCode
          The status code of the HTTP response.
private  java.lang.String _statusLine
          The status line of the HTTP response.
private  long _timestamp
          timestamp of creation (number of milliseconds since January 1, 1970, 00:00:00 GMT)
 
Constructor Summary
HttpCache.DefaultHttpResponse(int statusCode, java.lang.String statusLine, int redirectsFollowed, java.lang.String finalUri, org.apache.http.Header[] responseHeaders, java.lang.String body)
          Constructs a new HttpResponse with the provided parameters.
 
Method Summary
 java.lang.String getBody()
          Gets the HttpResponse body.
 java.lang.String getFinalUri()
          Gets the final URI from where the document was obtained, after following redirects.
 int getMaxRedirectsFollowed()
          Gets the maximum HTTP redirects limit that was configured when this HTTP response was obtained.
 org.apache.http.Header getResponseHeader(java.lang.String headerName)
          Gets the first header matching the provided headerName parameter, or null if no header with that name exists.
 org.apache.http.Header[] getResponseHeaders(java.lang.String headerName)
          Gets an array of Header objects for the provided headerName parameter.
 int getStatusCode()
          Gets the status code of the HttpResponse.
 java.lang.String getStatusLine()
          Gets the status line of the HttpResponse.
 long getTimestamp()
           
 boolean isBodySizeExceeded()
          Returns true if the HTTP response size exceeded the maximum allowed by the (default) HttpRequestOptions.
 void setBodySizeExceeded(boolean bodySizeExceeded)
          Sets the flag to indicate whether the HTTP response size exceeded the maximum allowed by the (default) HttpRequestOptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_statusCode

private int _statusCode
The status code of the HTTP response.


_statusLine

private java.lang.String _statusLine
The status line of the HTTP response.


_maxRedirectsFollowed

private int _maxRedirectsFollowed
The maximum HTTP redirects limit that was configured when this HTTP response was obtained.


_finalUri

private java.lang.String _finalUri
The final URI from where the document was obtained, after following redirects.


_responseHeaders

private java.util.Map _responseHeaders
Map of header names List of Header objects of the HTTP response.


_body

private java.lang.String _body
The HTTP response body.


_bodySizeExceeded

private boolean _bodySizeExceeded
Flag to indicate if the HTTP response size exceeded the maximum allowed by the (default) HttpRequestOptions.


_timestamp

private long _timestamp
timestamp of creation (number of milliseconds since January 1, 1970, 00:00:00 GMT)

Constructor Detail

HttpCache.DefaultHttpResponse

public HttpCache.DefaultHttpResponse(int statusCode,
                                     java.lang.String statusLine,
                                     int redirectsFollowed,
                                     java.lang.String finalUri,
                                     org.apache.http.Header[] responseHeaders,
                                     java.lang.String body)
Constructs a new HttpResponse with the provided parameters.

Method Detail

getStatusCode

public int getStatusCode()
Gets the status code of the HttpResponse.

Specified by:
getStatusCode in interface HttpResponse

getStatusLine

public java.lang.String getStatusLine()
Gets the status line of the HttpResponse.


getMaxRedirectsFollowed

public int getMaxRedirectsFollowed()
Gets the maximum HTTP redirects limit that was configured when this HTTP response was obtained.


getFinalUri

public java.lang.String getFinalUri()
Gets the final URI from where the document was obtained, after following redirects.

Specified by:
getFinalUri in interface HttpResponse

getResponseHeader

public org.apache.http.Header getResponseHeader(java.lang.String headerName)
Gets the first header matching the provided headerName parameter, or null if no header with that name exists.

Specified by:
getResponseHeader in interface HttpResponse

getResponseHeaders

public org.apache.http.Header[] getResponseHeaders(java.lang.String headerName)
Gets an array of Header objects for the provided headerName parameter.

Specified by:
getResponseHeaders in interface HttpResponse

getBody

public java.lang.String getBody()
Gets the HttpResponse body.

Specified by:
getBody in interface HttpResponse

isBodySizeExceeded

public boolean isBodySizeExceeded()
Returns true if the HTTP response size exceeded the maximum allowed by the (default) HttpRequestOptions.

Specified by:
isBodySizeExceeded in interface HttpResponse
Returns:

setBodySizeExceeded

public void setBodySizeExceeded(boolean bodySizeExceeded)
Sets the flag to indicate whether the HTTP response size exceeded the maximum allowed by the (default) HttpRequestOptions.


getTimestamp

public long getTimestamp()


Copyright 2006-2008 Sxip Identity Corporation