* org.apache.lucene.gdata.data.GDataAccount)
*/
public void createFeed(final ServerBaseFeed feed, final GDataAccount account)
throws ServiceException {
if (feed == null)
throw new ServiceException("Can not create feed -- feed is null",
GDataResponse.BAD_REQUEST);
if (account == null)
throw new ServiceException(
"Can not create feed -- account is null",
GDataResponse.UNAUTHORIZED);
if (feed.getId() == null)
throw new ServiceException("Feed ID is null can not create feed",
GDataResponse.BAD_REQUEST);
if (account.getName() == null)
throw new ServiceException(
"Account name is null -- can't create feed",
GDataResponse.UNAUTHORIZED);
try {
feed.setUpdated(getCurrentDateTime());
feed.setAccount(account);
this.storage.storeFeed(feed, account.getName());
} catch (StorageException e) {
if (LOG.isInfoEnabled())
LOG.info("Can not save feed -- " + e.getMessage(), e);
throw new ServiceException("Can not save feed", e,
GDataResponse.BAD_REQUEST);
}
}