Author: rajith
Date: Wed Mar  9 21:17:52 2011
New Revision: 1080006

URL: http://svn.apache.org/viewvc?rev=1080006&view=rev
Log:
Porting rev 1078971 from Qpid trunk to 0.10 branch.

Modified:
    
qpid/branches/0.10/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
    
qpid/branches/0.10/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/Link.java

Modified: 
qpid/branches/0.10/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
URL: 
http://svn.apache.org/viewvc/qpid/branches/0.10/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java?rev=1080006&r1=1080005&r2=1080006&view=diff
==============================================================================
--- 
qpid/branches/0.10/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
 (original)
+++ 
qpid/branches/0.10/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
 Wed Mar  9 21:17:52 2011
@@ -1173,6 +1173,22 @@ public class AMQSession_0_10 extends AMQ
             
             int type = resolveAddressType(dest);
             
+            if (type == AMQDestination.QUEUE_TYPE && 
+                    dest.getLink().getReliability() == Reliability.UNSPECIFIED)
+            {
+                dest.getLink().setReliability(Reliability.AT_LEAST_ONCE);
+            }
+            else if (type == AMQDestination.TOPIC_TYPE && 
+                    dest.getLink().getReliability() == Reliability.UNSPECIFIED)
+            {
+                dest.getLink().setReliability(Reliability.UNRELIABLE);
+            }
+            else if (type == AMQDestination.TOPIC_TYPE && 
+                    dest.getLink().getReliability() == 
Reliability.AT_LEAST_ONCE)
+            {
+                throw new AMQException("AT-LEAST-ONCE is not yet supported for 
Topics");                      
+            }
+            
             switch (type)
             {
                 case AMQDestination.QUEUE_TYPE: 

Modified: 
qpid/branches/0.10/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/Link.java
URL: 
http://svn.apache.org/viewvc/qpid/branches/0.10/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/Link.java?rev=1080006&r1=1080005&r2=1080006&view=diff
==============================================================================
--- 
qpid/branches/0.10/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/Link.java
 (original)
+++ 
qpid/branches/0.10/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/Link.java
 Wed Mar  9 21:17:52 2011
@@ -20,8 +20,7 @@
  */
 package org.apache.qpid.client.messaging.address;
 
-import static 
org.apache.qpid.client.messaging.address.Link.Reliability.UNRELIABLE;
-import static 
org.apache.qpid.client.messaging.address.Link.Reliability.AT_LEAST_ONCE;
+import static 
org.apache.qpid.client.messaging.address.Link.Reliability.UNSPECIFIED;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -32,7 +31,7 @@ public class Link
 { 
     public enum FilterType { SQL92, XQUERY, SUBJECT }
     
-    public enum Reliability { UNRELIABLE, AT_MOST_ONCE, AT_LEAST_ONCE, 
EXACTLY_ONCE }
+    public enum Reliability { UNRELIABLE, AT_MOST_ONCE, AT_LEAST_ONCE, 
EXACTLY_ONCE, UNSPECIFIED }
     
     protected String name;
     protected String _filter;
@@ -43,7 +42,7 @@ public class Link
     protected int _producerCapacity = 0;
     protected Node node;
     protected Subscription subscription;
-    protected Reliability reliability = AT_LEAST_ONCE;
+    protected Reliability reliability = UNSPECIFIED;
     
     public Reliability getReliability()
     {



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to