cz.geek.gdata.client
Class CachedRequest

java.lang.Object
  extended by com.google.gdata.client.http.HttpGDataRequest
      extended by com.google.gdata.client.http.GoogleGDataRequest
          extended by cz.geek.gdata.client.CachedRequest
All Implemented Interfaces:
com.google.gdata.client.Service.GDataRequest

public class CachedRequest
extends com.google.gdata.client.http.GoogleGDataRequest


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gdata.client.http.GoogleGDataRequest
com.google.gdata.client.http.GoogleGDataRequest.Factory, com.google.gdata.client.http.GoogleGDataRequest.GoogleCookie
 
Nested classes/interfaces inherited from interface com.google.gdata.client.Service.GDataRequest
com.google.gdata.client.Service.GDataRequest.RequestType
 
Field Summary
protected  cz.geek.cache.Cache<String,CachedResponse> cache
           
protected  CachedResponse resp
           
 
Fields inherited from class com.google.gdata.client.http.GoogleGDataRequest
DISABLE_COOKIE_HANDLER_PROPERTY
 
Fields inherited from class com.google.gdata.client.http.HttpGDataRequest
connectionSource, connectTimeout, executed, expectsInput, hasOutput, httpConn, inputType, METHOD_OVERRIDE_HEADER, METHOD_OVERRIDE_PROPERTY, readTimeout, requestUrl, type
 
Constructor Summary
protected CachedRequest(cz.geek.cache.Cache<String,CachedResponse> cache, com.google.gdata.client.Service.GDataRequest.RequestType type, URL requestUrl, com.google.gdata.util.ContentType contentType, com.google.gdata.client.http.HttpAuthToken authToken, Map<String,String> headerMap, Map<String,String> privateHeaderMap, com.google.gdata.client.http.HttpUrlConnectionSource connectionSource)
           
 
Method Summary
 void execute()
           Skips if request is in cache.
 com.google.gdata.util.ContentType getResponseContentType()
           
 com.google.gdata.data.DateTime getResponseDateHeader(String headerName)
           
 String getResponseHeader(String headerName)
           
 InputStream getResponseStream()
           
protected  boolean isCachable()
           
 
Methods inherited from class com.google.gdata.client.http.GoogleGDataRequest
getRequestVersion, getResponseVersion, handleErrorResponse, setService
 
Methods inherited from class com.google.gdata.client.http.HttpGDataRequest
checkResponse, end, getConnection, getParseSource, getRequestConnection, getRequestContentType, getRequestStream, getRequestUrl, getRequestWriter, setConnectTimeout, setEtag, setHeader, setIfModifiedSince, setMethod, setPrivateHeader, setReadTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected cz.geek.cache.Cache<String,CachedResponse> cache

resp

protected CachedResponse resp
Constructor Detail

CachedRequest

protected CachedRequest(cz.geek.cache.Cache<String,CachedResponse> cache,
                        com.google.gdata.client.Service.GDataRequest.RequestType type,
                        URL requestUrl,
                        com.google.gdata.util.ContentType contentType,
                        com.google.gdata.client.http.HttpAuthToken authToken,
                        Map<String,String> headerMap,
                        Map<String,String> privateHeaderMap,
                        com.google.gdata.client.http.HttpUrlConnectionSource connectionSource)
                 throws IOException
Throws:
IOException
Method Detail

execute

public void execute()
             throws IOException,
                    com.google.gdata.util.ServiceException
Skips if request is in cache.

Specified by:
execute in interface com.google.gdata.client.Service.GDataRequest
Overrides:
execute in class com.google.gdata.client.http.GoogleGDataRequest
Throws:
IOException
com.google.gdata.util.ServiceException

isCachable

protected boolean isCachable()

getResponseStream

public InputStream getResponseStream()
                              throws IOException
Specified by:
getResponseStream in interface com.google.gdata.client.Service.GDataRequest
Overrides:
getResponseStream in class com.google.gdata.client.http.HttpGDataRequest
Throws:
IOException

getResponseHeader

public String getResponseHeader(String headerName)
Specified by:
getResponseHeader in interface com.google.gdata.client.Service.GDataRequest
Overrides:
getResponseHeader in class com.google.gdata.client.http.HttpGDataRequest

getResponseContentType

public com.google.gdata.util.ContentType getResponseContentType()
Specified by:
getResponseContentType in interface com.google.gdata.client.Service.GDataRequest
Overrides:
getResponseContentType in class com.google.gdata.client.http.HttpGDataRequest

getResponseDateHeader

public com.google.gdata.data.DateTime getResponseDateHeader(String headerName)
Specified by:
getResponseDateHeader in interface com.google.gdata.client.Service.GDataRequest
Overrides:
getResponseDateHeader in class com.google.gdata.client.http.HttpGDataRequest


Copyright © 2012. All Rights Reserved.