Author: gsim
Date: Mon Dec 10 22:14:11 2012
New Revision: 1419835
URL: http://svn.apache.org/viewvc?rev=1419835&view=rev
Log:
PROTON-120: make current status of offset and length clear; overload method
with simple alternative
Modified:
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Link.java
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java
Modified:
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Link.java
URL:
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Link.java?rev=1419835&r1=1419834&r2=1419835&view=diff
==============================================================================
---
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Link.java
(original)
+++
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Link.java
Mon Dec 10 22:14:11 2012
@@ -42,10 +42,23 @@ public interface Link extends Endpoint
String getName();
/**
+ * Create a delivery object based on the specified tag.
*
* @param tag a tag for the delivery
- * @param offset
- *@param length @return a Delivery object
+ * @return a Delivery object
+ */
+ public Delivery delivery(byte[] tag);
+ /**
+ * Create a delivery object based on the specified tag. This form
+ * of the method is intended to allow the tag to be formed from a
+ * subsequence of the byte array passed in. This might allow more
+ * optimsation options in future but at present is not
+ * implemented.
+ *
+ * @param tag a tag for the delivery
+ * @param offset (currently ignored and must be 0)
+ * @param length (currently ignored and must be the length of the
<code>tag</code> array
+ * @return a Delivery object
*/
public Delivery delivery(byte[] tag, int offset, int length);
Modified:
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java
URL:
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java?rev=1419835&r1=1419834&r2=1419835&view=diff
==============================================================================
---
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java
(original)
+++
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java
Mon Dec 10 22:14:11 2012
@@ -80,11 +80,16 @@ public abstract class LinkImpl extends E
return _name;
}
-
+ public DeliveryImpl delivery(byte[] tag)
+ {
+ return delivery(tag, 0, tag.length);
+ }
public DeliveryImpl delivery(byte[] tag, int offset, int length)
{
-
+ if (offset != 0 || length != tag.length) {
+ throw new IllegalArgumentException("At present delivery tag must
be the whole byte array");
+ }
incrementQueued();
try
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]