/** * returns a set of {@link StoreTrait} that are common for all visible graphs. * traits1 = [a,b,c] * traits2 = [b,c] * traits3 = [a,b] * return [b] * * @param config containing optional graphIds csv. * @param user to match visibility against. * @return the set of {@link StoreTrait} that are common for all visible graphs */ public Set<StoreTrait> getTraits(final Map<String, String> config, final User user) { final List<String> graphIds = FederatedStoreUtil.getGraphIds(config); Collection<Graph> graphs = get(user, graphIds); final Set<StoreTrait> traits = graphs.isEmpty() ? Sets.newHashSet() : Sets.newHashSet(StoreTrait.values()); for (final Graph graph : graphs) { traits.retainAll(graph.getStoreTraits()); } return traits; }