qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject [3/3] qpid-proton git commit: PROTON-822: removed deprecated message save/load as it has been deprecated for a while now and was also the cause of a valgrind error
Date Wed, 18 Feb 2015 06:53:56 GMT
PROTON-822: removed deprecated message save/load as it has been deprecated for a while now
and was also the cause of a valgrind error


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/205ba181
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/205ba181
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/205ba181

Branch: refs/heads/master
Commit: 205ba181bc9d9077f8bd032ed08acccaae00f4f7
Parents: 7b81ca9
Author: Rafael Schloming <rhs@alum.mit.edu>
Authored: Wed Feb 18 01:04:03 2015 -0500
Committer: Rafael Schloming <rhs@alum.mit.edu>
Committed: Wed Feb 18 01:45:03 2015 -0500

----------------------------------------------------------------------
 proton-c/bindings/javascript/message.js         |  17 --
 .../bindings/perl/lib/qpid/proton/Message.pm    |  14 --
 proton-c/bindings/perl/perl.i                   |  30 ----
 proton-c/bindings/php/php.i                     |  14 --
 proton-c/bindings/php/proton.php                |  22 +--
 proton-c/bindings/python/cproton.i              |  30 ----
 proton-c/bindings/python/proton/__init__.py     |  26 ---
 .../bindings/ruby/lib/qpid_proton/message.rb    |  35 +---
 proton-c/bindings/ruby/ruby.i                   |  30 ----
 .../ruby/spec/qpid/proton/message_spec.rb       |  47 -----
 .../ruby/spec/qpid/proton/messenger_spec.rb     |   2 +-
 proton-c/include/proton/cproton.i               |  85 ---------
 proton-c/include/proton/message.h               |  65 -------
 proton-c/src/message/message.c                  | 180 -------------------
 tests/python/proton_tests/message.py            |  50 ------
 tests/ruby/proton_tests/interop.rb              |   2 +-
 tests/tools/apps/python/msgr-send.py            |   2 +-
 17 files changed, 6 insertions(+), 645 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/javascript/message.js
----------------------------------------------------------------------
diff --git a/proton-c/bindings/javascript/message.js b/proton-c/bindings/javascript/message.js
index bcab604..40b15f2 100644
--- a/proton-c/bindings/javascript/message.js
+++ b/proton-c/bindings/javascript/message.js
@@ -784,23 +784,6 @@ _Message_['setReplyToGroupID'] = function(id) {
 };
 
 /**
- * The following methods are marked as deprecated and are not implemented.
- * pn_message_get_format()
- * pn_message_set_format()
- * pn_message_load()
- * pn_message_load_data()
- * pn_message_load_text()
- * pn_message_load_amqp()
- * pn_message_load_json()
- * pn_message_save()
- * pn_message_save_data()
- * pn_message_save_text()
- * pn_message_save_amqp()
- * pn_message_save_json()
- * pn_message_data()
- */
-
-/**
  * Return a Binary representation of the message encoded in AMQP format. N.B. the
  * returned {@link proton.Data.Binary} "owns" the underlying raw data and is thus
  * responsible for freeing it or passing it to a method that consumes a Binary

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/perl/lib/qpid/proton/Message.pm
----------------------------------------------------------------------
diff --git a/proton-c/bindings/perl/lib/qpid/proton/Message.pm b/proton-c/bindings/perl/lib/qpid/proton/Message.pm
index 88184ed..b36caa7 100644
--- a/proton-c/bindings/perl/lib/qpid/proton/Message.pm
+++ b/proton-c/bindings/perl/lib/qpid/proton/Message.pm
@@ -231,20 +231,6 @@ sub get_content_type {
     return cproton_perl::pn_message_get_content_type($self->{_impl});
 }
 
-sub set_content {
-    my ($self) = @_;
-    my $content = $_[1];
-
-    cproton_perl::pn_message_load($self->{_impl}, $content);
-}
-
-sub get_content {
-    my ($self) = @_;
-    my $content = cproton_perl::pn_message_save($self->{_impl}, 1024);
-
-    return cproton_perl::pn_message_save($self->{_impl}, 1024);
-}
-
 sub set_content_encoding {
     my ($self) = @_;
     cproton_perl::pn_message_set_content_encoding($self->{_impl}, $_[1]);

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/perl/perl.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/perl/perl.i b/proton-c/bindings/perl/perl.i
index cb44188..e5c093c 100644
--- a/proton-c/bindings/perl/perl.i
+++ b/proton-c/bindings/perl/perl.i
@@ -152,39 +152,9 @@
 %cstring_output_withsize(char *OUTPUT, size_t *OUTPUT_SIZE)
 %cstring_output_allocate_size(char **ALLOC_OUTPUT, size_t *ALLOC_SIZE, free(*$1));
 
-int pn_message_load(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load;
-
-int pn_message_load_data(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_data;
-
-int pn_message_load_text(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_text;
-
-int pn_message_load_amqp(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_amqp;
-
-int pn_message_load_json(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_json;
-
 int pn_message_encode(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
 %ignore pn_message_encode;
 
-int pn_message_save(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save;
-
-int pn_message_save_data(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_data;
-
-int pn_message_save_text(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_text;
-
-int pn_message_save_amqp(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_amqp;
-
-int pn_message_save_json(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_json;
-
 ssize_t pn_link_send(pn_link_t *transport, char *STRING, size_t LENGTH);
 %ignore pn_link_send;
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/php/php.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/php/php.i b/proton-c/bindings/php/php.i
index 163f8ff..a318ecd 100644
--- a/proton-c/bindings/php/php.i
+++ b/proton-c/bindings/php/php.i
@@ -181,20 +181,6 @@ ssize_t pn_sasl_send(pn_sasl_t *sasl, char *STRING, size_t LENGTH);
 %}
 %ignore pn_message_encode;
 
-%rename(pn_message_save) wrap_pn_message_save;
-%inline %{
-    void wrap_pn_message_save(pn_message_t *message, size_t maxCount, char **OUTPUT_BUFFER,
ssize_t *OUTPUT_LEN) {
-        *OUTPUT_BUFFER = emalloc(sizeof(char) * maxCount);
-        *OUTPUT_LEN = maxCount;
-        int err = pn_message_save(message, *OUTPUT_BUFFER, OUTPUT_LEN);
-        if (err) {
-          *OUTPUT_LEN = err;
-          efree(*OUTPUT_BUFFER);
-        }
-    }
-%}
-%ignore pn_message_save;
-
 %rename(pn_message_data) wrap_pn_message_data;
 // in PHP:  array = pn_message_data("binary message data", MAXLEN);
 //          array[0] = size || error code

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/php/proton.php
----------------------------------------------------------------------
diff --git a/proton-c/bindings/php/proton.php b/proton-c/bindings/php/proton.php
index 2e2a69a..a8e6c5a 100644
--- a/proton-c/bindings/php/proton.php
+++ b/proton-c/bindings/php/proton.php
@@ -266,9 +266,9 @@ class Message {
     $props->clear();
     if ($this->properties != null)
       $props->put_object($this->properties);
+
+    $body->clear();
     if ($this->body != null) {
-      // XXX: move this out when load/save are gone
-      $body->clear();
       $body->put_object($this->body);
     }
   }
@@ -487,24 +487,6 @@ class Message {
     $this->_check(pn_message_decode($this->impl, $data, strlen($data)));
     $this->_post_decode();
   }
-
-  public function load($data) {
-    $this->_check(pn_message_load($this->impl, $data, strlen($data)));
-  }
-
-  public function save() {
-    $sz = 16;
-    while (true) {
-      list($err, $data) = pn_message_save($this->impl, $sz);
-      if ($err == PN_OVERFLOW) {
-        $sz *= 2;
-        continue;
-      } else {
-        $this->_check($err);
-        return $data;
-      }
-    }
-  }
 }
 
 class Binary {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/python/cproton.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/cproton.i b/proton-c/bindings/python/cproton.i
index 192f343..9885016 100644
--- a/proton-c/bindings/python/cproton.i
+++ b/proton-c/bindings/python/cproton.i
@@ -85,39 +85,9 @@
 
 %apply pn_uuid_t { pn_decimal128_t };
 
-int pn_message_load(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load;
-
-int pn_message_load_data(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_data;
-
-int pn_message_load_text(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_text;
-
-int pn_message_load_amqp(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_amqp;
-
-int pn_message_load_json(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_json;
-
 int pn_message_encode(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
 %ignore pn_message_encode;
 
-int pn_message_save(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save;
-
-int pn_message_save_data(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_data;
-
-int pn_message_save_text(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_text;
-
-int pn_message_save_amqp(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_amqp;
-
-int pn_message_save_json(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_json;
-
 ssize_t pn_link_send(pn_link_t *transport, char *STRING, size_t LENGTH);
 %ignore pn_link_send;
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/python/proton/__init__.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/__init__.py b/proton-c/bindings/python/proton/__init__.py
index 7f14650..0f49020 100644
--- a/proton-c/bindings/python/proton/__init__.py
+++ b/proton-c/bindings/python/proton/__init__.py
@@ -1081,18 +1081,6 @@ The sequence of the message within its group.
 The group-id for any replies.
 """)
 
-  # XXX
-  def _get_format(self):
-    return pn_message_get_format(self._msg)
-
-  def _set_format(self, value):
-    self._check(pn_message_set_format(self._msg, value))
-
-  format = property(_get_format, _set_format,
-                    doc="""
-The format of the message.
-""")
-
   def encode(self):
     self._pre_encode()
     sz = 16
@@ -1109,20 +1097,6 @@ The format of the message.
     self._check(pn_message_decode(self._msg, data, len(data)))
     self._post_decode()
 
-  def load(self, data):
-    self._check(pn_message_load(self._msg, data))
-
-  def save(self):
-    sz = 16
-    while True:
-      err, data = pn_message_save(self._msg, sz)
-      if err == PN_OVERFLOW:
-        sz *= 2
-        continue
-      else:
-        self._check(err)
-        return data
-
   def send(self, sender, tag=None):
     dlv = sender.delivery(tag or sender.delivery_tag())
     encoded = self.encode()

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/ruby/lib/qpid_proton/message.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/message.rb b/proton-c/bindings/ruby/lib/qpid_proton/message.rb
index d3d96fd..144990b 100644
--- a/proton-c/bindings/ruby/lib/qpid_proton/message.rb
+++ b/proton-c/bindings/ruby/lib/qpid_proton/message.rb
@@ -427,39 +427,6 @@ module Qpid # :nodoc:
         Cproton.pn_message_get_content_type(@impl)
       end
 
-      # Sets the message content.
-      #
-      # *WARNING:* This method has been deprecated. Please use #body= instead to
-      # set the content of a message.
-      #
-      # ==== Options
-      #
-      # * content - the content
-      #
-      def content=(content)
-        Cproton.pn_message_load(@impl, content)
-      end
-
-      # Returns the message content.
-      #
-      # *WARNING:* This method has been deprecated. Please use #body instead to
-      # retrieve the content of a message.
-      #
-      def content
-        size = 16
-        loop do
-          result = Cproton.pn_message_save(@impl, size)
-          error = result[0]
-          data = result[1]
-          if error == Qpid::Proton::Error::OVERFLOW
-            size = size * 2
-          else
-            check(error)
-            return data
-          end
-        end
-      end
-
       # Sets the content encoding type.
       #
       # ==== Options
@@ -642,7 +609,7 @@ module Qpid # :nodoc:
 
       def check(err) # :nodoc:
         if err < 0
-          raise DataError, "[#{err}]: #{Cproton.pn_message_error(@data)}"
+          raise DataError, "[#{err}]: #{Cproton.pn_message_error(@impl)}"
         else
           return err
         end

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/ruby/ruby.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/ruby.i b/proton-c/bindings/ruby/ruby.i
index cd0cef3..dd2162b 100644
--- a/proton-c/bindings/ruby/ruby.i
+++ b/proton-c/bindings/ruby/ruby.i
@@ -236,39 +236,9 @@
     }
 }
 
-int pn_message_load(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load;
-
-int pn_message_load_data(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_data;
-
-int pn_message_load_text(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_text;
-
-int pn_message_load_amqp(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_amqp;
-
-int pn_message_load_json(pn_message_t *msg, char *STRING, size_t LENGTH);
-%ignore pn_message_load_json;
-
 int pn_message_encode(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
 %ignore pn_message_encode;
 
-int pn_message_save(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save;
-
-int pn_message_save_data(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_data;
-
-int pn_message_save_text(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_text;
-
-int pn_message_save_amqp(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_amqp;
-
-int pn_message_save_json(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_save_json;
-
 ssize_t pn_link_send(pn_link_t *transport, char *STRING, size_t LENGTH);
 %ignore pn_link_send;
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
index df052c9..ba33a38 100644
--- a/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
+++ b/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
@@ -41,23 +41,6 @@ module Qpid
         expect(@message.subject).not_to eq(subject)
       end
 
-      it "has an error number" do
-        expect(@message.error?).to eq(false)
-        @message.format = Qpid::Proton::MessageFormat::AMQP
-        @message.content = "{"
-        expect(@message.error?).to eq(true)
-        expect(@message.errno).not_to eq(0)
-      end
-
-      it "has an error message" do
-        expect(@message.error?).to eq(false)
-        expect(@message.error).to be_nil
-        @message.format = Qpid::Proton::MessageFormat::AMQP
-        @message.content = "{"
-        expect(@message.error?).to eq(true)
-        expect(@message.error).not_to eq("")
-      end
-
       it "can be durable" do
         @message.durable = true
         expect(@message.durable).to eq(true)
@@ -253,25 +236,6 @@ module Qpid
         expect(@message.correlation_id).to eq(id)
       end
 
-      it "raises an error when setting  a nil format" do
-        expect {
-          @message.format = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on an invalid format" do
-        expect {
-          @message.format = "farkle"
-        }.to raise_error(TypeError)
-      end
-
-      it "has a format" do
-        Qpid::Proton::MessageFormat.formats.each do |format|
-          @message.format = format
-          expect(@message.format).to eq(format)
-        end
-      end
-
       it "will allow a nil content type" do
         @message.content_type = nil
         expect(@message.content_type).to be_nil
@@ -401,17 +365,6 @@ module Qpid
         expect(@message.reply_to_group_id).to eq(id)
       end
 
-      it "can have an empty string as content" do
-        @message.content = ""
-        expect(@message.content).to eq("")
-      end
-
-      it "can have content" do
-        content = random_string(255)
-        @message.content = content
-        expect(@message.content).to eq(content)
-      end
-
       it "has properties" do
         expect(@message).to respond_to(:properties)
         expect(@message).to respond_to(:properties=)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
index a99408c..ec60fdb 100644
--- a/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
+++ b/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
@@ -275,7 +275,7 @@ module Qpid
 
             @msg = Qpid::Proton::Message.new
             @msg.address = "amqp://0.0.0.0:#{@port}"
-            @msg.content = "Test sent #{Time.new}"
+            @msg.body = "Test sent #{Time.new}"
           end
 
           after (:each) do

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/include/proton/cproton.i
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/cproton.i b/proton-c/include/proton/cproton.i
index badac05..c52ffc6 100644
--- a/proton-c/include/proton/cproton.i
+++ b/proton-c/include/proton/cproton.i
@@ -862,91 +862,6 @@ typedef unsigned long int uintptr_t;
   msg != NULL;
 }
 
-%contract pn_message_get_format(pn_message_t *message)
-{
- require:
-  message != NULL;
- ensure:
-  check_format(pn_message_get_format);
-}
-
-%contract pn_message_set_format(pn_message_t *message, pn_format_t format)
-{
- require:
-  message != NULL;
-  check_format(format);
-}
-
-%contract pn_message_load(pn_message_t *message, const char *data, size_t size)
-{
- require:
-  message != NULL;
-  size >= 0;
-}
-
-%contract pn_message_load_data(pn_message_t *message, const char *data, size_t size)
-{
- require:
-  message != NULL;
-  size >= 0;
-}
-
-%contract pn_message_load_text(pn_message_t *message, const char *data, size_t size)
-{
- require:
-  message != NULL;
-  size >= 0;
-}
-
-%contract pn_message_load_amqp(pn_message_t *message, const char *data, size_t size)
-{
- require:
-  message != NULL;
-  size >= 0;
-}
-
-%contract pn_message_load_json(pn_message_t *message, const char *data, size_t size)
-{
- require:
-  message != NULL;
-  size >= 0;
-}
-
-%contract pn_message_save(pn_message_t *message, char *data, size_t *size)
-{
- require:
-  message != NULL;
-  *size >= 0;
-}
-
-%contract pn_message_save_data(pn_message_t *message, char *data, size_t *size)
-{
- require:
-  message != NULL;
-  *size >= 0;
-}
-
-%contract pn_message_save_text(pn_message_t *message, char *data, size_t *size)
-{
- require:
-  message != NULL;
-  *size >= 0;
-}
-
-%contract pn_message_save_amqp(pn_message_t *message, char *data, size_t *size)
-{
- require:
-  message != NULL;
-  *size >= 0;
-}
-
-%contract pn_message_save_json(pn_message_t *message, char *data, size_t *size)
-{
- require:
-  message != NULL;
-  *size >= 0;
-}
-
 %contract pn_message_decode(pn_message_t *msg, const char *bytes, size_t size)
 {
  require:

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/include/proton/message.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/message.h b/proton-c/include/proton/message.h
index 2857731..572ab00 100644
--- a/proton-c/include/proton/message.h
+++ b/proton-c/include/proton/message.h
@@ -658,66 +658,6 @@ PN_EXTERN const char *   pn_message_get_reply_to_group_id (pn_message_t
*msg);
 PN_EXTERN int            pn_message_set_reply_to_group_id (pn_message_t *msg, const char
*reply_to_group_id);
 
 /**
- * @deprecated
- */
-PN_EXTERN pn_format_t pn_message_get_format(pn_message_t *message);
-
-/**
- * @deprecated
- */
-PN_EXTERN int pn_message_set_format(pn_message_t *message, pn_format_t format);
-
-/**
- * @deprecated Use ::pn_message_body() instead.
- */
-PN_EXTERN int pn_message_load(pn_message_t *message, const char *data, size_t size);
-
-/**
- * @deprecated Use ::pn_message_body() instead.
- */
-PN_EXTERN int pn_message_load_data(pn_message_t *message, const char *data, size_t size);
-
-/**
- * @deprecated Use ::pn_message_body() instead.
- */
-PN_EXTERN int pn_message_load_text(pn_message_t *message, const char *data, size_t size);
-
-/**
- * @deprecated Use ::pn_message_body() instead.
- */
-PN_EXTERN int pn_message_load_amqp(pn_message_t *message, const char *data, size_t size);
-
-/**
- * @deprecated Use ::pn_message_body() instead.
- */
-PN_EXTERN int pn_message_load_json(pn_message_t *message, const char *data, size_t size);
-
-/**
- * @deprecated Use ::pn_message_body() instead.
- */
-PN_EXTERN int pn_message_save(pn_message_t *message, char *data, size_t *size);
-
-/**
- * @deprecated Use ::pn_message_body() instead.
- */
-PN_EXTERN int pn_message_save_data(pn_message_t *message, char *data, size_t *size);
-
-/**
- * @deprecated Use ::pn_message_body() instead.
- */
-PN_EXTERN int pn_message_save_text(pn_message_t *message, char *data, size_t *size);
-
-/**
- * @deprecated Use ::pn_message_body() instead.
- */
-PN_EXTERN int pn_message_save_amqp(pn_message_t *message, char *data, size_t *size);
-
-/**
- * @deprecated Use ::pn_message_body() instead.
- */
-PN_EXTERN int pn_message_save_json(pn_message_t *message, char *data, size_t *size);
-
-/**
  * Get/set the delivery instructions for a message.
  *
  * This operation returns a pointer to a ::pn_data_t representing the
@@ -808,11 +748,6 @@ PN_EXTERN int pn_message_decode(pn_message_t *msg, const char *bytes,
size_t siz
  */
 PN_EXTERN int pn_message_encode(pn_message_t *msg, char *bytes, size_t *size);
 
-/**
- * @deprecated
- */
-PN_EXTERN ssize_t pn_message_data(char *dst, size_t available, const char *src, size_t size);
-
 /** @}
  */
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/proton-c/src/message/message.c
----------------------------------------------------------------------
diff --git a/proton-c/src/message/message.c b/proton-c/src/message/message.c
index c158345..d750dc3 100644
--- a/proton-c/src/message/message.c
+++ b/proton-c/src/message/message.c
@@ -865,186 +865,6 @@ int pn_message_encode(pn_message_t *msg, char *bytes, size_t *size)
   return 0;
 }
 
-pn_format_t pn_message_get_format(pn_message_t *msg)
-{
-  return msg ? msg->format : PN_AMQP;
-}
-
-int pn_message_set_format(pn_message_t *msg, pn_format_t format)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  msg->format = format;
-  return 0;
-}
-
-int pn_message_load(pn_message_t *msg, const char *data, size_t size)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  switch (msg->format) {
-  case PN_DATA: return pn_message_load_data(msg, data, size);
-  case PN_TEXT: return pn_message_load_text(msg, data, size);
-  case PN_AMQP: return pn_message_load_amqp(msg, data, size);
-  case PN_JSON: return pn_message_load_json(msg, data, size);
-  }
-
-  return PN_STATE_ERR;
-}
-
-int pn_message_load_data(pn_message_t *msg, const char *data, size_t size)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  pn_data_clear(msg->body);
-  int err = pn_data_fill(msg->body, "z", size, data);
-  if (err) {
-    return pn_error_format(msg->error, err, "data error: %s",
-                           pn_data_error(msg->body));
-  } else {
-    return 0;
-  }
-}
-
-int pn_message_load_text(pn_message_t *msg, const char *data, size_t size)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  pn_data_clear(msg->body);
-  int err = pn_data_fill(msg->body, "S", data);
-  if (err) {
-    return pn_error_format(msg->error, err, "data error: %s",
-                           pn_data_error(msg->body));
-  } else {
-    return 0;
-  }
-}
-
-int pn_message_load_amqp(pn_message_t *msg, const char *data, size_t size)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  pn_parser_t *parser = pn_message_parser(msg);
-
-  pn_data_clear(msg->body);
-  int err = pn_parser_parse(parser, data, msg->body);
-  if (err) {
-    return pn_error_format(msg->error, err, "parse error: %s",
-                           pn_parser_error(parser));
-  } else {
-    return 0;
-  }
-}
-
-int pn_message_load_json(pn_message_t *msg, const char *data, size_t size)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  // XXX: unsupported format
-
-  return PN_ERR;
-}
-
-int pn_message_save(pn_message_t *msg, char *data, size_t *size)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  switch (msg->format) {
-  case PN_DATA: return pn_message_save_data(msg, data, size);
-  case PN_TEXT: return pn_message_save_text(msg, data, size);
-  case PN_AMQP: return pn_message_save_amqp(msg, data, size);
-  case PN_JSON: return pn_message_save_json(msg, data, size);
-  }
-
-  return PN_STATE_ERR;
-}
-
-int pn_message_save_data(pn_message_t *msg, char *data, size_t *size)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  if (!msg->body || pn_data_size(msg->body) == 0) {
-    *size = 0;
-    return 0;
-  }
-
-  bool scanned;
-  pn_bytes_t bytes;
-  int err = pn_data_scan(msg->body, "?z", &scanned, &bytes);
-  if (err) return pn_error_format(msg->error, err, "data error: %s",
-                                  pn_data_error(msg->body));
-  if (scanned) {
-    if (bytes.size > *size) {
-      *size = bytes.size;
-      return PN_OVERFLOW;
-    } else {
-      memcpy(data, bytes.start, bytes.size);
-      *size = bytes.size;
-      return 0;
-    }
-  } else {
-    return PN_STATE_ERR;
-  }
-}
-
-int pn_message_save_text(pn_message_t *msg, char *data, size_t *size)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  pn_data_rewind(msg->body);
-  if (pn_data_next(msg->body)) {
-    switch (pn_data_type(msg->body)) {
-    case PN_STRING:
-      {
-        pn_bytes_t str = pn_data_get_bytes(msg->body);
-        if (str.size >= *size) {
-          *size = str.size;
-          return PN_OVERFLOW;
-        } else {
-          memcpy(data, str.start, str.size);
-          data[str.size] = '\0';
-          *size = str.size;
-          return 0;
-        }
-      }
-      break;
-    case PN_NULL:
-      *size = 0;
-      return 0;
-    default:
-      return PN_STATE_ERR;
-    }
-  } else {
-    *size = 0;
-    return 0;
-  }
-}
-
-int pn_message_save_amqp(pn_message_t *msg, char *data, size_t *size)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  if (!msg->body) {
-    *size = 0;
-    return 0;
-  }
-
-  int err = pn_data_format(msg->body, data, size);
-  if (err) return pn_error_format(msg->error, err, "data error: %s",
-                                  pn_data_error(msg->body));
-
-  return 0;
-}
-
-int pn_message_save_json(pn_message_t *msg, char *data, size_t *size)
-{
-  if (!msg) return PN_ARG_ERR;
-
-  // XXX: unsupported format
-
-  return PN_ERR;
-}
-
 pn_data_t *pn_message_instructions(pn_message_t *msg)
 {
   return msg ? msg->instructions : NULL;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/tests/python/proton_tests/message.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/message.py b/tests/python/proton_tests/message.py
index 0cb713e..6bf94fe 100644
--- a/tests/python/proton_tests/message.py
+++ b/tests/python/proton_tests/message.py
@@ -126,53 +126,3 @@ class CodecTest(Test):
     assert self.msg.address == msg2.address, (self.msg.address, msg2.address)
     assert self.msg.subject == msg2.subject, (self.msg.subject, msg2.subject)
     assert self.msg.body == msg2.body, (self.msg.body, msg2.body)
-
-class LoadSaveTest(Test):
-
-  def _test(self, fmt, *bodies):
-    self.msg.format = fmt
-    for body in bodies:
-      self.msg.clear()
-      saved = self.msg.save()
-      assert  saved == "", saved
-      self.msg.load(body)
-      saved = self.msg.save()
-      assert saved == body, (body, saved)
-
-  def testIntegral(self):
-    self._test(Message.AMQP, "0", "1", "-1", "9223372036854775807")
-
-  def testFloating(self):
-    self._test(Message.AMQP, "1.1", "3.14159", "-3.14159", "-1.1")
-
-  def testSymbol(self):
-    self._test(Message.AMQP, ':symbol', ':"quoted symbol"')
-
-  def testString(self):
-    self._test(Message.AMQP, '"string"', '"string with spaces"')
-
-  def testBinary(self):
-    self._test(Message.AMQP, 'b"binary"', 'b"binary with spaces and special values: \\x00\\x01\\x02"')
-
-  def testMap(self):
-    self._test(Message.AMQP, '{"one"=1, :two=2, :pi=3.14159}', '{[1, 2, 3]=[3, 2, 1], {1=2}={3=4}}')
-
-  def testList(self):
-    self._test(Message.AMQP, '[1, 2, 3]', '["one", "two", "three"]', '[:one, 2, 3.14159]',
-               '[{1=2}, {3=4}, {5=6}]')
-
-  def testDescriptor(self):
-    self._test(Message.AMQP, '@21 ["one", 2, "three", @:url "http://example.org"]')
-
-  def testData(self):
-    self._test(Message.DATA, "this is data\x00\x01\x02 blah blah")
-
-  def testText(self):
-    self._test(Message.TEXT, "this is a text string")
-
-  def testTextLoadNone(self):
-    self.msg.format = Message.TEXT
-    self.msg.clear()
-    self.msg.load(None)
-    saved = self.msg.save()
-    assert saved == "", repr(saved)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/tests/ruby/proton_tests/interop.rb
----------------------------------------------------------------------
diff --git a/tests/ruby/proton_tests/interop.rb b/tests/ruby/proton_tests/interop.rb
index e14cba1..c1a201c 100755
--- a/tests/ruby/proton_tests/interop.rb
+++ b/tests/ruby/proton_tests/interop.rb
@@ -49,7 +49,7 @@ class InteropTest < Test::Unit::TestCase
   def decode_message_file(name)
     message = Message.new()
     message.decode(self.get_data(name))
-    self.decode_data(message.content)
+    self.decode_data(message.body)
   end
 
   def assert_next(type, value)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/205ba181/tests/tools/apps/python/msgr-send.py
----------------------------------------------------------------------
diff --git a/tests/tools/apps/python/msgr-send.py b/tests/tools/apps/python/msgr-send.py
index fb931de..872122b 100755
--- a/tests/tools/apps/python/msgr-send.py
+++ b/tests/tools/apps/python/msgr-send.py
@@ -132,7 +132,7 @@ def main(argv=None):
 
     message = Message()
     message.reply_to = "~"
-    message.load( "X" * opts.msg_size )
+    message.body = "X" * opts.msg_size
     reply_message = Message()
     messenger = Messenger( opts.name )
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message