/** * Creates a default phase set that covers all the provisioning operations. * Phases can be specified for exclusion. * * @param exclude - A set of bit options that specify the phases to exclude. * See {@link PhaseSetFactory} for possible options * @return the {@link PhaseSet} */ public static final IPhaseSet createDefaultPhaseSetExcluding(String[] exclude) { if (exclude == null || exclude.length == 0) return createDefaultPhaseSet(); List<String> excludeList = Arrays.asList(exclude); List<String> includeList = new ArrayList<>(ALL_PHASES_LIST); includeList.removeAll(excludeList); return createPhaseSetIncluding(includeList.toArray(new String[includeList.size()])); }
public static IPhaseSet createDefaultPhaseSet() { return createPhaseSetIncluding(ALL_PHASES_LIST.toArray(new String[ALL_PHASES_LIST.size()])); }
public IStatus perform(IProvisioningPlan plan, IProgressMonitor monitor) { return perform(plan, PhaseSetFactory.createDefaultPhaseSet(), monitor); }
plan.setInstallableUnitProfileProperty(iu, "org.eclipse.equinox.p2.internal.inclusion.rules", ProfileInclusionRules.createOptionalInclusionRule(iu)); //$NON-NLS-1$ IPhaseSet phaseSet = PhaseSetFactory.createDefaultPhaseSetExcluding(new String[] {PhaseSetFactory.PHASE_CHECK_TRUST, PhaseSetFactory.PHASE_COLLECT, PhaseSetFactory.PHASE_CONFIGURE, PhaseSetFactory.PHASE_UNCONFIGURE, PhaseSetFactory.PHASE_UNINSTALL}); IStatus status = engine.perform(plan, phaseSet, new NullProgressMonitor());
SubMonitor mon = SubMonitor.convert(monitor, 300); if (plan.getInstallerPlan() != null) { ISizingPhaseSet sizingPhaseSet = PhaseSetFactory.createSizingPhaseSet(); IStatus status = engine.perform(plan.getInstallerPlan(), sizingPhaseSet, mon.newChild(100)); if (status.isOK()) mon.worked(100); ISizingPhaseSet sizingPhaseSet = PhaseSetFactory.createSizingPhaseSet(); IStatus status = engine.perform(plan, sizingPhaseSet, mon.newChild(200)); if (status.isOK())
public static IPhaseSet createDefaultPhaseSet() { return createPhaseSetIncluding(ALL_PHASES_LIST.toArray(new String[ALL_PHASES_LIST.size()])); }
@Override public IStatus perform(IProvisioningPlan plan, IProgressMonitor monitor) { return perform(plan, PhaseSetFactory.createDefaultPhaseSet(), monitor); }
private IStatus executePlan(IProvisioningPlan plan, ProvisioningContext provisioningContext, IProgressMonitor monitor) { IEngine engine = (IEngine) agent.getService(IEngine.SERVICE_NAME); IPhaseSet phaseSet = PhaseSetFactory.createDefaultPhaseSetExcluding(new String[] {PhaseSetFactory.PHASE_COLLECT, PhaseSetFactory.PHASE_CHECK_TRUST}); if (plan.getInstallerPlan() != null) { IStatus installerPlanStatus = engine.perform(plan.getInstallerPlan(), phaseSet, monitor); if (!installerPlanStatus.isOK()) return installerPlanStatus; applyConfiguration(true); } return engine.perform(plan, phaseSet, monitor); }
/** * Creates a default phase set that covers all the provisioning operations. * Phases can be specified for exclusion. * * @param exclude - A set of bit options that specify the phases to exclude. * See {@link PhaseSetFactory} for possible options * @return the {@link PhaseSet} */ public static final IPhaseSet createDefaultPhaseSetExcluding(String[] exclude) { if (exclude == null || exclude.length == 0) return createDefaultPhaseSet(); List<String> excludeList = Arrays.asList(exclude); List<String> includeList = new ArrayList<String>(ALL_PHASES_LIST); includeList.removeAll(excludeList); return createPhaseSetIncluding(includeList.toArray(new String[includeList.size()])); }
private IStatus setProperty(String key, String value, ProvisioningContext provisioningContext, IProgressMonitor monitor) { IEngine engine = (IEngine) agent.getService(IEngine.SERVICE_NAME); IProvisioningPlan plan = engine.createPlan(profile, provisioningContext); plan.setProfileProperty(key, value); IPhaseSet phaseSet = PhaseSetFactory.createPhaseSetIncluding(new String[] {PhaseSetFactory.PHASE_PROPERTY}); return engine.perform(plan, phaseSet, monitor); }
public static IStatus executePlan(IProvisioningPlan result, IEngine engine, ProvisioningContext context, IProgressMonitor progress) { return executePlan(result, engine, PhaseSetFactory.createDefaultPhaseSet(), context, progress); }
IPhaseSet phases = PhaseSetFactory.createDefaultPhaseSetExcluding(new String[] {PhaseSetFactory.PHASE_CHECK_TRUST, PhaseSetFactory.PHASE_CONFIGURE, PhaseSetFactory.PHASE_UNCONFIGURE, PhaseSetFactory.PHASE_UNINSTALL}); IEngine engine = getEngine(); plan.setProfileProperty(PROP_PROVISION_MODE, TargetDefinitionPersistenceHelper.MODE_PLANNER);
IPhaseSet set; if (phaseSet == null) set = PhaseSetFactory.createDefaultPhaseSet(); else set = phaseSet; downloadPlan.addInstallableUnit(it.next()); IPhaseSet download = PhaseSetFactory.createPhaseSetIncluding(new String[] {PhaseSetFactory.PHASE_COLLECT}); IStatus downloadStatus = getEngine().perform(downloadPlan, download, mon.newChild(300)); if (!downloadStatus.isOK()) {
job.setPhaseSet(PhaseSetFactory.createPhaseSetIncluding(new String[] {PhaseSetFactory.PHASE_COLLECT})); job.setUser(false); job.setSystem(true);
IPhaseSet set; if (phaseSet == null) set = PhaseSetFactory.createDefaultPhaseSet(); else set = phaseSet; downloadPlan.addInstallableUnit(it.next()); IPhaseSet download = PhaseSetFactory.createPhaseSetIncluding(new String[] {PhaseSetFactory.PHASE_COLLECT}); IStatus downloadStatus = getEngine().perform(downloadPlan, download, mon.newChild(300)); if (!downloadStatus.isOK()) {