Eclipse Platform
2.0

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
 
Constructor Summary
Site()
          Constructor for Site
 
Method Summary
 void addPluginEntry(IPluginEntry pluginEntry)
          Adds a new plug-in entry to this site.
 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.
 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.
 IFeatureReference getFeatureReference(IFeature feature)
          Returns a reference to the specified feature on this site.
 IFeatureReference[] 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
 ISiteContentProvider getSiteContentProvider()
          Returns the content provider for this site.
 URL getURL()
          Returns the site URL
 IFeatureReference install(IFeature sourceFeature, 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, IVerificationListener verificationListener, IProgressMonitor progress)
          Install the specified feature 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, getDescriptionModel, getFeatureReferenceModels, getLocationURL, getLocationURLString, getType, markReadOnly, removeArchiveReferenceModel, removeCategoryModel, removeFeatureReferenceModel, resolve, setArchiveReferenceModels, setCategoryModels, setDescriptionModel, setFeatureReferenceModels, setLocationURLString, setType
 
Methods inherited from class org.eclipse.update.core.model.ModelObject
arrayTypeFor, arrayTypeFor, assertIsWriteable, 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

Overrides:
equals in class Object
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)

getFeatureReferences

public IFeatureReference[] getFeatureReferences()
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.
Since:
2.0
See Also:
ISite.getFeatureReferences()

getFeatureReference

public IFeatureReference 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#getDefaultInstallableFeatureType()

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:
IPluginContainer#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:
IPluginContainer#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:
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
Parameters:
feature - candidate feature
Returns:
download size of the feature in KiloBytes, or an indication the size could not be determined
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
Returns:
install size of the feature in KiloBytes, or an indication the size could not be determined
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 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
java.jang.UnsupportedOperationException
Since:
2.0
See Also:
ISite.install(IFeature, IVerificationListener, IProgressMonitor)

install

public IFeatureReference install(IFeature sourceFeature,
                                 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:
parentContentConsumer - content consumer of the parent feature
parentVerifier - verifier of the parent feature
verificationListener - install verification listener
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
Parameters:
feature - feature to remove
progress - progress monitor
Throws:
java.jang.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)

Eclipse Platform
2.0

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