org.apache.lucene.gdata.servlet.handler
Class DefaultGetHandler

java.lang.Object
  extended by org.apache.lucene.gdata.servlet.handler.RequestAuthenticator
      extended by org.apache.lucene.gdata.servlet.handler.AbstractGdataRequestHandler
          extended by org.apache.lucene.gdata.servlet.handler.DefaultGetHandler
All Implemented Interfaces:
GDataHttpAuthenticator, GDataRequestHandler

public class DefaultGetHandler
extends AbstractGdataRequestHandler

Default Handler implementation. This handler processes the incoming GDataRequest and retrieves the requested feed from the underlying storage.

This hander also processes search queries and retrieves the search hits from the underlying search component. The user query will be accessed via the GDataRequest instance passed to the Service class.

The DefaultGetHandler supports HTTP Conditional GET. It set the Last-Modified response header based upon the value of the element in the returned feed or entry. A client can send this value back as the value of the If-Modified-Since request header to avoid retrieving the content again if it hasn't changed. If the content hasn't changed since the If-Modified-Since time, then the GData service returns a 304 (Not Modified) HTTP response.

Author:
Simon Willnauer

Field Summary
 
Fields inherited from class org.apache.lucene.gdata.servlet.handler.AbstractGdataRequestHandler
feedRequest, feedResponse, service
 
Constructor Summary
DefaultGetHandler()
           
 
Method Summary
protected  boolean checkIsModified(String lastModified)
          returns true if the resource has been modified since the specified request header value
 void processRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes the GDATA Client request
 
Methods inherited from class org.apache.lucene.gdata.servlet.handler.AbstractGdataRequestHandler
closeService, initializeRequestHandler, sendError, setError, setFeedResponseFormat, setFeedResponseStatus
 
Methods inherited from class org.apache.lucene.gdata.servlet.handler.RequestAuthenticator
authenticateAccount, authenticateAccount, getTokenFromRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGetHandler

public DefaultGetHandler()
Method Detail

processRequest

public void processRequest(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response)
                    throws IOException,
                           javax.servlet.ServletException
Description copied from interface: GDataRequestHandler
Processes the GDATA Client request

Specified by:
processRequest in interface GDataRequestHandler
Specified by:
processRequest in class AbstractGdataRequestHandler
Parameters:
request - - the client request to be processed
response - - the response to the client request
Throws:
IOException - - if an input/output error occurs due to accessing an IO steam
javax.servlet.ServletException - - if a servlet exception is thrown by the request or response
See Also:
AbstractGdataRequestHandler.processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

checkIsModified

protected boolean checkIsModified(String lastModified)
                           throws ServiceException
returns true if the resource has been modified since the specified request header value

Throws:
ServiceException


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.