@Test public void testSearch() throws Exception { if (!runTest) { return; } RepositoriesDTO repositories = facade.search("karaf"); assertTrue(!repositories.results.isEmpty()); }
public RepositoriesDTO search(String query) { if (query == null) { query = ""; } RepositoriesDTO answer = new RepositoriesDTO(); answer.query = query; answer.num_results = 0; answer.results = new ArrayList<RepositoryDTO>(); try { List<ArtifactDTO> results = mavenIndexerFacade.searchTextAndPackaging(query, null, "image"); while (!results.isEmpty()) { ArtifactDTO result = results.remove(0); if (result.getPackaging().equals("zip")) { RepositoryDTO repository = new RepositoryDTO(); repository.name = result.getGroupId() + "/" + result.getArtifactId(); repository.description = result.getDescription(); List<ArtifactDTO> similar = findSimilarArtifacts(results, result); results.removeAll(similar); answer.results.add(repository); } } } catch (IOException e) { LOG.debug("Failed to fetch results from indexer facade", e); } return answer; }
RegistryFacade { public RepositoriesDTO search(String query) { if (query == null) { query = ""; } RepositoriesDTO answer = new RepositoriesDTO(); answer.query = query; answer.num_results = 0; answer.results = new ArrayList<RepositoryDTO>(); try { List<ArtifactDTO> results = mavenIndexerFacade.searchTextAndPackaging(query, null, "image"); while (!results.isEmpty()) { ArtifactDTO result = results.remove(0); if (result.getPackaging().equals("zip")) { RepositoryDTO repository = new RepositoryDTO(); repository.name = result.getGroupId() + "/" + result.getArtifactId(); repository.description = result.getDescription(); List<ArtifactDTO> similar = findSimilarArtifacts(results, result); results.removeAll(similar); answer.results.add(repository); } } } catch (IOException e) { LOG.debug("Failed to fetch results from indexer facade", e); } return answer; } }
RegistryFacade { public RepositoriesDTO search(String query) { if (query == null) { query = ""; } RepositoriesDTO answer = new RepositoriesDTO(); answer.query = query; answer.num_results = 0; answer.results = new ArrayList<RepositoryDTO>(); try { List<ArtifactDTO> results = mavenIndexerFacade.searchTextAndPackaging(query, null, "image"); while (!results.isEmpty()) { ArtifactDTO result = results.remove(0); if (result.getPackaging().equals("zip")) { RepositoryDTO repository = new RepositoryDTO(); repository.name = result.getGroupId() + "/" + result.getArtifactId(); repository.description = result.getDescription(); List<ArtifactDTO> similar = findSimilarArtifacts(results, result); results.removeAll(similar); answer.results.add(repository); } } } catch (IOException e) { LOG.debug("Failed to fetch results from indexer facade", e); } return answer; } RegistryFacade(); }
RegistryFacade { public RepositoriesDTO search(String query) { if (query == null) { query = ""; } RepositoriesDTO answer = new RepositoriesDTO(); answer.query = query; answer.num_results = 0; answer.results = new ArrayList<RepositoryDTO>(); try { List<ArtifactDTO> results = mavenIndexerFacade.searchTextAndPackaging(query, null, "image"); while (!results.isEmpty()) { ArtifactDTO result = results.remove(0); if (result.getPackaging().equals("zip")) { RepositoryDTO repository = new RepositoryDTO(); repository.name = result.getGroupId() + "/" + result.getArtifactId(); repository.description = result.getDescription(); List<ArtifactDTO> similar = findSimilarArtifacts(results, result); results.removeAll(similar); answer.results.add(repository); } } } catch (IOException e) { LOG.debug("Failed to fetch results from indexer facade", e); } return answer; } RegistryFacade(); File getMavenIndexerCacheDirectory(); @PostConstruct void init(); @PreDestroy void destroy(); RepositoriesDTO search(String query); Map<String, String> tags(String namespace, String repository); Object imageJson(String imageID); }
RegistryFacade { public RepositoriesDTO search(String query) { if (query == null) { query = ""; } RepositoriesDTO answer = new RepositoriesDTO(); answer.query = query; answer.num_results = 0; answer.results = new ArrayList<RepositoryDTO>(); try { List<ArtifactDTO> results = mavenIndexerFacade.searchTextAndPackaging(query, null, "image"); while (!results.isEmpty()) { ArtifactDTO result = results.remove(0); if (result.getPackaging().equals("zip")) { RepositoryDTO repository = new RepositoryDTO(); repository.name = result.getGroupId() + "/" + result.getArtifactId(); repository.description = result.getDescription(); List<ArtifactDTO> similar = findSimilarArtifacts(results, result); results.removeAll(similar); answer.results.add(repository); } } } catch (IOException e) { LOG.debug("Failed to fetch results from indexer facade", e); } return answer; } RegistryFacade(); File getMavenIndexerCacheDirectory(); @PostConstruct void init(); @PreDestroy void destroy(); RepositoriesDTO search(String query); Map<String, String> tags(String namespace, String repository); Object imageJson(String imageID); static final String SEPARATOR; }