Hi Raymond,

Yep, I saw that in the spec 1.1.

Unfortunately the current version of BundleRepository is providing version 1.0 and doesn't have such Repository.newRequirementBuilder neither a RequirementBuilder implementations.

I will try to workaround creating a class implementing org.osgi.resource.Requirement in my project and verify if I can search for bundles using its capabilities properly.

best regards,

Cristiano


On 23/11/2018 13:32, Raymond Auge wrote:
I think you want the Combining Requirements [1] section of the repository
spec demonstrating the Repository.newRequirementBuilder method.

HTH,
- Ray

[1]
https://osgi.org/specification/osgi.cmpn/7.0.0/service.repository.html#d0e104643
[2]
https://osgi.org/specification/osgi.cmpn/7.0.0/service.repository.html#org.osgi.service.repository.Repository.newRequirementBuilder-String-

On Fri, Nov 23, 2018 at 9:08 AM Cristiano <[email protected]> wrote:

Hello all,

I've been using BundleRepository for long time using
RepositoryAdmin.discoverResources(String filterExpr)...

But now I need to search for bundles and ESA artifacts in my R5
repositories using their provided Capabilities...


Well, the most logical way I found was to use the
RepositoryAdmin.discoverResources(Requirement[] requirements) method. I
also found that BundleRepository registers a
org.osgi.service.repository.Repository that has
findProviders(Collection<? extends Requirement> requirements) method.

But I was not able to find any way to create a
org.apache.felix.bundlerepository.Requirement neither
org.osgi.resource.Requirement object.

I found RequirementImpl class, but all its constructors requires a
Resource object. =-O and I don't have a resource,  it is exactly what I
was looking for ?

could someone give me a clue here please?

thanks,


Cristiano


Reply via email to