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(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
"required component is not available");
throw new FeedHandlerException(
"Can't save feed - ServiceFactory is null");
}
service = serviceFactory.getAdminService();
service.createFeed(feed, account);
} catch (ServiceException e) {
setError(GDataResponse.SERVER_ERROR,
"can not create feed");
LOG.error("Can not create feed -- " + e.getMessage(), e);
} catch (FeedHandlerException e) {
LOG.error("Can not create feed -- " + e.getMessage(), e);
}catch (ParseException e) {
LOG.error("Can not create feed -- " + e.getMessage(), e);
}finally{
if(service != null)
service.close();
}
}
sendResponse(response);