Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d09f6f1cbe21e5793e14ba0cf45aac093eeece92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
/*******************************************************************************
 *  Copyright (c) 2000, 2010 IBM Corporation and others.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 * 
 *  Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.update.core;

import java.net.URL;

import org.eclipse.core.runtime.CoreException;

/**
 * Feature content provider.
 * A feature content provider is an abstraction of each feature internal 
 * packaging structure. It allows the feature content to be accessed in
 * a standard way regardless of the internal packaging. All concrete feature
 * implementations need to implement a feature content provider.
 * <p>
 * There are two ways of looking at a feature content:
 * <ol>
 * <li>the "logical" view, which is a representation of the actual files that
 * make up the feature. These include any files that describe the feature
 * itself, files that are the actual implementation of referenced plug-ins,
 * and files that are the non-plug-in data files associated with the feature
 * <li>the "packaged" view, which is a set of related archive files that
 * contain the "logical" files.
 * </ol>
 * It is the responsibility of a feature content provider to manage the
 * mapping between the "packaged" and "logical" views.
 * </p>
 * <p>
 * Clients may implement this interface. However, in most cases clients should 
 * directly instantiate or subclass the provided implementation of this 
 * interface.
 * </p>
 * <p>
 * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to
 * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
 * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
 * (repeatedly) as the API evolves.
 * </p>
 * @see org.eclipse.update.core.FeatureContentProvider
 * @since 2.0
 * @deprecated The org.eclipse.update component has been replaced by Equinox p2.
 * This API will be deleted in a future release. See bug 311590 for details.
 */
public interface IFeatureContentProvider {

	/**
	 * Returns the feature url. 
	 * The exact interpretation of this URL is specific to each content
	 * provider. Typically, the URL is a reference to a file that can be 
	 * used directly, or indirectly, to determine the content of the feature.
	 * 
	 * @return feature url
	 * @since 2.0
	 */
	public URL getURL();

	/**
	 * Returns a content reference to the feature manifest. The feature manifest
	 * is an xml file, whose format is specified by the platform. Typically
	 * a feature will contain the manifest as one of the packaged files.
	 * For features that do not contain the manifest, or contain a manifest
	 * that does not follow the specified format, this method returns
	 * a reference to a computed manifest in the appropriate platform
	 * format.
	 * 
	 * @param monitor progress monitor, can be <code>null</code>
	 * @return feature manifest reference, or <code>null</code> if the manifest cannot be found.
	 * @since 2.0
	 */
	public ContentReference getFeatureManifestReference(InstallMonitor monitor)
		throws CoreException;

	/**
	 * Returns an array of content references of all the "packaged"
	 * archives that make up this feature. 
	 * <p>
	 * The number of returned references is dependent on each feature 
	 * content provider (i.e is dependent on the packaging mechanism used
	 * by the particular feature type).
	 * </p>
	 * 
	 * @param monitor progress monitor, can be <code>null</code>
	 * @return an array of references, or an empty array if no references
	 * are found
	 * @exception CoreException
	 * @since 2.0 
	 */
	public ContentReference[] getArchiveReferences(InstallMonitor monitor)
		throws CoreException;

	/**
	 * Returns an array of content references of the "packaged"
	 * archives that contain the feature descriptive information.
	 * <p>
	 * In general, the feature descriptive information should be packaged
	 * separately from the "bulk" of the actual feature content.
	 * The feature entry archive(s) must be downloaded from an update
	 * site in order to present information about the feature to the
	 * client. Consequently, keeping the number and size of the feature
	 * entry archive(s) to a minimum will speed up the responsiveness of the
	 * user interface.
	 * </p>
	 * <p>
	 * The number of returned references is dependent on each feature
	 * content provider (i.e is dependent on the packaging mechanism used
	 * by the particular feature type).
	 * </p>
	 * 
	 * @see IFeatureContentProvider#getFeatureEntryContentReferences(InstallMonitor)
	 * @param monitor progress monitor, can be <code>null</code>
	 * @return an array of references, or an empty array if no references
	 * are found
	 * @exception CoreException
	 * @since 2.0 
	 */
	public ContentReference[] getFeatureEntryArchiveReferences(InstallMonitor monitor)
		throws CoreException;

	/**
	 * Returns an array of content references of the "packaged"
	 * archives that contain the files for the specified plug-in entry.
	 * <p>
	 * The number of returned references is dependent on each feature
	 * content provider (i.e is dependent on the packaging mechanism used
	 * by the particular feature type).
	 * </p>
	 * 
	 * @see IFeatureContentProvider#getPluginEntryContentReferences(IPluginEntry, InstallMonitor)
	 * @param pluginEntry plug-in entry
	 * @param monitor progress monitor, can be <code>null</code>
	 * @return an array of references, or an empty array if no references
	 * are found
	 * @exception CoreException
	 * @since 2.0 
	 */
	public ContentReference[] getPluginEntryArchiveReferences(
		IPluginEntry pluginEntry,
		InstallMonitor monitor)
		throws CoreException;

	/**
	 * Returns an array of content references of the "packaged"
	 * archives that contain the files for the specified non-plug-in entry.
	 * <p>
	 * The number of returned references is dependent on each feature
	 * content provider (i.e is dependent on the packaging mechanism used
	 * by the particular feature type).
	 * </p>
	 * <p>
	 * Note, that the platform does not interpret non-plug-in entries in any 
	 * way, other that performing any required downloads. Non-plug-in entries
	 * are handled by custom install handlers that must be specified for
	 * the feature. Consequently, this interface does not make a distinction
	 * between the "logical" and "packaged" views for non-plug-in entries.
	 * The "packaged" view (returning references to the non-plug-in archives)
	 * is the only one supported. It is the responsibility of the custom install
	 * handler to understand the "logical" view of non-plug-in archives.
	 * </p>
	 * 
	 * @param monitor progress monitor, can be <code>null</code>
	 * @return an array of references, or an empty array if no references
	 * are found
	 * @exception CoreException
	 * @since 2.0 
	 */
	public ContentReference[] getNonPluginEntryArchiveReferences(
		INonPluginEntry nonPluginEntry,
		InstallMonitor monitor)
		throws CoreException;

	/**
	 * Returns an array of content references to the feature definition files
	 * (i.e the "logical" view of the files defining the feature). These
	 * are the files required to present information about the feature to the
	 * client, and in general, should not contain references to plug-in and 
	 * non-plug-in files.
	 * 
	 * @see IFeatureContentProvider#getFeatureEntryArchiveReferences(InstallMonitor)
	 * @param monitor progress monitor, can be <code>null</code>
	 * @return an array of ContentReference or an empty array if no references are found
	 * @exception CoreException when an error occurs
	 * @since 2.0 
	 */
	public ContentReference[] getFeatureEntryContentReferences(InstallMonitor monitor)
		throws CoreException;

	/**
	 * Returns an array of content references to the files implementing
	 * the specified plug-in. (i.e the "logical" view of the plug-in).
	 * 
	 * @see IFeatureContentProvider#getPluginEntryArchiveReferences(IPluginEntry, InstallMonitor)
	 * @param monitor progress monitor, can be <code>null</code>
	 * @return an array of ContentReference or an empty array if no references are found
	 * @exception CoreException
	 * @since 2.0 
	 */
	public ContentReference[] getPluginEntryContentReferences(
		IPluginEntry pluginEntry,
		InstallMonitor monitor)
		throws CoreException;

	/**
	 * Returns the total size of all archives required for the
	 * specified plug-in and non-plug-in entries (the "packaging" view).
	 * 
	 * @param pluginEntries an array of plug-in entries
	 * @param nonPluginEntries an array of non-plug-in entries
	 * @return total download size, or an indication that size could not be
	 * determined
	 * @see org.eclipse.update.core.model.ContentEntryModel#UNKNOWN_SIZE
	 * @since 2.0
	 */
	public long getDownloadSizeFor(
		IPluginEntry[] pluginEntries,
		INonPluginEntry[] nonPluginEntries);

	/**
	 * Returns the total size of all files required for the
	 * specified plug-in and non-plug-in entries (the "logical" view).
	 * 
	 * @param pluginEntries an array of plug-in entries
	 * @param nonPluginEntries an array of non-plug-in entries
	 * @return total download size, or an indication that size could not be
	 * determined
	 * @see org.eclipse.update.core.model.ContentEntryModel#UNKNOWN_SIZE
	 * @since 2.0
	 */
	public long getInstallSizeFor(
		IPluginEntry[] pluginEntries,
		INonPluginEntry[] nonPluginEntries);

	/**
	 * Returns the verifier for this feature.
	 * If provided, the verifier is called at various point during
	 * installation processing to verify downloaded archives. The
	 * type of verification provided is dependent on the content
	 * provider implementation.
	 * 
	 * @return verifier
	 * @exception CoreException
	 * @since 2.0
	 */
	public IVerifier getVerifier() throws CoreException;

	/**
	 * Returns the feature associated with this content provider.
	 * 
	 * @return feature for this content provider
	 * @since 2.0
	 */
	public IFeature getFeature();

	/**
	 * Sets the feature associated with this content provider.
	 * In general, this method should only be called as part of
	 * feature creation. Once set, the feature should not be reset.
	 * 
	 * @param feature feature for this content provider
	 * @since 2.0
	 */
	public void setFeature(IFeature feature);
}

Back to the top