Debian Codegraph @

bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/IUpdateDescriptor.java

raw
1 /*******************************************************************************
2 * Copyright (c) 2008, 2012 IBM Corporation 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 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.equinox.p2.metadata;
15
16 import java.net.URI;
17 import java.util.Collection;
18 import org.eclipse.equinox.p2.metadata.expression.IMatchExpression;
19
20 /**
21 * An update descriptor is attached to an installable unit to describe what that
22 * installable unit is capable of acting as an update for. Typically an installable unit
23 * will specify that it is capable of updating all installable units of the same name
24 * and with an older version. However, this descriptor allows an installable
25 * unit to be considered an update for an installable unit with a different name, or
26 * even an update for a unit with a higher version than itself.
27 *
28 * @noimplement This interface is not intended to be implemented by clients.
29 * @noextend This interface is not intended to be extended by clients.
30 * @since 2.0
31 * @see MetadataFactory#createUpdateDescriptor(String, VersionRange, int, String)
32 */
33 public interface IUpdateDescriptor {
34 /**
35 * Update severity constant (value 0) indicating a normal severity update.
36 */
37 public final int NORMAL = 0;
38 /**
39 * Update severity constant (value 1) indicating a high severity update.
40 */
41 public final int HIGH = 1;
42
43 /**
44 * Returns an expression matching all installable units that will be updated by
45 * the unit with this update descriptor.
46 * @return An expression matching all matching installable units
47 */
48 Collection<IMatchExpression<IInstallableUnit>> getIUsBeingUpdated();
49
50 /**
51 * The description of the update. This allows to explain what the update is about.
52 * @return A description
53 */
54 public String getDescription();
55
56 /**
57 * Returns the location of a document containing the description.
58 *
59 * @return the location of the document, or <code>null</code>
60 */
61 public URI getLocation();
62
63 /**
64 * The importance of the update descriptor represented as a int.
65 * @return The severity (either {@link #HIGH} or {@link #NORMAL}).
66 */
67 public int getSeverity();
68
69 /**
70 * Helper method indicating whether or not an installable unit is an update for the installable unit passed
71 * @param iu the installable unit checked
72 * @return A boolean indicating whether or not an installable unit is an update.
73 */
74 public boolean isUpdateOf(IInstallableUnit iu);
75 }