public void run() { RepositoryIndexer.indexRepo(info); } });
public static void updateIndexWithArtifacts(RepositoryInfo repo, Collection<Artifact> artifacts) { assert repo != null; if (artifacts == null || artifacts.size() == 0) { return; } RepositoryIndexerImplementation impl = findImplementation(repo); if (impl == null) { return; } impl.updateIndexWithArtifacts(repo, artifacts); }
/** Creates new form RepositoryRegisterUI */ public RepositoryRegisterUI() { initComponents(); validateInfo(); String[] types = RepositoryIndexer.getAvailableTypes(); if (types.length == 1) { lblType.setVisible(false); comType.setVisible(false); } comType.setModel(new DefaultComboBoxModel(types)); comType.setSelectedItem(RepositoryPreferences.TYPE_NEXUS); }
public void taskFinished(Task task2) { //reload is done in executors // ProjectURLWatcher.fireMavenProjectReload(project); RepositoryInfo info = RepositoryPreferences.getInstance().getRepositoryInfoById(RepositoryPreferences.LOCAL_REPO_ID); if (info != null) { RepositoryIndexer.updateIndexWithArtifacts(info, project.getOriginalMavenProject().getDependencyArtifacts()); } } });
for (NBVersionInfo record : rec) { Artifact a = RepositoryUtil.createArtifact(record); RepositoryIndexer.deleteArtifactFromIndex(info, a);
public void run() { if (ri.getIndexUpdateUrl() != null) { RepositoryIndexer.indexRepo(ri); } } }, MILIS_IN_MIN * 2);
public static void indexRepo(RepositoryInfo repo) { assert repo != null; RepositoryIndexerImplementation impl = findImplementation(repo); if (impl == null) { return; } impl.indexRepo(repo); }
public void run() { List<RepositoryInfo> infos = RepositoryPreferences.getInstance().getRepositoryInfos(); for (RepositoryInfo ri : infos) { RepositoryIndexer.indexRepo(ri); } SwingUtilities.invokeLater(new Runnable() { public void run() { btnIndex.setEnabled(true); } }); } });
public static void deleteArtifactFromIndex(RepositoryInfo repo, Artifact artifact) { assert repo != null; if (artifact == null) { return; } RepositoryIndexerImplementation impl = findImplementation(repo); if (impl == null) { return; } impl.deleteArtifactFromIndex(repo, artifact); }
public void run() { RepositoryIndexer.indexRepo(info); ((GroupListChildren)getChildren()).refreshGroups(); SwingUtilities.invokeLater(new Runnable() { public void run() { RefreshIndexAction.this.setEnabled(true); } }); } });
public static List<NBVersionInfo> findBySHA1(String sha1, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); List<NBVersionInfo> toRet = new ArrayList<NBVersionInfo>(); for (List<RepositoryInfo> rps : all) { RepositoryIndexerImplementation impl = RepositoryIndexer.findImplementation(rps.get(0)); if (impl != null) { ChecksumQueries chq = impl.getCapabilityLookup().lookup(ChecksumQueries.class); if (chq != null) { toRet.addAll(chq.findBySHA1(sha1, rps)); } } } return toRet; }
public void run() { //TODO shall we iterate all "local" repositories?? RepositoryInfo info = RepositoryPreferences.getInstance().getRepositoryInfoById(RepositoryPreferences.LOCAL_REPO_ID); if (info != null) { RepositoryIndexer.indexRepo(info); SwingUtilities.invokeLater(new Runnable() { public void run() { btnIndex.setEnabled(true); } }); } } });
public static List<NBVersionInfo> findArchetypes(RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); List<NBVersionInfo> toRet = new ArrayList<NBVersionInfo>(); for (List<RepositoryInfo> rps : all) { RepositoryIndexerImplementation impl = RepositoryIndexer.findImplementation(rps.get(0)); if (impl != null) { ArchetypeQueries aq = impl.getCapabilityLookup().lookup(ArchetypeQueries.class); if (aq != null) { toRet.addAll(aq.findArchetypes(rps)); } } } return toRet; }
public static List<NBVersionInfo> findByMD5(String md5, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); List<NBVersionInfo> toRet = new ArrayList<NBVersionInfo>(); for (List<RepositoryInfo> rps : all) { RepositoryIndexerImplementation impl = RepositoryIndexer.findImplementation(rps.get(0)); if (impl != null) { ChecksumQueries chq = impl.getCapabilityLookup().lookup(ChecksumQueries.class); if (chq != null) { toRet.addAll(chq.findByMD5(md5, rps)); } } } return toRet; }
public static List<NBVersionInfo> findVersionsByClass(final String className, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); List<NBVersionInfo> toRet = new ArrayList<NBVersionInfo>(); for (List<RepositoryInfo> rps : all) { RepositoryIndexerImplementation impl = RepositoryIndexer.findImplementation(rps.get(0)); if (impl != null) { ClassesQuery chq = impl.getCapabilityLookup().lookup(ClassesQuery.class); if (chq != null) { toRet.addAll(chq.findVersionsByClass(className, rps)); } } } return toRet; }
public static List<NBVersionInfo> find(List<QueryField> fields, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); List<NBVersionInfo> toRet = new ArrayList<NBVersionInfo>(); for (List<RepositoryInfo> rps : all) { RepositoryIndexerImplementation impl = RepositoryIndexer.findImplementation(rps.get(0)); if (impl != null) { GenericFindQuery gfq = impl.getCapabilityLookup().lookup(GenericFindQuery.class); if (gfq != null) { toRet.addAll(gfq.find(fields, rps)); } } } return toRet; }
public static List<NBVersionInfo> getVersions(String groupId, String artifactId, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); List<NBVersionInfo> toRet = new ArrayList<NBVersionInfo>(); for (List<RepositoryInfo> rps : all) { RepositoryIndexerImplementation impl = RepositoryIndexer.findImplementation(rps.get(0)); if (impl != null) { BaseQueries bq = impl.getCapabilityLookup().lookup(BaseQueries.class); assert bq != null : "All RepositoryIndexerImplementation need to define BaseQueries:" + impl.getType() + " : " + impl.getClass(); toRet.addAll(bq.getVersions(groupId, artifactId, rps)); } } return toRet; }
public static List<NBVersionInfo> getRecords(String groupId, String artifactId, String version, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); List<NBVersionInfo> toRet = new ArrayList<NBVersionInfo>(); for (List<RepositoryInfo> rps : all) { RepositoryIndexerImplementation impl = RepositoryIndexer.findImplementation(rps.get(0)); if (impl != null) { BaseQueries bq = impl.getCapabilityLookup().lookup(BaseQueries.class); assert bq != null : "All RepositoryIndexerImplementation need to define BaseQueries:" + impl.getType() + " : " + impl.getClass(); toRet.addAll(bq.getRecords(groupId, artifactId, version, rps)); } } return toRet; }
/** * * @param repos * @return */ public static Set<String> getGroups(RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); final Set<String> toRet = new TreeSet<String>(); for (List<RepositoryInfo> rps : all) { RepositoryIndexerImplementation impl = RepositoryIndexer.findImplementation(rps.get(0)); if (impl != null) { BaseQueries bq = impl.getCapabilityLookup().lookup(BaseQueries.class); assert bq != null : "All RepositoryIndexerImplementation need to define BaseQueries:" + impl.getType() + " : " + impl.getClass(); toRet.addAll(bq.getGroups(rps)); } } return toRet; }
public static List<NBGroupInfo> findDependencyUsage(String groupId, String artifactId, String version, RepositoryInfo... repos) { //tempmaps Map<String, NBGroupInfo> groupMap = new HashMap<String, NBGroupInfo>(); Map<String, NBArtifactInfo> artifactMap = new HashMap<String, NBArtifactInfo>(); List<NBGroupInfo> groupInfos = new ArrayList<NBGroupInfo>(); Collection<List<RepositoryInfo>> all = splitReposByType(repos); for (List<RepositoryInfo> rps : all) { RepositoryIndexerImplementation impl = RepositoryIndexer.findImplementation(rps.get(0)); if (impl != null) { DependencyInfoQueries dq = impl.getCapabilityLookup().lookup(DependencyInfoQueries.class); if (dq != null) { convertToNBGroupInfo(dq.findDependencyUsage(groupId, artifactId, version, rps), groupMap, artifactMap, groupInfos); } } } return groupInfos; }