Debian Codegraph @

bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/p2/planner/IProfileChangeRequest.java

raw
1 /*******************************************************************************
2 * Copyright (c) 2010, 2013 Sonatype, Inc 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 * Sonatype, Inc. - initial API and implementation
13 * IBM Corporation - ongoing development
14 * Rapicorp, Inc. - ongoing development
15 *******************************************************************************/
16 package org.eclipse.equinox.p2.planner;
17
18 import java.util.Collection;
19 import org.eclipse.equinox.p2.engine.IProfile;
20 import org.eclipse.equinox.p2.metadata.IInstallableUnit;
21 import org.eclipse.equinox.p2.metadata.IRequirement;
22
23 /**
24 * A profile change request is a description of a set of changes that a client
25 * would like to perform on a profile. The request is provided as input to an
26 * {@link IPlanner}, which validates which of the requested changes can be
27 * performed, and what other changes are required in order to make the profile
28 * state consistent.
29 *
30 * It is important to note that a change request can only be submitted once to the planner.
31 *
32 * Clients should create and manipulate profile change requests via the API {@link IPlanner#createChangeRequest(IProfile)}.
33 *
34 * @noimplement This interface is not intended to be implemented by clients.
35 * @noextend This interface is not intended to be extended by clients.
36 * @since 2.0
37 */
38 public interface IProfileChangeRequest {
39
40 /**
41 * Causes the installation of the mentioned IU.
42 * @param toInstall the entity to add to the profile
43 */
44 public abstract void add(IInstallableUnit toInstall);
45
46 /**
47 * Causes the installation of all the IUs mentioned
48 * @param toInstall the installable units to be added to the profile
49 */
50 public abstract void addAll(Collection<IInstallableUnit> toInstall);
51
52 /**
53 * Requests the removal of the specified installable unit
54 *
55 * @param toUninstall the installable units to be remove from the profile
56 */
57 public abstract void remove(IInstallableUnit toUninstall);
58
59 /**
60 * Requests the removal of all installable units in the provided collection
61 * @param toUninstall the installable units to be remove from the profile
62 */
63 public abstract void removeAll(Collection<IInstallableUnit> toUninstall);
64
65 /**
66 * Add extra requirements that must be satisfied by the planner.
67 *
68 * @param requirements the additional requirements
69 */
70 public void addExtraRequirements(Collection<IRequirement> requirements);
71
72 /**
73 * Associate an inclusion rule with the installable unit. An inclusion rule will dictate how
74 * the installable unit is treated when its dependencies are not satisfied.
75 * <p>
76 * The provided inclusion rule must be one of the values specified in {@link ProfileInclusionRules}.
77 * </p>
78 * @param iu the installable unit to set an inclusion rule for
79 * @param inclusionRule The inclusion rule.
80 */
81 public abstract void setInstallableUnitInclusionRules(IInstallableUnit iu, String inclusionRule);
82
83 /**
84 * Removes all inclusion rules associated with the given installable unit
85 *
86 * @param iu the installable unit to remove inclusion rules for
87 */
88 public abstract void removeInstallableUnitInclusionRules(IInstallableUnit iu);
89
90 /**
91 * Set a global property on the profile
92 *
93 * @param key key of the property
94 * @param value value of the property
95 */
96 public abstract void setProfileProperty(String key, String value);
97
98 /**
99 * Remove a global property on the profile
100 *
101 * @param key key of the property
102 */
103 public abstract void removeProfileProperty(String key);
104
105 /**
106 * Associate a property with a given installable unit.
107 *
108 * @param key key of the property
109 * @param value value of the property
110 */
111 public abstract void setInstallableUnitProfileProperty(IInstallableUnit iu, String key, String value);
112
113 /**
114 * Remove a property with a given installable unit.
115 * @param iu The installable until to remove a property for
116 * @param key key of the property
117 */
118 public abstract void removeInstallableUnitProfileProperty(IInstallableUnit iu, String key);
119
120 /**
121 * Provide the set of installable units that have been requested for addition
122 * @return a collection of the installable units to add
123 */
124 public abstract Collection<IInstallableUnit> getAdditions();
125
126 /**
127 * Provide the set of installable units that have been requested for removal
128 * @return a collection of the installable units to remove
129 */
130 public abstract Collection<IInstallableUnit> getRemovals();
131
132 /**
133 * Get the extra requirements that have been specified through method {@link #addExtraRequirements(Collection)}
134 * @since 2.2
135 */
136 public abstract Collection<IRequirement> getExtraRequirements();
137 }