Bug 296280 - Composite Repositories use wrong agent.
Summary: Composite Repositories use wrong agent.
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M5   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 293606
Blocks: 290207 293340
  Show dependency tree
 
Reported: 2009-11-26 14:18 EST by Andrew Niefer CLA
Modified: 2009-12-09 21:29 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Niefer CLA 2009-11-26 14:18:53 EST
The Composite metadata and artifact repositories load the child repos using the default repo manager services.

If the composite repo was created using some other agent location, then it will end up using the incorrect repo manager to load the children.  

It seems like the composite repos will need to keep a reference to the agent they were created under.
Comment 1 Andrew Niefer CLA 2009-12-09 12:05:23 EST
A variation of this is that ICompositeRepository#getChildren(), which returns a list of URIs, can't really be used correctly without knowing the agent used for the composite.

We would need to either change getChildren to return a list of IRepository, or add a new method ICompositeRepository.getManager().

We don't really need to keep the agent, only the IRepositoryManager.
Comment 2 Andrew Niefer CLA 2009-12-09 12:09:02 EST
The list of child URIs could be useful as URIs especially if some children are not reachable.  perhaps we want
List<URI> getChildren
List<IRepository> getChildRepositories
Comment 3 John Arthorne CLA 2009-12-09 16:15:12 EST
(In reply to comment #1)
> A variation of this is that ICompositeRepository#getChildren(), which returns a
> list of URIs, can't really be used correctly without knowing the agent used for
> the composite.

I don't see anyone doing anything interesting with the result of getChildren() today that would require this. The only references outside of tests today are of the form getChildren().length > 0 (i.e., they really just need a hasChildren() method). We could add a new method that returns the loaded child repositories, but clients shouldn't actually need this - the composite effectively "contains" all of the elements that are contained in the children so any additional query on the children would be redundant.
Comment 4 Andrew Niefer CLA 2009-12-09 16:33:02 EST
As part of bug 293340, I was looking at moving the CompositeRepository.validate stuff out of CompositeRepository and into the repo.tools bundle.  This would require getting the children.
Comment 5 John Arthorne CLA 2009-12-09 21:29:02 EST
I have fixed the problem in p2 API branch of using the wrong agent. The repository manager is now passed into composite repositories on construction. I haven't added a getChildRepositories method, but Andrew feel free to add one if you find a need for it.