FileDocCategorySizeDatePackage
DefaultUpdateHandler.javaAPI DocApache Lucene 2.1.03314Wed Feb 14 10:46:04 GMT 2007org.apache.lucene.gdata.servlet.handler

DefaultUpdateHandler

public class DefaultUpdateHandler extends AbstractGdataRequestHandler
Default Handler implementation. This handler processes the incoming {@link org.apache.lucene.gdata.server.GDataRequest} and updates the requested feed entry in the storage and the search component.

The handler sends following response to the client:

  1. if the entry was successfully updated - HTTP status code 200 OK
  2. if an error occurs - HTTP status code 500 INTERNAL SERVER ERROR
  3. if the resource could not found - HTTP status code 404 NOT FOUND
author
Simon Willnauer

Fields Summary
private static final Log
LOG
Constructors Summary
Methods Summary
public voidprocessRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

throws
ServletException
see
org.apache.lucene.gdata.servlet.handler.AbstractGdataRequestHandler#processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)


	           	 
	
	   
			      
		try {
			initializeRequestHandler(request, response,GDataRequestType.UPDATE);
		} catch (GDataRequestException e) {
            setError(GDataResponse.UNAUTHORIZED);
			sendError();
			return;
		}
        if(!authenticateAccount(request,AccountRole.ENTRYAMINISTRATOR)){
            sendError();
            return;
        }
        
		try {
			BaseEntry entry = this.service.updateEntry(this.feedRequest,
					this.feedResponse);
			setFeedResponseFormat();
			this.feedResponse.sendResponse(entry, this.feedRequest.getConfigurator());
		
		}
		catch (ServiceException e) {
			LOG.error("Could not process UpdateFeed request - "
					+ e.getMessage(), e);
            setError(e.getErrorCode());
			sendError();
		}finally{
        closeService();
        }