summaryrefslogtreecommitdiff
path: root/java/client
diff options
context:
space:
mode:
authorArnaud Simon <arnaudsimon@apache.org>2007-09-18 09:27:48 +0000
committerArnaud Simon <arnaudsimon@apache.org>2007-09-18 09:27:48 +0000
commit5f93ac7768804affcad81dca7a35546d11cc901f (patch)
treeb03b68b874c702868a9daff4d7f72d2664d0543d /java/client
parentd576e8af1b815495901aca7e207cf2076944659e (diff)
downloadqpid-python-5f93ac7768804affcad81dca7a35546d11cc901f.tar.gz
added support querying an exchange and implemented dtx Session
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@576799 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client')
-rw-r--r--java/client/src/main/java/org/apache/qpidity/client/DtxSession.java8
-rw-r--r--java/client/src/main/java/org/apache/qpidity/client/Session.java26
-rw-r--r--java/client/src/main/java/org/apache/qpidity/client/impl/ClientSession.java2
3 files changed, 24 insertions, 12 deletions
diff --git a/java/client/src/main/java/org/apache/qpidity/client/DtxSession.java b/java/client/src/main/java/org/apache/qpidity/client/DtxSession.java
index bf6433af6a..457bb9fe7d 100644
--- a/java/client/src/main/java/org/apache/qpidity/client/DtxSession.java
+++ b/java/client/src/main/java/org/apache/qpidity/client/DtxSession.java
@@ -45,6 +45,7 @@ public interface DtxSession extends Session
*
* @param xid Specifies the xid of the transaction branch to be started.
* @param options Possible options are: {@link Option#JOIN} and {@link Option#RESUME}.
+ * @return Confirms to the client that the transaction branch is started or specify the error condition.
*/
public Future<DtxDemarcationStartResult> dtxDemarcationStart(String xid, Option... options);
@@ -62,6 +63,7 @@ public interface DtxSession extends Session
*
* @param xid Specifies the xid of the transaction branch to be ended.
* @param options Available options are: {@link Option#FAIL} and {@link Option#SUSPEND}.
+ * @return Confirms to the client that the transaction branch is ended or specify the error condition.
*/
public Future<DtxDemarcationEndResult> dtxDemarcationEnd(String xid, Option... options);
@@ -75,6 +77,7 @@ public interface DtxSession extends Session
*
* @param xid Specifies the xid of the transaction branch to be committed.
* @param options Available option is: {@link Option#ONE_PHASE}
+ * @return Confirms to the client that the transaction branch is committed or specify the error condition.
*/
public Future<DtxCoordinationCommitResult> dtxCoordinationCommit(String xid, Option... options);
@@ -114,16 +117,17 @@ public interface DtxSession extends Session
/**
* This method is called to obtain a list of transaction branches that are in a prepared or
* heuristically completed state.
- *
+ * Todo The options ahould be removed once the xml is updated
* @return a array of xids to be recovered.
*/
- public Future<DtxCoordinationRecoverResult> dtxCoordinationRecover();
+ public Future<DtxCoordinationRecoverResult> dtxCoordinationRecover(Option... options);
/**
* This method rolls back the work associated with xid. Any produced messages are discarded and
* any consumed messages are re-enqueued.
*
* @param xid Specifies the xid of the transaction branch that can be rolled back.
+ * @return Confirms to the client that the transaction branch is rolled back or specify the error condition.
*/
public Future<DtxCoordinationRollbackResult> dtxCoordinationRollback(String xid);
diff --git a/java/client/src/main/java/org/apache/qpidity/client/Session.java b/java/client/src/main/java/org/apache/qpidity/client/Session.java
index 2340d27882..444fb64d1b 100644
--- a/java/client/src/main/java/org/apache/qpidity/client/Session.java
+++ b/java/client/src/main/java/org/apache/qpidity/client/Session.java
@@ -22,9 +22,7 @@ import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Map;
-import org.apache.qpidity.transport.Option;
-import org.apache.qpidity.transport.RangeSet;
-import org.apache.qpidity.transport.Struct;
+import org.apache.qpidity.transport.*;
import org.apache.qpidity.api.Message;
/**
@@ -151,11 +149,11 @@ public interface Session
/**
* Declare the beginning of a message transfer operation. This operation must
- * be followed by {@link Session#headers} then followed by any number of {@link Session#data}.
+ * be followed by {@link Session#header} then followed by any number of {@link Session#data}.
* The transfer is ended by {@link Session#endData}.
* <p> This way of transferring messages is useful when streaming large messages
* <p> In the interval [messageTransfer endData] any attempt to call a method other than
- * {@link Session#headers}, {@link Session#endData} ore {@link Session#sessionClose}
+ * {@link Session#header}, {@link Session#endData} ore {@link Session#sessionClose}
* will result in an exception being thrown.
*
* @param destination The exchange the message is being sent.
@@ -181,10 +179,10 @@ public interface Session
/**
* Add a set of headers the following headers to the message being sent.
*
- * @param headers Are either <code>{@link org.apache.qpidity.DeliveryProperties}</code>
- * or <code>{@link org.apache.qpidity.MessageProperties}</code>
- * @see org.apache.qpidity.DeliveryProperties
- * @see org.apache.qpidity.MessageProperties
+ * @param headers Are either <code>{@link org.apache.qpidity.transport.DeliveryProperties}</code>
+ * or <code>{@link org.apache.qpidity.transport.MessageProperties}</code>
+ * @see org.apache.qpidity.transport.DeliveryProperties
+ * @see org.apache.qpidity.transport.MessageProperties
*/
public void header(Struct... headers);
@@ -596,6 +594,16 @@ public interface Session
*/
public void exchangeDelete(String exchangeName, Option... options);
+
+ /**
+ * This method is used to request information on a particular exchange.
+ *
+ * @param exchangeName The name of the exchange for which information is requested. If not specified explicitly
+ * the default exchange is implied.
+ * @result Information on the specified exchange.
+ */
+ public Future<ExchangeQueryResult> exchangeQuery(String exchangeName);
+
/**
* If the session receives a sessionClosed with an error code it
* informs the session's ExceptionListener
diff --git a/java/client/src/main/java/org/apache/qpidity/client/impl/ClientSession.java b/java/client/src/main/java/org/apache/qpidity/client/impl/ClientSession.java
index 2e53bdfcad..6d2640b8bb 100644
--- a/java/client/src/main/java/org/apache/qpidity/client/impl/ClientSession.java
+++ b/java/client/src/main/java/org/apache/qpidity/client/impl/ClientSession.java
@@ -16,7 +16,7 @@ import org.apache.qpidity.client.MessagePartListener;
/**
* Implements a Qpid Sesion.
*/
-public class ClientSession extends org.apache.qpidity.transport.Session implements org.apache.qpidity.client.Session
+public class ClientSession extends org.apache.qpidity.transport.Session implements org.apache.qpidity.client.DtxSession
{
private Map<String,MessagePartListener> _messageListeners = new HashMap<String,MessagePartListener>();
private ExceptionListener _exceptionListner;