diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2012-03-10 19:22:10 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2012-03-10 19:22:10 +0000 |
commit | 4eaa4e42093e5524d9552d8fa312c214524b6bb4 (patch) | |
tree | a251d57ee92d9c779fe4455c583be0ed90e69a43 /qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java | |
parent | 92be7e8f3163c048a8642d2deeaa921bbb65dc9c (diff) | |
download | qpid-python-rg-amqp-1-0-sandbox.tar.gz |
NO-JIRA : AMQP-1-0 sandbox updates - merge from trunkrg-amqp-1-0-sandbox
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/rg-amqp-1-0-sandbox@1299257 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java')
-rw-r--r-- | qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java index 8a2ad53157..f6fa89a91c 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java @@ -20,24 +20,23 @@ */ package org.apache.qpid.framing; +import org.apache.qpid.AMQException; +import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; + import java.io.DataInput; import java.io.DataInputStream; import java.io.DataOutput; import java.io.IOException; -import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; -import org.apache.qpid.AMQException; - public class ContentHeaderBody implements AMQBody { public static final byte TYPE = 2; - public int classId; + private int classId; - public int weight; + private int weight; - /** unsigned long but java can't handle that anyway when allocating byte array */ - public long bodySize; + private long bodySize; /** must never be null */ private ContentHeaderProperties properties; @@ -76,17 +75,6 @@ public class ContentHeaderBody implements AMQBody return TYPE; } - protected void populateFromBuffer(DataInputStream buffer, long size) - throws AMQFrameDecodingException, AMQProtocolVersionException, IOException - { - classId = buffer.readUnsignedShort(); - weight = buffer.readUnsignedShort(); - bodySize = buffer.readLong(); - int propertyFlags = buffer.readUnsignedShort(); - ContentHeaderPropertiesFactory factory = ContentHeaderPropertiesFactory.getInstance(); - properties = factory.createContentHeaderProperties(classId, propertyFlags, buffer, (int)size - 14); - } - /** * Helper method that is used currently by the persistence layer (by BDB at the moment). * @param buffer @@ -153,4 +141,25 @@ public class ContentHeaderBody implements AMQBody ", properties=" + properties + '}'; } + + public int getClassId() + { + return classId; + } + + public int getWeight() + { + return weight; + } + + /** unsigned long but java can't handle that anyway when allocating byte array */ + public long getBodySize() + { + return bodySize; + } + + public void setBodySize(long bodySize) + { + this.bodySize = bodySize; + } } |