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, mrid, 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());
               
                Artifact transformedMetadataArtifact = NameSpaceHelper.transform(
                    md.getMetadataArtifact(), options.getNamespace().getToSystemTransformer());
                saveArtifactOrigin(transformedMetadataArtifact, report.getArtifactOrigin());
               
View Full Code Here

        r.setName(name);
        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

                            .getPublicationDate(), javaProject.getPath().toString(),
                            ECLIPSE_PROJECT_TYPE, ECLIPSE_PROJECT_EXTENSION);

                    DefaultModuleDescriptor workspaceMd = cloneMd(md, af);

                    MetadataArtifactDownloadReport madr = new MetadataArtifactDownloadReport(af);
                    madr.setDownloadStatus(DownloadStatus.SUCCESSFUL);
                    madr.setSearched(true);

                    return new ResolvedModuleRevision(this, this, workspaceMd, madr);
                }
            }
        }
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());
                    getRepositoryCacheManager().cacheModuleDescriptor(this, artifactRef,
                        toSystem(dd), systemMd.getAllArtifacts()[0], null, getCacheOptions(data));
                }
            } else {
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

        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

                        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 = DateUtil.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

        }
    }

    private void outputMetadataArtifact(PrintWriter out, IvyNode dep) {
        if (dep.getModuleRevision() != null) {
            MetadataArtifactDownloadReport madr = dep.getModuleRevision().getReport();
            out.print("\t\t\t\t<metadata-artifact");
            out.print(" status=\""
                + XMLHelper.escape(madr.getDownloadStatus().toString()) + "\"");
            out.print(" details=\"" + XMLHelper.escape(madr.getDownloadDetails()) + "\"");
            out.print(" size=\"" + madr.getSize() + "\"");
            out.print(" time=\"" + madr.getDownloadTimeMillis() + "\"");
            if (madr.getLocalFile() != null) {
                out.print(" location=\""
                    + XMLHelper.escape(madr.getLocalFile().getAbsolutePath()) + "\"");
            }

            out.print(" searched=\"" + madr.isSearched() + "\"");
            if (madr.getOriginalLocalFile() != null) {
                out.print(" original-local-location=\""
                    + XMLHelper.escape(madr.getOriginalLocalFile().getAbsolutePath()) + "\"");
            }

            ArtifactOrigin origin = madr.getArtifactOrigin();
            if (origin != null) {
                out.print(" origin-is-local=\"" + String.valueOf(origin.isLocal()) + "\"");
                out.print(" origin-location=\"" + XMLHelper.escape(origin.getLocation()) + "\"");
            }
            out.println("/>");
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.