Examples of ResolutionResult


Examples of org.wso2.carbon.component.mgt.core.ResolutionResult

     * @throws AxisFault if an exception occurs while quering licensing
     */
    public LicenseInfo[] getLicensingInformation() throws AxisFault {
        LicenseInfo[] licenseInfo = null;
        try {
            ResolutionResult resolutionResult = ProvWSUtils.getResolutionResult(
                    ProfileModificationActionFactory.INSTALL_ACTION, MessageContext.getCurrentMessageContext());
            if (resolutionResult == null) {
                return new LicenseInfo[0];
            }
            ILicense[] licenses = ProvisioningUtils.getLicensingInformation(resolutionResult.getProvisioningPlan());
            licenseInfo = ProvWSUtils.wrapP2LicensesAsLicenses(licenses);
        } catch (Exception e) {
            handleException("Error occured while quering license information",
                    "failed.get.license.info", e);
        }
View Full Code Here

Examples of org.wso2.carbon.component.mgt.core.ResolutionResult

     * @return true only if the operation is successful
     * @throws AxisFault if an exception occurs while performing the prov action
     */
    public boolean performProvisioningAction(String actionType) throws AxisFault {
        try {
            ResolutionResult resolutionResult = ProvWSUtils.getResolutionResult(actionType,
                    MessageContext.getCurrentMessageContext());
            if (resolutionResult == null) {
                handleException("Error occured while performing provisioning action",
                        "failed.perform.prov.action");
            }
View Full Code Here

Examples of org.wso2.carbon.component.mgt.core.ResolutionResult

                    ProfileModificationActionFactory.getProfileModificationAction(
                            ProfileModificationActionFactory.REVERT_ACTION);

            for (long timestamp : timestamps) {
                profModificationAction.setTimestamp(timestamp);
                ResolutionResult resolutionResult = profModificationAction.reviewProfileChangeAction(
                        ProvisioningUtils.getProfile());

                if (resolutionResult.getReviewedInstallableUnits() != null) {
                    installableFeatures = resolutionResult.getReviewedInstallableUnits().length;
                }

                if (resolutionResult.getReviewedUninstallableUnits() != null) {
                    uninstallableFeatures = resolutionResult.getReviewedUninstallableUnits().length;
                }

                if (installableFeatures != 0 || uninstallableFeatures != 0) {
                    profileHistoryList.add(ProvWSUtils.getProfileHistoryFromTimestamp(timestamp));
                }
View Full Code Here

Examples of org.wso2.carbon.component.mgt.core.ResolutionResult

        ProfileModificationAction profModificationAction =
                ProfileModificationActionFactory.getProfileModificationAction(
                        ProfileModificationActionFactory.UNINSTALL_ACTION);
        profModificationAction.setIusToUninstall(iusToUninstall.toArray(new IInstallableUnit[iusToUninstall.size()]));

        ResolutionResult resolutionResult = profModificationAction.reviewProfileChangeAction(
                ProvisioningUtils.getProfile());
        ProvisioningUtils.performProvisioningAction(resolutionResult);

        //Installing server, console and common features depending on the action
        profModificationAction =
View Full Code Here

Examples of org.wso2.carbon.component.mgt.core.ResolutionResult

                                                     ProvisioningPlan plan,
                                                     MultiStatus originalStatus)
            throws ProvisioningException {
        IEngine engine = ServiceHolder.getP2Engine();

        ResolutionResult report = new ResolutionResult();
        report.setProvisioningPlan(plan);

        if (nothingToDo(originalRequest)) {
            report.addSummaryStatus(new Status(IStatus.ERROR, "temp", 10050,
                    "Cannot complete the request.  See the error log for details.", null));
            IStatus[] details = originalStatus.getChildren();
            for (IStatus detail : details) {
                report.addSummaryStatus(detail);
            }
            return report;
        }

        // If there was already some status supplied before resolution, this should get included
        // with the report.
        if (originalStatus != null && originalStatus.getChildren().length > 0) {
            report.addSummaryStatus(originalStatus);
        }

        // If the overall plan had a non-OK status, capture that in the report.
        if (!plan.getStatus().isOK()) {
            report.addSummaryStatus(plan.getStatus());
        }

        // Now we compare what was requested with what is going to happen.
        if (plan.getStatus().getSeverity() != IStatus.ERROR) {
            IInstallableUnit[] iusAdded = originalRequest.getAddedInstallableUnits();
            for (IInstallableUnit anIusAdded : iusAdded) {
                RequestStatus rs = plan.getRequestStatus(anIusAdded);
                if (rs.getSeverity() == IStatus.ERROR) {
                    // This is a serious error so it must also appear in the overall status
                    IStatus fail = new Status(IStatus.ERROR, "temp", 10011, anIusAdded.getId() +
                            " is not applicable to the current configuration and will not be installed.", null);
                    report.addStatus(anIusAdded, fail);
                    report.addSummaryStatus(fail);
                    report.addFailedInstallableUnit(anIusAdded);
                } else {
                    report.addReviewedInstallableUnit(anIusAdded);
                }
            }
            IInstallableUnit[] iusRemoved = originalRequest.getRemovedInstallableUnits();
            for (IInstallableUnit anIusRemoved : iusRemoved) {
                RequestStatus rs = plan.getRequestStatus(anIusRemoved);
                if (rs.getSeverity() == IStatus.ERROR) {
                    // We are making assumptions here about why the planner chose to ignore an uninstall.
                    IStatus fail = new Status(IStatus.INFO, "temp", 10007, anIusRemoved.getId() +
                            " cannot be fully uninstalled because other installed software requires it.  " +
                            "The parts that are not required will be uninstalled.", null);
                    report.addStatus(anIusRemoved, fail);
                    report.addSummaryStatus(fail);
                    report.addFailedUninstallableUnit(anIusRemoved);
                } else {
                    report.addReviewedUninstallableUnit(anIusRemoved);
                }
            }
        }

        // Now process the side effects
        Map sideEffects = plan.getSideEffectChanges();
        for (Object o : sideEffects.keySet()) {
            IInstallableUnit iu = (IInstallableUnit) o;
            RequestStatus rs = (RequestStatus) sideEffects.get(iu);
            if (rs.getInitialRequestType() == RequestStatus.ADDED) {
                report.addStatus(iu, new Status(rs.getSeverity(), "temp", 10010, iu.getId() +
                        " will also be installed in order to complete this operation.", null));
                report.addReviewedInstallableUnit(iu);
            } else {
                report.addStatus(iu, new Status(rs.getSeverity(), "temp", 10009, iu.getId() +
                        " must be uninstalled in order to complete this operation.", null));
                report.addReviewedUninstallableUnit(iu);
            }
        }

        long size = 0;
        if (report.getReviewedInstallableUnits().length != 0) {
            size = getSize(plan,
                    plan.getProfileChangeRequest().getProfile(), engine, new ProvisioningContext(), null);
        }
        report.setInstallationSize(getFormattedSize(size));
        return report;
    }
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.