org.openid4java.util
Class AbstractHttpFetcher

java.lang.Object
  extended by org.openid4java.util.AbstractHttpFetcher
All Implemented Interfaces:
HttpFetcher
Direct Known Subclasses:
HttpCache

public abstract class AbstractHttpFetcher
extends java.lang.Object
implements HttpFetcher


Field Summary
private  HttpRequestOptions _defaultOptions
          Default set of HTTP request options to be used when placing HTTP requests, if a custom one was not specified.
 
Constructor Summary
AbstractHttpFetcher()
           
 
Method Summary
 HttpResponse get(java.lang.String url)
          GETs a HTTP URL.
abstract  HttpResponse get(java.lang.String url, HttpRequestOptions requestOptions)
          GETs a HTTP URL.
 HttpRequestOptions getDefaultRequestOptions()
          Returns the default HttpRequestOptions.
 HttpRequestOptions getRequestOptions()
          Gets a clone of the default HttpRequestOptions.
 HttpResponse head(java.lang.String url)
           
abstract  HttpResponse head(java.lang.String url, HttpRequestOptions requestOptions)
           
 HttpResponse post(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> parameters)
           
abstract  HttpResponse post(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> parameters, HttpRequestOptions requestOptions)
           
 void setDefaultRequestOptions(HttpRequestOptions defaultOptions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_defaultOptions

private HttpRequestOptions _defaultOptions
Default set of HTTP request options to be used when placing HTTP requests, if a custom one was not specified.

Constructor Detail

AbstractHttpFetcher

public AbstractHttpFetcher()
Method Detail

get

public HttpResponse get(java.lang.String url)
                 throws java.io.IOException
Description copied from interface: HttpFetcher
GETs a HTTP URL. A cached copy will be returned if one exists.

Specified by:
get in interface HttpFetcher
Parameters:
url - The HTTP URL to GET.
Returns:
A HttpResponse object containing the fetched data.
Throws:
java.io.IOException
See Also:
HttpResponse

get

public abstract HttpResponse get(java.lang.String url,
                                 HttpRequestOptions requestOptions)
                          throws java.io.IOException
Description copied from interface: HttpFetcher
GETs a HTTP URL. A cached copy will be returned if one exists and the supplied options match it.

Specified by:
get in interface HttpFetcher
Parameters:
url - The HTTP URL to GET.
Returns:
A HttpResponse object containing the fetched data.
Throws:
java.io.IOException
See Also:
HttpRequestOptions, HttpResponse

getDefaultRequestOptions

public HttpRequestOptions getDefaultRequestOptions()
Description copied from interface: HttpFetcher
Returns the default HttpRequestOptions. Note that this does not return a clone, so manipulating the object returned here will manipulate the HttpRequestOptions used by the HttpFetcher.

Specified by:
getDefaultRequestOptions in interface HttpFetcher

getRequestOptions

public HttpRequestOptions getRequestOptions()
Description copied from interface: HttpFetcher
Gets a clone of the default HttpRequestOptions.

Specified by:
getRequestOptions in interface HttpFetcher

head

public HttpResponse head(java.lang.String url)
                  throws java.io.IOException
Specified by:
head in interface HttpFetcher
Throws:
java.io.IOException

post

public abstract HttpResponse post(java.lang.String url,
                                  java.util.Map<java.lang.String,java.lang.String> parameters,
                                  HttpRequestOptions requestOptions)
                           throws java.io.IOException
Specified by:
post in interface HttpFetcher
Throws:
java.io.IOException

post

public HttpResponse post(java.lang.String url,
                         java.util.Map<java.lang.String,java.lang.String> parameters)
                  throws java.io.IOException
Specified by:
post in interface HttpFetcher
Throws:
java.io.IOException

head

public abstract HttpResponse head(java.lang.String url,
                                  HttpRequestOptions requestOptions)
                           throws java.io.IOException
Specified by:
head in interface HttpFetcher
Throws:
java.io.IOException

setDefaultRequestOptions

public void setDefaultRequestOptions(HttpRequestOptions defaultOptions)
Specified by:
setDefaultRequestOptions in interface HttpFetcher


Copyright 2006-2008 Sxip Identity Corporation