Karaf
  1. Karaf
  2. KARAF-452

Support bundle id ranges, symbolic name/version, and regex in shell start/stop etc commands

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1, 3.0.0
    • Fix Version/s: 3.0.1, 4.0.0
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      There are several commands that extend BundlesCommand all of which could be enhanced at once.Guillaume suggested on the dev list that the ids argument could be a List<String> and decoded in the doExecute method.

        Activity

        Hide
        Ivan added a comment -

        Hi, Jean, is there any progress for this JIRA, I would like to try it while it is ready.
        Thanks.

        Show
        Ivan added a comment - Hi, Jean, is there any progress for this JIRA, I would like to try it while it is ready. Thanks.
        Hide
        viola.lu added a comment -

        Hi, Jean:
        Do you have any plan about this improvement? One bug of geronimo has a very close relation with this one, we need to fix it in time, appreciate if u can give me an accurate target date or your current progress.

        Show
        viola.lu added a comment - Hi, Jean: Do you have any plan about this improvement? One bug of geronimo has a very close relation with this one, we need to fix it in time, appreciate if u can give me an accurate target date or your current progress.
        Hide
        Jean-Baptiste Onofré added a comment -

        As sent on the dev mailing list:

        I propose the following convention to identify a bundles or features.
        The identifier could be:

        • a id (long) (as it is currently)
        • a name (for instance bundle_A), the name could contain regexp (for instance bundle_*)
        • a name and a version (for instance bundle_A/1.0.0), the name and version could contain regexp (for instance bundle_/1.0.0 or bundle_A/1)
        • a range of id (for instance 1-4 7-9 will install bundles with id 1, 2, 3, 4 and 7, 8, 9)
        Show
        Jean-Baptiste Onofré added a comment - As sent on the dev mailing list: I propose the following convention to identify a bundles or features. The identifier could be: a id (long) (as it is currently) a name (for instance bundle_A), the name could contain regexp (for instance bundle_*) a name and a version (for instance bundle_A/1.0.0), the name and version could contain regexp (for instance bundle_ /1.0.0 or bundle_A/1 ) a range of id (for instance 1-4 7-9 will install bundles with id 1, 2, 3, 4 and 7, 8, 9)
        Hide
        viola.lu added a comment -

        hi, i provide a patch for support bundle id ranges, can somebody review and apply it?thanks.

        Show
        viola.lu added a comment - hi, i provide a patch for support bundle id ranges, can somebody review and apply it?thanks.
        Hide
        Jean-Baptiste Onofré added a comment -

        I already did it. I'm gonna to commit my changes.

        Show
        Jean-Baptiste Onofré added a comment - I already did it. I'm gonna to commit my changes.
        Hide
        viola.lu added a comment -

        Great, thank.

        Show
        viola.lu added a comment - Great, thank.
        Hide
        Jean-Baptiste Onofré added a comment -

        Trunk: revision 1086180.

        I'm gonna:

        • make deeper tests
        • see if some commands don't extend BundlesCommand
        • add a bundle completer
        • adopt the same behavior around features.
        Show
        Jean-Baptiste Onofré added a comment - Trunk: revision 1086180. I'm gonna: make deeper tests see if some commands don't extend BundlesCommand add a bundle completer adopt the same behavior around features.
        Hide
        Jean-Baptiste Onofré added a comment -

        I saw other commands that should be updated (BundleCommand for instance).
        I'm gonna move some methods into Karaf util bundle to use it in several command classes.

        Show
        Jean-Baptiste Onofré added a comment - I saw other commands that should be updated (BundleCommand for instance). I'm gonna move some methods into Karaf util bundle to use it in several command classes.
        Hide
        viola.lu added a comment -

        hi, jean:
        There is a small type error:
        for (long i = startId; i <= endId; startId++)

        { Bundle bundle = getBundleContext().getBundle(i); this.addBundle(bundle, id, force, bundles); }

        startId++ should be i++.

        Show
        viola.lu added a comment - hi, jean: There is a small type error: for (long i = startId; i <= endId; startId++) { Bundle bundle = getBundleContext().getBundle(i); this.addBundle(bundle, id, force, bundles); } startId++ should be i++.
        Hide
        viola.lu added a comment -

        Pattern versionPattern = Pattern.compile(version); should move from Line 140 to Line 151, if version is null, will introduce an null pointer exception.

        Show
        viola.lu added a comment - Pattern versionPattern = Pattern.compile(version); should move from Line 140 to Line 151, if version is null, will introduce an null pointer exception.
        Hide
        viola.lu added a comment -

        I did several tests, no problem now Can you apply it to karaf branch 2.1.2/2.1.3? Thanks in advance!

        Show
        viola.lu added a comment - I did several tests, no problem now Can you apply it to karaf branch 2.1.2/2.1.3? Thanks in advance!
        Hide
        Jean-Baptiste Onofré added a comment -

        karaf-2.2.x branch: revision 1086518.

        Show
        Jean-Baptiste Onofré added a comment - karaf-2.2.x branch: revision 1086518.
        Hide
        Jean-Baptiste Onofré added a comment -

        Karaf 2.2.1-SNAPSHOT deploy is in progress.

        Show
        Jean-Baptiste Onofré added a comment - Karaf 2.2.1-SNAPSHOT deploy is in progress.
        Hide
        viola.lu added a comment -

        Thanks.

        Show
        viola.lu added a comment - Thanks.
        Hide
        Jarek Gawor added a comment -

        I had some time so I added bundle range support for headers, ls, info, refresh, and resolve commands. Also fixed some NPEs I ran into. Changes committed to trunk in revision 1091989.

        Show
        Jarek Gawor added a comment - I had some time so I added bundle range support for headers, ls, info, refresh, and resolve commands. Also fixed some NPEs I ran into. Changes committed to trunk in revision 1091989.
        Hide
        Jarek Gawor added a comment -

        Merged the changes into 2.2.x branch in revision 1091991.

        Show
        Jarek Gawor added a comment - Merged the changes into 2.2.x branch in revision 1091991.
        Hide
        Jean-Baptiste Onofré added a comment -

        Thanks for the contribution Jarek.

        I'm gonna resume my work on this issue, also related to KARAF-540.

        Show
        Jean-Baptiste Onofré added a comment - Thanks for the contribution Jarek. I'm gonna resume my work on this issue, also related to KARAF-540 .
        Hide
        Jean-Baptiste Onofré added a comment -

        It's now included in K3.

        Show
        Jean-Baptiste Onofré added a comment - It's now included in K3.

          People

          • Assignee:
            Unassigned
            Reporter:
            David Jencks
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development