Examples of ProfileChangeRequest


Examples of org.eclipse.equinox.internal.p2.director.ProfileChangeRequest

      context.setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, String.valueOf(followReferences));

      // EV: invoke private methods
      //ProfileChangeRequest request = buildProvisioningRequest(profile, installs, uninstalls);
      //printRequest(request);
      ProfileChangeRequest request = (ProfileChangeRequest)
        invokePrivate("buildProvisioningRequest",
            new Class[]{IProfile.class, Collection.class, Collection.class},
            new Object[]{profile, installs, uninstalls});
      invokePrivate(
          "printRequest",
View Full Code Here

Examples of org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest

        super(actionType);
    }

    public ProfileChangeRequest generateProfileChangeRequest(IProfile profile, MultiStatus status,
                                                             IProgressMonitor monitor) {
        ProfileChangeRequest request = new ProfileChangeRequest(profile);
        request.removeInstallableUnits(iusToUninstall);
        return request;
    }
View Full Code Here

Examples of org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest

        super(actionType);
    }

    public ProfileChangeRequest generateProfileChangeRequest(IProfile profile, MultiStatus status,
                                                             IProgressMonitor monitor) {
        ProfileChangeRequest request = new ProfileChangeRequest(profile);
        for (IInstallableUnit iu : iusToInstall) {
            // If the user is installing a patch, we mark it optional.  This allows
            // the patched IU to be updated later by removing the patch.
            if (Boolean.toString(true).equals(iu.getProperty(IInstallableUnit.PROP_TYPE_PATCH))) {
                request.setInstallableUnitInclusionRules(iu, PlannerHelper.createOptionalInclusionRule(iu));
            }

            // Check to see if it is already installed.  This may alter the request.
            Collector alreadyInstalled = profile.query(new InstallableUnitQuery(iu.getId()), new Collector(), null);

            if (alreadyInstalled.size() > 0) {
                IInstallableUnit installedIU = (IInstallableUnit) alreadyInstalled.iterator().next();
                int compareTo = iu.getVersion().compareTo(installedIU.getVersion());
                // If the iu is a newer version of something already installed, consider this an
                // update request
                if (compareTo > 0) {
                    boolean lockedForUpdate = false;
                    String value = profile.getInstallableUnitProperty(installedIU,
                            IInstallableUnit.PROP_PROFILE_LOCKED_IU);
                    if (value != null) {
                        lockedForUpdate = (Integer.parseInt(value) & IInstallableUnit.LOCK_UPDATE) ==
                                IInstallableUnit.LOCK_UPDATE;
                    }
                    if (lockedForUpdate) {
                        // Add a status telling the user that this implies an update, but the
                        // iu should not be updated
                        status.merge(new Status(IStatus.WARNING, "temp", 10013, installedIU.getId() + "-" +
                                installedIU.getVersion() +
                                " will be ignored because it is already installed, " +
                                "and updates are not permitted.", null));
                    } else {
                        request.addInstallableUnits(new IInstallableUnit[]{iu});
                        request.removeInstallableUnits(new IInstallableUnit[]{installedIU});
                        // Add a status informing the user that the update has been inferred
                        status.merge(new Status(IStatus.WARNING, "temp", 10013, installedIU.getId() + "-" +
                                installedIU.getVersion() +
                                " is already installed, so an update will be performed instead.", null));
                        // Mark it as a root if it hasn't been already
                        if (!Boolean.toString(true).equals(profile.getInstallableUnitProperty(installedIU,
                                IInstallableUnit.PROP_PROFILE_ROOT_IU))) {
                            request.setInstallableUnitProfileProperty(iu, IInstallableUnit.PROP_PROFILE_ROOT_IU,
                                    Boolean.toString(true));
                        }
                    }
                } else if (compareTo < 0) {
                    // An implied downgrade.  We will not put this in the plan, add a status informing the user
                    status.merge(new Status(IStatus.WARNING, "temp", 10004, installedIU.getId() + "-" +
                            installedIU.getVersion() +
                            " will be ignored because a newer version is already installed.", null));
                } else {
                    if (Boolean.toString(true).equals(profile.getInstallableUnitProperty(installedIU,
                            IInstallableUnit.PROP_PROFILE_ROOT_IU)))
                    // It is already a root, nothing to do. We tell the user it was already installed
                    {
                        status.merge(new Status(IStatus.WARNING, "temp", 10005, installedIU.getId() + "-" +
                                installedIU.getVersion() + " will be ignored because it is already installed.", null));
                    } else {
                        // It was already installed but not as a root.
                        // Tell the user that parts of it are already installed and mark it as a root.
                        status.merge(new Status(IStatus.WARNING, "temp", 10006, installedIU.getId() + "-" +
                                installedIU.getVersion() +
                                " is already present because other installed software requires it.  " +
                                "It will be added to the installed software list.", null));
                        request.setInstallableUnitProfileProperty(iu, "org.eclipse.equinox.p2.type.root",
                                Boolean.toString(true));
                    }
                }
            } else {
                // Install it and mark as a root
                request.addInstallableUnits(new IInstallableUnit[]{iu});
                request.setInstallableUnitProfileProperty(iu, "org.eclipse.equinox.p2.type.root",
                        Boolean.toString(true));
            }
        }
        return request;
    }
View Full Code Here

Examples of org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest

        this.actionType = actionType;
    }

    public ResolutionResult reviewProfileChangeAction(IProfile profile) throws ProvisioningException {
        MultiStatus initialStatus = getInitialStatus();
        ProfileChangeRequest profileChangeRequest = generateProfileChangeRequest(
                profile, initialStatus, null);
        ProvisioningPlan provisioningPlan = generateProvisioningPlan(profileChangeRequest);
        if (provisioningPlan == null) {
            throw new ProvisioningException("Failed to generate the Provisioning Plan");
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.