Package org.apache.ivy.core.report

Examples of org.apache.ivy.core.report.MetadataArtifactDownloadReport


                    if (resolver != null) {
                        Message.debug("\tfound ivy file in cache for " + mrid + " (resolved by "
                            + resolver.getName() + "): " + ivyFile);
                        if (expectedResolver == null
                                || expectedResolver.equals(resolver.getName())) {
                            MetadataArtifactDownloadReport madr
                            = new MetadataArtifactDownloadReport(
                                depMD.getMetadataArtifact());
                            madr.setDownloadStatus(DownloadStatus.NO);
                            madr.setSearched(false);
                            madr.setLocalFile(ivyFile);
                            madr.setSize(ivyFile.length());
                            madr.setArtifactOrigin(
                                getSavedArtifactOrigin(depMD.getMetadataArtifact()));
                            return new ResolvedModuleRevision(
                                resolver, artResolver, depMD, madr);
                        } else {
                            Message.debug(
View Full Code Here


                } else if (isChanging(dd, options)) {
                    Message.verbose(mrid
                        + " is changing, but has not changed: will trust cached artifacts if any");
                }
               
                MetadataArtifactDownloadReport madr
                    = new MetadataArtifactDownloadReport(md.getMetadataArtifact());
                madr.setSearched(true);
                madr.setDownloadStatus(report.getDownloadStatus());
                madr.setDownloadDetails(report.getDownloadDetails());
                madr.setArtifactOrigin(report.getArtifactOrigin());
                madr.setDownloadTimeMillis(report.getDownloadTimeMillis());
                madr.setOriginalLocalFile(report.getLocalFile());
                madr.setSize(report.getSize());
                saveArtifactOrigin(md.getMetadataArtifact(), report.getArtifactOrigin());
               
                return new ResolvedModuleRevision(resolver, resolver, md, madr);
            } catch (IOException ex) {
                Message.warn("io problem while parsing ivy file: " + mdRef.getResource() + ": "
View Full Code Here

                    if (isDynamic) {
                        nsMd.setResolvedModuleRevisionId(ModuleRevisionId.newInstance(nsMrid,
                            artifactRef.getRevision()));
                    }
                    systemMd = toSystem(nsMd);
                    MetadataArtifactDownloadReport madr =
                        new MetadataArtifactDownloadReport(systemMd.getMetadataArtifact());
                    madr.setDownloadStatus(DownloadStatus.NO);
                    madr.setSearched(true);
                    rmr = new ResolvedModuleRevision(this, this, systemMd, madr);
                }
            } else {
                if (ivyRef instanceof MDResolvedResource) {
                    rmr = ((MDResolvedResource) ivyRef).getResolvedModuleRevision();
                }
                if (rmr == null) {
                    rmr = parse(ivyRef, systemDd, data);
                    if (rmr == null) {
                        return null;
                    }
                }
                if (!rmr.getReport().isDownloaded()) {
                    return toSystem(rmr);
                } else {
                    nsMd = rmr.getDescriptor();
                    parser = ModuleDescriptorParserRegistry.getInstance().getParser(
                        ivyRef.getResource());

                    // check descriptor data is in sync with resource revision and names
                    systemMd = toSystem(nsMd);
                    if (checkconsistency) {
                        checkDescriptorConsistency(systemMrid, systemMd, ivyRef);
                        checkDescriptorConsistency(nsMrid, nsMd, ivyRef);
                    } else {
                        if (systemMd instanceof DefaultModuleDescriptor) {
                            String revision = getRevision(ivyRef, systemMrid, systemMd);
                            ((DefaultModuleDescriptor) systemMd).setModuleRevisionId(
                                ModuleRevisionId.newInstance(systemMrid, revision));
                        } else {
                            Message.warn(
                              "consistency disabled with instance of non DefaultModuleDescriptor..."
                              + " module info can't be updated, so consistency check will be done");
                            checkDescriptorConsistency(nsMrid, nsMd, ivyRef);
                            checkDescriptorConsistency(systemMrid, systemMd, ivyRef);
                        }
                    }
                    MetadataArtifactDownloadReport madr =
                        new MetadataArtifactDownloadReport(systemMd.getMetadataArtifact());
                    madr.setDownloadStatus(rmr.getReport().getDownloadStatus());
                    madr.setDownloadDetails(rmr.getReport().getDownloadDetails());
                    madr.setArtifactOrigin(rmr.getReport().getArtifactOrigin());
                    madr.setDownloadTimeMillis(rmr.getReport().getDownloadTimeMillis());
                    madr.setSize(rmr.getReport().getSize());
                    madr.setOriginalLocalFile(rmr.getReport().getOriginalLocalFile());
                    madr.setSearched(true);
                    rmr = new ResolvedModuleRevision(this, this, systemMd, madr);
                }
            }

            // resolve revision
View Full Code Here

    protected ResourceMDParser getDefaultRMDParser(final ModuleId mid) {
        return new ResourceMDParser() {
            public MDResolvedResource parse(Resource resource, String rev) {
                DefaultModuleDescriptor md =
                    DefaultModuleDescriptor.newDefaultInstance(new ModuleRevisionId(mid, rev));
                MetadataArtifactDownloadReport madr =
                    new MetadataArtifactDownloadReport(md.getMetadataArtifact());
                madr.setDownloadStatus(DownloadStatus.NO);
                madr.setSearched(true);
                return new MDResolvedResource(resource, rev, new ResolvedModuleRevision(
                        BasicResolver.this, BasicResolver.this, md, madr));
            }
        };
    }
View Full Code Here

                        if (isDefault) {
                            defaultMrids.add(mrid);
                        } else {
                            Artifact metadataArtifact =
                                DefaultArtifact.newIvyArtifact(mrid, pubdate);
                            MetadataArtifactDownloadReport madr =
                                new MetadataArtifactDownloadReport(metadataArtifact);
                            metadataReports.put(mrid, madr);
                            realMrids.add(mrid);
                        }
                        try {
                            String pubDateAttr = attributes.getValue("pubdate");
                            if (pubDateAttr != null) {
                                pubdate = Ivy.DATE_FORMAT.parse(pubDateAttr);
                            }
                            skip = false;
                        } catch (ParseException e) {
                            throw new IllegalArgumentException("invalid publication date for "
                                    + organisation + " " + module + " " + revision + ": "
                                    + attributes.getValue("pubdate"));
                        }
                    }
                } else if ("metadata-artifact".equals(qName)) {
                    if (skip) {
                        return;
                    }
                    MetadataArtifactDownloadReport madr =
                        (MetadataArtifactDownloadReport) metadataReports.get(mrid);
                    if (madr != null) {
                        madr.setDownloadStatus(
                            DownloadStatus.fromString(attributes.getValue("status")));
                        madr.setDownloadDetails(attributes.getValue("details"));
                        madr.setSize(Long.parseLong(attributes.getValue("size")));
                        madr.setDownloadTimeMillis(Long.parseLong(attributes.getValue("time")));
                        madr.setSearched(parseBoolean(attributes.getValue("searched")));
                        if (attributes.getValue("location") != null) {
                            madr.setLocalFile(new File(attributes.getValue("location")));
                        }
                        if (attributes.getValue("original-local-location") != null) {
                            madr.setOriginalLocalFile(
                                new File(attributes.getValue("original-local-location")));
                        }
                        if (attributes.getValue("origin-location") != null) {
                            if (ArtifactOrigin.isUnknown(attributes.getValue("origin-location"))) {
                                madr.setArtifactOrigin(ArtifactOrigin.unkwnown(madr.getArtifact()));
                            } else {
                                madr.setArtifactOrigin(
                                    new ArtifactOrigin(
                                        madr.getArtifact(),
                                        parseBoolean(attributes.getValue("origin-is-local")),
                                        attributes.getValue("origin-location")));
                            }
                        }
                    }
View Full Code Here

        ResolvedResource[] ret = new ResolvedResource[mds.size()];
        int i = 0;
        Iterator itMd = mds.iterator();
        while (itMd.hasNext()) {
            ModuleDescriptor md = (ModuleDescriptor) itMd.next();
            MetadataArtifactDownloadReport report = new MetadataArtifactDownloadReport(null);
            report.setDownloadStatus(DownloadStatus.NO);
            report.setSearched(true);
            ResolvedModuleRevision rmr = new ResolvedModuleRevision(this, this, md, report);
            MDResolvedResource mdrr = new MDResolvedResource(null, md.getRevision(), rmr);
            ret[i++] = mdrr;
        }
        return ret;
View Full Code Here

        capabilityDD.addDependencyConfiguration(BundleInfoAdapter.CONF_NAME_TRANSITIVE_OPTIONAL,
            BundleInfoAdapter.CONF_NAME_TRANSITIVE_OPTIONAL);
        capabilityDD.addDependencyConfiguration(useConf, useConf);
        capabilityMd.addDependency(capabilityDD);

        MetadataArtifactDownloadReport report = new MetadataArtifactDownloadReport(null);
        report.setDownloadStatus(DownloadStatus.NO);
        report.setSearched(true);
        ResolvedModuleRevision rmr = new ResolvedModuleRevision(this, this, capabilityMd, report);
        return new MDResolvedResource(null, capabilityMd.getRevision(), rmr);
    }
View Full Code Here

        r.setSettings(settings);
        if (findRevision) {
            DefaultModuleDescriptor md = new DefaultModuleDescriptor(
                mrid, "integration", publicationDate, isdefault);
            r.rmr = new ResolvedModuleRevision(
                r, r, md, new MetadataArtifactDownloadReport(md.getMetadataArtifact()));
        }
        return r;
    }
View Full Code Here

                    if (isDynamic) {
                        nsMd.setResolvedModuleRevisionId(ModuleRevisionId.newInstance(nsMrid,
                            artifactRef.getRevision()));
                    }
                    systemMd = toSystem(nsMd);
                    MetadataArtifactDownloadReport madr =
                        new MetadataArtifactDownloadReport(systemMd.getMetadataArtifact());
                    madr.setDownloadStatus(DownloadStatus.NO);
                    madr.setSearched(true);
                    rmr = new ResolvedModuleRevision(this, this, systemMd, madr, isForce());
                }
            } else {
                if (ivyRef instanceof MDResolvedResource) {
                    rmr = ((MDResolvedResource) ivyRef).getResolvedModuleRevision();
View Full Code Here

    protected ResourceMDParser getDefaultRMDParser(final ModuleId mid) {
        return new ResourceMDParser() {
            public MDResolvedResource parse(Resource resource, String rev) {
                DefaultModuleDescriptor md =
                    DefaultModuleDescriptor.newDefaultInstance(new ModuleRevisionId(mid, rev));
                MetadataArtifactDownloadReport madr =
                    new MetadataArtifactDownloadReport(md.getMetadataArtifact());
                madr.setDownloadStatus(DownloadStatus.NO);
                madr.setSearched(true);
                return new MDResolvedResource(resource, rev, new ResolvedModuleRevision(
                        BasicResolver.this, BasicResolver.this, md, madr, isForce()));
            }
        };
    }
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.report.MetadataArtifactDownloadReport

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.