You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "San Martín, Matías" <ma...@yahoo.com.ar> on 2012/03/18 00:16:53 UTC

Look for a missing dependency in OBR

Hi everybody,
I'm doing some experimentation with OBR (API) and I don't know how to 
find a missing requirement with it.
That is, if I have a filter expression (as used in a <resource>'s 
<require> description in a repository xml file), is there a way to query 
the OBR service (by means of the repositoryAdmin, I guess) for the 
bundles that satisfy that requirement?

For example,
I have the filter: "(&(package=org.foo.somepackage)(version>=1.3.0))"
Then I would like to query for some bundle that exports the package 
"org.foo.somepackage" with a version >= 1.3.0.

 From the documentation in the RepositoryAdmin class (revision 1.3):
"Checking the capabilities of the filters is not possible because that 
requires a new construct in the filter."
I guess it can't be done. But maybe I'm missing something.

Thanks in advance for any insight about this.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Look for a missing dependency in OBR

Posted by Matias SM <ma...@yahoo.com.ar>.
Thank you very much for your help Richard.
I will start another thread about my "distribution" problem to set a 
context and hopefully get some insights about other possible approaches 
to the problem.

Regards and thanks again.

On 18/03/12 00:13, Richard S. Hall wrote:
> On 3/17/12 20:59 , Matias SM wrote:
>> Thank you for your answer Richard.
>>
>> Is that API available as a bundle to download?
>
> The Felix OBR bundle provides that API. The OSGi API is also 
> optionally provided, but you have to download that OSGi OBR API as a 
> separate bundle. (i.e., you only need the Felix OBR bundle installed 
> to use the Felix OBR API, but you need the Felix OBR bundle and the 
> OSGi OBR API bundle installed to use the OSGi OBR API with the Felix 
> OBR implementation)
>
>>
>> I see in the Felix svn trunk that the RepositoryAdmin has a "new" 
>> method:
>> > Resource[] discoverResources(Requirement[] requirements);
>> Is that what you mean?
>
> Yes.
>
>>
>> Also, I need to "ask" for the resource (bundle) in other server, so I 
>> need to transmit the "requirement" through the network. Is there a 
>> way to do this (e.g. create a requirement from a string) using only 
>> the exported API or should I use the specific implementation?
>
> Not sure what you mean. The OBR bundle and/or spec has nothing to do 
> with distribution, so you are on your own there. However, yes, it 
> should be fairly easy to serialize a requirement since they are 
> already read from an XML file to begin with.
>
> -> richard
>
>>
>> On 17/03/12 20:50, Richard S. Hall wrote:
>>> The original proposed OSGi OBR API didn't provide a way to do this 
>>> from the RepositoryAdmin. You need to use the Felix OBR API, which 
>>> exposes such functionality on its RepositoryAdmin.
>>>
>>> -> richard
>>>
>>> On 3/17/12 19:16 , "San Martín, Matías" wrote:
>>>> Hi everybody,
>>>> I'm doing some experimentation with OBR (API) and I don't know how 
>>>> to find a missing requirement with it.
>>>> That is, if I have a filter expression (as used in a <resource>'s 
>>>> <require> description in a repository xml file), is there a way to 
>>>> query the OBR service (by means of the repositoryAdmin, I guess) 
>>>> for the bundles that satisfy that requirement?
>>>>
>>>> For example,
>>>> I have the filter: "(&(package=org.foo.somepackage)(version>=1.3.0))"
>>>> Then I would like to query for some bundle that exports the package 
>>>> "org.foo.somepackage" with a version >= 1.3.0.
>>>>
>>>> From the documentation in the RepositoryAdmin class (revision 1.3):
>>>> "Checking the capabilities of the filters is not possible because 
>>>> that requires a new construct in the filter."
>>>> I guess it can't be done. But maybe I'm missing something.
>>>>
>>>> Thanks in advance for any insight about this.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Look for a missing dependency in OBR

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 3/17/12 20:59 , Matias SM wrote:
> Thank you for your answer Richard.
>
> Is that API available as a bundle to download?

The Felix OBR bundle provides that API. The OSGi API is also optionally 
provided, but you have to download that OSGi OBR API as a separate 
bundle. (i.e., you only need the Felix OBR bundle installed to use the 
Felix OBR API, but you need the Felix OBR bundle and the OSGi OBR API 
bundle installed to use the OSGi OBR API with the Felix OBR implementation)

>
> I see in the Felix svn trunk that the RepositoryAdmin has a "new" method:
> > Resource[] discoverResources(Requirement[] requirements);
> Is that what you mean?

Yes.

>
> Also, I need to "ask" for the resource (bundle) in other server, so I 
> need to transmit the "requirement" through the network. Is there a way 
> to do this (e.g. create a requirement from a string) using only the 
> exported API or should I use the specific implementation?

Not sure what you mean. The OBR bundle and/or spec has nothing to do 
with distribution, so you are on your own there. However, yes, it should 
be fairly easy to serialize a requirement since they are already read 
from an XML file to begin with.

-> richard

>
> On 17/03/12 20:50, Richard S. Hall wrote:
>> The original proposed OSGi OBR API didn't provide a way to do this 
>> from the RepositoryAdmin. You need to use the Felix OBR API, which 
>> exposes such functionality on its RepositoryAdmin.
>>
>> -> richard
>>
>> On 3/17/12 19:16 , "San Martín, Matías" wrote:
>>> Hi everybody,
>>> I'm doing some experimentation with OBR (API) and I don't know how 
>>> to find a missing requirement with it.
>>> That is, if I have a filter expression (as used in a <resource>'s 
>>> <require> description in a repository xml file), is there a way to 
>>> query the OBR service (by means of the repositoryAdmin, I guess) for 
>>> the bundles that satisfy that requirement?
>>>
>>> For example,
>>> I have the filter: "(&(package=org.foo.somepackage)(version>=1.3.0))"
>>> Then I would like to query for some bundle that exports the package 
>>> "org.foo.somepackage" with a version >= 1.3.0.
>>>
>>> From the documentation in the RepositoryAdmin class (revision 1.3):
>>> "Checking the capabilities of the filters is not possible because 
>>> that requires a new construct in the filter."
>>> I guess it can't be done. But maybe I'm missing something.
>>>
>>> Thanks in advance for any insight about this.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Look for a missing dependency in OBR

Posted by Matias SM <ma...@yahoo.com.ar>.
Thank you for your answer Richard.

Is that API available as a bundle to download?

I see in the Felix svn trunk that the RepositoryAdmin has a "new" method:
 > Resource[] discoverResources(Requirement[] requirements);
Is that what you mean?

Also, I need to "ask" for the resource (bundle) in other server, so I 
need to transmit the "requirement" through the network. Is there a way 
to do this (e.g. create a requirement from a string) using only the 
exported API or should I use the specific implementation?

On 17/03/12 20:50, Richard S. Hall wrote:
> The original proposed OSGi OBR API didn't provide a way to do this 
> from the RepositoryAdmin. You need to use the Felix OBR API, which 
> exposes such functionality on its RepositoryAdmin.
>
> -> richard
>
> On 3/17/12 19:16 , "San Martín, Matías" wrote:
>> Hi everybody,
>> I'm doing some experimentation with OBR (API) and I don't know how to 
>> find a missing requirement with it.
>> That is, if I have a filter expression (as used in a <resource>'s 
>> <require> description in a repository xml file), is there a way to 
>> query the OBR service (by means of the repositoryAdmin, I guess) for 
>> the bundles that satisfy that requirement?
>>
>> For example,
>> I have the filter: "(&(package=org.foo.somepackage)(version>=1.3.0))"
>> Then I would like to query for some bundle that exports the package 
>> "org.foo.somepackage" with a version >= 1.3.0.
>>
>> From the documentation in the RepositoryAdmin class (revision 1.3):
>> "Checking the capabilities of the filters is not possible because 
>> that requires a new construct in the filter."
>> I guess it can't be done. But maybe I'm missing something.
>>
>> Thanks in advance for any insight about this.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Look for a missing dependency in OBR

Posted by "Richard S. Hall" <he...@ungoverned.org>.
The original proposed OSGi OBR API didn't provide a way to do this from 
the RepositoryAdmin. You need to use the Felix OBR API, which exposes 
such functionality on its RepositoryAdmin.

-> richard

On 3/17/12 19:16 , "San Martín, Matías" wrote:
> Hi everybody,
> I'm doing some experimentation with OBR (API) and I don't know how to 
> find a missing requirement with it.
> That is, if I have a filter expression (as used in a <resource>'s 
> <require> description in a repository xml file), is there a way to 
> query the OBR service (by means of the repositoryAdmin, I guess) for 
> the bundles that satisfy that requirement?
>
> For example,
> I have the filter: "(&(package=org.foo.somepackage)(version>=1.3.0))"
> Then I would like to query for some bundle that exports the package 
> "org.foo.somepackage" with a version >= 1.3.0.
>
> From the documentation in the RepositoryAdmin class (revision 1.3):
> "Checking the capabilities of the filters is not possible because that 
> requires a new construct in the filter."
> I guess it can't be done. But maybe I'm missing something.
>
> Thanks in advance for any insight about this.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org