Eclipse Platform
2.1

org.eclipse.update.core
Class Site

java.lang.Object
  |
  +--org.eclipse.core.runtime.PlatformObject
        |
        +--org.eclipse.update.core.model.ModelObject
              |
              +--org.eclipse.update.core.model.SiteModel
                    |
                    +--org.eclipse.update.core.Site
All Implemented Interfaces:
IAdaptable, ISite

public class Site
extends SiteModel
implements ISite

Convenience implementation of a site.

This class may be instantiated or subclassed by clients.

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.
 org.eclipse.update.configuration.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.
 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.
 void setSiteContentProvider(ISiteContentProvider siteContentProvider)
          Sets the site content provider.
 
Methods inherited from class org.eclipse.update.core.model.SiteModel
addArchiveReferenceModel, addCategoryModel, addFeatureReferenceModel, getArchiveReferenceModels, getCategoryModels, getConfiguredSiteModel, getDescriptionModel, getFeatureReferenceModels, getLocationURL, getLocationURLString, getPropertyName, getType, markReadOnly, removeArchiveReferenceModel, removeCategoryModel, removeFeatureReferenceModel, resolve, setArchiveReferenceModels, setCategoryModels, setConfiguredSiteModel, setDescriptionModel, setFeatureReferenceModels, setLocationURLString, 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

DEFAULT_PLUGIN_PATH

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

DEFAULT_FEATURE_PATH

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

SITE_FILE

public static final String SITE_FILE
Default site manifest file name
Since:
2.0

SITE_XML

public static final String SITE_XML
Default site manifest extension
Since:
2.0
Constructor Detail

Site

public Site()
Constructor for Site
Method Detail

equals

public boolean equals(Object obj)
Compares two sites for equality
Overrides:
equals in class Object
Parameters:
object - 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
Since:
2.0
See Also:
ISite.getURL()

getDescription

public IURLEntry getDescription()
Returns the site description.
Specified by:
getDescription in interface ISite
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
Since:
2.0
See Also:
ISite.getCategories()

getCategory

public ICategory getCategory(String key)
Returns the named site category.
Specified by:
getCategory in interface ISite
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
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
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
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
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
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
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
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
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
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
Throws:
java.jang.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
Throws:
java.jang.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
Throws:
java.jang.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
Throws:
InstallAbortedException - when the user cancels the install
CoreException -  
java.jang.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
Throws:
InstallAbortedException - when the user cancels the install
CoreException -  
java.jang.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:
feature - feature to install
parentContentConsumer - content consumer of the parent feature
parentVerifier - verifier of the parent feature
verificationListener - install verification listener
monitor - install monitor, can be null
Throws:
InstallAbortedException - when the user cancels the install
CoreException -  
java.jang.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
Throws:
java.jang.UnsupportedOperationException -  
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
Since:
2.0
See Also:
ISite.setSiteContentProvider(ISiteContentProvider)

getCurrentConfiguredSite

public org.eclipse.update.configuration.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
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
See Also:
ISite.createFeature(String, URL, IProgressMonitor)

Eclipse Platform
2.1

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