KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > configuration > IConfiguredSite


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.update.configuration;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IAdaptable;
15 import org.eclipse.core.runtime.IProgressMonitor;
16 import org.eclipse.core.runtime.IStatus;
17 import org.eclipse.update.core.IFeature;
18 import org.eclipse.update.core.IFeatureReference;
19 import org.eclipse.update.core.ISite;
20 import org.eclipse.update.core.IVerificationListener;
21
22 /**
23  * Configured Site.
24  * Represents an installation site "filtered" by configuration information.
25  * Configured site is the target of the feature update operations (install
26  * feature, remove feature, configure feature, unconfigure feature).
27  * <p>
28  * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to
29  * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
30  * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
31  * (repeatedly) as the API evolves.
32  * </p>
33  * @since 2.0
34  */

35 public interface IConfiguredSite extends IAdaptable {
36
37     /**
38      * Returns the underlying "unfiltered" site.
39      *
40      * @return the underlying site
41      * @since 2.0
42      * <p>
43      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
44      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
45      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
46      * (repeatedly) as the API evolves.
47      * </p>
48      */

49     public ISite getSite();
50
51     /**
52      * Indicates whether updates can be applied to the site.
53      *
54      * <code>IStatus.isOk()</code> return <code>true</code> if
55      * the site can be updated, <code>false</code> otherwise.
56      *
57      * If updates cannot be aplied, the status contains the error message, and
58      * the possible exception.
59      *
60      * @see IStatus
61      * @return an IStatus
62      * @since 2.0
63      * <p>
64      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
65      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
66      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
67      * (repeatedly) as the API evolves.
68      * </p>
69      */

70     public IStatus verifyUpdatableStatus();
71
72     /**
73      * Indicates whether updates can be applied to the site.
74      *
75      * A configuration site is tagged a non-updatable by reading
76      * the platform configuration for this site.
77      *
78      * @return <code>true</code> if the site can be updated,
79      * <code>false</code> otherwise
80      * @since 2.0
81      * <p>
82      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
83      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
84      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
85      * (repeatedly) as the API evolves.
86      * </p>
87      */

88     public boolean isUpdatable();
89
90     /**
91      * Install the specified feature on this site.
92      *
93      * @param feature feature to install
94      * @param verificationListener verification listener, or <code>null</code>
95      * @param monitor progress monitor, or <code>null</code>
96      * @exception CoreException
97      * @since 2.0
98      * <p>
99      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
100      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
101      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
102      * (repeatedly) as the API evolves.
103      * </p>
104      */

105     public IFeatureReference install(IFeature feature, IVerificationListener verificationListener, IProgressMonitor monitor) throws CoreException;
106
107     /**
108      * Install the specified feature on this site.
109      * Only the specified optional features will be installed
110      *
111      * @param feature feature to install
112      * @param optionalFeatures optional features to install
113      * @param verificationListener verification listener, or <code>null</code>
114      * @param monitor progress monitor, or <code>null</code>
115      * @exception CoreException
116      * @since 2.0
117      * <p>
118      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
119      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
120      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
121      * (repeatedly) as the API evolves.
122      * </p>
123      */

124     public IFeatureReference install(IFeature feature, IFeatureReference[] optionalFeatures, IVerificationListener verificationListener, IProgressMonitor monitor) throws CoreException;
125
126
127     /**
128      * Remove (uninstall) the specified feature from this site
129      *
130      * @param feature feature to remove
131      * @param monitor progress monitor, or <code>null</code>
132      * @since 2.0
133      * <p>
134      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
135      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
136      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
137      * (repeatedly) as the API evolves.
138      * </p>
139      */

140     public void remove(IFeature feature, IProgressMonitor monitor) throws CoreException;
141
142     /**
143      * Indicates if the specified feature is "broken". A feature is considered
144      * to be broken in the context of this site, if some of the plug-ins
145      * referenced by the feature are not installed on this site.
146      *
147      * The status code is <code>IStatus.ERROR</code> if the feature is considered
148      * broken. The Status may contain the reason why the feature is broken.
149      * The status code is <code>IStatus.OK</code> if the feature is not considered
150      * broken.
151      *
152      * @param feature the feature
153      * @return the status for this feature on this configured site
154      * @since 2.0
155      * <p>
156      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
157      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
158      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
159      * (repeatedly) as the API evolves.
160      * </p>
161      */

162     public IStatus getBrokenStatus(IFeature feature);
163
164     /**
165      * Indicates if the specified feature is configured on this site.
166      *
167      * @param feature the feature
168      * @return <code>true</code> if the feature is configured,
169      * <code>false</code> otherwise
170      * @since 2.0
171      * <p>
172      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
173      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
174      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
175      * (repeatedly) as the API evolves.
176      * </p>
177      */

178     public boolean isConfigured(IFeature feature);
179
180     /**
181      * Configure the specified feature on this site. The configured
182      * feature will be included on next startup.
183      *
184      * @param feature the feature
185      * @since 2.0
186      * <p>
187      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
188      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
189      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
190      * (repeatedly) as the API evolves.
191      * </p>
192      */

193     public void configure(IFeature feature) throws CoreException;
194
195     /**
196      * Unconfigure the specified feature from this site. The unconfigured
197      * feature will be omitted on the next startup.
198      *
199      * @param feature the feature
200      * @since 2.0
201      * <p>
202      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
203      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
204      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
205      * (repeatedly) as the API evolves.
206      * </p>
207      */

208     public boolean unconfigure(IFeature feature) throws CoreException;
209
210     /**
211      * Return references to features configured on this site.
212      *
213      * @return an array of feature references, or an empty array.
214      * @since 2.0
215      * <p>
216      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
217      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
218      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
219      * (repeatedly) as the API evolves.
220      * </p>
221      */

222     public IFeatureReference[] getConfiguredFeatures();
223
224     /**
225      * Return all features installed on this site (configured as well
226      * as unconfigured). Note, that if the site requires reconciliation,
227      * the result may not match the result of the corresponding method
228      * on the underlying site.
229      *
230      * @see ISite#getFeatureReferences()
231      * @return an array of site feature references, or an empty array.
232      * @since 2.0
233      * <p>
234      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
235      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
236      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
237      * (repeatedly) as the API evolves.
238      * </p>
239      */

240     public IFeatureReference[] getFeatureReferences();
241
242     /**
243      * Returns the install configuration object this site is part of.
244      *
245      * @return install configuration object
246      * @since 2.0
247      * <p>
248      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
249      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
250      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
251      * (repeatedly) as the API evolves.
252      * </p>
253      */

254     public IInstallConfiguration getInstallConfiguration();
255
256     /**
257      * Adds a change listener to the configured site.
258      *
259      * @param listener the listener to add
260      * @since 2.0
261      * <p>
262      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
263      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
264      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
265      * (repeatedly) as the API evolves.
266      * </p>
267      */

268     public void addConfiguredSiteChangedListener(IConfiguredSiteChangedListener listener);
269
270     /**
271      * Removes a change listener from the configured site.
272      *
273      * @param listener the listener to remove
274      * @since 2.0
275      * <p>
276      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
277      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
278      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
279      * (repeatedly) as the API evolves.
280      * </p>
281      */

282     public void removeConfiguredSiteChangedListener(IConfiguredSiteChangedListener listener);
283
284     /**
285      * Indicates if the site is an extension site.
286      *
287      * @return <code>true</code> if the site is an extension site,
288      * <code>false</code> otherwise
289      * @since 2.0
290      * <p>
291      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
292      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
293      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
294      * (repeatedly) as the API evolves.
295      * </p>
296      */

297     public boolean isExtensionSite();
298
299     /**
300      * Indicates if the site is a product site.
301      *
302      * @return <code>true</code> if the site is a product site,
303      * <code>false</code> otherwise
304      * @since 2.0
305      * <p>
306      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
307      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
308      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
309      * (repeatedly) as the API evolves.
310      * </p>
311      */

312     public boolean isProductSite();
313
314     /**
315      * Indicates if the site is a private site.
316      * This does not check if this private site belongs to the
317      * product that is running.
318      *
319      * @return <code>true</code> if the site is a private site,
320      * <code>false</code> otherwise
321      * @since 2.0
322      * <p>
323      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
324      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
325      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
326      * (repeatedly) as the API evolves.
327      * </p>
328      * @deprecated private site are considered the same as extension site (3.0)
329      */

330     public boolean isPrivateSite();
331
332     /**
333      * Indicates if the site has been linked by a native
334      * installer.
335      *
336      * @return <code>true</code> if the site is a natively linked site,
337      * <code>false</code> otherwise
338      * @since 2.0
339      * <p>
340      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
341      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
342      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
343      * (repeatedly) as the API evolves.
344      * </p>
345      */

346     public boolean isNativelyLinked() throws CoreException;
347
348     /**
349      * Sets if the site is enabled
350      *
351      * @param value <code>true</code> if the site is enable, <code>false</code>
352      * otherwise
353      * @since 2.1
354      * <p>
355      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
356      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
357      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
358      * (repeatedly) as the API evolves.
359      * </p>
360      */

361     public void setEnabled(boolean value);
362
363     /**
364      * Indicates if the site is enabled.
365      * If a site is not enable, all teh features are considered disabled.
366      *
367      * @return <code>true</code> if the site is enable, <code>false</code>
368      * otherwise
369      * @since 2.1
370      * <p>
371      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
372      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
373      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
374      * (repeatedly) as the API evolves.
375      * </p>
376      */

377     public boolean isEnabled();
378 }
379
Popular Tags