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
>
>

-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)

Reply via email to