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

DefaultDeleteHandler

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

The handler sends following response to the client:

  1. if the entry could be deleted - 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.DELETE);
		} catch (GDataRequestException e) {
			sendError();
			return;
		}
        if(!authenticateAccount(request,AccountRole.ENTRYAMINISTRATOR)){
            setError(GDataResponse.UNAUTHORIZED);
            sendError();
            return;
        }
		
		try {
			this.service.deleteEntry(this.feedRequest, this.feedResponse);
		
		} catch (ServiceException e) {
			LOG.error("Could not process DeleteFeed request - "
					+ e.getMessage(), e);
            setError(e.getErrorCode());
			sendError();
		}finally{
        closeService();
        }