Eclipse Platform
Release 3.1

org.eclipse.update.core
Class Site

java.lang.Object
  extended byorg.eclipse.core.runtime.PlatformObject
      extended byorg.eclipse.update.core.model.ModelObject
          extended byorg.eclipse.update.core.model.SiteModel
              extended byorg.eclipse.update.core.Site
All Implemented Interfaces:
IAdaptable, ISite, ISiteWithMirrors

public class Site
extends SiteModel
implements ISiteWithMirrors

Convenience implementation of a site.

This class may be instantiated or subclassed by clients.

Note: 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.

Since:
2.0
See Also:
ISite, SiteModel

Field Summary
static String DEFAULT_FEATURE_PATH
          Default path on a site where packaged features are located
static String DEFAULT_INSTALLED_FEATURE_PATH
          Default installation path for features
static String DEFAULT_PLUGIN_PATH
          Default installation path for plug-ins and plug-in fragments
static String SITE_FILE
          Default site manifest file name
static String SITE_XML
          Default site manifest extension
 
Fields inherited from interface org.eclipse.update.core.ISite
DEFAULT_INSTALLED_FEATURE_TYPE, DEFAULT_PACKAGED_FEATURE_TYPE, SITE_ACCESS_EXCEPTION
 
Constructor Summary
Site()
          Constructor for Site
 
Method Summary
 void addPluginEntry(IPluginEntry pluginEntry)
          Adds a new plug-in entry to this site.
 IFeature createFeature(String type, URL url)
          Creates a new feature object.
 IFeature createFeature(String type, URL url, IProgressMonitor monitor)
          Creates a new feature object.
 boolean equals(Object obj)
          Compares two sites for equality
 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 key)
          Returns the named site category.
 IConfiguredSite getCurrentConfiguredSite()
          Returns the IConfiguredSite for this site in the current configuration or null if none found.
 String getDefaultPackagedFeatureType()
          Returns the default type for a packaged feature supported by this site
 IURLEntry getDescription()
          Returns the site description.
 long getDownloadSizeFor(IFeature feature)
          Get download size for the specified feature on this site.
 ISiteFeatureReference getFeatureReference(IFeature feature)
          Returns a reference to the specified feature on this site.
 ISiteFeatureReference[] getFeatureReferences()
          Returns an array of references to features on this site.
 long getInstallSizeFor(IFeature feature)
          Get install size for the specified feature on this site.
 IURLEntry[] getMirrorSiteEntries()
          Return an array of mirror update sites.
 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
 ISiteFeatureReference[] getRawFeatureReferences()
          Returns an array of references to features on this site.
 ISiteContentProvider getSiteContentProvider()
          Returns the content provider for this site.
 URL getURL()
          Returns the site URL
 IFeatureReference install(IFeature sourceFeature, IFeatureReference[] optionalFeatures, IFeatureContentConsumer parentContentConsumer, IVerifier parentVerifier, IVerificationListener verificationListener, IProgressMonitor progress)
          Install the specified feature on this site using the content consumer as a context to install the feature in.
 IFeatureReference install(IFeature sourceFeature, IFeatureReference[] optionalFeatures, IVerificationListener verificationListener, IProgressMonitor progress)
          Install the specified feature and listed optional features on this site.
 IFeatureReference install(IFeature sourceFeature, IVerificationListener verificationListener, IProgressMonitor progress)
          Install the specified feature and all optional features on this site.
 void remove(IFeature feature, IProgressMonitor progress)
          Remove (uninstall) the specified feature from this site.
protected  void removeFeatureFromCache(URL featureURL)
           
 void setSiteContentProvider(ISiteContentProvider siteContentProvider)
          Sets the site content provider.
 
Methods inherited from class org.eclipse.update.core.model.SiteModel
addArchiveReferenceModel, addCategoryModel, addFeatureReferenceModel, addMirrorModel, getArchiveReferenceModels, getCategoryModels, getConfiguredSiteModel, getDescriptionModel, getFeatureReferenceModels, getLocationURL, getLocationURLString, getMirrorSiteEntryModels, getPropertyName, getType, markReadOnly, removeArchiveReferenceModel, removeCategoryModel, removeFeatureReferenceModel, removeMirror, resolve, setArchiveReferenceModels, setCategoryModels, setConfiguredSiteModel, setDescriptionModel, setFeatureReferenceModels, setLocationURLString, setMirrorSiteEntryModels, setMirrorsURLString, setType
 
Methods inherited from class org.eclipse.update.core.model.ModelObject
arrayTypeFor, arrayTypeFor, assertIsWriteable, getResourceBundle, isReadOnly, markListReferenceReadOnly, markReferenceReadOnly, resolveListReference, resolveNLString, resolveReference, resolveURL
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.update.core.ISite
getType
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

DEFAULT_INSTALLED_FEATURE_PATH

public static final String DEFAULT_INSTALLED_FEATURE_PATH
Default installation path for features

Since:
2.0
See Also:
Constant Field Values

DEFAULT_PLUGIN_PATH

public static final String DEFAULT_PLUGIN_PATH
Default installation path for plug-ins and plug-in fragments

Since:
2.0
See Also:
Constant Field Values

DEFAULT_FEATURE_PATH

public static final String DEFAULT_FEATURE_PATH
Default path on a site where packaged features are located

Since:
2.0
See Also:
Constant Field Values

SITE_FILE

public static final String SITE_FILE
Default site manifest file name

Since:
2.0
See Also:
Constant Field Values

SITE_XML

public static final String SITE_XML
Default site manifest extension

Since:
2.0
See Also:
Constant Field Values
Constructor Detail

Site

public Site()
Constructor for Site

Method Detail

equals

public boolean equals(Object obj)
Compares two sites for equality

Parameters:
obj - site object to compare with
Returns:
true if the two sites are equal, false otherwise
Since:
2.0

getURL

public URL getURL()
Returns the site URL

Specified by:
getURL in interface ISite
Returns:
site URL
Since:
2.0
See Also:
ISite.getURL()

getDescription

public IURLEntry getDescription()
Returns the site description.

Specified by:
getDescription in interface ISite
Returns:
site description, or null.
Since:
2.0
See Also:
ISite.getDescription()

getCategories

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

Specified by:
getCategories in interface ISite
Returns:
array of site categories, or an empty array.
Since:
2.0
See Also:
ISite.getCategories()

getCategory

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

Specified by:
getCategory in interface ISite
Parameters:
key - category name
Returns:
named category, or null ifit does not exist
Since:
2.0
See Also:
ISite.getCategory(String)

getRawFeatureReferences

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

Specified by:
getRawFeatureReferences in interface ISite
Returns:
an array of feature references, or an empty array..
Since:
2.0
See Also:
ISite.getFeatureReferences()

getFeatureReferences

public ISiteFeatureReference[] getFeatureReferences()
Description copied from interface: ISite
Returns an array of references to features on this site.

Specified by:
getFeatureReferences in interface ISite
Returns:
an array of feature references, or an empty array.
See Also:
ISite.getFeatureReferences()

getFeatureReference

public ISiteFeatureReference getFeatureReference(IFeature feature)
Returns a reference to the specified feature on this site.

Specified by:
getFeatureReference in interface ISite
Parameters:
feature - feature
Returns:
feature reference, or null if this feature cannot be located on this site.
Since:
2.0
See Also:
ISite.getFeatureReference(IFeature)

getArchives

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

Specified by:
getArchives in interface ISite
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
See Also:
ISite.getArchives()

getSiteContentProvider

public ISiteContentProvider getSiteContentProvider()
                                            throws CoreException
Returns the content provider for this site.

Specified by:
getSiteContentProvider in interface ISite
Returns:
site content provider
Throws:
CoreException
Since:
2.0
See Also:
ISite.getSiteContentProvider()

getDefaultPackagedFeatureType

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

Specified by:
getDefaultPackagedFeatureType in interface ISite
Returns:
feature type, as registered in the org.eclipse.update.core.featureTypes extension point.
Since:
2.0
See Also:
ISite.getDefaultPackagedFeatureType()

getPluginEntries

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

Specified by:
getPluginEntries in interface ISite
Returns:
array of plug-in entries,or an empty array.
Since:
2.0
See Also:
ISite.getPluginEntries()

getPluginEntryCount

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

Specified by:
getPluginEntryCount in interface ISite
Returns:
number of installed plug-ins
Since:
2.0
See Also:
ISite.getPluginEntryCount()

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.

Specified by:
getPluginEntriesOnlyReferencedBy in interface ISite
Parameters:
feature - feature
Returns:
an array of plug-in entries, or an empty array.
Throws:
CoreException
Since:
2.0
See Also:
*

addPluginEntry

public void addPluginEntry(IPluginEntry pluginEntry)
Adds a new plug-in entry to this site. This implementation always throws UnsupportedOperationException because this implementation does not support the install action.

Specified by:
addPluginEntry in interface ISite
Parameters:
pluginEntry - plug-in entry
Throws:
UnsupportedOperationException
Since:
2.0
See Also:
ISite.addPluginEntry(IPluginEntry)

getDownloadSizeFor

public long getDownloadSizeFor(IFeature feature)
Get download size for the specified feature on this site. This implementation always throws UnsupportedOperationException because this implementation does not support the install action.

Specified by:
getDownloadSizeFor in interface ISite
Parameters:
feature - candidate feature
Returns:
download size of the feature in KiloBytes, or an indication the size could not be determined
Throws:
UnsupportedOperationException
Since:
2.0
See Also:
ISite.getDownloadSizeFor(IFeature)

getInstallSizeFor

public long getInstallSizeFor(IFeature feature)
Get install size for the specified feature on this site. This implementation always throws UnsupportedOperationException because this implementation does not support the install action.

Specified by:
getInstallSizeFor in interface ISite
Parameters:
feature - candidate feature
Returns:
install size of the feature in KiloBytes, or an indication the size could not be determined
Throws:
UnsupportedOperationException
Since:
2.0
See Also:
ISite.getInstallSizeFor(IFeature)

install

public IFeatureReference install(IFeature sourceFeature,
                                 IVerificationListener verificationListener,
                                 IProgressMonitor progress)
                          throws InstallAbortedException,
                                 CoreException
Install the specified feature and all optional features on this site. This implementation always throws UnsupportedOperationException because this implementation does not support the install action.

Specified by:
install in interface ISite
Parameters:
sourceFeature - feature to install
verificationListener - install verification listener
progress - install monitor, can be null
Throws:
InstallAbortedException - when the user cancels the install
CoreException
UnsupportedOperationException
Since:
2.0
See Also:
ISite.install(IFeature, IVerificationListener, IProgressMonitor)

install

public IFeatureReference install(IFeature sourceFeature,
                                 IFeatureReference[] optionalFeatures,
                                 IVerificationListener verificationListener,
                                 IProgressMonitor progress)
                          throws InstallAbortedException,
                                 CoreException
Install the specified feature and listed optional features on this site. This implementation always throws UnsupportedOperationException because this implementation does not support the install action.

Specified by:
install in interface ISite
Parameters:
sourceFeature - feature to install
optionalFeatures - list of optional features to be installed
verificationListener - install verification listener
progress - install monitor, can be null
Throws:
InstallAbortedException - when the user cancels the install
CoreException
UnsupportedOperationException
Since:
2.0
See Also:
ISite.install(IFeature, IVerificationListener, IProgressMonitor)

install

public IFeatureReference install(IFeature sourceFeature,
                                 IFeatureReference[] optionalFeatures,
                                 IFeatureContentConsumer parentContentConsumer,
                                 IVerifier parentVerifier,
                                 IVerificationListener verificationListener,
                                 IProgressMonitor progress)
                          throws CoreException
Install the specified feature on this site using the content consumer as a context to install the feature in. This implementation always throws UnsupportedOperationException because this implementation does not support the install action.

Parameters:
sourceFeature - feature to install
parentContentConsumer - content consumer of the parent feature
parentVerifier - verifier of the parent feature
verificationListener - install verification listener
progress - install monitor, can be null
Throws:
InstallAbortedException - when the user cancels the install
CoreException
UnsupportedOperationException
Since:
2.0

remove

public void remove(IFeature feature,
                   IProgressMonitor progress)
            throws CoreException
Remove (uninstall) the specified feature from this site. This implementation always throws UnsupportedOperationException because this implementation does not support the remove action.

Specified by:
remove in interface ISite
Parameters:
feature - feature to remove
progress - progress monitor
Throws:
UnsupportedOperationException
CoreException
Since:
2.0
See Also:
ISite.remove(IFeature, IProgressMonitor)

setSiteContentProvider

public void setSiteContentProvider(ISiteContentProvider siteContentProvider)
Sets the site content provider.

Specified by:
setSiteContentProvider in interface ISite
Parameters:
siteContentProvider - site content provider
Since:
2.0
See Also:
ISite.setSiteContentProvider(ISiteContentProvider)

getCurrentConfiguredSite

public IConfiguredSite getCurrentConfiguredSite()
Description copied from interface: ISite
Returns the IConfiguredSite for this site in the current configuration or null if none found.

Specified by:
getCurrentConfiguredSite in interface ISite
See Also:
ISite.getCurrentConfiguredSite()

createFeature

public IFeature createFeature(String type,
                              URL url)
                       throws CoreException
Deprecated.  

Description copied from interface: ISite
Creates a new feature object. The feature must exist on this site or a core exception will be thrown. Concrete implementations may elect to cache instances, in which case subsequent calls to create a feature with the same URL will return the same instance. param type the feature type that will be used to select the factory. If null is passed, default feature type will be used. param url URL of the feature archive as listed in the site. return newly created feature object, or a cached value if caching is implemented by this site.

Specified by:
createFeature in interface ISite
Throws:
CoreException
See Also:
ISite.createFeature(String, URL)

createFeature

public IFeature createFeature(String type,
                              URL url,
                              IProgressMonitor monitor)
                       throws CoreException
Description copied from interface: ISite
Creates a new feature object. The feature must exist on this site or a core exception will be thrown. Concrete implementations may elect to cache instances, in which case subsequent calls to create a feature with the same URL will return the same instance. param type the feature type that will be used to select the factory. If null is passed, default feature type will be used. param url URL of the feature archive as listed in the site. return newly created feature object, or a cached value if caching is implemented by this site.

Specified by:
createFeature in interface ISite
Parameters:
monitor - the progress monitor
Throws:
CoreException
See Also:
ISite.createFeature(String, URL, IProgressMonitor)

removeFeatureFromCache

protected void removeFeatureFromCache(URL featureURL)

getMirrorSiteEntries

public IURLEntry[] getMirrorSiteEntries()
Return an array of mirror update sites.

Specified by:
getMirrorSiteEntries in interface ISiteWithMirrors
Returns:
an array of mirror update sites
Since:
2.0

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.