Eclipse Platform
2.0

org.eclipse.update.core
Interface ISite

All Superinterfaces:
IAdaptable
All Known Implementing Classes:
Site

public interface ISite
extends IAdaptable

Site represents a location containing some number of features (packaged or installed). Sites are treated purely as an installation and packaging construct. They do not play a role during Eclipse plug-in execution.

Clients may implement this interface. However, in most cases clients should directly instantiate or subclass the provided implementation of this interface.

Since:
2.0
See Also:
Site

Field Summary
static String DEFAULT_INSTALLED_FEATURE_TYPE
          Default type for an installed feature.
static String DEFAULT_PACKAGED_FEATURE_TYPE
          Default type for a packaged feature.
 
Method Summary
 void addPluginEntry(IPluginEntry pluginEntry)
          Adds a new plug-in entry to this site.
 IArchiveReference[] getArchives()
          Returns an array of plug-in and non-plug-in archives located on this site
 ICategory[] getCategories()
          Returns an array of categories defined by the site.
 ICategory getCategory(String name)
          Returns the named site category.
 String getDefaultPackagedFeatureType()
          Returns the default type for a packaged feature supported by this site
 IURLEntry getDescription()
          Returns the site description.
 long getDownloadSizeFor(IFeature feature)
          Returns the size of the files that need to be downloaded in order to install the specified feature on this site, if it can be determined.
 IFeatureReference getFeatureReference(IFeature feature)
          Returns a reference to the specified feature if it is installed on this site.
 IFeatureReference[] getFeatureReferences()
          Returns an array of references to features on this site.
 long getInstallSizeFor(IFeature site)
          Returns the size of the files that need to be installed for the specified feature on this site, if it can be determined.
 IPluginEntry[] getPluginEntries()
          Returns an array of entries corresponding to plug-ins installed on this site.
 IPluginEntry[] getPluginEntriesOnlyReferencedBy(IFeature feature)
          Returns an array of entries corresponding to plug-ins that are installed on this site and are referenced only by the specified feature.
 int getPluginEntryCount()
          Returns the number of plug-ins installed on this site
 ISiteContentProvider getSiteContentProvider()
          Returns the content provider for this site.
 String getType()
          Return the site type.
 URL getURL()
          Returns the site URL
 IFeatureReference install(IFeature feature, IVerificationListener verificationListener, IProgressMonitor monitor)
          Installs the specified feature on this site.
 void remove(IFeature feature, IProgressMonitor monitor)
          Removes (uninstalls) the specified feature from this site.
 void setSiteContentProvider(ISiteContentProvider siteContentProvider)
          Sets the site content provider.
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

DEFAULT_INSTALLED_FEATURE_TYPE

public static final String DEFAULT_INSTALLED_FEATURE_TYPE
Default type for an installed feature. Different concrete feature implementations can be registered together with their corresponding type using the org.eclipse.update.core.featureTypes extension point.

Since:
2.0
See Also:
Constant Field Values

DEFAULT_PACKAGED_FEATURE_TYPE

public static final String DEFAULT_PACKAGED_FEATURE_TYPE
Default type for a packaged feature. Different concrete feature implementations can be registered together with their corresponding type using the org.eclipse.update.core.featureTypes extension point.

Since:
2.0
See Also:
Constant Field Values
Method Detail

getURL

public URL getURL()
Returns the site URL

Returns:
site URL
Since:
2.0

getType

public String getType()
Return the site type. Different concrete site implementations can be registered together with their corresponding type using the org.eclipse.update.core.siteTypes extension point.

Returns:
site type, or null.
Since:
2.0

getDescription

public IURLEntry getDescription()
Returns the site description.

Returns:
site description, or null.
Since:
2.0

getCategories

public ICategory[] getCategories()
Returns an array of categories defined by the site.

Returns:
array of site categories, or an empty array.
Since:
2.0

getCategory

public ICategory getCategory(String name)
Returns the named site category.

Parameters:
name - category name
Returns:
named category, or null ifit does not exist
Since:
2.0

getFeatureReferences

public IFeatureReference[] getFeatureReferences()
Returns an array of references to features on this site.

Returns:
an array of feature references, or an empty array.
Since:
2.0

getFeatureReference

public IFeatureReference getFeatureReference(IFeature feature)
Returns a reference to the specified feature if it is installed on this site.

Parameters:
feature - feature
Returns:
feature reference, or null if this feature cannot be located on this site.

getArchives

public IArchiveReference[] getArchives()
Returns an array of plug-in and non-plug-in archives located on this site

Returns:
an array of archive references, or an empty array if there are no archives known to this site. Note, that an empty array does not necessarily indicate there are no archives accessible on this site. It simply indicates the site has no prior knowledge of such archives.
Since:
2.0

getSiteContentProvider

public ISiteContentProvider getSiteContentProvider()
                                            throws CoreException
Returns the content provider for this site. A content provider is an abstraction of each site organization. It allows the content of the site to be accessed in a standard way regardless of the organization. All concrete sites need to be able to return a content provider.

Returns:
site content provider
Throws:
CoreException
Since:
2.0

getDefaultPackagedFeatureType

public String getDefaultPackagedFeatureType()
Returns the default type for a packaged feature supported by this site

Returns:
feature type, as registered in the org.eclipse.update.core.featureTypes extension point.
Since:
2.0

getPluginEntries

public IPluginEntry[] getPluginEntries()
Returns an array of entries corresponding to plug-ins installed on this site.

Returns:
array of plug-in entries,or an empty array.
Since:
2.0

getPluginEntryCount

public int getPluginEntryCount()
Returns the number of plug-ins installed on this site

Returns:
number of installed plug-ins
Since:
2.0

addPluginEntry

public void addPluginEntry(IPluginEntry pluginEntry)
Adds a new plug-in entry to this site.

Parameters:
pluginEntry - plug-in entry
Since:
2.0

getPluginEntriesOnlyReferencedBy

public IPluginEntry[] getPluginEntriesOnlyReferencedBy(IFeature feature)
                                                throws CoreException
Returns an array of entries corresponding to plug-ins that are installed on this site and are referenced only by the specified feature. These are plug-ins that are not shared with any other feature.

Parameters:
feature - feature
Returns:
an array of plug-in entries, or an empty array.
Throws:
CoreException
Since:
2.0

getDownloadSizeFor

public long getDownloadSizeFor(IFeature feature)
Returns the size of the files that need to be downloaded in order to install the specified feature on this site, if it can be determined. This method takes into account any plug-ins that are already available on this site.

Parameters:
feature - candidate feature
Returns:
download size of the feature in KiloBytes, or an indication the size could not be determined
Since:
2.0
See Also:
ContentEntryModel.UNKNOWN_SIZE

getInstallSizeFor

public long getInstallSizeFor(IFeature site)
Returns the size of the files that need to be installed for the specified feature on this site, if it can be determined. This method takes into account any plug-ins that are already installed on this site.

Returns:
install size of the feature in KiloBytes, or an indication the size could not be determined
Since:
2.0
See Also:
ContentEntryModel.UNKNOWN_SIZE

install

public IFeatureReference install(IFeature feature,
                                 IVerificationListener verificationListener,
                                 IProgressMonitor monitor)
                          throws InstallAbortedException,
                                 CoreException
Installs the specified feature on this site.

Parameters:
feature - feature to install
verificationListener - install verification listener
monitor - install monitor, can be null
Throws:
InstallAbortedException - when the user cancels the install
CoreException
Since:
2.0

remove

public void remove(IFeature feature,
                   IProgressMonitor monitor)
            throws CoreException
Removes (uninstalls) the specified feature from this site. This method takes into account plug-in entries referenced by the specified fetaure that continue to be required by other features installed on this site.

Parameters:
feature - feature to remove
monitor - progress monitor
Throws:
CoreException
Since:
2.0

setSiteContentProvider

public void setSiteContentProvider(ISiteContentProvider siteContentProvider)
Sets the site content provider. This is typically performed as part of the site creation operation. Once set, the provider should not be reset.

Parameters:
siteContentProvider - site content provider
Since:
2.0

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.