Ejemplo n.º 1
0
 public ArtifactDownloadReport[] getArtifactsReports(ModuleRevisionId mrid) {
   Collection all = new LinkedHashSet();
   for (Iterator iter = confReports.values().iterator(); iter.hasNext(); ) {
     ConfigurationResolveReport report = (ConfigurationResolveReport) iter.next();
     all.addAll(Arrays.asList(report.getDownloadReports(mrid)));
   }
   return (ArtifactDownloadReport[]) all.toArray(new ArtifactDownloadReport[all.size()]);
 }
Ejemplo n.º 2
0
 public boolean hasError() {
   boolean hasError = false;
   for (Iterator it = confReports.values().iterator(); it.hasNext() && !hasError; ) {
     ConfigurationResolveReport report = (ConfigurationResolveReport) it.next();
     hasError |= report.hasError();
   }
   return hasError;
 }
Ejemplo n.º 3
0
 public IvyNode[] getUnresolvedDependencies() {
   Collection all = new LinkedHashSet();
   for (Iterator iter = confReports.values().iterator(); iter.hasNext(); ) {
     ConfigurationResolveReport report = (ConfigurationResolveReport) iter.next();
     all.addAll(Arrays.asList(report.getUnresolvedDependencies()));
   }
   return (IvyNode[]) all.toArray(new IvyNode[all.size()]);
 }
Ejemplo n.º 4
0
 /** Can only be called if checkIfChanged has been called */
 public boolean hasChanged() {
   for (Iterator iter = confReports.values().iterator(); iter.hasNext(); ) {
     ConfigurationResolveReport report = (ConfigurationResolveReport) iter.next();
     if (report.hasChanged()) {
       return true;
     }
   }
   return false;
 }
Ejemplo n.º 5
0
 /**
  * Get the report on the download requests. The list of download report can be restricted to a
  * specific download status, and also remove the download report for the evicted modules.
  *
  * @param downloadStatus the status of download to retreive. Set it to <code>null</code> for no
  *     restriction on the download status
  * @param withEvicted set it to <code>true</code> if the report for the evicted modules have to be
  *     retrieved, <code>false</code> to exclude reports from modules evicted in all
  *     configurations.
  * @return the list of reports, never <code>null</code>
  * @see ConfigurationResolveReport#getArtifactsReports(DownloadStatus, boolean)
  */
 public ArtifactDownloadReport[] getArtifactsReports(
     DownloadStatus downloadStatus, boolean withEvicted) {
   Collection all = new LinkedHashSet();
   for (Iterator iter = confReports.values().iterator(); iter.hasNext(); ) {
     ConfigurationResolveReport report = (ConfigurationResolveReport) iter.next();
     ArtifactDownloadReport[] reports = report.getArtifactsReports(downloadStatus, withEvicted);
     all.addAll(Arrays.asList(reports));
   }
   return (ArtifactDownloadReport[]) all.toArray(new ArtifactDownloadReport[all.size()]);
 }
Ejemplo n.º 6
0
 public void setDependencies(List dependencies, Filter artifactFilter) {
   this.dependencies = dependencies;
   // collect list of artifacts
   artifacts = new ArrayList();
   for (Iterator iter = dependencies.iterator(); iter.hasNext(); ) {
     IvyNode dependency = (IvyNode) iter.next();
     if (!dependency.isCompletelyEvicted() && !dependency.hasProblem()) {
       artifacts.addAll(Arrays.asList(dependency.getSelectedArtifacts(artifactFilter)));
     }
     // update the configurations reports with the dependencies
     // these reports will be completed later with download information, if any
     String[] dconfs = dependency.getRootModuleConfigurations();
     for (int j = 0; j < dconfs.length; j++) {
       ConfigurationResolveReport configurationReport = getConfigurationReport(dconfs[j]);
       if (configurationReport != null) {
         configurationReport.addDependency(dependency);
       }
     }
   }
 }
Ejemplo n.º 7
0
 public List getAllProblemMessages() {
   List ret = new ArrayList(problemMessages);
   for (Iterator iter = confReports.values().iterator(); iter.hasNext(); ) {
     ConfigurationResolveReport r = (ConfigurationResolveReport) iter.next();
     IvyNode[] unresolved = r.getUnresolvedDependencies();
     for (int i = 0; i < unresolved.length; i++) {
       String errMsg = unresolved[i].getProblemMessage();
       if (errMsg.length() > 0) {
         ret.add("unresolved dependency: " + unresolved[i].getId() + ": " + errMsg);
       } else {
         ret.add("unresolved dependency: " + unresolved[i].getId());
       }
     }
     ArtifactDownloadReport[] adrs = r.getFailedArtifactsReports();
     for (int i = 0; i < adrs.length; i++) {
       ret.add("download failed: " + adrs[i].getArtifact());
     }
   }
   return ret;
 }
Ejemplo n.º 8
0
 public void checkIfChanged() {
   for (Iterator iter = confReports.values().iterator(); iter.hasNext(); ) {
     ConfigurationResolveReport report = (ConfigurationResolveReport) iter.next();
     report.checkIfChanged();
   }
 }
Ejemplo n.º 9
0
 /**
  * Get every report on the download requests.
  *
  * @return the list of reports, never <code>null</code>
  */
 public ArtifactDownloadReport[] getFailedArtifactsReports() {
   return ConfigurationResolveReport.filterOutMergedArtifacts(
       getArtifactsReports(DownloadStatus.FAILED, true));
 }