/** * Get the count of the items in the given container. * * @param dso Dspace Context * @return count * @throws ItemCountException if count error */ @Override public int getCount(DSpaceObject dso) throws ItemCountException { loadCount(); Integer val; if (dso instanceof Collection) { val = collectionsCount.get(String.valueOf(((Collection) dso).getID())); } else if (dso instanceof Community) { val = communitiesCount.get(String.valueOf(((Community) dso).getID())); } else { throw new ItemCountException("We can only count items in Communities or Collections"); } if (val != null) { return val.intValue(); } else { return 0; } }
.forName(className.trim()).newInstance(); } catch (Exception e) { throw new ItemCountException("The configuration for ItemCountDAO is invalid: " + className, e);
} catch (SQLException e) { log.error("caught exception: ", e); throw new ItemCountException(e); } catch (SQLException e) { log.error("caught exception: ", e); throw new ItemCountException(e);
throw new ItemCountException(e);