org.openid4java.util
Class HttpCache
java.lang.Object
org.openid4java.util.AbstractHttpFetcher
org.openid4java.util.HttpCache
- All Implemented Interfaces:
- HttpFetcher
public class HttpCache
- extends AbstractHttpFetcher
Wrapper cache around HttpClient providing caching for HTTP requests.
Intended to be used to optimize the number of HTTP requests performed
during OpenID discovery.
- Author:
- Marius Scurtescu, Johnny Bufu
Constructor Summary |
HttpCache()
|
HttpCache(javax.net.ssl.SSLContext sslContext)
|
HttpCache(javax.net.ssl.SSLContext sslContext,
org.apache.http.conn.ssl.X509HostnameVerifier hostnameVerifier)
Constructs a new HttpCache object, that will be initialized with the
default set of HttpRequestOptions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpCache
public HttpCache()
HttpCache
public HttpCache(javax.net.ssl.SSLContext sslContext)
HttpCache
public HttpCache(javax.net.ssl.SSLContext sslContext,
org.apache.http.conn.ssl.X509HostnameVerifier hostnameVerifier)
- Constructs a new HttpCache object, that will be initialized with the
default set of HttpRequestOptions.
- See Also:
HttpRequestOptions
get
public 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
- Specified by:
get
in class AbstractHttpFetcher
- Parameters:
url
- The HTTP URL to GET.
- Returns:
- A HttpResponse object containing the fetched data.
- Throws:
java.io.IOException
- See Also:
HttpRequestOptions, HttpResponse
post
public 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
- Specified by:
post
in class AbstractHttpFetcher
- Throws:
java.io.IOException
head
public HttpResponse head(java.lang.String url,
HttpRequestOptions requestOptions)
throws java.io.IOException
- Specified by:
head
in interface HttpFetcher
- Specified by:
head
in class AbstractHttpFetcher
- Throws:
java.io.IOException
Copyright © 2012 Sxip. All Rights Reserved.