public JmxRepository(Repository repository) { try { String[] itemNames = FeaturesServiceMBean.REPOSITORY; Object[] itemValues = new Object[itemNames.length]; itemValues[0] = repository.getName(); itemValues[1] = repository.getURI().toString(); itemValues[2] = toStringArray(repository.getRepositories()); itemValues[3] = getFeatureIdentifierTable(Arrays.asList(repository.getFeatures())); itemValues[4] = repository.isBlacklisted(); data = new CompositeDataSupport(REPOSITORY, itemNames, itemValues); } catch (Exception e) { throw new IllegalStateException("Cannot form repository open data", e); } }
protected void doExecute(FeaturesService featuresService) throws Exception { if (reload) { reloadAllRepos(featuresService); } ShellTable table = new ShellTable(); table.column("Repository"); table.column("URL"); if (showBlacklisted) { table.column("Blacklisted"); } table.emptyTableText("No repositories available"); Repository[] repos = featuresService.listRepositories(); for (Repository repo : repos) { if (repo != null) { if (showBlacklisted || !repo.isBlacklisted()) { Row row = table.addRow(); row.addContent(repo.getName(), repo.getURI().toString()); if (showBlacklisted) { row.addContent(repo.isBlacklisted() ? "yes" : "no"); } } } } table.print(System.out, !noFormat); }
protected void doExecute(FeaturesService featuresService) throws Exception { if (reload) { reloadAllRepos(featuresService); } ShellTable table = new ShellTable(); table.column("Repository"); table.column("URL"); if (showBlacklisted) { table.column("Blacklisted"); } table.emptyTableText("No repositories available"); Repository[] repos = featuresService.listRepositories(); for (Repository repo : repos) { if (repo != null) { if (showBlacklisted || !repo.isBlacklisted()) { Row row = table.addRow(); row.addContent(repo.getName(), repo.getURI().toString()); if (showBlacklisted) { row.addContent(repo.isBlacklisted() ? "yes" : "no"); } } } } table.print(System.out, !noFormat); }