@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ChannelSpec other = (ChannelSpec) obj; Object otherField = other.getName(); if (channel == null) { if (otherField != null) return false; } else if (!channel.equals(otherField)) return false; otherField = other.getProducer(); if (producer == null) { if (otherField != null) return false; } else if (!producer.equals(otherField)) return false; otherField = other.getUniverse(); if (universeSpec == null) { if (otherField != null) return false; } else if (!universeSpec.equals(otherField)) return false; return true; }
@Override public void install(Universe<?> universe, FeaturePackLocation.FPID fpid, Path fpZip) throws ProvisioningException { final LegacyGalleon1Universe mvnUni = (LegacyGalleon1Universe) universe; final ChannelSpec channel = fpid.getChannel(); final LegacyGalleon1Producer producer = mvnUni.getProducer(channel.getProducer()); // make sure the channel exists producer.getChannel(channel.getName()); if(!(mvnUni.artifactResolver instanceof LegacyGalleon1RepositoryManager)) { throw new ProvisioningException(mvnUni.artifactResolver.getClass().getName() + " is not an instance of " + LegacyGalleon1RepositoryManager.class.getName()); } ((LegacyGalleon1RepositoryManager) mvnUni.artifactResolver).install(LegacyGalleon1Universe.toMavenCoords(fpid.getLocation()), fpZip); } }
@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; } }