Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Equinox p2 Composite Repositories"

(Created page. Added "Defining a Composite Repository" and "Using Composite Repositories")
 
m (typo)
Line 1: Line 1:
While regular repositories store their own content, composite repositories consists simply of references to other repositories. This allows users to store large, complex repositories as multiple smaller, more manageable repositories. Similarly, composite repositories allow users to access multiple, dispersed repositories from a single point of entry.
+
While regular repositories store their own content, composite repositories consist simply of references to other repositories. This allows users to store large, complex repositories as multiple smaller, more manageable repositories. Similarly, composite repositories allow users to access multiple, dispersed repositories from a single point of entry.
  
 
__TOC__
 
__TOC__

Revision as of 12:38, 18 November 2008

While regular repositories store their own content, composite repositories consist simply of references to other repositories. This allows users to store large, complex repositories as multiple smaller, more manageable repositories. Similarly, composite repositories allow users to access multiple, dispersed repositories from a single point of entry.

Defining a Composite Repository

Because composite repositories do not have content beyond links to other repositories, all composite repositories will be defined in a similar way. See the example below:

 <repository name='artifact name' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1'>
   ...
   <children size='2'>
     <child location='http://www.eclipse.org/foo'/>
     <child location='http://www.eclipse.org/bar'/>
   </children>
 </repository>

As we can see this xml defines a CompositeArtifactRepository with 2 children. The children are the locations of the referenced repositories. Both of these children are remote repositories but local repositories can be defined by the following code:

 <child location='file:/<local repository location>'/>

Like all other repository types, composite repositories require the "repository" element to be included. Additionally, composite repositories also support the same "properties" element as all other repositories.

Using Composite Repositories

Composite repositories implement the ICompositeRepository interface with the following functionality:

  • getChildren(): returns an ArrayList containing the locations of the repository's children as URIs.
  • removeAllChildren(): removes all children from the composite repository.
  • addChild(URI): adds the specified location to the list of child repositories
  • removeChild(URI): removes the specified URI from the list of child repositories.

Remember, composite repositories treat child repositories only as references and do not directly modify them.

Back to the top