Eclipse Platform
Release 3.6

org.eclipse.equinox.p2.repository.metadata.spi
Class AbstractMetadataRepository

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.equinox.p2.repository.spi.AbstractRepository<IInstallableUnit>
          extended by org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository
All Implemented Interfaces:
IAdaptable, IQueryable<IInstallableUnit>, IRepository<IInstallableUnit>, IMetadataRepository

public abstract class AbstractMetadataRepository
extends AbstractRepository<IInstallableUnit>
implements IMetadataRepository

The common base class for all metadata repositories.

Clients may subclass this class.

Since:
2.0

Nested Class Summary
static class AbstractMetadataRepository.RepositoryState
           
 
Field Summary
 
Fields inherited from class org.eclipse.equinox.p2.repository.spi.AbstractRepository
agent, description, location, name, properties, provider, type, version
 
Fields inherited from interface org.eclipse.equinox.p2.repository.IRepository
ENABLED, NONE, PREFERENCE_NODE, PROP_COMPRESSED, PROP_DESCRIPTION, PROP_MIRRORS_BASE_URL, PROP_MIRRORS_URL, PROP_NAME, PROP_NICKNAME, PROP_PASSWORD, PROP_SYSTEM, PROP_TIMESTAMP, PROP_USERNAME, TYPE_ARTIFACT, TYPE_METADATA
 
Constructor Summary
  AbstractMetadataRepository(IProvisioningAgent agent)
           
protected AbstractMetadataRepository(IProvisioningAgent agent, String name, String type, String version, URI location, String description, String provider, Map<String,String> properties)
           
 
Method Summary
 void addInstallableUnits(Collection<IInstallableUnit> installableUnits)
          Add the given installable units to this repository.
 void addInstallableUnits(IInstallableUnit[] installableUnit)
           
 void addReference(URI repositoryLocation, String nickname, int repositoryType, int options)
          Adds a reference to another repository to this repository.
abstract  void initialize(AbstractMetadataRepository.RepositoryState state)
           
 void removeAll()
          Remove all installable units from this repository.
 boolean removeInstallableUnits(Collection<IInstallableUnit> installableUnits)
          Removes all installable units in the given collection from this repository.
 boolean removeInstallableUnits(IInstallableUnit[] installableUnits, IProgressMonitor monitor)
           
 
Methods inherited from class org.eclipse.equinox.p2.repository.spi.AbstractRepository
assertModifiable, getDescription, getLocation, getName, getProperties, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setDescription, setName, setProperty, setProvider
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.equinox.p2.repository.IRepository
getDescription, getLocation, getName, getProperties, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setDescription, setName, setProperty, setProvider
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.equinox.p2.query.IQueryable
query
 

Constructor Detail

AbstractMetadataRepository

public AbstractMetadataRepository(IProvisioningAgent agent)

AbstractMetadataRepository

protected AbstractMetadataRepository(IProvisioningAgent agent,
                                     String name,
                                     String type,
                                     String version,
                                     URI location,
                                     String description,
                                     String provider,
                                     Map<String,String> properties)
Method Detail

initialize

public abstract void initialize(AbstractMetadataRepository.RepositoryState state)

addInstallableUnits

public void addInstallableUnits(IInstallableUnit[] installableUnit)
Specified by:
addInstallableUnits in interface IMetadataRepository

addInstallableUnits

public void addInstallableUnits(Collection<IInstallableUnit> installableUnits)
Description copied from interface: IMetadataRepository
Add the given installable units to this repository.

Specified by:
addInstallableUnits in interface IMetadataRepository
Parameters:
installableUnits - the installable units to add

addReference

public void addReference(URI repositoryLocation,
                         String nickname,
                         int repositoryType,
                         int options)
Description copied from interface: IMetadataRepository
Adds a reference to another repository to this repository. When a repository is loaded by IMetadataRepositoryManager, its references are automatically added to the repository manager's set of known repositories.

Note that this method does not add the contents of the given repository to this repository, but merely adds the location of another repository to the metadata of this repository.

The IRepository.ENABLED option flag controls whether the referenced repository should be marked as enabled when added to the repository manager. If this flag is set, the repository will be marked as enabled when added to the repository manager. If this flag is missing, the repository will be marked as disabled.

Specified by:
addReference in interface IMetadataRepository
Parameters:
repositoryLocation - the location of the repository to add
nickname - The nickname of the repository, or null
repositoryType - the repository type (currently either IRepository.TYPE_METADATA or IRepository.TYPE_ARTIFACT).
options - bit-wise or of option constants (currently either IRepository.ENABLED or IRepository.NONE).
See Also:
IRepositoryManager.setEnabled(URI, boolean)

removeAll

public void removeAll()
Description copied from interface: IMetadataRepository
Remove all installable units from this repository.

Specified by:
removeAll in interface IMetadataRepository

removeInstallableUnits

public boolean removeInstallableUnits(IInstallableUnit[] installableUnits,
                                      IProgressMonitor monitor)
Specified by:
removeInstallableUnits in interface IMetadataRepository

removeInstallableUnits

public boolean removeInstallableUnits(Collection<IInstallableUnit> installableUnits)
Description copied from interface: IMetadataRepository
Removes all installable units in the given collection from this repository.

Specified by:
removeInstallableUnits in interface IMetadataRepository
Parameters:
installableUnits - the installable units to remove
Returns:
true if any units were actually removed, and false otherwise

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.