cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsosno...@apache.org
Subject svn commit: r1137112 [3/7] - in /cxf/trunk: rt/ws/rm/ rt/ws/rm/src/main/build-resources/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/ rt/ws/rm...
Date Sat, 18 Jun 2011 01:51:04 GMT
Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java Sat Jun 18 01:51:01 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.math.BigInteger;
 import java.util.Collections;
 import java.util.List;
 import java.util.logging.Level;
@@ -27,10 +26,7 @@ import java.util.logging.Logger;
 
 import javax.xml.datatype.Duration;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.binding.Binding;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.jaxb.DatatypeFactory;
 import org.apache.cxf.message.Exchange;
@@ -38,9 +34,14 @@ import org.apache.cxf.message.Message;
 import org.apache.cxf.service.invoker.Invoker;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.ws.addressing.AddressingProperties;
-import org.apache.cxf.ws.addressing.VersionTransformer;
-import org.apache.cxf.ws.addressing.v200408.AttributedURI;
 import org.apache.cxf.ws.rm.manager.DestinationPolicyType;
+import org.apache.cxf.ws.rm.v200702.AcceptType;
+import org.apache.cxf.ws.rm.v200702.CreateSequenceResponseType;
+import org.apache.cxf.ws.rm.v200702.CreateSequenceType;
+import org.apache.cxf.ws.rm.v200702.Expires;
+import org.apache.cxf.ws.rm.v200702.Identifier;
+import org.apache.cxf.ws.rm.v200702.OfferType;
+import org.apache.cxf.ws.rm.v200702.TerminateSequenceType;
 
 /**
  * 
@@ -56,25 +57,6 @@ public class Servant implements Invoker 
         reliableEndpoint = rme;
     }
     
-    private void throwSequenceFault(SequenceFault sf, Exchange exchange) {
-        Endpoint e = exchange.get(Endpoint.class);
-        Binding b = null;
-        if (null != e) {
-            b = e.getBinding();
-        }
-        Bus bus = exchange.get(Bus.class);
-        if (null != b && bus != null) {
-            RMManager m = bus.getExtension(RMManager.class);
-            LOG.fine("Manager: " + m);
-            BindingFaultFactory bff = m.getBindingFaultFactory(b);
-            Fault f = bff.createFault(sf);
-            LogUtils.log(LOG, Level.SEVERE, "SEQ_FAULT_MSG", bff.toString(f));
-            throw f;
-        }
-        throw new Fault(sf);
-    }
-    
-    
     public Object invoke(Exchange exchange, Object o) {
         LOG.fine("Invoking on RM Endpoint");
         OperationInfo oi = exchange.get(OperationInfo.class);
@@ -83,38 +65,31 @@ public class Servant implements Invoker 
             return null;
         }
         
-        if (RMConstants.getCreateSequenceOperationName().equals(oi.getName())
-            || RMConstants.getCreateSequenceOnewayOperationName().equals(oi.getName())) {
+        if (RM10Constants.INSTANCE.getCreateSequenceOperationName().equals(oi.getName())
+            || RM11Constants.INSTANCE.getCreateSequenceOperationName().equals(oi.getName())
+            || RM10Constants.INSTANCE.getCreateSequenceOnewayOperationName().equals(oi.getName())
+            || RM11Constants.INSTANCE.getCreateSequenceOnewayOperationName().equals(oi.getName())) {
             try {
                 return Collections.singletonList(createSequence(exchange.getInMessage()));
-            } catch (SequenceFault ex) {
-                throwSequenceFault(ex, exchange);
             } catch (Exception ex) {
                 throw new Fault(ex);
             }
-        } else if (RMConstants.getCreateSequenceResponseOnewayOperationName().equals(oi.getName())) {
+        } else if (RM10Constants.INSTANCE.getCreateSequenceResponseOnewayOperationName().equals(oi.getName())
+            || RM11Constants.INSTANCE.getCreateSequenceResponseOnewayOperationName().equals(oi.getName())) {
+            EncoderDecoder codec = reliableEndpoint.getEncoderDecoder();
             CreateSequenceResponseType createResponse = 
-                (CreateSequenceResponseType)getParameter(exchange.getInMessage());
-            try {
-                createSequenceResponse(createResponse);
-            } catch (SequenceFault ex) {
-                throwSequenceFault(ex, exchange);
-            }
-        } else if (RMConstants.getTerminateSequenceOperationName().equals(oi.getName())) {            
-            try {
-                terminateSequence(exchange.getInMessage());
-            } catch (SequenceFault ex) {
-                throwSequenceFault(ex, exchange);
-            } catch (RMException ex) {
-                throw new Fault(ex);
-            }
+                codec.convertReceivedCreateSequenceResponse(getParameter(exchange.getInMessage()));
+            createSequenceResponse(createResponse);
+        } else if (RM10Constants.INSTANCE.getTerminateSequenceOperationName().equals(oi.getName())
+            || RM11Constants.INSTANCE.getTerminateSequenceOperationName().equals(oi.getName())) {
+            terminateSequence(exchange.getInMessage());
         }
         
         return null;
     }
 
 
-    CreateSequenceResponseType createSequence(Message message) throws SequenceFault {
+    Object createSequence(Message message) {
         LOG.fine("Creating sequence");
         
         AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);        
@@ -123,7 +98,8 @@ public class Servant implements Invoker 
             RMContextUtils.storeMAPs(maps, outMessage, false, false);
         }
         
-        CreateSequenceType create = (CreateSequenceType)getParameter(message);
+        EncoderDecoder codec = reliableEndpoint.getEncoderDecoder();
+        CreateSequenceType create = codec.convertReceivedCreateSequence(getParameter(message));
         Destination destination = reliableEndpoint.getDestination();
         
         CreateSequenceResponseType createResponse = 
@@ -157,13 +133,12 @@ public class Servant implements Invoker 
                 Source source = reliableEndpoint.getSource();
                 LOG.fine("Accepting inbound sequence offer");
                 // AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
-                AttributedURI to = VersionTransformer.convert(maps.getTo());
-                accept.setAcksTo(RMUtils.createReference2004(to.getValue()));
+                accept.setAcksTo(RMUtils.createReference(maps.getTo().getValue()));
                 SourceSequence seq = new SourceSequence(offer.getIdentifier(), 
                                                                     null, 
                                                                     createResponse.getIdentifier());
                 seq.setExpires(offer.getExpires());
-                seq.setTarget(VersionTransformer.convert(create.getAcksTo()));
+                seq.setTarget(create.getAcksTo());
                 source.addSequence(seq);
                 source.setCurrent(createResponse.getIdentifier(), seq);  
                 if (LOG.isLoggable(Level.FINE)) {
@@ -174,7 +149,7 @@ public class Servant implements Invoker 
                 if (LOG.isLoggable(Level.FINE)) {
                     LOG.fine("Refusing inbound sequence offer"); 
                 }
-                accept.setAcksTo(RMUtils.createNoneReference2004());
+                accept.setAcksTo(RMUtils.createNoneReference());
             }
             createResponse.setAccept(accept);
         }
@@ -184,10 +159,10 @@ public class Servant implements Invoker 
         seq.setCorrelationID(maps.getMessageID().getValue());
         destination.addSequence(seq);
         LOG.fine("returning " + createResponse);
-        return createResponse;
+        return codec.convertToSend(createResponse);
     }
 
-    public void createSequenceResponse(CreateSequenceResponseType createResponse) throws SequenceFault {
+    public void createSequenceResponse(CreateSequenceResponseType createResponse) {
         LOG.fine("Creating sequence response");
         
         SourceSequence seq = new SourceSequence(createResponse.getIdentifier());
@@ -218,10 +193,13 @@ public class Servant implements Invoker 
         }
     }
 
-    public void terminateSequence(Message message) throws SequenceFault, RMException {
+    public void terminateSequence(Message message) {
         LOG.fine("Terminating sequence");
         
-        TerminateSequenceType terminate = (TerminateSequenceType)getParameter(message);
+        EncoderDecoder codec = reliableEndpoint.getEncoderDecoder();
+        org.apache.cxf.ws.rm.v200502.TerminateSequenceType external =
+            (org.apache.cxf.ws.rm.v200502.TerminateSequenceType)getParameter(message);
+        TerminateSequenceType terminate = codec.convertReceivedTerminateSequence(external);
         
         // check if the terminated sequence was created in response to a a createSequence
         // request
@@ -248,7 +226,7 @@ public class Servant implements Invoker 
         for (SourceSequence outboundSeq : source.getAllSequences()) {
             if (outboundSeq.offeredBy(sid) && !outboundSeq.isLastMessage()) {
                 
-                if (BigInteger.ZERO.equals(outboundSeq.getCurrentMessageNr())) {
+                if (outboundSeq.getCurrentMessageNr() == 0) {
                     source.removeSequence(outboundSeq);
                 }
                 // send an out of band message with an empty body and a 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Source.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Source.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Source.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Source.java Sat Jun 18 01:51:01 2011
@@ -29,6 +29,7 @@ import java.util.concurrent.locks.Reentr
 
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.ws.rm.persistence.RMStore;
+import org.apache.cxf.ws.rm.v200702.Identifier;
 
 public class Source extends AbstractEndpoint {
 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java Sat Jun 18 01:51:01 2011
@@ -28,9 +28,14 @@ import javax.xml.datatype.Duration;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.jaxb.DatatypeFactory;
 import org.apache.cxf.ws.addressing.ContextUtils;
-import org.apache.cxf.ws.rm.SequenceAcknowledgement.AcknowledgementRange;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.rm.manager.SequenceTerminationPolicyType;
+import org.apache.cxf.ws.rm.v200702.Expires;
+import org.apache.cxf.ws.rm.v200702.Identifier;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement.AcknowledgementRange;
 
+// TODO: handle lastMessage
 public class SourceSequence extends AbstractSequence {
 
     private static final Logger LOG = LogUtils.getL7dLogger(SourceSequence.class);
@@ -40,7 +45,7 @@ public class SourceSequence extends Abst
     private long currentMessageNumber;
     private boolean lastMessage;
     private Identifier offeringId;
-    private org.apache.cxf.ws.addressing.EndpointReferenceType target;
+    private EndpointReferenceType target;
 
     public SourceSequence(Identifier i) {
         this(i, null, null);
@@ -235,13 +240,13 @@ public class SourceSequence extends Abst
      * 
      * @param to
      */
-    synchronized void setTarget(org.apache.cxf.ws.addressing.EndpointReferenceType to) {
+    synchronized void setTarget(EndpointReferenceType to) {
         if (target == null && !ContextUtils.isGenericAddress(to)) {
             target = to;
         }
     }
 
-    synchronized org.apache.cxf.ws.addressing.EndpointReferenceType getTarget() {
+    synchronized EndpointReferenceType getTarget() {
         return target;
     }
 

Added: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/VersionTransformer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/VersionTransformer.java?rev=1137112&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/VersionTransformer.java (added)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/VersionTransformer.java Sat Jun 18 01:51:01 2011
@@ -0,0 +1,818 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.rm;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.ws.rm.v200702.AcceptType;
+import org.apache.cxf.ws.rm.v200702.AckRequestedType;
+import org.apache.cxf.ws.rm.v200702.CreateSequenceResponseType;
+import org.apache.cxf.ws.rm.v200702.CreateSequenceType;
+import org.apache.cxf.ws.rm.v200702.Expires;
+import org.apache.cxf.ws.rm.v200702.Identifier;
+import org.apache.cxf.ws.rm.v200702.OfferType;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
+import org.apache.cxf.ws.rm.v200702.SequenceType;
+import org.apache.cxf.ws.rm.v200702.TerminateSequenceType;
+
+// Importation convention: only the 200702 namespace versions of classes (the standard version used throughout
+// the code) are imported directly. All other versions are fully qualified.
+
+/**
+ * This class is responsible for transforming between the native WS-ReliableMessaging schema version
+ * (currently http://docs.oasis-open.org/ws-rx/wsrm/200702) and exposed version (which may be the 200702
+ * namespace, the http://schemas.xmlsoap.org/ws/2005/02/rm namespace using the old
+ * http://schemas.xmlsoap.org/ws/2004/08/addressing WS-Addressing namespace, or 2005/02 namespace with the
+ * newer http://www.w3.org/2005/08/addressing WS-Addressing namespace).
+ * <p>
+ * The native version is that used throughout the stack, where the WS-RM types are represented via the JAXB
+ * generated types.
+ * <p>
+ * The exposed version is that used when the WS-RM types are externalized, i.e. are encoded in the headers of
+ * outgoing messages. For outgoing requests, the exposed version is  determined from configuration. For
+ * outgoing responses, the exposed version is determined by the exposed version of the corresponding request.
+ */
+public final class VersionTransformer {
+        
+    /**
+     * Constructor.
+     */
+    private VersionTransformer() {
+    }
+    
+    /**
+     * Check if a namespace URI represents a supported version of WS-ReliableMessaging.
+     * 
+     * @param uri
+     * @return <code>true</code> if supported, <code>false</code> if not
+     */
+    public static boolean isSupported(String uri) {
+        return RM10Constants.NAMESPACE_URI.equals(uri)
+            || RM11Constants.NAMESPACE_URI.equals(uri);
+    }
+    
+    /**
+     * Get the encoder/decoder for a supported version of WS-ReliableMessaging and WS-Addressing.
+     * 
+     * @param wsrm WS-RM namespace URI
+     * @param wsa WS-A namespace URI
+     * @return instance (<code>null</code> if not a supported version)
+     */
+    public static EncoderDecoder getEncoderDecoder(String wsrm, String wsa) {
+        if (EncoderDecoder10Impl.INSTANCE.getWSRMNamespace().equals(wsrm)
+            && EncoderDecoder10Impl.INSTANCE.getWSANamespace().equals(wsa)) {
+            return EncoderDecoder10Impl.INSTANCE;
+        } else if (EncoderDecoder10AImpl.INSTANCE.getWSRMNamespace().equals(wsrm)
+            && EncoderDecoder10AImpl.INSTANCE.getWSANamespace().equals(wsa)) {
+            return EncoderDecoder10AImpl.INSTANCE;
+        } else if (EncoderDecoder11Impl.INSTANCE.getWSRMNamespace().equals(wsrm)
+            && EncoderDecoder11Impl.INSTANCE.getWSANamespace().equals(wsa)) {
+            return EncoderDecoder11Impl.INSTANCE;
+        } else {
+            return null;
+        }
+    }
+    
+    /**
+     * Convert CreateSequenceType to 200502 version with 200508 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static
+    org.apache.cxf.ws.rm.v200502wsa15.CreateSequenceType convert200502wsa15(CreateSequenceType internal) {
+        org.apache.cxf.ws.rm.v200502wsa15.CreateSequenceType exposed =
+            RMUtils.getWSRM200502WSA200508Factory().createCreateSequenceType();
+        exposed.setAcksTo(internal.getAcksTo());
+        exposed.setExpires(convert200502wsa15(internal.getExpires()));
+        exposed.setOffer(convert200502wsa15(internal.getOffer()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert CreateSequenceType to 200502 version with 200408 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502.CreateSequenceType convert200502(CreateSequenceType internal) {
+        org.apache.cxf.ws.rm.v200502.CreateSequenceType exposed =
+            RMUtils.getWSRM200502Factory().createCreateSequenceType();
+        exposed.setAcksTo(org.apache.cxf.ws.addressing.VersionTransformer.convert(internal.getAcksTo()));
+        exposed.setExpires(convert200502(internal.getExpires()));
+        exposed.setOffer(convert200502(internal.getOffer()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+
+    /**
+     * Convert wsrm:Expires to 200502 version with 200508 WS-Addressing namespace.
+     * 
+     * @param internal (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    private static org.apache.cxf.ws.rm.v200502wsa15.Expires convert200502wsa15(Expires internal) {
+        if (internal == null) {
+            return null;
+        }
+        org.apache.cxf.ws.rm.v200502wsa15.Expires exposed =
+            RMUtils.getWSRM200502WSA200508Factory().createExpires();
+        exposed.setValue(internal.getValue());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+
+    /**
+     * Convert wsrm:Expires to 200502 version with 200408 WS-Addressing namespace.
+     * 
+     * @param internal (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    private static org.apache.cxf.ws.rm.v200502.Expires convert200502(Expires internal) {
+        if (internal == null) {
+            return null;
+        }
+        org.apache.cxf.ws.rm.v200502.Expires exposed = RMUtils.getWSRM200502Factory().createExpires();
+        exposed.setValue(internal.getValue());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+
+    /**
+     * Convert wsrm:Identifier to 200502 version with 200508 WS-Addressing namespace.
+     * 
+     * @param internal (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    public static org.apache.cxf.ws.rm.v200502wsa15.Identifier convert200502wsa15(Identifier internal) {
+        if (internal == null) {
+            return null;
+        }
+        org.apache.cxf.ws.rm.v200502wsa15.Identifier exposed =
+            RMUtils.getWSRM200502WSA200508Factory().createIdentifier();
+        exposed.setValue(internal.getValue());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+
+    /**
+     * Convert wsrm:Identifier to 200502 version with 200408 WS-Addressing namespace.
+     * 
+     * @param internal (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    public static org.apache.cxf.ws.rm.v200502.Identifier convert200502(Identifier internal) {
+        if (internal == null) {
+            return null;
+        }
+        org.apache.cxf.ws.rm.v200502.Identifier exposed = RMUtils.getWSRM200502Factory().createIdentifier();
+        exposed.setValue(internal.getValue());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+
+    /**
+     * Convert 200502 wsrm:Identifier with 200508 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if exposed is <code>null</code>)
+     */
+    public static Identifier convert(org.apache.cxf.ws.rm.v200502wsa15.Identifier exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        Identifier internal = RMUtils.getWSRMFactory().createIdentifier();
+        internal.setValue(exposed.getValue());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+
+    /**
+     * Convert 200502 wsrm:Identifier with 200408 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if exposed is <code>null</code>)
+     */
+    public static Identifier convert(org.apache.cxf.ws.rm.v200502.Identifier exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        Identifier internal = RMUtils.getWSRMFactory().createIdentifier();
+        internal.setValue(exposed.getValue());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 wsrm:CreateSequenceType with 200508 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if exposed is <code>null</code>)
+     */
+    public static CreateSequenceType convert(org.apache.cxf.ws.rm.v200502wsa15.CreateSequenceType exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        CreateSequenceType internal = new CreateSequenceType();
+        internal.setAcksTo(exposed.getAcksTo());
+        internal.setExpires(convert(exposed.getExpires()));
+        internal.setOffer(convert(exposed.getOffer()));
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 wsrm:CreateSequenceType with 200408 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if exposed is <code>null</code>)
+     */
+    public static CreateSequenceType convert(org.apache.cxf.ws.rm.v200502.CreateSequenceType exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        CreateSequenceType internal = new CreateSequenceType();
+        internal.setAcksTo(org.apache.cxf.ws.addressing.VersionTransformer.convert(exposed.getAcksTo()));
+        internal.setExpires(convert(exposed.getExpires()));
+        internal.setOffer(convert(exposed.getOffer()));
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 wsrm:CreateSequenceResponseType with 200508 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if exposed is <code>null</code>)
+     */
+    public static CreateSequenceResponseType
+    convert(org.apache.cxf.ws.rm.v200502wsa15.CreateSequenceResponseType exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        CreateSequenceResponseType internal = new CreateSequenceResponseType();
+        internal.setAccept(convert(exposed.getAccept()));
+        internal.setExpires(convert(exposed.getExpires()));
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 wsrm:CreateSequenceResponseType with 200408 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if exposed is <code>null</code>)
+     */
+    public static CreateSequenceResponseType
+    convert(org.apache.cxf.ws.rm.v200502.CreateSequenceResponseType exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        CreateSequenceResponseType internal = new CreateSequenceResponseType();
+        internal.setAccept(convert(exposed.getAccept()));
+        internal.setExpires(convert(exposed.getExpires()));
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+
+    /**
+     * Convert wsrm:Offer to 200502 version with 200508 WS-Addressing namespace.
+     * 
+     * @param internal (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    private static org.apache.cxf.ws.rm.v200502wsa15.OfferType convert200502wsa15(OfferType internal) {
+        if (internal == null) {
+            return null;
+        }
+        org.apache.cxf.ws.rm.v200502wsa15.OfferType exposed =
+            RMUtils.getWSRM200502WSA200508Factory().createOfferType();
+        exposed.setExpires(convert200502wsa15(internal.getExpires()));
+        exposed.setIdentifier(convert200502wsa15(internal.getIdentifier()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+
+    /**
+     * Convert wsrm:Offer to 200502 version with 200408 WS-Addressing namespace.
+     * 
+     * @param internal (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    private static org.apache.cxf.ws.rm.v200502.OfferType convert200502(OfferType internal) {
+        if (internal == null) {
+            return null;
+        }
+        org.apache.cxf.ws.rm.v200502.OfferType exposed = RMUtils.getWSRM200502Factory().createOfferType();
+        exposed.setExpires(convert200502(internal.getExpires()));
+        exposed.setIdentifier(convert200502(internal.getIdentifier()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert wsrm:CreateSequenceResponseType to 200502 version with 200508 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502wsa15.CreateSequenceResponseType
+    convert200502wsa15(CreateSequenceResponseType internal) {
+        org.apache.cxf.ws.rm.v200502wsa15.CreateSequenceResponseType exposed =
+            RMUtils.getWSRM200502WSA200508Factory().createCreateSequenceResponseType();
+        exposed.setIdentifier(convert200502wsa15(internal.getIdentifier()));
+        exposed.setExpires(convert200502wsa15(internal.getExpires()));
+        exposed.setAccept(convert200502wsa15(internal.getAccept()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert wsrm:CreateSequenceResponseType to 200502 version with 200408 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502.CreateSequenceResponseType
+    convert200502(CreateSequenceResponseType internal) {
+        org.apache.cxf.ws.rm.v200502.CreateSequenceResponseType exposed =
+            RMUtils.getWSRM200502Factory().createCreateSequenceResponseType();
+        exposed.setIdentifier(convert200502(internal.getIdentifier()));
+        exposed.setExpires(convert200502(internal.getExpires()));
+        exposed.setAccept(convert200502(internal.getAccept()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+
+    /**
+     * Convert wsrm:AcceptType to 200502 version with 200508 WS-Addressing namespace.
+     * 
+     * @param internal (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    private static org.apache.cxf.ws.rm.v200502wsa15.AcceptType convert200502wsa15(AcceptType internal) {
+        if (internal == null) {
+            return null;
+        }
+        org.apache.cxf.ws.rm.v200502wsa15.AcceptType exposed =
+            RMUtils.getWSRM200502WSA200508Factory().createAcceptType();
+        exposed.setAcksTo(internal.getAcksTo());
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+
+    /**
+     * Convert wsrm:AcceptType to 200502 version with 200408 WS-Addressing namespace.
+     * 
+     * @param internal (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    private static org.apache.cxf.ws.rm.v200502.AcceptType convert200502(AcceptType internal) {
+        if (internal == null) {
+            return null;
+        }
+        org.apache.cxf.ws.rm.v200502.AcceptType exposed = RMUtils.getWSRM200502Factory().createAcceptType();
+        exposed.setAcksTo(org.apache.cxf.ws.addressing.VersionTransformer.convert(internal.getAcksTo()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert wsrm:SequenceType to 200502 version with 200508 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502wsa15.SequenceType convert200502wsa15(SequenceType internal) {
+        org.apache.cxf.ws.rm.v200502wsa15.SequenceType exposed =
+            RMUtils.getWSRM200502WSA200508Factory().createSequenceType();
+        exposed.setIdentifier(convert200502wsa15(internal.getIdentifier()));
+        exposed.setMessageNumber(internal.getMessageNumber());
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert 200502 wsrm:SequenceType with 200408 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (non-<code>null</code>)
+     * @return converted
+     */
+    public static SequenceType convert(org.apache.cxf.ws.rm.v200502.SequenceType exposed) {
+        SequenceType internal = RMUtils.getWSRMFactory().createSequenceType();
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        internal.setMessageNumber(exposed.getMessageNumber());
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 wsrm:SequenceType with 200508 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (non-<code>null</code>)
+     * @return converted
+     */
+    public static SequenceType convert(org.apache.cxf.ws.rm.v200502wsa15.SequenceType exposed) {
+        SequenceType internal = RMUtils.getWSRMFactory().createSequenceType();
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        internal.setMessageNumber(exposed.getMessageNumber());
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 Expires with 200408 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    public static Expires convert(org.apache.cxf.ws.rm.v200502.Expires exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        Expires internal = new Expires();
+        internal.setValue(exposed.getValue());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 Expires with 200508 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    public static Expires convert(org.apache.cxf.ws.rm.v200502wsa15.Expires exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        Expires internal = new Expires();
+        internal.setValue(exposed.getValue());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 AcceptType with 200408 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    public static AcceptType convert(org.apache.cxf.ws.rm.v200502.AcceptType exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        AcceptType internal = new AcceptType();
+        internal.setAcksTo(org.apache.cxf.ws.addressing.VersionTransformer.convert(exposed.getAcksTo()));
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 AcceptType with 200508 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    public static AcceptType convert(org.apache.cxf.ws.rm.v200502wsa15.AcceptType exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        AcceptType internal = new AcceptType();
+        internal.setAcksTo(exposed.getAcksTo());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 OfferType with 200408 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    public static OfferType convert(org.apache.cxf.ws.rm.v200502.OfferType exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        OfferType internal = new OfferType();
+        internal.setExpires(convert(exposed.getExpires()));
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 Expires with 200508 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (may be <code>null</code>)
+     * @return converted (<code>null</code> if internal is <code>null</code>)
+     */
+    public static OfferType convert(org.apache.cxf.ws.rm.v200502wsa15.OfferType exposed) {
+        if (exposed == null) {
+            return null;
+        }
+        OfferType internal = new OfferType();
+        internal.setExpires(convert(exposed.getExpires()));
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        return internal;
+    }
+    
+    /**
+     * Convert wsrm:SequenceType to 200502 version with 200408 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502.SequenceType convert200502(SequenceType internal) {
+        org.apache.cxf.ws.rm.v200502.SequenceType exposed =
+            RMUtils.getWSRM200502Factory().createSequenceType();
+        exposed.setIdentifier(convert200502(internal.getIdentifier()));
+        exposed.setMessageNumber(internal.getMessageNumber());
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert TerminateSequenceType to 200502 version with 200408 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502.TerminateSequenceType
+    convert200502(TerminateSequenceType internal) {
+        org.apache.cxf.ws.rm.v200502.TerminateSequenceType exposed =
+            new org.apache.cxf.ws.rm.v200502.TerminateSequenceType();
+        exposed.setIdentifier(convert200502(internal.getIdentifier()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert TerminateSequenceType to 200502 version with 200508 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502wsa15.TerminateSequenceType
+    convert200502wsa15(TerminateSequenceType internal) {
+        org.apache.cxf.ws.rm.v200502wsa15.TerminateSequenceType exposed =
+            new org.apache.cxf.ws.rm.v200502wsa15.TerminateSequenceType();
+        exposed.setIdentifier(convert200502wsa15(internal.getIdentifier()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert wsrm:SequenceAcknowledgement to 200502 version with 200508 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement
+    convert200502wsa15(SequenceAcknowledgement internal) {
+        org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement exposed =
+            RMUtils.getWSRM200502WSA200508Factory().createSequenceAcknowledgement();
+        exposed.setIdentifier(convert200502wsa15(internal.getIdentifier()));
+        List<org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement.AcknowledgementRange> exposedRanges
+            = exposed.getAcknowledgementRange();
+        for (SequenceAcknowledgement.AcknowledgementRange range : internal.getAcknowledgementRange()) {
+            org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement.AcknowledgementRange exposedRange
+                = new org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement.AcknowledgementRange();
+            exposedRange.setLower(range.getLower());
+            exposedRange.setUpper(range.getUpper());
+            exposedRanges.add(exposedRange);
+            putAll(range.getOtherAttributes(), exposedRange.getOtherAttributes());
+        }
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert wsrm:SequenceAcknowledgement to 200502 version with 200408 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502.SequenceAcknowledgement
+    convert200502(SequenceAcknowledgement internal) {
+        org.apache.cxf.ws.rm.v200502.SequenceAcknowledgement exposed =
+            RMUtils.getWSRM200502Factory().createSequenceAcknowledgement();
+        exposed.setIdentifier(convert200502(internal.getIdentifier()));
+        List<org.apache.cxf.ws.rm.v200502.SequenceAcknowledgement.AcknowledgementRange> exposedRanges
+            = exposed.getAcknowledgementRange();
+        for (SequenceAcknowledgement.AcknowledgementRange range : internal.getAcknowledgementRange()) {
+            org.apache.cxf.ws.rm.v200502.SequenceAcknowledgement.AcknowledgementRange exposedRange
+                = new org.apache.cxf.ws.rm.v200502.SequenceAcknowledgement.AcknowledgementRange();
+            exposedRange.setLower(range.getLower());
+            exposedRange.setUpper(range.getUpper());
+            exposedRanges.add(exposedRange);
+            putAll(range.getOtherAttributes(), exposedRange.getOtherAttributes());
+        }
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert 200502 wsrm:SequenceAcknowledgement with 200508 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (non-<code>null</code>)
+     * @return converted
+     */
+    public static SequenceAcknowledgement
+    convert(org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement exposed) {
+        SequenceAcknowledgement internal = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        List<SequenceAcknowledgement.AcknowledgementRange> internalRanges
+            = internal.getAcknowledgementRange();
+        for (org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement.AcknowledgementRange range
+            : exposed.getAcknowledgementRange()) {
+            SequenceAcknowledgement.AcknowledgementRange internalRange
+                = new SequenceAcknowledgement.AcknowledgementRange();
+            internalRange.setLower(range.getLower());
+            internalRange.setUpper(range.getUpper());
+            internalRanges.add(internalRange);
+            putAll(range.getOtherAttributes(), internalRange.getOtherAttributes());
+        }
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 wsrm:SequenceAcknowledgement with 200408 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (non-<code>null</code>)
+     * @return converted
+     */
+    public static SequenceAcknowledgement
+    convert(org.apache.cxf.ws.rm.v200502.SequenceAcknowledgement exposed) {
+        SequenceAcknowledgement internal = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        List<SequenceAcknowledgement.AcknowledgementRange> internalRanges
+            = internal.getAcknowledgementRange();
+        for (org.apache.cxf.ws.rm.v200502.SequenceAcknowledgement.AcknowledgementRange range
+            : exposed.getAcknowledgementRange()) {
+            SequenceAcknowledgement.AcknowledgementRange internalRange
+                = new SequenceAcknowledgement.AcknowledgementRange();
+            internalRange.setLower(range.getLower());
+            internalRange.setUpper(range.getUpper());
+            internalRanges.add(internalRange);
+            putAll(range.getOtherAttributes(), internalRange.getOtherAttributes());
+        }
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert wsrm:SequenceAcknowledgement to 200502 version with 200508 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502wsa15.AckRequestedType
+    convert200502wsa15(AckRequestedType internal) {
+        org.apache.cxf.ws.rm.v200502wsa15.AckRequestedType exposed =
+            RMUtils.getWSRM200502WSA200508Factory().createAckRequestedType();
+        exposed.setIdentifier(convert200502wsa15(internal.getIdentifier()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert wsrm:SequenceAcknowledgement to 200502 version with 200408 WS-Addressing namespace.
+     * 
+     * @param internal (non-<code>null</code>)
+     * @return converted
+     */
+    public static org.apache.cxf.ws.rm.v200502.AckRequestedType
+    convert200502(AckRequestedType internal) {
+        org.apache.cxf.ws.rm.v200502.AckRequestedType exposed =
+            RMUtils.getWSRM200502Factory().createAckRequestedType();
+        exposed.setIdentifier(convert200502(internal.getIdentifier()));
+        addAll(internal.getAny(), exposed.getAny());
+        putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
+        return exposed;
+    }
+    
+    /**
+     * Convert 200502 wsrm:SequenceAcknowledgement with 200508 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (non-<code>null</code>)
+     * @return converted
+     */
+    public static AckRequestedType
+    convert(org.apache.cxf.ws.rm.v200502wsa15.AckRequestedType exposed) {
+        AckRequestedType internal = RMUtils.getWSRMFactory().createAckRequestedType();
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 wsrm:SequenceAcknowledgement with 200408 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (non-<code>null</code>)
+     * @return converted
+     */
+    public static AckRequestedType
+    convert(org.apache.cxf.ws.rm.v200502.AckRequestedType exposed) {
+        AckRequestedType internal = RMUtils.getWSRMFactory().createAckRequestedType();
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 TerminateSequenceType with 200508 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (non-<code>null</code>)
+     * @return converted
+     */
+    public static TerminateSequenceType
+    convert(org.apache.cxf.ws.rm.v200502wsa15.TerminateSequenceType exposed) {
+        TerminateSequenceType internal = new TerminateSequenceType();
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+    
+    /**
+     * Convert 200502 TerminateSequenceType with 200408 WS-Addressing namespace to internal form.
+     * 
+     * @param exposed (non-<code>null</code>)
+     * @return converted
+     */
+    public static TerminateSequenceType
+    convert(org.apache.cxf.ws.rm.v200502.TerminateSequenceType exposed) {
+        TerminateSequenceType internal = new TerminateSequenceType();
+        internal.setIdentifier(convert(exposed.getIdentifier()));
+        addAll(exposed.getAny(), internal.getAny());
+        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
+        return internal;
+    }
+
+    /**
+     * Put all entries from one map into another.
+     * @param from source map
+     * @param to target map
+     */
+    private static void putAll(Map<QName, String> from, Map<QName, String> to) {
+        if (from != null) {
+            to.putAll(from);
+        }
+    }
+
+    /**
+     * Add all entries from one list into another.
+     * @param from source list
+     * @param to target list
+     */
+    private static void addAll(List<Object> from, List<Object> to) {
+        if (from != null) {
+            to.addAll(from);
+        }
+    }
+}
\ No newline at end of file

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/RMFeature.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/RMFeature.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/RMFeature.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/RMFeature.java Sat Jun 18 01:51:01 2011
@@ -23,6 +23,8 @@ import org.apache.cxf.Bus;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.interceptor.InterceptorProvider;
+import org.apache.cxf.ws.addressing.VersionTransformer.Names200408;
+import org.apache.cxf.ws.rm.RM10Constants;
 import org.apache.cxf.ws.rm.RMCaptureInInterceptor;
 import org.apache.cxf.ws.rm.RMDeliveryInterceptor;
 import org.apache.cxf.ws.rm.RMInInterceptor;
@@ -32,8 +34,8 @@ import org.apache.cxf.ws.rm.manager.Deli
 import org.apache.cxf.ws.rm.manager.DestinationPolicyType;
 import org.apache.cxf.ws.rm.manager.SourcePolicyType;
 import org.apache.cxf.ws.rm.persistence.RMStore;
-import org.apache.cxf.ws.rm.policy.RMAssertion;
 import org.apache.cxf.ws.rm.soap.RMSoapInterceptor;
+import org.apache.cxf.ws.rmp.v200502.RMAssertion;
 
 /**
  * 
@@ -51,7 +53,9 @@ public class RMFeature extends AbstractF
     private RMOutInterceptor rmLogicalOut = new RMOutInterceptor();
     private RMDeliveryInterceptor rmDelivery = new RMDeliveryInterceptor();
     private RMSoapInterceptor rmCodec = new RMSoapInterceptor();
-    private RMCaptureInInterceptor rmCaptureIn = new RMCaptureInInterceptor(); 
+    private RMCaptureInInterceptor rmCaptureIn = new RMCaptureInInterceptor();
+    private String rmNamespace = RM10Constants.NAMESPACE_URI;
+    private String rm10AddressingNamespace = Names200408.WSA_NAMESPACE_NAME;
 
     public void setDeliveryAssurance(DeliveryAssuranceType da) {
         deliveryAssurance = da;
@@ -73,6 +77,22 @@ public class RMFeature extends AbstractF
         this.store = store;
     }
 
+    public String getRMNamespace() {
+        return rmNamespace;
+    }
+
+    public void setRMNamespace(String uri) {
+        rmNamespace = uri;
+    }
+
+    public String getRM10AddressingNamespace() {
+        return rm10AddressingNamespace;
+    }
+
+    public void setRM10AddressingNamespace(String uri) {
+        rm10AddressingNamespace = uri;
+    }
+
     @Override
     protected void initializeProvider(InterceptorProvider provider, Bus bus) {
 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/PersistenceUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/PersistenceUtils.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/PersistenceUtils.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/PersistenceUtils.java Sat Jun 18 01:51:01 2011
@@ -29,7 +29,7 @@ import javax.xml.bind.Unmarshaller;
 
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.helpers.LoadingByteArrayOutputStream;
-import org.apache.cxf.ws.rm.SequenceAcknowledgement;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
 
 /**
  * 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMStore.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMStore.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMStore.java Sat Jun 18 01:51:01 2011
@@ -22,8 +22,8 @@ package org.apache.cxf.ws.rm.persistence
 import java.util.Collection;
 
 import org.apache.cxf.ws.rm.DestinationSequence;
-import org.apache.cxf.ws.rm.Identifier;
 import org.apache.cxf.ws.rm.SourceSequence;
+import org.apache.cxf.ws.rm.v200702.Identifier;
 
 public interface RMStore {
  

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java Sat Jun 18 01:51:01 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm.persistence.jdbc;
 
-
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -43,22 +42,29 @@ import javax.annotation.PostConstruct;
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.ws.addressing.v200408.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.rm.DestinationSequence;
-import org.apache.cxf.ws.rm.Identifier;
 import org.apache.cxf.ws.rm.RMUtils;
-import org.apache.cxf.ws.rm.SequenceAcknowledgement;
 import org.apache.cxf.ws.rm.SourceSequence;
 import org.apache.cxf.ws.rm.persistence.PersistenceUtils;
 import org.apache.cxf.ws.rm.persistence.RMMessage;
 import org.apache.cxf.ws.rm.persistence.RMStore;
 import org.apache.cxf.ws.rm.persistence.RMStoreException;
-
+import org.apache.cxf.ws.rm.v200702.Identifier;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
 
 public class RMTxStore implements RMStore {
     
     public static final String DEFAULT_DATABASE_NAME = "rmdb";
     
+    private static final String CREATE_ENDPOINTS_TABLE_STMT =
+        "CREATE TABLE CXF_ENDPOINTS " 
+        + "(QNAME_URI VARCHAR(1024), "
+        + "QNAME_LOCAL VARCHAR(1024), "
+        + "ENDPOINT_ID VARCHAR(1024), "
+        + "WSRM_URI VARCHAR(256) NOT NULL, "
+        + "WSA_URI VARCHAR(256) NOT NULL, "
+        + "PRIMARY KEY (QNAME_URI, QNAME_LOCAL))";
     private static final String CREATE_DEST_SEQUENCES_TABLE_STMT =
         "CREATE TABLE CXF_RM_DEST_SEQUENCES " 
         + "(SEQ_ID VARCHAR(256) NOT NULL, "
@@ -86,7 +92,6 @@ public class RMTxStore implements RMStor
     private static final String INBOUND_MSGS_TABLE_NAME = "CXF_RM_INBOUND_MESSAGES";
     private static final String OUTBOUND_MSGS_TABLE_NAME = "CXF_RM_OUTBOUND_MESSAGES";    
     
-    
     private static final String CREATE_DEST_SEQUENCE_STMT_STR 
         = "INSERT INTO CXF_RM_DEST_SEQUENCES (SEQ_ID, ACKS_TO, ENDPOINT_ID) VALUES(?, ?, ?)";
     private static final String CREATE_SRC_SEQUENCE_STMT_STR
@@ -117,7 +122,7 @@ public class RMTxStore implements RMStor
         + "WHERE ENDPOINT_ID = ?";
     private static final String SELECT_MESSAGES_STMT_STR =
         "SELECT MSG_NO, SEND_TO, CONTENT FROM {0} WHERE SEQ_ID = ?";
-
+    
     private static final String DERBY_TABLE_EXISTS_STATE = "X0Y32";
     private static final int ORACLE_TABLE_EXISTS_CODE = 955;
     
@@ -125,7 +130,7 @@ public class RMTxStore implements RMStor
     
     private Connection connection;
     private Lock writeLock = new ReentrantLock();
-
+    
     private PreparedStatement createDestSequenceStmt;
     private PreparedStatement createSrcSequenceStmt;
     private PreparedStatement deleteDestSequenceStmt;
@@ -157,7 +162,7 @@ public class RMTxStore implements RMStor
     public String getDriverClassName() {
         return driverClassName;
     }
-
+    
     public void setPassword(String p) {
         password = p;
     }
@@ -173,7 +178,7 @@ public class RMTxStore implements RMStor
     public String getUrl() {
         return url;
     }
-
+    
     public void setUserName(String un) {
         userName = un;
     }
@@ -181,7 +186,7 @@ public class RMTxStore implements RMStor
     public String getUserName() {
         return userName;
     }    
-   
+    
     public void setConnection(Connection c) {
         connection = c;
     }
@@ -260,7 +265,7 @@ public class RMTxStore implements RMStor
             
             ResultSet res = selectDestSequenceStmt.executeQuery(); 
             if (res.next()) {
-                EndpointReferenceType acksTo = RMUtils.createReference2004(res.getString(1));  
+                EndpointReferenceType acksTo = RMUtils.createReference(res.getString(1));  
                 long lm = res.getLong(2);
                 InputStream is = res.getBinaryStream(3); 
                 SequenceAcknowledgement ack = null;
@@ -308,7 +313,7 @@ public class RMTxStore implements RMStor
         }
         return null;
     }
-
+    
     public void removeDestinationSequence(Identifier sid) {
         try {
             beginTransaction();
@@ -326,8 +331,8 @@ public class RMTxStore implements RMStor
             throw new RMStoreException(ex);
         }        
     }
-
-
+    
+    
     public void removeSourceSequence(Identifier sid) {
         try {
             beginTransaction();
@@ -362,7 +367,7 @@ public class RMTxStore implements RMStor
             while (res.next()) {
                 Identifier sid = RMUtils.getWSRMFactory().createIdentifier();                
                 sid.setValue(res.getString(1));
-                EndpointReferenceType acksTo = RMUtils.createReference2004(res.getString(2));  
+                EndpointReferenceType acksTo = RMUtils.createReference(res.getString(2));  
                 long lm = res.getLong(3);
                 InputStream is = res.getBinaryStream(4); 
                 SequenceAcknowledgement ack = null;
@@ -446,7 +451,7 @@ public class RMTxStore implements RMStor
         }
         return msgs;
     }
-
+    
     public void persistIncoming(DestinationSequence seq, RMMessage msg) {        
         try {
             beginTransaction();
@@ -483,7 +488,7 @@ public class RMTxStore implements RMStor
             throw new RMStoreException(ex);        
         }        
     }
-
+    
     public void removeMessages(Identifier sid, Collection<Long> messageNrs, boolean outbound) {
         try {
             beginTransaction();
@@ -497,7 +502,7 @@ public class RMTxStore implements RMStor
                     deleteInboundMessageStmt = stmt;
                 }
             }
-
+    
             stmt.setString(1, sid.getValue());
                         
             for (Long messageNr : messageNrs) {
@@ -512,7 +517,7 @@ public class RMTxStore implements RMStor
             throw new RMStoreException(ex);
         }        
     }
-
+    
     // transaction demarcation
     // 
     
@@ -599,6 +604,17 @@ public class RMTxStore implements RMStor
         Statement stmt = null;
         stmt = connection.createStatement();
         try {
+            stmt.executeUpdate(CREATE_ENDPOINTS_TABLE_STMT);
+        } catch (SQLException ex) {
+            if (!isTableExistsError(ex)) {
+                throw ex;
+            } else {
+                LOG.fine("Table CXF_ENDPOINTS already exists.");
+            }
+        }
+        stmt.close();
+        stmt = connection.createStatement();
+        try {
             stmt.executeUpdate(CREATE_SRC_SEQUENCES_TABLE_STMT);
         } catch (SQLException ex) {
             if (!isTableExistsError(ex)) {
@@ -651,11 +667,11 @@ public class RMTxStore implements RMStor
                 LogUtils.log(LOG, Level.SEVERE, "CONNECT_EXC", ex);
                 return;
             }
-
+    
             try {
                 LOG.log(Level.FINE, "Using url: " + url);
                 connection = DriverManager.getConnection(url, userName, password);
-
+    
             } catch (SQLException ex) {
                 LogUtils.log(LOG, Level.SEVERE, "CONNECT_EXC", ex);
                 return;
@@ -715,9 +731,9 @@ public class RMTxStore implements RMStor
             LOG.log(Level.FINE, "Trying to delete directory {0}", root);
             recursiveDelete(root, now);
         }
-
+    
     }
-
+    
     private static void recursiveDelete(File dir, boolean now) {
         for (File f : dir.listFiles()) {
             if (f.isDirectory()) {
@@ -736,11 +752,9 @@ public class RMTxStore implements RMStor
             dir.deleteOnExit();
         }
     }
-
+    
     private static boolean isTableExistsError(SQLException ex) {
         return DERBY_TABLE_EXISTS_STATE.equals(ex.getSQLState())
                 || ORACLE_TABLE_EXISTS_CODE == ex.getErrorCode();
     }
-
-
-}
+}
\ No newline at end of file

Added: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10PolicyUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10PolicyUtils.java?rev=1137112&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10PolicyUtils.java (added)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10PolicyUtils.java Sat Jun 18 01:51:01 2011
@@ -0,0 +1,229 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.rm.policy;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.cxf.message.Message;
+import org.apache.cxf.ws.policy.AssertionInfo;
+import org.apache.cxf.ws.policy.AssertionInfoMap;
+import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertion;
+import org.apache.cxf.ws.rm.RM10Constants;
+import org.apache.cxf.ws.rm.RM11Constants;
+import org.apache.cxf.ws.rmp.v200502.RMAssertion;
+import org.apache.cxf.ws.rmp.v200502.RMAssertion.AcknowledgementInterval;
+import org.apache.cxf.ws.rmp.v200502.RMAssertion.BaseRetransmissionInterval;
+import org.apache.cxf.ws.rmp.v200502.RMAssertion.InactivityTimeout;
+
+/**
+ * 
+ */
+public final class RM10PolicyUtils {
+    
+    /**
+     * Prevents instantiation.
+     *
+     */
+    private RM10PolicyUtils() {        
+    }
+
+    /**
+     * Collect RMAssertions from map. This checks both namespaces defined for WS-RM policy assertions.
+     * 
+     * @param aim map, may be <code>null</code>
+     * @return merged collection, never <code>null</code>
+     */
+    public static Collection<AssertionInfo> collectRMAssertions(AssertionInfoMap aim) {
+        Collection<AssertionInfo> mergedAsserts = new ArrayList<AssertionInfo>();
+        if (aim != null) {
+            Collection<AssertionInfo> ais = aim.get(RM10Constants.WSRMP_RMASSERTION_QNAME);
+            if (ais != null) {
+                mergedAsserts.addAll(ais);
+            }
+            ais = aim.get(RM11Constants.WSRMP_RMASSERTION_QNAME);
+            if (ais != null) {
+                mergedAsserts.addAll(ais);
+            }
+        }
+        return mergedAsserts;
+    }
+
+    /**
+     * Returns an RMAssertion that is compatible with the default value
+     * and all RMAssertions pertaining to the message (can never be null).
+     * 
+     * @param rma the default value
+     * @param message the message
+     * @return the compatible RMAssertion
+     */
+    public static RMAssertion getRMAssertion(RMAssertion defaultValue, Message message) {        
+        RMAssertion compatible = defaultValue;
+        Collection<AssertionInfo> ais = collectRMAssertions(message.get(AssertionInfoMap.class));
+        for (AssertionInfo ai : ais) {
+            JaxbAssertion<RMAssertion> ja = getAssertion(ai);
+            RMAssertion rma = ja.getData();
+            compatible = null == defaultValue ? rma : intersect(compatible, rma);
+        }
+        return compatible;
+    }
+    
+    public static RMAssertion intersect(RMAssertion a, RMAssertion b) {
+        if (equals(a, b)) {
+            return a;
+        }
+        RMAssertion compatible = new RMAssertion();
+        
+        // use maximum of inactivity timeout
+        
+        Long aval = null;
+        if (null != a.getInactivityTimeout()) {
+            aval = a.getInactivityTimeout().getMilliseconds();
+        }
+        Long bval = null;
+        if (null != b.getInactivityTimeout()) {
+            bval = b.getInactivityTimeout().getMilliseconds();            
+        }
+        if (null != aval || null != bval) {
+            InactivityTimeout ia = new RMAssertion.InactivityTimeout();
+            if (null != aval && null != bval) {
+                ia.setMilliseconds(bval);
+            } else {
+                ia.setMilliseconds(aval != null ? aval : bval);
+            }
+            compatible.setInactivityTimeout(ia);
+        }
+        
+        // use minimum of base retransmission interval
+        
+        aval = null;
+        if (null != a.getBaseRetransmissionInterval()) {
+            aval = a.getBaseRetransmissionInterval().getMilliseconds();
+        }
+        bval = null;
+        if (null != b.getBaseRetransmissionInterval()) {
+            bval = b.getBaseRetransmissionInterval().getMilliseconds();            
+        }
+        if (null != aval || null != bval) {
+            BaseRetransmissionInterval bri = new RMAssertion.BaseRetransmissionInterval();
+            if (null != aval && null != bval) {
+                bri.setMilliseconds(bval);
+            } else {
+                bri.setMilliseconds(aval != null ? aval : bval);
+            }
+            compatible.setBaseRetransmissionInterval(bri);
+        }
+        
+        // use minimum of acknowledgement interval
+        
+        aval = null;
+        if (null != a.getAcknowledgementInterval()) {
+            aval = a.getAcknowledgementInterval().getMilliseconds();
+        }
+        bval = null;
+        if (null != b.getAcknowledgementInterval()) {
+            bval = b.getAcknowledgementInterval().getMilliseconds(); 
+        }
+        if (null != aval || null != bval) {
+            AcknowledgementInterval ai = new RMAssertion.AcknowledgementInterval();
+            if (null != aval && null != bval) {
+                ai.setMilliseconds(bval);
+            } else {
+                ai.setMilliseconds(aval != null ? aval : bval);
+            }
+            compatible.setAcknowledgementInterval(ai);
+        }
+    
+        // backoff parameter
+        if (null != a.getExponentialBackoff() || null != b.getExponentialBackoff()) {
+            compatible.setExponentialBackoff(new RMAssertion.ExponentialBackoff());
+        }
+        return compatible;
+    }
+    
+    public static boolean equals(RMAssertion a, RMAssertion b) {
+        if (a == b) {
+            return true;
+        }
+        
+        Long aval = null;
+        if (null != a.getInactivityTimeout()) {
+            aval = a.getInactivityTimeout().getMilliseconds();
+        }
+        Long bval = null;
+        if (null != b.getInactivityTimeout()) {
+            bval = b.getInactivityTimeout().getMilliseconds();            
+        }
+        if (!equals(aval, bval)) {
+            return false;
+        }
+            
+        aval = null;
+        if (null != a.getBaseRetransmissionInterval()) {
+            aval = a.getBaseRetransmissionInterval().getMilliseconds();
+        }
+        bval = null;
+        if (null != b.getBaseRetransmissionInterval()) {
+            bval = b.getBaseRetransmissionInterval().getMilliseconds();            
+        }
+        if (!equals(aval, bval)) {
+            return false;
+        }
+        
+        aval = null;
+        if (null != a.getAcknowledgementInterval()) {
+            aval = a.getAcknowledgementInterval().getMilliseconds();
+        }
+        bval = null;
+        if (null != b.getAcknowledgementInterval()) {
+            bval = b.getAcknowledgementInterval().getMilliseconds(); 
+        }
+        if (!equals(aval, bval)) {
+            return false;
+        }
+        
+        return null == a.getExponentialBackoff()
+            ? null == b.getExponentialBackoff() 
+            : null != b.getExponentialBackoff();         
+    }
+        
+    private static boolean equals(Long aval, Long bval) {
+        if (null != aval) {
+            if (null != bval) {
+                if (!aval.equals(bval)) {
+                    return false;
+                }
+            } else {
+                return false;
+            }
+        } else {
+            if (null != bval) {
+                return false;
+            }
+            return true;
+        }
+        return true;
+    }
+
+    @SuppressWarnings("unchecked")
+    private static JaxbAssertion<RMAssertion> getAssertion(AssertionInfo ai) {
+        return (JaxbAssertion<RMAssertion>)ai.getAssertion();
+    }
+}

Added: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM11AssertionBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM11AssertionBuilder.java?rev=1137112&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM11AssertionBuilder.java (added)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM11AssertionBuilder.java Sat Jun 18 01:51:01 2011
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.rm.policy;
+
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertion;
+import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertionBuilder;
+import org.apache.cxf.ws.rm.RM11Constants;
+import org.apache.cxf.ws.rmp.v200702.RMAssertion;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.PolicyComponent;
+
+/**
+ * 
+ */
+public class RM11AssertionBuilder extends JaxbAssertionBuilder<RMAssertion> {
+    public static final List<QName> KNOWN_ELEMENTS 
+        = Collections.singletonList(RM11Constants.WSRMP_RMASSERTION_QNAME);
+
+    public RM11AssertionBuilder() throws JAXBException {
+        super(RMAssertion.class, RM11Constants.WSRMP_RMASSERTION_QNAME);     
+    }
+
+    @Override
+    protected JaxbAssertion<RMAssertion> buildAssertion() {
+        return new RMPolicyAssertion();
+    }
+    
+    class RMPolicyAssertion extends JaxbAssertion<RMAssertion> {
+        RMPolicyAssertion() {
+            super(RM11Constants.WSRMP_RMASSERTION_QNAME, false);
+        }
+        RMPolicyAssertion(boolean opt) {
+            super(RM11Constants.WSRMP_RMASSERTION_QNAME, opt);
+        }
+        RMPolicyAssertion(boolean opt, boolean ignore) {
+            super(RM11Constants.WSRMP_RMASSERTION_QNAME, opt, ignore);
+        }
+
+        @Override
+        public boolean equal(PolicyComponent policyComponent) {
+//            if (policyComponent.getType() != Constants.TYPE_ASSERTION
+//                || !getName().equals(((Assertion)policyComponent).getName())) {
+//                return false;
+//            }
+//            JaxbAssertion<RMAssertion> other = JaxbAssertion.cast((Assertion)policyComponent);
+            // TODO: implement the handling for delivery assurances in the policy
+            return false;  
+        }
+        
+        @Override
+        protected Assertion clone(boolean b) {
+            RMPolicyAssertion a = new RMPolicyAssertion();
+            a.setData(getData());
+            return a;        
+        }
+    }
+}

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java Sat Jun 18 01:51:01 2011
@@ -27,7 +27,8 @@ import javax.xml.namespace.QName;
 
 import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertion;
 import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertionBuilder;
-import org.apache.cxf.ws.rm.RMConstants;
+import org.apache.cxf.ws.rm.RM10Constants;
+import org.apache.cxf.ws.rmp.v200502.RMAssertion;
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Constants;
 import org.apache.neethi.PolicyComponent;
@@ -37,10 +38,10 @@ import org.apache.neethi.PolicyComponent
  */
 public class RMAssertionBuilder extends JaxbAssertionBuilder<RMAssertion> {
     public static final List<QName> KNOWN_ELEMENTS 
-        = Collections.singletonList(RMConstants.getRMAssertionQName());
+        = Collections.singletonList(RM10Constants.WSRMP_RMASSERTION_QNAME);
 
     public RMAssertionBuilder() throws JAXBException {
-        super(RMAssertion.class, RMConstants.getRMAssertionQName());     
+        super(RMAssertion.class, RM10Constants.WSRMP_RMASSERTION_QNAME);     
     }
 
     @Override
@@ -50,13 +51,13 @@ public class RMAssertionBuilder extends 
     
     class RMPolicyAssertion extends JaxbAssertion<RMAssertion> {
         RMPolicyAssertion() {
-            super(RMConstants.getRMAssertionQName(), false);
+            super(RM10Constants.WSRMP_RMASSERTION_QNAME, false);
         }
         RMPolicyAssertion(boolean opt) {
-            super(RMConstants.getRMAssertionQName(), opt);
+            super(RM10Constants.WSRMP_RMASSERTION_QNAME, opt);
         }
         RMPolicyAssertion(boolean opt, boolean ignore) {
-            super(RMConstants.getRMAssertionQName(), opt, ignore);
+            super(RM10Constants.WSRMP_RMASSERTION_QNAME, opt, ignore);
         }
 
         @Override
@@ -67,7 +68,7 @@ public class RMAssertionBuilder extends 
             }
             JaxbAssertion<RMAssertion> other = 
                     JaxbAssertion.cast((Assertion)policyComponent);            
-            return PolicyUtils.equals(this.getData(), other.getData());  
+            return RM10PolicyUtils.equals(this.getData(), other.getData());  
         }
         
         @Override
@@ -77,9 +78,4 @@ public class RMAssertionBuilder extends 
             return a;        
         }
     }
-    
-    
-
-        
-}
-
+}
\ No newline at end of file

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/Messages.properties?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/Messages.properties (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/Messages.properties Sat Jun 18 01:51:01 2011
@@ -18,6 +18,7 @@
 #
 SOAP_HEADER_ENCODE_FAILURE_MSG = Failed to encode RM properties as SOAP headers.
 SOAP_HEADER_DECODE_FAILURE_MSG = Failed to decode RM properties from SOAP headers.
+NAMESPACE_ERROR_MSG = Unsupported addressing namespace {0} for RM.
 
 RESEND_MSG = WS-RM retransmission of message {0}.
 RESEND_CANDIDATES_CONCURRENT_MODIFICATION_MSG = Candidates were acknowledged while iterating for resend.



Mime
View raw message