You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2012/06/01 00:22:06 UTC

svn commit: r1344930 - in /qpid/proton/trunk/proton-j: ./ src/org/apache/qpid/proton/message/ src/org/apache/qpid/proton/type/messaging/

Author: rgodfrey
Date: Thu May 31 22:22:06 2012
New Revision: 1344930

URL: http://svn.apache.org/viewvc?rev=1344930&view=rev
Log:
proton-j : add message abstraction api

Added:
    qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/
    qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/Message.java
    qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/MessageFormat.java
Modified:
    qpid/proton/trunk/proton-j/jproton.py
    qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/type/messaging/Header.java
    qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/type/messaging/Properties.java

Modified: qpid/proton/trunk/proton-j/jproton.py
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/jproton.py?rev=1344930&r1=1344929&r2=1344930&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/jproton.py (original)
+++ qpid/proton/trunk/proton-j/jproton.py Thu May 31 22:22:06 2012
@@ -18,6 +18,7 @@
 #
 
 from org.apache.qpid.proton.engine import *
+from org.apache.qpid.proton.message import *
 from jarray import zeros
 from java.util import EnumSet
 
@@ -36,6 +37,10 @@ PN_REJECTED = 3
 PN_RELEASED = 4
 PN_MODIFIED = 5
 
+PN_DEFAULT_PRIORITY = Message.DEFAULT_PRIORITY
+
+PN_AMQP = MessageFormat.AMQP
+
 def enums(mask):
   local = []
   if (PN_LOCAL_UNINIT | mask):
@@ -200,3 +205,155 @@ def pn_local_disp(d):
 
 def pn_settle(d):
   d.settle()
+
+def pn_message():
+  return Message()
+
+def pn_message_is_durable(m):
+  return m.isDurable()
+
+def pn_message_set_durable(m,d):
+  m.setDurable(d)
+  return 0
+
+def pn_message_get_priority(m):
+  return m.getPriority()
+
+def pn_message_set_priority(m,p):
+  m.setPriority(p)
+  return 0
+
+def pn_message_get_ttl(m):
+  return m.getTtl()
+
+def pn_message_set_ttl(m, t):
+  m.setTtl(t)
+  return 0
+
+def pn_message_is_first_acquirer(m):
+  return m.isFirstAcquirer()
+
+def pn_message_set_first_acquirer(m, b):
+  m.setFirstAcquirer(b)
+  return 0
+
+def pn_message_get_delivery_count(m):
+  return m.getDeliveryCount()
+
+def pn_message_set_delivery_count(m,c):
+  m.setDeliveryCount(c)
+  return 0
+
+def pn_message_get_id(m):
+  return m.getId()
+
+def pn_message_set_id(m, i):
+  m.setId(i)
+  return 0
+
+def pn_message_get_user_id(m):
+  u = m.getUserId()
+  if u is None:
+      return ""
+  else:
+      return u.tostring()
+
+def pn_message_set_user_id(m, u):
+  m.setUserId(u)
+  return 0
+
+def pn_message_get_address(m):
+  return m.getAddress()
+
+def pn_message_set_address(m, a):
+  m.setAddress(a)
+  return 0
+
+def pn_message_get_subject(m):
+  return m.getSubject()
+
+def pn_message_set_subject(m,d):
+  m.setSubject(d)
+  return 0
+
+def pn_message_get_reply_to(m):
+  return m.getReplyTo()
+
+def pn_message_set_reply_to(m,d):
+  m.setReplyTo(d)
+  return 0
+
+def pn_message_get_correlation_id(m):
+  return m.getCorrelationId()
+
+def pn_message_set_correlation_id(m,d):
+  m.setCorrelationId(d)
+  return 0
+
+def pn_message_get_content_type(m):
+  return m.getContentType()
+
+def pn_message_set_content_type(m,d):
+  m.setContentType(d)
+  return 0
+
+def pn_message_get_content_encoding(m):
+  return m.getContentEncoding()
+
+def pn_message_set_content_encoding(m,d):
+  m.setContentEncoding(d)
+  return 0
+
+def pn_message_get_expiry_time(m):
+  return m.getExpiryTime()
+
+def pn_message_set_expiry_time(m,d):
+  m.setExpiryTime(d)
+  return 0
+
+def pn_message_get_creation_time(m):
+  return m.getCreationTime()
+
+def pn_message_set_creation_time(m,d):
+  m.setCreationTime(d)
+  return 0
+
+def pn_message_get_group_id(m):
+  return m.getGroupId()
+
+def pn_message_set_group_id(m,d):
+  m.setGroupId(d)
+  return 0
+
+def pn_message_get_group_sequence(m):
+  return m.getGroupSequence()
+
+def pn_message_set_group_sequence(m,d):
+  m.setGroupSequence(d)
+  return 0
+
+def pn_message_get_reply_to_group_id(m):
+  return m.getReplyToGroupId()
+
+def pn_message_set_reply_to_group_id(m,d):
+  m.setReplyToGroupId(d)
+  return 0
+
+def pn_message_free(m):
+  return
+
+def pn_message_encode(m,f,size):
+    output = zeros(size, "b")
+    n = m.encode(f, output, 0, size)
+    result = ""
+    if n > 0:
+      result = output.tostring()[:n]
+    return [0, result]
+
+def pn_message_decode(m,f,data,size):
+    m.decode(f,data,0,size)
+    return 0
+
+
+
+

Added: qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/Message.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/Message.java?rev=1344930&view=auto
==============================================================================
--- qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/Message.java (added)
+++ qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/Message.java Thu May 31 22:22:06 2012
@@ -0,0 +1,595 @@
+package org.apache.qpid.proton.message;
+
+import java.nio.ByteBuffer;
+import java.util.Date;
+import org.apache.qpid.proton.codec.DecoderImpl;
+import org.apache.qpid.proton.codec.EncoderImpl;
+import org.apache.qpid.proton.type.*;
+import org.apache.qpid.proton.type.messaging.*;
+
+public class Message
+{
+    public static final short DEFAULT_PRIORITY = 4;
+
+    private Header _header;
+    private DeliveryAnnotations _deliveryAnnotations;
+    private MessageAnnotations _messageAnnotations;
+    private Properties _properties;
+    private ApplicationProperties _applicationProperties;
+    private Section _body;
+    private Footer _footer;
+
+    public Message()
+    {
+    }
+
+    Message(Header header, DeliveryAnnotations deliveryAnnotations, MessageAnnotations messageAnnotations,
+            Properties properties, ApplicationProperties applicationProperties, Section body, Footer footer)
+    {
+        _header = header;
+        _deliveryAnnotations = deliveryAnnotations;
+        _messageAnnotations = messageAnnotations;
+        _properties = properties;
+        _applicationProperties = applicationProperties;
+        _body = body;
+        _footer = footer;
+    }
+
+    public boolean isDurable()
+    {
+        return (_header == null || _header.getDurable() == null) ? false : _header.getDurable();
+    }
+
+
+    public long getDeliveryCount()
+    {
+        return (_header == null || _header.getDeliveryCount() == null) ? 0l : _header.getDeliveryCount().longValue();
+    }
+
+
+    public short getPriority()
+    {
+        return (_header == null || _header.getPriority() == null)
+                       ? DEFAULT_PRIORITY
+                       : _header.getPriority().shortValue();
+    }
+
+    public boolean isFirstAcquirer()
+    {
+        return (_header == null || _header.getFirstAcquirer() == null) ? false : _header.getFirstAcquirer();
+    }
+
+    public long getTtl()
+    {
+        return (_header == null || _header.getTtl() == null) ? 0l : _header.getTtl().longValue();
+    }
+
+    public void setDurable(boolean durable)
+    {
+        if (_header == null)
+        {
+            if (durable)
+            {
+                _header = new Header();
+            }
+            else
+            {
+                return;
+            }
+        }
+        _header.setDurable(durable);
+    }
+
+    public void setTtl(long ttl)
+    {
+
+        if (_header == null)
+        {
+            if (ttl != 0l)
+            {
+                _header = new Header();
+            }
+            else
+            {
+                return;
+            }
+        }
+        _header.setTtl(UnsignedInteger.valueOf(ttl));
+    }
+
+    public void setDeliveryCount(long deliveryCount)
+    {
+        if (_header == null)
+        {
+            if (deliveryCount == 0l)
+            {
+                return;
+            }
+            _header = new Header();
+        }
+        _header.setDeliveryCount(UnsignedInteger.valueOf(deliveryCount));
+    }
+
+
+    public void setFirstAcquirer(boolean firstAcquirer)
+    {
+
+        if (_header == null)
+        {
+            if (!firstAcquirer)
+            {
+                return;
+            }
+            _header = new Header();
+        }
+        _header.setFirstAcquirer(firstAcquirer);
+    }
+
+    public void setPriority(short priority)
+    {
+
+        if (_header == null)
+        {
+            if (priority == DEFAULT_PRIORITY)
+            {
+                return;
+            }
+            _header = new Header();
+        }
+        _header.setPriority(UnsignedByte.valueOf((byte) priority));
+    }
+
+    public Object getMessageId()
+    {
+        return _properties == null ? null : _properties.getMessageId();
+    }
+
+    public long getGroupSequence()
+    {
+        return (_properties == null || _properties.getGroupSequence() == null) ? 0l : _properties.getGroupSequence().intValue();
+    }
+
+    public String getReplyToGroupId()
+    {
+        return _properties == null ? null : _properties.getReplyToGroupId();
+    }
+
+    public long getCreationTime()
+    {
+        return (_properties == null || _properties.getCreationTime() == null) ? 0l : _properties.getCreationTime().getTime();
+    }
+
+    public String getAddress()
+    {
+        return _properties == null ? null : _properties.getTo();
+    }
+
+    public byte[] getUserId()
+    {
+        if(_properties == null || _properties.getUserId() == null)
+        {
+            return null;
+        }
+        else
+        {
+            final Binary userId = _properties.getUserId();
+            byte[] id = new byte[userId.getLength()];
+            System.arraycopy(userId.getArray(),userId.getArrayOffset(),id,0,userId.getLength());
+            return id;
+        }
+
+    }
+
+    public String getReplyTo()
+    {
+        return _properties == null ? null : _properties.getReplyTo();
+    }
+
+    public String getGroupId()
+    {
+        return _properties == null ? null : _properties.getGroupId();
+    }
+
+    public String getContentType()
+    {
+        return (_properties == null || _properties.getContentType() == null) ? null : _properties.getContentType().toString();
+    }
+
+    public long getExpiryTime()
+    {
+        return (_properties == null || _properties.getAbsoluteExpiryTime() == null) ? 0l : _properties.getAbsoluteExpiryTime().getTime();
+    }
+
+    public Object getCorrelationId()
+    {
+        return (_properties == null) ? null : _properties.getCorrelationId();
+    }
+
+    public String getContentEncoding()
+    {
+        return (_properties == null || _properties.getContentEncoding() == null) ? null : _properties.getContentEncoding().toString();
+    }
+
+    public String getSubject()
+    {
+        return _properties == null ? null : _properties.getSubject();
+    }
+
+    public void setGroupSequence(long groupSequence)
+    {
+        if(_properties == null)
+        {
+            if(groupSequence == 0l)
+            {
+                return;
+            }
+            else
+            {
+                _properties = new Properties();
+            }
+        }
+        _properties.setGroupSequence(UnsignedInteger.valueOf((int) groupSequence));
+    }
+
+    public void setUserId(byte[] userId)
+    {
+        if(userId == null)
+        {
+            if(_properties != null)
+            {
+                _properties.setUserId(null);
+            }
+
+        }
+        else
+        {
+            if(_properties == null)
+            {
+                _properties = new Properties();
+            }
+            byte[] id = new byte[userId.length];
+            System.arraycopy(userId, 0, id,0, userId.length);
+            _properties.setUserId(new Binary(id));
+        }
+    }
+
+    public void setCreationTime(long creationTime)
+    {
+        if(_properties == null)
+        {
+            if(creationTime == 0l)
+            {
+                return;
+            }
+            _properties = new Properties();
+
+        }
+        _properties.setCreationTime(new Date(creationTime));
+    }
+
+    public void setSubject(String subject)
+    {
+        if(_properties == null)
+        {
+            if(subject == null)
+            {
+                return;
+            }
+            _properties = new Properties();
+        }
+        _properties.setSubject(subject);
+    }
+
+    public void setGroupId(String groupId)
+    {
+        if(_properties == null)
+        {
+            if(groupId == null)
+            {
+                return;
+            }
+            _properties = new Properties();
+        }
+        _properties.setGroupId(groupId);
+    }
+
+    public void setAddress(String to)
+    {
+        if(_properties == null)
+        {
+            if(to == null)
+            {
+                return;
+            }
+            _properties = new Properties();
+        }
+        _properties.setTo(to);
+    }
+
+    public void setExpiryTime(long absoluteExpiryTime)
+    {
+        if(_properties == null)
+        {
+            if(absoluteExpiryTime == 0l)
+            {
+                return;
+            }
+            _properties = new Properties();
+
+        }
+        _properties.setAbsoluteExpiryTime(new Date(absoluteExpiryTime));
+    }
+
+    public void setReplyToGroupId(String replyToGroupId)
+    {
+        if(_properties == null)
+        {
+            if(replyToGroupId == null)
+            {
+                return;
+            }
+            _properties = new Properties();
+        }
+        _properties.setReplyToGroupId(replyToGroupId);
+    }
+
+    public void setContentEncoding(String contentEncoding)
+    {
+        if(_properties == null)
+        {
+            if(contentEncoding == null)
+            {
+                return;
+            }
+            _properties = new Properties();
+        }
+        _properties.setContentEncoding(Symbol.valueOf(contentEncoding));
+    }
+
+    public void setContentType(String contentType)
+    {
+        if(_properties == null)
+        {
+            if(contentType == null)
+            {
+                return;
+            }
+            _properties = new Properties();
+        }
+        _properties.setContentType(Symbol.valueOf(contentType));
+    }
+
+    public void setReplyTo(String replyTo)
+    {
+
+        if(_properties == null)
+        {
+            if(replyTo == null)
+            {
+                return;
+            }
+            _properties = new Properties();
+        }
+        _properties.setReplyTo(replyTo);
+    }
+
+    public void setCorrelationId(Object correlationId)
+    {
+
+        if(_properties == null)
+        {
+            if(correlationId == null)
+            {
+                return;
+            }
+            _properties = new Properties();
+        }
+        _properties.setCorrelationId(correlationId);
+    }
+
+    public void setMessageId(Object messageId)
+    {
+
+        if(_properties == null)
+        {
+            if(messageId == null)
+            {
+                return;
+            }
+            _properties = new Properties();
+        }
+        _properties.setMessageId(messageId);
+    }
+
+
+    Header getHeader()
+    {
+        return _header;
+    }
+
+    DeliveryAnnotations getDeliveryAnnotations()
+    {
+        return _deliveryAnnotations;
+    }
+
+    MessageAnnotations getMessageAnnotations()
+    {
+        return _messageAnnotations;
+    }
+
+    Properties getProperties()
+    {
+        return _properties;
+    }
+
+    ApplicationProperties getApplicationProperties()
+    {
+        return _applicationProperties;
+    }
+
+    Section getBody()
+    {
+        return _body;
+    }
+
+    Footer getFooter()
+    {
+        return _footer;
+    }
+
+    public int decode(MessageFormat format, byte[] data, int offset, int length)
+    {
+        DecoderImpl decoder = new DecoderImpl();
+        EncoderImpl encoder = new EncoderImpl(decoder);
+
+        AMQPDefinedTypes.registerAllTypes(decoder);
+        final ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
+        decoder.setByteBuffer(buffer);
+
+        _header = null;
+        _deliveryAnnotations = null;
+        _messageAnnotations = null;
+        _properties = null;
+        _applicationProperties = null;
+        _body = null;
+        _footer = null;
+        Section section = null;
+
+        if(buffer.hasRemaining())
+        {
+            section = (Section) decoder.readObject();
+        }
+        if(section instanceof Header)
+        {
+            _header = (Header) section;
+            if(buffer.hasRemaining())
+            {
+                section = (Section) decoder.readObject();
+            }
+            else
+            {
+                section = null;
+            }
+
+        }
+        if(section instanceof DeliveryAnnotations)
+        {
+            _deliveryAnnotations = (DeliveryAnnotations) section;
+
+            if(buffer.hasRemaining())
+            {
+                section = (Section) decoder.readObject();
+            }
+            else
+            {
+                section = null;
+            }
+
+        }
+        if(section instanceof MessageAnnotations)
+        {
+            _messageAnnotations = (MessageAnnotations) section;
+
+            if(buffer.hasRemaining())
+            {
+                section = (Section) decoder.readObject();
+            }
+            else
+            {
+                section = null;
+            }
+
+        }
+        if(section instanceof Properties)
+        {
+            _properties = (Properties) section;
+
+            if(buffer.hasRemaining())
+            {
+                section = (Section) decoder.readObject();
+            }
+            else
+            {
+                section = null;
+            }
+
+        }
+        if(section instanceof ApplicationProperties)
+        {
+            _applicationProperties = (ApplicationProperties) section;
+
+            if(buffer.hasRemaining())
+            {
+                section = (Section) decoder.readObject();
+            }
+            else
+            {
+                section = null;
+            }
+
+        }
+        if(section != null && !(section instanceof Footer))
+        {
+            _body = section;
+
+            if(buffer.hasRemaining())
+            {
+                section = (Section) decoder.readObject();
+            }
+            else
+            {
+                section = null;
+            }
+
+        }
+        if(section instanceof Footer)
+        {
+            _footer = (Footer) section;
+
+        }
+
+        return length-buffer.remaining();
+
+    }
+
+    public int encode(MessageFormat format, byte[] data, int offset, int length)
+    {
+        DecoderImpl decoder = new DecoderImpl();
+        EncoderImpl encoder = new EncoderImpl(decoder);
+        AMQPDefinedTypes.registerAllTypes(decoder);
+        final ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
+        encoder.setByteBuffer(buffer);
+
+        if(getHeader() != null)
+        {
+            encoder.writeObject(getHeader());
+        }
+        if(getDeliveryAnnotations() != null)
+        {
+            encoder.writeObject(getDeliveryAnnotations());
+        }
+        if(getMessageAnnotations() != null)
+        {
+            encoder.writeObject(getDeliveryAnnotations());
+        }
+        if(getProperties() != null)
+        {
+            encoder.writeObject(getProperties());
+        }
+        if(getApplicationProperties() != null)
+        {
+            encoder.writeObject(getApplicationProperties());
+        }
+        if(getBody() != null)
+        {
+            encoder.writeObject(getBody());
+        }
+        if(getFooter() != null)
+        {
+            encoder.writeObject(getFooter());
+        }
+
+        return length - buffer.remaining();
+    }
+
+}

Added: qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/MessageFormat.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/MessageFormat.java?rev=1344930&view=auto
==============================================================================
--- qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/MessageFormat.java (added)
+++ qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/message/MessageFormat.java Thu May 31 22:22:06 2012
@@ -0,0 +1,6 @@
+package org.apache.qpid.proton.message;
+
+public enum MessageFormat
+{
+    AMQP
+}

Modified: qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/type/messaging/Header.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/type/messaging/Header.java?rev=1344930&r1=1344929&r2=1344930&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/type/messaging/Header.java (original)
+++ qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/type/messaging/Header.java Thu May 31 22:22:06 2012
@@ -36,12 +36,12 @@ public class Header
 {
     private static final Object[] DESCRIPTORS =
     {
-        UnsignedLong.valueOf(0x0000000000000070L), Symbol.valueOf("amqp:header:list"), 
+        UnsignedLong.valueOf(0x0000000000000070L), Symbol.valueOf("amqp:header:list"),
     };
 
     private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000070L);
     private final HeaderWrapper _wrapper = new HeaderWrapper();
-    
+
     private Boolean _durable;
     private UnsignedByte _priority;
     private UnsignedInteger _ttl;
@@ -97,7 +97,7 @@ public class Header
     {
         _deliveryCount = deliveryCount;
     }
-    
+
     public Object getDescriptor()
     {
         return DESCRIPTOR;
@@ -107,7 +107,7 @@ public class Header
     {
         return _wrapper;
     }
-    
+
     public Object get(final int index)
     {
 
@@ -122,7 +122,7 @@ public class Header
             case 3:
                 return _firstAcquirer;
             case 4:
-                return _deliveryCount;            
+                return _deliveryCount;
         }
 
         throw new IllegalStateException("Unknown index " + index);
@@ -131,17 +131,17 @@ public class Header
 
     public int size()
     {
-        return _deliveryCount != null 
-                  ? 5 
-                  : _firstAcquirer != null 
-                  ? 4 
-                  : _ttl != null 
-                  ? 3 
-                  : _priority != null 
-                  ? 2 
-                  : _durable != null 
-                  ? 1 
-                  : 0;        
+        return _deliveryCount != null
+                  ? 5
+                  : _firstAcquirer != null
+                  ? 4
+                  : _ttl != null
+                  ? 3
+                  : _priority != null
+                  ? 2
+                  : _durable != null
+                  ? 1
+                  : 0;
 
     }
 
@@ -205,5 +205,16 @@ public class Header
             decoder.register(descriptor, constructor);
         }
     }
+
+    @Override
+    public String toString()
+    {
+        return "Header{" +
+               "durable=" + _durable +
+               ", priority=" + _priority +
+               ", ttl=" + _ttl +
+               ", firstAcquirer=" + _firstAcquirer +
+               ", deliveryCount=" + _deliveryCount +
+               '}';
+    }
 }
-  
\ No newline at end of file

Modified: qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/type/messaging/Properties.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/type/messaging/Properties.java?rev=1344930&r1=1344929&r2=1344930&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/type/messaging/Properties.java (original)
+++ qpid/proton/trunk/proton-j/src/org/apache/qpid/proton/type/messaging/Properties.java Thu May 31 22:22:06 2012
@@ -37,12 +37,12 @@ public class Properties
 {
     private static final Object[] DESCRIPTORS =
     {
-        UnsignedLong.valueOf(0x0000000000000073L), Symbol.valueOf("amqp:properties:list"), 
+        UnsignedLong.valueOf(0x0000000000000073L), Symbol.valueOf("amqp:properties:list"),
     };
 
     private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000073L);
     private final PropertiesWrapper _wrapper = new PropertiesWrapper();
-    
+
     private Object _messageId;
     private Binary _userId;
     private String _to;
@@ -186,7 +186,7 @@ public class Properties
     {
         _replyToGroupId = replyToGroupId;
     }
-    
+
     public Object getDescriptor()
     {
         return DESCRIPTOR;
@@ -196,7 +196,7 @@ public class Properties
     {
         return _wrapper;
     }
-    
+
     public Object get(final int index)
     {
 
@@ -227,7 +227,7 @@ public class Properties
             case 11:
                 return _groupSequence;
             case 12:
-                return _replyToGroupId;            
+                return _replyToGroupId;
         }
 
         throw new IllegalStateException("Unknown index " + index);
@@ -236,33 +236,33 @@ public class Properties
 
     public int size()
     {
-        return _replyToGroupId != null 
-                  ? 13 
-                  : _groupSequence != null 
-                  ? 12 
-                  : _groupId != null 
-                  ? 11 
-                  : _creationTime != null 
-                  ? 10 
-                  : _absoluteExpiryTime != null 
-                  ? 9 
-                  : _contentEncoding != null 
-                  ? 8 
-                  : _contentType != null 
-                  ? 7 
-                  : _correlationId != null 
-                  ? 6 
-                  : _replyTo != null 
-                  ? 5 
-                  : _subject != null 
-                  ? 4 
-                  : _to != null 
-                  ? 3 
-                  : _userId != null 
-                  ? 2 
-                  : _messageId != null 
-                  ? 1 
-                  : 0;        
+        return _replyToGroupId != null
+                  ? 13
+                  : _groupSequence != null
+                  ? 12
+                  : _groupId != null
+                  ? 11
+                  : _creationTime != null
+                  ? 10
+                  : _absoluteExpiryTime != null
+                  ? 9
+                  : _contentEncoding != null
+                  ? 8
+                  : _contentType != null
+                  ? 7
+                  : _correlationId != null
+                  ? 6
+                  : _replyTo != null
+                  ? 5
+                  : _subject != null
+                  ? 4
+                  : _to != null
+                  ? 3
+                  : _userId != null
+                  ? 2
+                  : _messageId != null
+                  ? 1
+                  : 0;
 
     }
 
@@ -342,5 +342,24 @@ public class Properties
             decoder.register(descriptor, constructor);
         }
     }
+
+    @Override
+    public String toString()
+    {
+        return "Properties{" +
+               "messageId=" + _messageId +
+               ", userId=" + _userId +
+               ", to='" + _to + '\'' +
+               ", subject='" + _subject + '\'' +
+               ", replyTo='" + _replyTo + '\'' +
+               ", correlationId=" + _correlationId +
+               ", contentType=" + _contentType +
+               ", contentEncoding=" + _contentEncoding +
+               ", absoluteExpiryTime=" + _absoluteExpiryTime +
+               ", creationTime=" + _creationTime +
+               ", groupId='" + _groupId + '\'' +
+               ", groupSequence=" + _groupSequence +
+               ", replyToGroupId='" + _replyToGroupId + '\'' +
+               '}';
+    }
 }
-  
\ No newline at end of file



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