KickJava   Java API By Example, From Geeks To Geeks.

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


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
19 /**
20  * Local Site.
21  * Represents the local installation. It consists of the current
22  * configuration and the configuration history. A local site
23  * manages the number of configuration histories kept. It also allows
24  * specific configuration histories to be saved.
25  * <p>
26  * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to
27  * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
28  * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
29  * (repeatedly) as the API evolves.
30  * </p>
31  * @since 2.0
32  */

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

47     IInstallConfiguration getCurrentConfiguration();
48
49     /**
50      * Return configuration history.
51      *
52      * @return an array of configurations, or an empty array.
53      * @since 2.0
54      * <p>
55      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
56      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
57      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
58      * (repeatedly) as the API evolves.
59      * </p>
60      */

61     public IInstallConfiguration[] getConfigurationHistory();
62
63     /**
64      * Reverts the local site to use the specified configuration.
65      * The result of this operation is a new configuration that
66      * contains the same configured features as the specified configuration.
67      * The new configuration becomes the current configuration.
68      *
69      * @param configuration configuration state to revert to
70      * @param monitor progress monitor
71      * @param handler problem handler
72      * @exception CoreException
73      * @since 2.0
74      * <p>
75      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
76      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
77      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
78      * (repeatedly) as the API evolves.
79      * </p>
80      */

81     public void revertTo(
82         IInstallConfiguration configuration,
83         IProgressMonitor monitor,
84         IProblemHandler handler)
85         throws CoreException;
86
87     /**
88      * Creates a new configuration containing the same state as the
89      * specified configuration. The new configuration is not added to
90      * this lical site.
91      *
92      * @return cloned configuration
93      * @exception CoreException
94      * @since 2.0
95      * <p>
96      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
97      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
98      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
99      * (repeatedly) as the API evolves.
100      * </p>
101      */

102     public IInstallConfiguration cloneCurrentConfiguration() throws CoreException;
103
104     /**
105      * Adds the specified configuration to this local site.
106      * The new configuration becomes the current one.
107      *
108      * @param config the configuration
109      * @since 2.0
110      * <p>
111      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
112      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
113      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
114      * (repeatedly) as the API evolves.
115      * </p>
116      */

117     public void addConfiguration(IInstallConfiguration config);
118
119     /**
120      * Saves the local site state
121      *
122      * @exception CoreException
123      * @since 2.0
124      * <p>
125      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
126      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
127      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
128      * (repeatedly) as the API evolves.
129      * </p>
130      * @return true if a restart is needed. This return code was added in 3.0.
131      */

132     public boolean save() throws CoreException;
133
134     /**
135      * Indicates how many configuration histories should be maintained.
136      * Histories beyond the specified count are automatically deleted.
137      *
138      * @return number of past configurations to keep as history
139      * @since 2.0
140      * <p>
141      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
142      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
143      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
144      * (repeatedly) as the API evolves.
145      * </p>
146      */

147     public int getMaximumHistoryCount();
148
149     /**
150      * Sets the number of past configurations to keep in history
151      *
152      * @param history number of configuration to keep
153      * @since 2.0
154      * <p>
155      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
156      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
157      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
158      * (repeatedly) as the API evolves.
159      * </p>
160      */

161     public void setMaximumHistoryCount(int history);
162
163     /**
164      * Adds a site change listener
165      *
166      * @param listener the listener
167      * @since 2.0
168      * <p>
169      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
170      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
171      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
172      * (repeatedly) as the API evolves.
173      * </p>
174      */

175     public void addLocalSiteChangedListener(ILocalSiteChangedListener listener);
176
177     /**
178      * Removes a site listener
179      *
180      * @param listener the listener
181      * @since 2.0
182      * <p>
183      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
184      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
185      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
186      * (repeatedly) as the API evolves.
187      * </p>
188      */

189     public void removeLocalSiteChangedListener(ILocalSiteChangedListener listener);
190
191     /**
192      * Save the specified configuration. Saved configurations are
193      * not deleted based on the history count. They must be explicitly
194      * removed.
195      *
196      * @param configuration the configuration to save
197      * @return the preserved configuration or <code>null</code> if the configuration to save is <code>null</code>
198      * @exception CoreException
199      * @since 2.0
200      * <p>
201      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
202      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
203      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
204      * (repeatedly) as the API evolves.
205      * </p>
206      */

207     public IInstallConfiguration addToPreservedConfigurations(IInstallConfiguration configuration)
208         throws CoreException;
209
210     /**
211      * Removes the specified configuration from the list of previously
212      * saved configurations.
213      *
214      * @param configuration the configuration to remove
215      * @since 2.0
216      * <p>
217      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
218      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
219      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
220      * (repeatedly) as the API evolves.
221      * </p>
222      */

223     public void removeFromPreservedConfigurations(IInstallConfiguration configuration);
224
225     /**
226      * Return the list of saved configurations
227      *
228      * @return an array of configurations, or an empty array.
229      * @since 2.0
230      * <p>
231      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
232      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
233      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
234      * (repeatedly) as the API evolves.
235      * </p>
236      */

237     public IInstallConfiguration[] getPreservedConfigurations();
238     
239     /**
240      * Indicates if the 'state' of the specified feature and its children features.
241      *
242      * A feature is considered to be 'unhappy' in the context of this site,
243      * if some of the plug-ins referenced by the feature, or any of its children,
244      * are not installed on this site.
245      *
246      * A feature is considered to be 'happy' in the context of a local site
247      * if all the plug-ins referenced by the feature, or any of its children,
248      * are installed on the site and no other version of any of the plug-ins
249      * are installed on any other site of the local site.
250      *
251      * A feature is considered to be 'ambiguous' in the context of a local site
252      * if all the plug-ins referenced by the feature, or any of its children,
253      * are installed on the site and other version of any of the plug-ins
254      * are installed on any other site of the local site.
255      *
256      * @param feature the feature
257      * @see IFeature#STATUS_HAPPY
258      * @see IFeature#STATUS_UNHAPPY
259      * @see IFeature#STATUS_AMBIGUOUS
260      * @return the state of the feature
261      * @exception CoreException
262      * @since 2.0
263      * <p>
264      * <b>Note:</b> This method is part of an interim API that is still under development and expected to
265      * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
266      * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
267      * (repeatedly) as the API evolves.
268      * </p>
269      */

270     public IStatus getFeatureStatus(IFeature feature) throws CoreException ;
271
272 }
273
Popular Tags