Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-1541

Add object() and first_object() convenience APIs to qmf

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.5
    • QMF
    • None

    Description

      Here is a patch to add object() and first_object() to the ruby qmf console. Similar would have to be done for python but it should be very easy.

      diff --git a/lib/qpid/qmf.rb b/lib/qpid/qmf.rb
      index d2e2651..f341da7 100644
      — a/lib/qpid/qmf.rb
      +++ b/lib/qpid/qmf.rb
      @@ -390,6 +390,18 @@ module Qpid::Qmf
      @result
      end

      + # Return one and only one object or nil.
      + def object(kwargs)
      + objs = objects(kwargs)
      + return objs.length == 1 ? objs[0] : nil
      + end
      +
      + # Return the first of potentially many objects.
      + def first_object(kwargs)
      + objs = objects(kwargs)
      + return objs.length > 0 ? objs[0] : nil
      + end
      +
      def set_event_filter(kwargs); end

      def handle_broker_connect(broker); end

      Attachments

        Activity

          People

            tross Ted Ross
            imain Ian Main
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified