Debian Codegraph @

bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/IEngine.java

raw
1 /*******************************************************************************
2 * Copyright (c) 2008, 2010 Band XI International, LLC and others.
3 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
11 * Contributors:
12 * Band XI - initial API and implementation
13 * IBM - ongoing development
14 *******************************************************************************/
15 package org.eclipse.equinox.p2.engine;
16
17 import org.eclipse.core.runtime.IProgressMonitor;
18 import org.eclipse.core.runtime.IStatus;
19
20 /**
21 * The engine is a service that naively performs a set of requested changes to a provisioned
22 * system. No attempt is made to determine whether the requested changes or the
23 * resulting system are valid or consistent. It is assumed that the engine client has
24 * crafted a valid provisioning plan for the engine to perform, typically by using a planner
25 * service.
26 * <p>
27 * The engine operates by executing a series of installation phases. The client can
28 * customize the set of phases that are executed, or else the engine will execute
29 * a default set of phases. During each phase the changes described by the provisioning
30 * plan are performed against the profile being provisioned.
31 *
32 * @noimplement This interface is not intended to be implemented by clients.
33 * @noextend This interface is not intended to be extended by clients.
34 * @since 2.0
35 */
36 public interface IEngine {
37 /**
38 * Service name constant for the engine service.
39 */
40 public static final String SERVICE_NAME = IEngine.class.getName();
41
42 /**
43 * Creates a provisioning plan whose methods can be use to provide pre-validated changes.
44 * This is an advanced method for clients that know they are creating changes that do
45 * not require validation by a planner. Most clients should instead obtain a validated plan
46 * from a planner.
47 *
48 * @param profile The profile to operate against
49 * @param context The provisioning context for the plan
50 * @return A provisioning plan
51 */
52
53 public IProvisioningPlan createPlan(IProfile profile, ProvisioningContext context);
54
55 /**
56 * Executes a provisioning plan.
57 *
58 * @param plan The plan describing the changes to be made
59 * @param phaseSet The phases to run, or <code>null</code> to run default phases
60 * @param monitor A progress monitor, or <code>null</code> if progress reporting is not required
61 * @return The result of executing the plan
62 */
63 public IStatus perform(IProvisioningPlan plan, IPhaseSet phaseSet, IProgressMonitor monitor);
64
65 /**
66 * Executes a provisioning plan with a default phase set and context.
67 *
68 * @param plan The plan describing the changes to be made
69 * @param monitor A progress monitor, or <code>null</code> if progress reporting is not required
70 * @return The result of executing the plan
71 */
72 public IStatus perform(IProvisioningPlan plan, IProgressMonitor monitor);
73 }