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"

m (typo)
Line 14: Line 14:
 
   </repository>
 
   </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:
+
As we can see this xml defines a CompositeArtifactRepository with 2 children (as indicated by the "size" attribute). The children are the locations of the referenced repositories. Both of these children are remote repositories but local repositories can be defined as follows:
  
 
   <child location='file:/<local repository location>'/>
 
   <child location='file:/<local repository location>'/>
Line 21: Line 21:
  
 
== Using Composite Repositories ==
 
== Using Composite Repositories ==
Composite repositories implement the ICompositeRepository interface with the following functionality:
+
Composite repositories implement the ICompositeRepository interface which includes the following mthods:
  
* <b>getChildren():</b> returns an ArrayList containing the locations of the repository's children as URIs.
+
* <b>getChildren():</b> returns an ArrayList containing the locations of the child repositories as URIs.
* <b>removeAllChildren():</b> removes all children from the composite repository.
+
* <b>removeAllChildren():</b> removes all child repositories from the composite repository.
 
* <b>addChild(URI):</b> adds the specified location to the list of child repositories
 
* <b>addChild(URI):</b> adds the specified location to the list of child repositories
 
* <b>removeChild(URI):</b> removes the specified URI from the list of child repositories.
 
* <b>removeChild(URI):</b> 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.
+
Note that composite repositories treat child repositories only as references and do not directly modify them.

Revision as of 14:10, 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 (as indicated by the "size" attribute). The children are the locations of the referenced repositories. Both of these children are remote repositories but local repositories can be defined as follows:

 <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 which includes the following mthods:

  • getChildren(): returns an ArrayList containing the locations of the child repositories as URIs.
  • removeAllChildren(): removes all child repositories 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.

Note that composite repositories treat child repositories only as references and do not directly modify them.

Back to the top