@Test void getIndex() { assertIndex(client.fetchIndex()); }
@Override public ComponentIndices getIndex(final String language, final boolean includeIconContent, final String query) { final Locale locale = localeMapper.mapLocale(language); caches.evictIfNeeded(indicesPerRequest, configuration.getMaxCacheSize() - 1); return indicesPerRequest.computeIfAbsent(new RequestKey(locale, includeIconContent, query), k -> { final Predicate<ComponentIndex> filter = queryLanguageCompiler.compile(query, componentEvaluators); return new ComponentIndices(Stream .concat(findDeployedComponents(includeIconContent, locale), virtualComponents .getDetails() .stream() .map(detail -> new ComponentIndex(detail.getId(), detail.getDisplayName(), detail.getId().getFamily(), new Icon(detail.getIcon(), null, null), new Icon(virtualComponents.getFamilyIconFor(detail.getId().getFamilyId()), null, null), detail.getVersion(), singletonList(detail.getId().getFamily()), detail.getLinks()))) .filter(filter) .collect(toList())); }); }
ComponentResourceImpl implements ComponentResource { @Override public ComponentIndices getIndex(final String language, final boolean includeIconContent, final String query) { final Locale locale = localeMapper.mapLocale(language); caches.evictIfNeeded(indicesPerRequest, configuration.getMaxCacheSize() - 1); return indicesPerRequest.computeIfAbsent(new RequestKey(locale, includeIconContent, query), k -> { final Predicate<ComponentIndex> filter = queryLanguageCompiler.compile(query, componentEvaluators); return new ComponentIndices(Stream .concat(findDeployedComponents(includeIconContent, locale), virtualComponents .getDetails() .stream() .map(detail -> new ComponentIndex(detail.getId(), detail.getDisplayName(), detail.getId().getFamily(), new Icon(detail.getIcon(), null, null), new Icon(virtualComponents.getFamilyIconFor(detail.getId().getFamilyId()), null, null), detail.getVersion(), singletonList(detail.getId().getFamily()), detail.getLinks()))) .filter(filter) .collect(toList())); }); } }
ComponentResourceImpl implements ComponentResource { @Override public ComponentIndices getIndex(final String language, final boolean includeIconContent, final String query) { final Locale locale = localeMapper.mapLocale(language); caches.evictIfNeeded(indicesPerRequest, configuration.getMaxCacheSize() - 1); return indicesPerRequest.computeIfAbsent(new RequestKey(locale, includeIconContent, query), k -> { final Predicate<ComponentIndex> filter = queryLanguageCompiler.compile(query, componentEvaluators); return new ComponentIndices(Stream .concat(findDeployedComponents(includeIconContent, locale), virtualComponents .getDetails() .stream() .map(detail -> new ComponentIndex(detail.getId(), detail.getDisplayName(), detail.getId().getFamily(), new Icon(detail.getIcon(), null, null), new Icon(virtualComponents.getFamilyIconFor(detail.getId().getFamilyId()), null, null), detail.getVersion(), singletonList(detail.getId().getFamily()), detail.getLinks()))) .filter(filter) .collect(toList())); }); }  }
ComponentResourceImpl implements ComponentResource { @Override public ComponentIndices getIndex(final String language, final boolean includeIconContent, final String query) { final Locale locale = localeMapper.mapLocale(language); caches.evictIfNeeded(indicesPerRequest, configuration.getMaxCacheSize() - 1); return indicesPerRequest.computeIfAbsent(new RequestKey(locale, includeIconContent, query), k -> { final Predicate<ComponentIndex> filter = queryLanguageCompiler.compile(query, componentEvaluators); return new ComponentIndices(Stream .concat(findDeployedComponents(includeIconContent, locale), virtualComponents .getDetails() .stream() .map(detail -> new ComponentIndex(detail.getId(), detail.getDisplayName(), detail.getId().getFamily(), new Icon(detail.getIcon(), null, null), new Icon(virtualComponents.getFamilyIconFor(detail.getId().getFamilyId()), null, null), detail.getVersion(), singletonList(detail.getId().getFamily()), detail.getLinks()))) .filter(filter) .collect(toList())); }); }  void clearCache(@Observes final DeployedComponent deployedComponent); @Override Dependencies getDependencies(final String[] ids); @Override StreamingOutput getDependency(final String id); @Override ComponentIndices getIndex(final String language, final boolean includeIconContent, final String query); @Override Response familyIcon(final String id); @Override Response icon(final String id); @Override Map<String, String> migrate(final String id, final int version, final Map<String, String> config); @Override // TODO: max ids.length ComponentDetailList getDetail(final String language, final String[] ids); }
ComponentResourceImpl implements ComponentResource { @Override public ComponentIndices getIndex(final String language, final boolean includeIconContent, final String query) { final Locale locale = localeMapper.mapLocale(language); caches.evictIfNeeded(indicesPerRequest, configuration.getMaxCacheSize() - 1); return indicesPerRequest.computeIfAbsent(new RequestKey(locale, includeIconContent, query), k -> { final Predicate<ComponentIndex> filter = queryLanguageCompiler.compile(query, componentEvaluators); return new ComponentIndices(Stream .concat(findDeployedComponents(includeIconContent, locale), virtualComponents .getDetails() .stream() .map(detail -> new ComponentIndex(detail.getId(), detail.getDisplayName(), detail.getId().getFamily(), new Icon(detail.getIcon(), null, null), new Icon(virtualComponents.getFamilyIconFor(detail.getId().getFamilyId()), null, null), detail.getVersion(), singletonList(detail.getId().getFamily()), detail.getLinks()))) .filter(filter) .collect(toList())); }); }  void clearCache(@Observes final DeployedComponent deployedComponent); @Override Dependencies getDependencies(final String[] ids); @Override StreamingOutput getDependency(final String id); @Override ComponentIndices getIndex(final String language, final boolean includeIconContent, final String query); @Override Response familyIcon(final String id); @Override Response icon(final String id); @Override Map<String, String> migrate(final String id, final int version, final Map<String, String> config); @Override // TODO: max ids.length ComponentDetailList getDetail(final String language, final String[] ids);  }