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

UpdateFeedHandler

public class UpdateFeedHandler extends AbstractFeedHandler
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)

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

        super.processRequest(request, response);
        if (this.authenticated) {
            AdminService service= null;
            try {
                ServerBaseFeed feed = createFeedFromRequest(request);
                GDataAccount account = createRequestedAccount(request);

                GDataServerRegistry registry = GDataServerRegistry
                        .getRegistry();
                ServiceFactory serviceFactory = registry.lookup(
                        ServiceFactory.class, ComponentType.SERVICEFACTORY);
                if (serviceFactory == null) {
                    setError(GDataResponse.SERVER_ERROR,
                            "required component is not available");
                    throw new FeedHandlerException(
                            "Can't update feed - ServiceFactory is null");
                }
                service = serviceFactory.getAdminService();
                service.updateFeed(feed, account);
            } catch (ServiceException e) {
                setError(e.getErrorCode(),
                        "can not update feed");
                LOG.error("Can not update feed -- " + e.getMessage(), e);
            } catch (Exception e) {

                LOG.error("Can not update feed -- " + e.getMessage(), e);

            }finally{
                if(service != null)
                    service.close();
            }
        }
        sendResponse(response);