You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2015/08/07 15:49:31 UTC

[3/3] cxf git commit: [CXF-6519] add CloseSequence handling in 2.7.x (part 2)

[CXF-6519] add CloseSequence handling in 2.7.x (part 2)


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f94b15a6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f94b15a6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f94b15a6

Branch: refs/heads/2.7.x-fixes
Commit: f94b15a61897313d54270361aa03c0887573be4c
Parents: c7e8637
Author: Akitoshi Yoshida <ay...@apache.org>
Authored: Fri Aug 7 15:34:04 2015 +0200
Committer: Akitoshi Yoshida <ay...@apache.org>
Committed: Fri Aug 7 15:34:04 2015 +0200

----------------------------------------------------------------------
 rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java    | 10 +++++++++-
 .../main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java  |  3 ++-
 .../java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java |  6 +++++-
 3 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f94b15a6/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
index e8d3889..c9167cd 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
@@ -47,6 +47,7 @@ import org.apache.cxf.ws.addressing.AttributedURIType;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.addressing.RelatesToType;
 import org.apache.cxf.ws.rm.manager.SourcePolicyType;
+import org.apache.cxf.ws.rm.v200702.CloseSequenceType;
 import org.apache.cxf.ws.rm.v200702.CreateSequenceResponseType;
 import org.apache.cxf.ws.rm.v200702.CreateSequenceType;
 import org.apache.cxf.ws.rm.v200702.Expires;
@@ -210,7 +211,14 @@ public class Proxy {
                 Collections.singletonMap(SourceSequence.class.getName(), 
                                          (Object)s));
 
-        invoke(oi, protocol, new Object[] {}, context);
+        if (constants instanceof RM11Constants) {
+            CloseSequenceType csr = new CloseSequenceType();
+            csr.setIdentifier(s.getIdentifier());
+            csr.setLastMsgNumber(s.getCurrentMessageNr());
+            invoke(oi, protocol, new Object[] {csr}, context);
+        } else {
+            invoke(oi, protocol, new Object[] {}, context);
+        }
     }
     
     void ackRequested(SourceSequence s) throws RMException {

http://git-wip-us.apache.org/repos/asf/cxf/blob/f94b15a6/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
index f9c855b..f65d4c9 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
@@ -98,7 +98,7 @@ public class RMOutInterceptor extends AbstractRMInterceptor<Message>  {
         boolean isApplicationMessage = !RMContextUtils.isRMProtocolMessage(action);
         boolean isPartialResponse = MessageUtils.isPartialResponse(msg);
         RMConstants constants = protocol.getConstants();
-        boolean isLastMessage = constants.getCloseSequenceAction().equals(action);
+        boolean isLastMessage = RM10Constants.CLOSE_SEQUENCE_ACTION.equals(action);
         
         if (isApplicationMessage && !isPartialResponse) {
             RetransmissionInterceptor ri = new RetransmissionInterceptor();
@@ -159,6 +159,7 @@ public class RMOutInterceptor extends AbstractRMInterceptor<Message>  {
 
                 // increase message number and store a sequence type object in
                 // context
+
                 seq.nextMessageNumber(inSeqId, inMessageNumber, isLastMessage);
                 
                 if (Boolean.TRUE.equals(msg.getContextualProperty(RMManager.WSRM_LAST_MESSAGE_PROPERTY))) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/f94b15a6/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
index 3f86259..71ea41d 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
@@ -418,6 +418,9 @@ public class RMSoapInterceptor extends AbstractSoapInterceptor {
             isOneway = false;
         } else if (consts.getCloseSequenceAction().equals(action)) {
             boi = bi.getOperation(consts.getCloseSequenceOperationName()); 
+        } else if (RM11Constants.INSTANCE.getCloseSequenceResponseAction().equals(action)) {
+            boi = bi.getOperation(RM11Constants.INSTANCE.getCloseSequenceOperationName());
+            isOneway = false;
         }
         assert boi != null;
         exchange.put(BindingOperationInfo.class, boi);
@@ -433,7 +436,8 @@ public class RMSoapInterceptor extends AbstractSoapInterceptor {
         
         if (!consts.getCreateSequenceResponseAction().equals(action)
             && !consts.getSequenceAckAction().equals(action)
-            && !RM11Constants.INSTANCE.getTerminateSequenceResponseAction().equals(action)) {
+            && !RM11Constants.INSTANCE.getTerminateSequenceResponseAction().equals(action)
+            && !RM11Constants.INSTANCE.getCloseSequenceResponseAction().equals(action)) {
             LOG.fine("Changing requestor role from " + message.get(Message.REQUESTOR_ROLE)
                      + " to false");
             Object originalRequestorRole = message.get(Message.REQUESTOR_ROLE);