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> 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 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> 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; }
/** * * @param groupId * @param prefix * @param repos * @return */ public static Set<String> filterPluginArtifactIds(String groupId, String prefix, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); 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.filterPluginArtifactIds(groupId, prefix, rps)); } } return toRet; }
/** * * @param prefix * @param repos * @return */ public static Set<String> filterGroupIds(String prefix, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); 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.filterGroupIds(prefix, rps)); } } return toRet; }
/** * * @param groupId * @param repos * @return */ public static Set<String> getArtifacts(String groupId, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); 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.getArtifacts(groupId, rps)); } } return toRet; }
/** * * @param prefix * @param repos * @return */ public static Set<String> filterPluginGroupIds(String prefix, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); 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.filterPluginGroupIds(prefix, rps)); } } return toRet; }
/** * * @param groupId * @param prefix * @param repos * @return */ public static Set<String> filterArtifactIdForGroupId(String groupId, String prefix, RepositoryInfo... repos) { Collection<List<RepositoryInfo>> all = splitReposByType(repos); 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.filterArtifactIdForGroupId(groupId, prefix, rps)); } } return toRet; }