private void resolveUniverse(UniverseSpec u) throws ProvisioningException { // Resolve universe synchronously. Universe<?> universe = universeResolver.getUniverse(u); for (Producer<?> p : universe.getProducers()) { for (Channel c : p.getChannels()) { } } }
private void getAllProducers(String name, UniverseSpec spec, Universe<?> universe, List<String> candidates) throws ProvisioningException { for (Producer<?> p : universe.getProducers()) { for (Channel c : p.getChannels()) { if (!candidates.contains(p.getName())) { candidates.add(p.getName() + FeaturePackLocation.CHANNEL_START + c.getName()); } } } }
private void getProducers(String producerName, String universeName, Universe<?> universe, List<String> candidates) throws ProvisioningException { for (Producer<?> p : universe.getProducers()) { if (!candidates.contains(p.getName())) { // Display producer:channel as a whole, makes it clear that we require both. if (p.getName().startsWith(producerName)) { if (universeName == null) { for (Channel c : p.getChannels()) { candidates.add(p.getName() + FeaturePackLocation.CHANNEL_START + c.getName()); } } else { for (Channel c : p.getChannels()) { candidates.add(p.getName() + FeaturePackLocation.UNIVERSE_START + universeName + FeaturePackLocation.CHANNEL_START + c.getName()); } } } } } }
private static void visit(UniverseVisitor visitor, Universe<?> universe, UniverseSpec universeSpec, boolean allBuilds) throws ProvisioningException { for (Producer<?> producer : universe.getProducers()) { for (Channel channel : producer.getChannels()) { if (allBuilds) { List<String> builds = getAllBuilds(universeSpec, producer, channel); if (builds != null && !builds.isEmpty()) { for (String build : builds) { visitor.visit(producer, new FeaturePackLocation(universeSpec, producer.getName(), channel.getName(), null, build)); } } } for (String freq : producer.getFrequencies()) { String build = getBuild(universeSpec, producer, channel, freq); // We have a latest build for the frequency. if (build != null) { FeaturePackLocation loc = new FeaturePackLocation(universeSpec, producer.getName(), channel.getName(), freq, build); visitor.visit(producer, loc); } } } } }
private Producer<?> getProducer(FPLocationParser.ParsedFPLocation parsedLocation, PmSession pmSession) { try { UniverseSpec spec = null; if (parsedLocation.getUniverseName() != null) { spec = pmSession.getUniverse().getUniverseSpec(installation, parsedLocation.getUniverseName()); } else if (parsedLocation.getUniverseFactory() == null) { // default universe spec = pmSession.getUniverse().getDefaultUniverseSpec(installation); } else { spec = new UniverseSpec(parsedLocation.getUniverseFactory(), parsedLocation.getUniverseLocation()); } if (spec == null) { return null; } Universe<?> universe = pmSession.getUniverse().getUniverse(spec); if (universe == null) { return null; } for (Producer<?> p : universe.getProducers()) { if (p.getName().equals(parsedLocation.getProducer())) { return p; } } } catch (ProvisioningException ex) { CliLogging.completionException(ex); } return null; }