/** * Gets the follower count of a following specified by the given following id and following type. * * @param followingId the given following id * @param followingType the given following type * @return count */ public long getFollowerCount(final String followingId, final int followingType) { final List<Filter> filters = new ArrayList<Filter>(); filters.add(new PropertyFilter(Follow.FOLLOWING_ID, FilterOperator.EQUAL, followingId)); filters.add(new PropertyFilter(Follow.FOLLOWING_TYPE, FilterOperator.EQUAL, followingType)); final Query query = new Query().setFilter(new CompositeFilter(CompositeFilterOperator.AND, filters)); try { return followRepository.count(query); } catch (final RepositoryException e) { LOGGER.log(Level.ERROR, "Counts follower count error", e); return 0; } }