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 static String getBuild(UniverseSpec spec, Producer<?> producer, Channel channel, String freq) { FeaturePackLocation loc = new FeaturePackLocation(spec, producer.getName(), channel.getName(), freq, null); String build = null; try { build = channel.getLatestBuild(loc); } catch (ProvisioningException ex) { // OK, no build. } return build; }
public static String formatChannel(FeaturePackLocation loc) { String channel = loc.getFrequency() == null ? loc.getChannel().getName() : loc.getChannel().getName() + "/" + loc.getFrequency(); return (loc.getUniverse() == null ? "" : loc.getUniverse() + "@") + channel; }
/** * Resolves feature-pack location to a path in a local repository * * @param fpl feature-pack location * @return local feature-pack path * @throws ProvisioningException in case the feature-pack could not be resolved */ public Path resolve(FeaturePackLocation fpl) throws ProvisioningException { if (localFeaturePacks.containsKey(fpl.getFPID())) { return localFeaturePacks.get(fpl.getFPID()); } return getUniverse(fpl.getUniverse()).getProducer(fpl.getProducerName()).getChannel(fpl.getChannelName()).resolve(fpl); }
@Override public boolean hasExpired(Path fpDir, FeaturePackLocation.FPID fpid) { try { boolean devBuild = universe.getUniverse(fpid.getUniverse()). getProducer(fpid.getProducer().getName()).getChannel(fpid.getChannel().getName()). isDevBuild(fpid); return devBuild && !seen.contains(fpid); } catch (ProvisioningException ex) { CliLogging.exception(ex); return true; } }
public boolean isResolved(FeaturePackLocation fpl) throws ProvisioningException { return getUniverse(fpl.getUniverse()).getProducer(fpl.getProducerName()).getChannel(fpl.getChannelName()).isResolved(fpl); }
public Universe<?> getUniverse(UniverseSpec universeSpec) throws ProvisioningException { final UniverseFactory factory = getUniverseFactory(universeSpec.getFactory()); return factory.getUniverse(getArtifactResolver(factory.getRepositoryId()), universeSpec.getLocation()); }
public static ProducerSpec newProducer(String producer) { return new FeaturePackLocation(new UniverseSpec(LegacyGalleon1UniverseFactory.ID, null), producer, null, null, null).getProducer(); }
private static List<String> getAllBuilds(UniverseSpec spec, Producer<?> producer, Channel channel) { FeaturePackLocation loc = new FeaturePackLocation(spec, producer.getName(), channel.getName(), null, null); List<String> build = Collections.emptyList(); try { build = channel.getAllBuilds(loc); } catch (ProvisioningException ex) { // OK, no build. } return build; }
public Universe<?> getUniverse(String factoryId, String location) throws ProvisioningException { final UniverseFactory factory = getUniverseFactory(factoryId); return factory.getUniverse(getArtifactResolver(factory.getRepositoryId()), location); }
@Override public UniverseSpec getDefaultUniverse() { return this.defaultUniverse == null ? fpid.getLocation().getUniverse() : this.defaultUniverse; }
public static String getDefaultOriginName(FeaturePackLocation fpl) { return fpl.getProducer().toString(); }
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()); } } } }
@SuppressWarnings("unchecked") public T addArtifactResolver(String repoId, RepositoryArtifactResolver artifactResolver) throws ProvisioningException { getUfl().addArtifactResolver(repoId, artifactResolver); return (T) this; }
public Universe<?> getUniverse(String factoryId, String location, String repoId) throws ProvisioningException { return getUniverseFactory(factoryId).getUniverse(getArtifactResolver(repoId), location); }
@Override public String toString() { return toString(universeSpec, producer, channel, frequency, build); } }
@Override public String toString() { return '{' + producer.toString() + "}" + name; } }
@Override public FeaturePackLayout newFeaturePack(FeaturePackLocation fpl, FeaturePackSpec fpSpec, Path dir, int type) { return new FeaturePackLayout(fpl.getFPID(), dir, type) { @Override public FeaturePackSpec getSpec() { return fpSpec; } }; }}, false); }
public FeaturePackRuntimeBuilder(FPID fpid, FeaturePackSpec spec, Path dir, int type) { super(fpid, dir, type); this.producer = fpid.getProducer(); this.dir = dir; this.spec = spec; }
protected UniverseFactoryLoader getUfl() throws ProvisioningException { if(ufl == null) { ufl = UniverseFactoryLoader.getInstance(); } return ufl; }