Package org.eclipse.equinox.internal.provisional.p2.metadata.query

Examples of org.eclipse.equinox.internal.provisional.p2.metadata.query.IUPropertyQuery


    xenRootIU.addTouchpointData(tpd);
    ArtifactKey xen_image = new ArtifactKey(PublisherHelper.BINARY_ARTIFACT_CLASSIFIER, filename, Version.create("1.0.0"));
    xenRootIU.setArtifacts(new IArtifactKey[] {xen_image});
   
    File f = new File(repofiles + filename);
    IArtifactDescriptor ad = PublisherHelper.createArtifactDescriptor(xen_image, f);
 
   
    publishArtifact(ad, f, publisherInfo);

    createSelfCapability = PublisherHelper.createSelfCapability(xenRootIU.getId(), xenRootIU.getVersion());
View Full Code Here


    ArtifactKey jvm_rpm = new ArtifactKey(PublisherHelper.BINARY_ARTIFACT_CLASSIFIER, filename , Version.create("1.0.0"));
    jvmIU.setArtifacts(new IArtifactKey[] {jvm_rpm});
   
    File f = new File(repofiles + filename);
    IArtifactDescriptor ad = PublisherHelper.createArtifactDescriptor(jvm_rpm, f);
   
    publishArtifact(ad, f, publisherInfo);

    IProvidedCapability createSelfCapability = PublisherHelper.createSelfCapability(jvmIU.getId(),jvmIU.getVersion());
    jvmIU.setCapabilities(new IProvidedCapability[] {createSelfCapability});
View Full Code Here

                    (nickName == null) ? "null value" : nickName);
        }

        try {
            IMetadataRepositoryManager metadataRepositoryManager = ServiceHolder.getMetadataRepositoryManager();
            IArtifactRepositoryManager artifactRepositoryManager = ServiceHolder.getArtifactRepositoryManager();

            if (metadataRepositoryManager.contains(location)) {
                return;
            }

            //Validating the repositories
            status = metadataRepositoryManager.validateRepositoryLocation(location, null);
            if (!status.isOK()) {
                throw ProvisioningException.makeExceptionFromErrorCode(
                        CompMgtMessages.INVALID_REPO_LOCATION, location);
            }

            //Loading the metadata repository
            metadataRepositoryManager.loadRepository(location, null);
            metadataRepositoryManager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, nickName);

            //Loading the artifact repository
            artifactRepositoryManager.loadRepository(location, null);
            artifactRepositoryManager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, nickName);
        } catch (Exception e) {
            throw ProvisioningException.makeExceptionFromErrorCode(
                    CompMgtMessages.FAILD_TO_ADD_REPSITORY, e, location);
        }
    }
View Full Code Here

        }
    }

    public static void enableRepository(URI location, boolean enable) throws ProvisioningException {
        IMetadataRepositoryManager metadataRepositoryManager;
        IArtifactRepositoryManager artifactRepositoryManager;

        if (location == null) {
            throw ProvisioningException.makeExceptionFromErrorCode(CompMgtMessages.INVALID_REPO_LOCATION,
                    "null value");
        }

        try {
            metadataRepositoryManager = ServiceHolder.getMetadataRepositoryManager();
            artifactRepositoryManager = ServiceHolder.getArtifactRepositoryManager();
            metadataRepositoryManager.setEnabled(location, enable);
            artifactRepositoryManager.setEnabled(location, enable);
        } catch (Exception e) {
            throw ProvisioningException.makeExceptionFromErrorCode(
                    CompMgtMessages.FAILD_TO_ENABLE_REPSITORY, e, location);
        }
View Full Code Here

    }

    public static boolean isRepositoryEnabled(URI location) throws ProvisioningException {
        IMetadataRepositoryManager metadataRepositoryManager = ServiceHolder.getMetadataRepositoryManager();
        IArtifactRepositoryManager artifactRepositoryManager = ServiceHolder.getArtifactRepositoryManager();
        return metadataRepositoryManager.isEnabled(location) && artifactRepositoryManager.isEnabled(location);
    }
View Full Code Here

        IMetadataRepositoryManager metadataRepositoryManager = ServiceHolder.getMetadataRepositoryManager();
        metadataRepositoryManager.removeRepository(location);
    }

    private static void removeArtifactRepository(URI location) throws ProvisioningException {
        IArtifactRepositoryManager artifactRepositoryManager = ServiceHolder.getArtifactRepositoryManager();
        artifactRepositoryManager.removeRepository(location);
    }
View Full Code Here

        HashMap<String, IInstallableUnit> iuMap = new HashMap<String, IInstallableUnit>();

        for (FeatureInfo featureInfo : features) {
            Collector collector = new Collector();
            Query query = new InstallableUnitQuery(featureInfo.getFeatureID(),
                    new VersionRange(Version.create(featureInfo.getFeatureVersion()),
                            true, Version.create(featureInfo.getFeatureVersion()), true));
            collector = RepositoryUtils.getInstallableUnitsInRepositories(null, query, collector, null);
            IInstallableUnit[] units = (IInstallableUnit[]) collector.toArray(IInstallableUnit.class);

            if (units[0] == null) {
View Full Code Here

        for (int i = 0; i < features.length; i++) {
            FeatureInfo feature = features[i];
            QueryContext queryContext = new QueryContext();
            queryContext.setQueryable(ProvisioningUtils.getProfile());
            queryContext.setQuery(new InstallableUnitQuery(feature.getFeatureID(), new VersionRange(feature.getFeatureVersion())));
            InstalledIUQuery installedIUQuery = new InstalledIUQuery(queryContext);
            IInstallableUnit[] units = ProvisioningUtils.performIUQuery(installedIUQuery);
            ius[i] = units[0];
        }
        return ius;
View Full Code Here

        String startVersion = versionRange.substring(0, versionRange.indexOf(','));
        // end version starts after ", " therefore, versionRange.indexOf(',') + 2
        String endVersion = versionRange.substring(versionRange.indexOf(',') + 2,
                versionRange.length());
        this.versionRange = new VersionRange(Version.create(startVersion), startIncluded,
                Version.create(endVersion), endIncluded);
    }
View Full Code Here

    publishArtifact(ad, f, publisherInfo);

    createSelfCapability = PublisherHelper.createSelfCapability(xenRootIU.getId(), xenRootIU.getVersion());
    xenRootIU.setCapabilities(new IProvidedCapability[] {createSelfCapability});

    RequiredCapability vm = new RequiredCapability(PublisherHelper.IU_NAMESPACE, "org.example.xenVM", new VersionRange(Version.create("0.0.0"), true, Version.create("9.9.9"), true), "", false, false);
    xenRootIU.setRequiredCapabilities(new IRequiredCapability[] {vm});
    ITouchpointData vm_touchpoint = MetadataFactory.createTouchpointData(Collections.EMPTY_MAP);
    xenRootIU.addTouchpointData(vm_touchpoint);
   
    results.addIU(makeJVM(publisherInfo), IPublisherResult.NON_ROOT);
View Full Code Here

TOP

Related Classes of org.eclipse.equinox.internal.provisional.p2.metadata.query.IUPropertyQuery

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.