You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2010/02/19 22:28:28 UTC

[jira] Created: (FELIX-2109) OBR should support matching resources for a given requirement

OBR should support matching resources for a given requirement
-------------------------------------------------------------

                 Key: FELIX-2109
                 URL: https://issues.apache.org/jira/browse/FELIX-2109
             Project: Felix
          Issue Type: Improvement
          Components: Bundle Repository (OBR)
            Reporter: Guillaume Nodet


Somehing like
     Resource[] discoverResources(Requirement requirement);
on the RespositoryAdmin

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2109) OBR should support matching resources for a given requirement

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836139#action_12836139 ] 

Richard S. Hall commented on FELIX-2109:
----------------------------------------

Yep, my bad. I was thinking that discoverResources() was applying the filter to the capabilities of the resources, but it is just applying it to the properties of the resource. I agree that is not sufficient. I don't have an issue with adding such a method.

> OBR should support matching resources for a given requirement
> -------------------------------------------------------------
>
>                 Key: FELIX-2109
>                 URL: https://issues.apache.org/jira/browse/FELIX-2109
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>
> Somehing like
>      Resource[] discoverResources(Requirement requirement);
> on the RespositoryAdmin

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2109) OBR should support matching resources for a given requirement

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836122#action_12836122 ] 

Richard S. Hall commented on FELIX-2109:
----------------------------------------

Technically, this is very close to just doing:

    discoverResources(req.getFilter());

The main/only difference is the requirement has a namespace associated with it. What precisely are you trying to achieve?

> OBR should support matching resources for a given requirement
> -------------------------------------------------------------
>
>                 Key: FELIX-2109
>                 URL: https://issues.apache.org/jira/browse/FELIX-2109
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>
> Somehing like
>      Resource[] discoverResources(Requirement requirement);
> on the RespositoryAdmin

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2109) OBR should support matching resources for a given requirement

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836134#action_12836134 ] 

Guillaume Nodet commented on FELIX-2109:
----------------------------------------

Mmh, this is not exactly the same thing.  
There is currently no way to find a list of resources that export a given package or service right now.

Another way is to extend the syntax of the argument and not consider it a string but a requirement.
The syntax I've implemented locally is the following:
   [name:]filter
With a heuristic to determine the name of the requirement if not specified.

    private Requirement parseRequirement(String req) throws InvalidSyntaxException {
        int p = req.indexOf(':');
        String name;
        String filter;
        if (p > 0) {
            name = req.substring(0, p);
            filter = req.substring(p + 1);
        } else {
            if (req.contains("package")) {
                name = "package";
            } else if (req.contains("service")) {
                name = "service";
            } else {
                name = "bundle";
            }
            filter = req;
        }
        if (!filter.startsWith("(")) {
            filter = "(" + filter + ")";
        }
        Filter flt = FrameworkUtil.createFilter(filter);
        return new RequirementImpl(name, flt);
    }

Then we simply have to modify the method a use the requirement.  
This way, we don't have to modify the interface and we still have the new feature.
The problem in doing so, it that we can't match against resource properties anymore such as license and such.  Thought it would still work for the most common cases of symbolicname, presentationname and version.

Another way would be to add the follwoing:
     Resource[] discoverResources(java.lang.String name, java.lang.String filter);


 

> OBR should support matching resources for a given requirement
> -------------------------------------------------------------
>
>                 Key: FELIX-2109
>                 URL: https://issues.apache.org/jira/browse/FELIX-2109
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>
> Somehing like
>      Resource[] discoverResources(Requirement requirement);
> on the RespositoryAdmin

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-2109) OBR should support matching resources for a given requirement

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved FELIX-2109.
------------------------------------

       Resolution: Fixed
    Fix Version/s: karaf 1.6.0

Committing to https://svn.apache.org/repos/asf/felix/trunk ...
	M	bundlerepository/pom.xml
	M	bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdminImpl.java
	M	bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryImplTest.java
	M	bundlerepository/src/test/java/org/apache/felix/bundlerepository/ResolverImplTest.java
	M	org.osgi.service.obr/src/main/java/org/osgi/service/obr/RepositoryAdmin.java
Committed r912356


> OBR should support matching resources for a given requirement
> -------------------------------------------------------------
>
>                 Key: FELIX-2109
>                 URL: https://issues.apache.org/jira/browse/FELIX-2109
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: karaf 1.6.0
>
>
> Somehing like
>      Resource[] discoverResources(Requirement requirement);
> on the RespositoryAdmin

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (FELIX-2109) OBR should support matching resources for a given requirement

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet reassigned FELIX-2109:
--------------------------------------

    Assignee: Guillaume Nodet

> OBR should support matching resources for a given requirement
> -------------------------------------------------------------
>
>                 Key: FELIX-2109
>                 URL: https://issues.apache.org/jira/browse/FELIX-2109
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>
> Somehing like
>      Resource[] discoverResources(Requirement requirement);
> on the RespositoryAdmin

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.