*/
@SuppressWarnings("unchecked")
public BaseFeed getFeed(final ServerBaseFeed feed) throws StorageException {
if (feed == null)
throw new StorageException("feed is null");
if (LOG.isInfoEnabled())
LOG.info("get feed: " + feed.getId() + " start-index: "
+ feed.getStartIndex() + " resultCount: "
+ feed.getItemsPerPage());
ReferenceCounter<StorageQuery> query = null;
try {
query = this.controller.getStorageQuery();
BaseFeed retVal = query.get().getLatestFeedQuery(feed.getId(),
feed.getItemsPerPage(), feed.getStartIndex(),
feed.getServiceConfig());
return retVal;
} catch (Exception e) {
LOG.error("Can't get latest feed for feedID: " + feed.getId()
+ " -- " + e.getMessage(), e);
StorageException ex = new StorageException("Can't create Entry -- "
+ e.getMessage(), e);
ex.setStackTrace(e.getStackTrace());
throw ex;
} finally {
if (query != null)
query.decrementRef();