/** * 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; } }
dao = new ItemCountDAOSolr(); } else { try {