From 2e8c761063d6a6de8a59e7c5dc7a5db282cde737 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Wed, 15 Aug 2007 13:56:45 +0000 Subject: Added clearData() and getTransferId() to the Message interface Added Java doc git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@566155 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/qpidity/ToyBroker.java | 1 - .../main/java/org/apache/qpidity/api/Message.java | 59 ++++++++++++++++++++-- 2 files changed, 56 insertions(+), 4 deletions(-) (limited to 'qpid/java/common/src/main') diff --git a/qpid/java/common/src/main/java/org/apache/qpidity/ToyBroker.java b/qpid/java/common/src/main/java/org/apache/qpidity/ToyBroker.java index 4949568bbf..c57bc7e0e9 100644 --- a/qpid/java/common/src/main/java/org/apache/qpidity/ToyBroker.java +++ b/qpid/java/common/src/main/java/org/apache/qpidity/ToyBroker.java @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Queue; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpidity/api/Message.java b/qpid/java/common/src/main/java/org/apache/qpidity/api/Message.java index 4e4a070fb4..ab45ee01aa 100644 --- a/qpid/java/common/src/main/java/org/apache/qpidity/api/Message.java +++ b/qpid/java/common/src/main/java/org/apache/qpidity/api/Message.java @@ -42,10 +42,23 @@ public interface Message *
  • To Disk *
  • To Socket (Stream) * - * @param src + * @param src - the data to append */ public void appendData(byte[] src) throws IOException; + /** + * This will abstract the underlying message data. + * The Message implementation may not hold all message + * data in memory (especially in the case of large messages) + * + * The appendData function might write data to + * + * @param src - the data to append + */ public void appendData(ByteBuffer src) throws IOException; /** @@ -59,10 +72,50 @@ public interface Message *
  • From Disk *
  • From Socket as and when it gets streamed * - * @param target + * @param target The target byte[] which the data gets copied to */ public void readData(byte[] target) throws IOException; - + + /** + * * This will abstract the underlying message data. + * The Message implementation may not hold all message + * data in memory (especially in the case of large messages) + * + * The read function might copy data from + * + * + * @return A ByteBuffer containing data + * @throws IOException + */ public ByteBuffer readData() throws IOException; + + /** + * This should clear the body of the message. + */ + public void clearData(); + + /** + * The provides access to the command Id assigned to the + * message transfer. + * This id is useful when you do + * + * + * @return the message transfer id. + */ + public long getMessageTransferId(); + } -- cgit v1.2.1