Author: richard.opalka(a)jboss.com
Date: 2007-11-30 06:01:50 -0500 (Fri, 30 Nov 2007)
New Revision: 5154
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceResponseSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceAcknowledgementSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceAcknowledgementImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceAcknowledgementImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequenceResponse.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceAcknowledgement.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/RMDeSerializationTestCase.java
Log:
handling of Sequence, AckRequested, SequenceAcknowledgement + minor refactoring
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -73,11 +73,15 @@
import org.jboss.ws.extensions.wsrm.RMSequenceImpl;
import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.api.RMSequence;
import org.jboss.ws.extensions.wsrm.api.RMSequenceType;
import org.jboss.ws.extensions.wsrm.common.RMHelper;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
import org.jboss.ws.metadata.config.Configurable;
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
@@ -326,8 +330,41 @@
}
finally
{
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ this.wsrmLock.lock();
+ try
+ {
+ if (this.wsrmSequence != null)
+ {
+ if (RMConstant.PROTOCOL_OPERATION_QNAMES.contains(opName) == false)
+ {
+ Map<String, Object> wsrmResCtx = (Map<String, Object>)
msgContext.get(RMConstant.RESPONSE_CONTEXT);
+ RMConstants wsrmConstants = RMProvider.get().getConstants();
+ Map<QName, RMSerializable> mapping = (Map<QName,
RMSerializable>)wsrmResCtx.get(RMConstant.PROTOCOL_MESSAGES_MAPPING);
+ QName seqAck = wsrmConstants.getSequenceAcknowledgementQName();
+ if (mapping.keySet().contains(seqAck))
+ {
+
RMHelper.handleSequenceAcknowledgementHeader((RMSequenceAcknowledgement)mapping.get(seqAck),
this.wsrmSequence);
+ }
+ QName seq = wsrmConstants.getSequenceQName();
+ if (mapping.keySet().contains(seq))
+ {
+ RMHelper.handleSequenceHeader((RMSequence)mapping.get(seq),
this.wsrmSequence);
+ }
+ QName ackReq = wsrmConstants.getAckRequestedQName();
+ if (mapping.keySet().contains(ackReq))
+ {
+
RMHelper.handleAckRequestedHeader((RMAckRequested)mapping.get(ackReq),
this.wsrmSequence);
+ }
+ }
+ }
+ }
+ finally
+ {
+ this.wsrmLock.unlock();
+ }
+
// Copy the inbound msg properties to the binding's response context
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
for (String key : msgContext.keySet())
{
Object value = msgContext.get(key);
@@ -489,7 +526,7 @@
// WS-RM support //
///////////////////
@SuppressWarnings("unchecked")
- public RMSequence createSequence(RMAddressingType addrType, RMSequenceType seqType)
throws RMException
+ public org.jboss.ws.extensions.wsrm.api.RMSequence createSequence(RMAddressingType
addrType, RMSequenceType seqType) throws RMException
{
this.getWSRMLock().lock();
try
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -182,7 +182,7 @@
log.debug("handling inbound message");
SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
- Map rmResponseContext = new HashMap();
+ Map<String, Object> rmResponseContext = new HashMap();
List<QName> messages = new LinkedList<QName>();
rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES, messages);
Map<QName, RMSerializable> data = new HashMap<QName,
RMSerializable>();
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -27,6 +27,8 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@@ -68,6 +70,8 @@
private final RMConfig wsrmConfig;
private final RMSequenceType sequenceType;
private final RMAddressingType addrType;
+ private final Set<Long> acknowledgedOutboundMessages = new
TreeSet<Long>();
+ private final Set<Long> receivedInboundMessages = new TreeSet<Long>();
private RMIncompleteSequenceBehavior behavior =
RMIncompleteSequenceBehavior.NO_DISCARD;
private String incomingSequenceId;
private String outgoingSequenceId;
@@ -76,8 +80,10 @@
private URI backPort;
private ClientImpl client;
// object states variables
- private boolean terminated = false;
- private boolean discarded = false;
+ private boolean terminated;
+ private boolean discarded;
+ private boolean isFinal;
+ private boolean inboundMessageAckRequested;
private AtomicLong messageNumber = new AtomicLong();
private final Lock objectLock = new ReentrantLock();
private AtomicInteger countOfUnassignedMessagesAvailable = new AtomicInteger();
@@ -109,6 +115,62 @@
}
}
+ public final void setFinal()
+ {
+ this.objectLock.lock();
+ try
+ {
+ this.isFinal = true;
+ logger.debug("Sequence " + this.outgoingSequenceId + " state
changed to final");
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+
+ public final void ackRequested()
+ {
+ this.objectLock.lock();
+ try
+ {
+ this.inboundMessageAckRequested = true;
+ logger.debug("Sequence " + this.incomingSequenceId + " ack
requested. Messages in the queue: " + this.receivedInboundMessages);
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+
+ public final void addReceivedInboundMessage(long messageId)
+ {
+ this.objectLock.lock();
+ try
+ {
+ this.receivedInboundMessages.add(messageId);
+ logger.debug("Inbound Sequence: " + this.incomingSequenceId + ",
received message no. " + messageId);
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+
+ public final void addReceivedMessage(long messageId)
+ {
+ this.objectLock.lock();
+ try
+ {
+ this.acknowledgedOutboundMessages.add(messageId);
+ logger.debug("Message no. " + messageId + " of sequence: " +
this.outgoingSequenceId + " acknowledged by server");
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+
public final void setOutboundId(String outboundId)
{
this.objectLock.lock();
@@ -122,6 +184,19 @@
}
}
+ public final void setInboundId(String inboundId)
+ {
+ this.objectLock.lock();
+ try
+ {
+ this.incomingSequenceId = inboundId;
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+
public final void setClient(ClientImpl client)
{
this.objectLock.lock();
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -22,12 +22,19 @@
package org.jboss.ws.extensions.wsrm.common;
import java.util.Date;
+import java.util.List;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
+import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.wsrm.RMClientHandler;
+import org.jboss.ws.extensions.wsrm.RMSequenceImpl;
import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
/**
* RM utility library
@@ -39,6 +46,8 @@
public final class RMHelper
{
+ private static final Logger logger = Logger.getLogger(RMHelper.class);
+
private RMHelper()
{
// no instances allowed
@@ -76,4 +85,59 @@
return d.getTimeInMillis(new Date());
}
+ public static void handleSequenceAcknowledgementHeader(RMSequenceAcknowledgement
seqAckHeader, RMSequenceImpl sequence)
+ {
+ String seqId = seqAckHeader.getIdentifier();
+ if (sequence.getOutboundId().equals(seqId))
+ {
+ List<RMSequenceAcknowledgement.RMAcknowledgementRange> ranges =
seqAckHeader.getAcknowledgementRanges();
+ for (RMSequenceAcknowledgement.RMAcknowledgementRange range : ranges)
+ {
+ for (long i = range.getLower(); i <= range.getUpper(); i++)
+ {
+ sequence.addReceivedInboundMessage(i);
+ }
+ }
+ if (seqAckHeader.isFinal())
+ {
+ sequence.setFinal();
+ }
+ }
+ else
+ {
+ logger.warn("Expected outbound sequenceId:" + sequence.getOutboundId()
+ " , but was: " + seqId);
+ throw new RMException("Expected outbound sequenceId:" +
sequence.getOutboundId() + " , but was: " + seqId);
+ }
+ }
+
+ public static void handleAckRequestedHeader(RMAckRequested ackReqHeader,
RMSequenceImpl sequence)
+ {
+ String inboundSeqId = ackReqHeader.getIdentifier();
+ if (false == sequence.getInboundId().equals(inboundSeqId))
+ {
+ logger.warn("Expected inbound sequenceId:" + sequence.getInboundId() +
" , but was: " + inboundSeqId);
+ throw new RMException("Expected inbound sequenceId:" +
sequence.getInboundId() + " , but was: " + inboundSeqId);
+ }
+
+ sequence.ackRequested();
+ }
+
+ public static void handleSequenceHeader(RMSequence seqHeader, RMSequenceImpl
sequence)
+ {
+ String inboundSeqId = seqHeader.getIdentifier();
+ if (null == sequence.getInboundId())
+ {
+ sequence.setInboundId(inboundSeqId);
+ }
+ else
+ {
+ if (false == sequence.getInboundId().equals(inboundSeqId))
+ {
+ logger.warn("Expected inbound sequenceId:" +
sequence.getInboundId() + " , but was: " + inboundSeqId);
+ throw new RMException("Expected inbound sequenceId:" +
sequence.getInboundId() + " , but was: " + inboundSeqId);
+ }
+ }
+ sequence.addReceivedInboundMessage(seqHeader.getMessageNumber());
+ }
+
}
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceResponseSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceResponseSerializer.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceResponseSerializer.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -112,7 +112,7 @@
SOAPElement acceptElement = getOptionalElement(createSequenceResponseElement,
acceptQName, createSequenceResponseQName);
if (acceptElement != null)
{
- RMCreateSequenceResponse.Accept accept = o.newAccept();
+ RMCreateSequenceResponse.RMAccept accept = o.newAccept();
// read required wsrm:AcksTo element
QName acksToQName = wsrmConstants.getAcksToQName();
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceSerializer.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceSerializer.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -107,7 +107,7 @@
SOAPElement offerElement = getOptionalElement(createSequenceElement, offerQName,
createSequenceQName);
if (offerElement != null)
{
- RMCreateSequence.Offer offer = o.newOffer();
+ RMCreateSequence.RMOffer offer = o.newOffer();
// read required wsrm:Identifier element
QName identifierQName = wsrmConstants.getIdentifierQName();
@@ -194,7 +194,7 @@
if (o.getOffer() != null)
{
- RMCreateSequence.Offer offer = o.getOffer();
+ RMCreateSequence.RMOffer offer = o.getOffer();
// write optional wsrm:Offer element
QName offerQName = wsrmConstants.getOfferQName();
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceAcknowledgementSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceAcknowledgementSerializer.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceAcknowledgementSerializer.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -121,7 +121,7 @@
for (SOAPElement ackRangeElement : ackRangeElements)
{
- RMSequenceAcknowledgement.AcknowledgementRange ackRange =
o.newAcknowledgementRange();
+ RMSequenceAcknowledgement.RMAcknowledgementRange ackRange =
o.newAcknowledgementRange();
// read required wsrm:Upper attribute
String upper = getRequiredTextContent(ackRangeElement, upperQName,
ackRangeQName);
@@ -198,7 +198,7 @@
}
}
- List<RMSequenceAcknowledgement.AcknowledgementRange> ackRanges =
o.getAcknowledgementRanges();
+ List<RMSequenceAcknowledgement.RMAcknowledgementRange> ackRanges =
o.getAcknowledgementRanges();
if (ackRanges.size() != 0)
{
QName acknowledgementRangeQName =
wsrmConstants.getAcknowledgementRangeQName();
@@ -206,7 +206,7 @@
QName lowerQName = wsrmConstants.getLowerQName();
// write optional wsrm:AcknowledgementRange elements
- for (RMSequenceAcknowledgement.AcknowledgementRange ackRange : ackRanges)
+ for (RMSequenceAcknowledgement.RMAcknowledgementRange ackRange : ackRanges)
{
SOAPElement acknowledgementRangeElement =
sequenceAckElement.addChildElement(acknowledgementRangeQName);
// write required wsrm:Lower attribute
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceImpl.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceImpl.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -41,7 +41,7 @@
// internal fields
private String acksTo;
private Duration expires;
- private Offer offer;
+ private RMOffer offer;
RMCreateSequenceImpl()
{
@@ -67,7 +67,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getOffer()
*/
- public Offer getOffer()
+ public RMOffer getOffer()
{
return this.offer;
}
@@ -75,7 +75,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#newOffer()
*/
- public Offer newOffer()
+ public RMOffer newOffer()
{
return new OfferImpl();
}
@@ -109,7 +109,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setOffer(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer)
*/
- public void setOffer(Offer offer)
+ public void setOffer(RMOffer offer)
{
if (offer == null)
throw new IllegalArgumentException("Offer cannot be null");
@@ -190,7 +190,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer
*/
- private static class OfferImpl implements RMCreateSequence.Offer
+ private static class OfferImpl implements RMCreateSequence.RMOffer
{
private String duration;
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceResponseImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceResponseImpl.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceResponseImpl.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -41,7 +41,7 @@
// internal fields
private String identifier;
private Duration expires;
- private Accept accept;
+ private RMAccept accept;
RMCreateSequenceResponseImpl()
{
@@ -51,7 +51,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getAccept()
*/
- public Accept getAccept()
+ public RMAccept getAccept()
{
return this.accept;
}
@@ -83,7 +83,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#newAccept()
*/
- public Accept newAccept()
+ public RMAccept newAccept()
{
return new AcceptImpl();
}
@@ -91,7 +91,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setAccept(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept)
*/
- public void setAccept(Accept accept)
+ public void setAccept(RMAccept accept)
{
if (accept == null)
throw new IllegalArgumentException("Accept cannot be null");
@@ -204,7 +204,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept
*/
- private static class AcceptImpl implements RMCreateSequenceResponse.Accept
+ private static class AcceptImpl implements RMCreateSequenceResponse.RMAccept
{
private String acksTo;
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceAcknowledgementImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceAcknowledgementImpl.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceAcknowledgementImpl.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -41,7 +41,7 @@
private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
// internal fields
private final List<Long> nacks = new LinkedList<Long>();
- private final List<AcknowledgementRange> acknowledgementRanges = new
LinkedList<AcknowledgementRange>();
+ private final List<RMAcknowledgementRange> acknowledgementRanges = new
LinkedList<RMAcknowledgementRange>();
private String identifier;
RMSequenceAcknowledgementImpl()
@@ -52,7 +52,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addAcknowledgementRange(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange)
*/
- public void addAcknowledgementRange(AcknowledgementRange newAcknowledgementRange)
+ public void addAcknowledgementRange(RMAcknowledgementRange newAcknowledgementRange)
{
if ((newAcknowledgementRange == null) || (!(newAcknowledgementRange instanceof
AcknowledgementRangeImpl)))
throw new IllegalArgumentException();
@@ -60,7 +60,7 @@
throw new IllegalStateException("There are already some nacks
specified");
if ((newAcknowledgementRange.getLower() == 0) ||
(newAcknowledgementRange.getUpper() == 0))
throw new IllegalArgumentException("Both, lower and upper values must be
specified");
- for (AcknowledgementRange alreadyAccepted : acknowledgementRanges)
+ for (RMAcknowledgementRange alreadyAccepted : acknowledgementRanges)
checkOverlap(alreadyAccepted, newAcknowledgementRange);
this.acknowledgementRanges.add(newAcknowledgementRange);
@@ -82,7 +82,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getAcknowledgementRanges()
*/
- public List<AcknowledgementRange> getAcknowledgementRanges()
+ public List<RMAcknowledgementRange> getAcknowledgementRanges()
{
return Collections.unmodifiableList(acknowledgementRanges);
}
@@ -122,7 +122,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#newAcknowledgementRange()
*/
- public AcknowledgementRange newAcknowledgementRange()
+ public RMAcknowledgementRange newAcknowledgementRange()
{
return new AcknowledgementRangeImpl();
}
@@ -220,7 +220,7 @@
throw new RMException("AcknowledgementRange or Nack must be set");
}
- private static void checkOverlap(AcknowledgementRange currentRange,
AcknowledgementRange newRange)
+ private static void checkOverlap(RMAcknowledgementRange currentRange,
RMAcknowledgementRange newRange)
{
if ((currentRange.getLower() <= newRange.getLower()) &&
(newRange.getLower() <= currentRange.getUpper()))
throw new IllegalArgumentException(
@@ -230,7 +230,7 @@
"Overlap detected: " + currentRange + " vs. " +
newRange);
}
- private static class AcknowledgementRangeImpl implements
RMSequenceAcknowledgement.AcknowledgementRange
+ private static class AcknowledgementRangeImpl implements
RMSequenceAcknowledgement.RMAcknowledgementRange
{
private long lower;
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceImpl.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceImpl.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -41,7 +41,7 @@
// internal fields
private String acksTo;
private Duration expires;
- private Offer offer;
+ private RMOffer offer;
RMCreateSequenceImpl()
{
@@ -67,7 +67,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getOffer()
*/
- public Offer getOffer()
+ public RMOffer getOffer()
{
return this.offer;
}
@@ -75,7 +75,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#newOffer()
*/
- public Offer newOffer()
+ public RMOffer newOffer()
{
return new OfferImpl();
}
@@ -109,7 +109,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setOffer(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer)
*/
- public void setOffer(Offer offer)
+ public void setOffer(RMOffer offer)
{
if (offer == null)
throw new IllegalArgumentException("Offer cannot be null");
@@ -190,7 +190,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer
*/
- private static class OfferImpl implements RMCreateSequence.Offer
+ private static class OfferImpl implements RMCreateSequence.RMOffer
{
private String endpoint;
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceResponseImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceResponseImpl.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceResponseImpl.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -41,7 +41,7 @@
// internal fields
private String identifier;
private Duration expires;
- private Accept accept;
+ private RMAccept accept;
private RMIncompleteSequenceBehavior incompleteSequenceBehavior;
RMCreateSequenceResponseImpl()
@@ -52,7 +52,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getAccept()
*/
- public Accept getAccept()
+ public RMAccept getAccept()
{
return this.accept;
}
@@ -84,7 +84,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#newAccept()
*/
- public Accept newAccept()
+ public RMAccept newAccept()
{
return new AcceptImpl();
}
@@ -92,7 +92,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setAccept(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept)
*/
- public void setAccept(Accept accept)
+ public void setAccept(RMAccept accept)
{
if (accept == null)
throw new IllegalArgumentException("Accept cannot be null");
@@ -218,7 +218,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept
*/
- private static class AcceptImpl implements RMCreateSequenceResponse.Accept
+ private static class AcceptImpl implements RMCreateSequenceResponse.RMAccept
{
private String acksTo;
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceAcknowledgementImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceAcknowledgementImpl.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceAcknowledgementImpl.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -41,7 +41,7 @@
private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
// internal fields
private final List<Long> nacks = new LinkedList<Long>();
- private final List<AcknowledgementRange> acknowledgementRanges = new
LinkedList<AcknowledgementRange>();
+ private final List<RMAcknowledgementRange> acknowledgementRanges = new
LinkedList<RMAcknowledgementRange>();
private String identifier;
private boolean isFinal;
private boolean isNone;
@@ -54,7 +54,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addAcknowledgementRange(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange)
*/
- public void addAcknowledgementRange(AcknowledgementRange newAcknowledgementRange)
+ public void addAcknowledgementRange(RMAcknowledgementRange newAcknowledgementRange)
{
if ((newAcknowledgementRange == null) || (!(newAcknowledgementRange instanceof
AcknowledgementRangeImpl)))
throw new IllegalArgumentException();
@@ -64,7 +64,7 @@
throw new IllegalStateException("There is already none specified");
if ((newAcknowledgementRange.getLower() == 0) ||
(newAcknowledgementRange.getUpper() == 0))
throw new IllegalArgumentException("Both, lower and upper values must be
specified");
- for (AcknowledgementRange alreadyAccepted : acknowledgementRanges)
+ for (RMAcknowledgementRange alreadyAccepted : acknowledgementRanges)
checkOverlap(alreadyAccepted, newAcknowledgementRange);
this.acknowledgementRanges.add(newAcknowledgementRange);
@@ -90,7 +90,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getAcknowledgementRanges()
*/
- public List<AcknowledgementRange> getAcknowledgementRanges()
+ public List<RMAcknowledgementRange> getAcknowledgementRanges()
{
return Collections.unmodifiableList(acknowledgementRanges);
}
@@ -130,7 +130,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#newAcknowledgementRange()
*/
- public AcknowledgementRange newAcknowledgementRange()
+ public RMAcknowledgementRange newAcknowledgementRange()
{
return new AcknowledgementRangeImpl();
}
@@ -242,7 +242,7 @@
throw new RMException("AcknowledgementRange or Nack or None must be
set");
}
- private static void checkOverlap(AcknowledgementRange currentRange,
AcknowledgementRange newRange)
+ private static void checkOverlap(RMAcknowledgementRange currentRange,
RMAcknowledgementRange newRange)
{
if ((currentRange.getLower() <= newRange.getLower()) &&
(newRange.getLower() <= currentRange.getUpper()))
throw new IllegalArgumentException(
@@ -252,7 +252,7 @@
"Overlap detected: " + currentRange + " vs. " +
newRange);
}
- private static class AcknowledgementRangeImpl implements
RMSequenceAcknowledgement.AcknowledgementRange
+ private static class AcknowledgementRangeImpl implements
RMSequenceAcknowledgement.RMAcknowledgementRange
{
private long lower;
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequence.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequence.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -90,25 +90,25 @@
* Factory method
* @return new instance of Offer
*/
- Offer newOffer();
+ RMOffer newOffer();
/**
* Setter
* @param offer
*/
- void setOffer(Offer offer);
+ void setOffer(RMOffer offer);
/**
* Getter
* @return offer
*/
- Offer getOffer();
+ RMOffer getOffer();
/**
* This element, if present, enables an RM Source to offer a corresponding Sequence
for the reliable
* exchange of messages Transmitted from RM Destination to RM Source.
*/
- interface Offer
+ interface RMOffer
{
/**
* The RM Source MUST set the value of this element to an absolute URI (conformant
with
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequenceResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequenceResponse.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequenceResponse.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -99,19 +99,19 @@
* Factory method
* @return new instance of accept
*/
- Accept newAccept();
+ RMAccept newAccept();
/**
* Setter
* @param accept
*/
- void setAccept(Accept accept);
+ void setAccept(RMAccept accept);
/**
* Getter
* @return accept
*/
- Accept getAccept();
+ RMAccept getAccept();
/**
* <p>This element, if present, enables an RM Destination to accept the offer of
a corresponding
@@ -121,7 +121,7 @@
* <b>CreateSequence</b> that did contain a child Offer, then the RM
Source MAY immediately reclaim
* any resources associated with the unused offered Sequence.</p>
*/
- interface Accept
+ interface RMAccept
{
/**
* <p>The RM Destination MUST include this element, of type
<b>wsa:EndpointReferenceType</b> (as
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceAcknowledgement.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceAcknowledgement.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceAcknowledgement.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -118,19 +118,19 @@
* Factory method
* @return new instance of AcknowledgementRange
*/
- AcknowledgementRange newAcknowledgementRange();
+ RMAcknowledgementRange newAcknowledgementRange();
/**
* Setter
* @param acknowledgementRange
*/
- void addAcknowledgementRange(AcknowledgementRange acknowledgementRange);
+ void addAcknowledgementRange(RMAcknowledgementRange acknowledgementRange);
/**
* Getter
* @return list of acknowledged ranges
*/
- List<AcknowledgementRange> getAcknowledgementRanges();
+ List<RMAcknowledgementRange> getAcknowledgementRanges();
/**
* The RM Destination MAY include one or more instances of this element within a
@@ -139,7 +139,7 @@
* Destination MUST NOT include this element if a sibling <b>Nack</b> or
<b>None</b> element is also present as
* a child of <b>SequenceAcknowledgement</b>.
*/
- interface AcknowledgementRange
+ interface RMAcknowledgementRange
{
/**
* The RM Destination MUST set the value of this attribute equal to the message
number of the
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/RMDeSerializationTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/RMDeSerializationTestCase.java 2007-11-30
08:23:20 UTC (rev 5153)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/RMDeSerializationTestCase.java 2007-11-30
11:01:50 UTC (rev 5154)
@@ -284,12 +284,12 @@
assertTrue(sequenceAcknowledgement.isFinal());
assertFalse(sequenceAcknowledgement.isNone());
assertEquals(sequenceAcknowledgement.getNacks().size(), 0);
- List<RMSequenceAcknowledgement.AcknowledgementRange> ranges =
sequenceAcknowledgement.getAcknowledgementRanges();
+ List<RMSequenceAcknowledgement.RMAcknowledgementRange> ranges =
sequenceAcknowledgement.getAcknowledgementRanges();
assertEquals(ranges.size(), 2);
- RMSequenceAcknowledgement.AcknowledgementRange firstRange = ranges.get(0);
+ RMSequenceAcknowledgement.RMAcknowledgementRange firstRange = ranges.get(0);
assertEquals(firstRange.getLower(), 1);
assertEquals(firstRange.getLower(), 1);
- RMSequenceAcknowledgement.AcknowledgementRange secondRange = ranges.get(1);
+ RMSequenceAcknowledgement.RMAcknowledgementRange secondRange = ranges.get(1);
assertEquals(secondRange.getLower(), 3);
assertEquals(secondRange.getLower(), 3);
}
@@ -300,11 +300,11 @@
// construct message
sequenceAcknowledgementMessage.setIdentifier("http://Business456.com...;
sequenceAcknowledgementMessage.setFinal();
- RMSequenceAcknowledgement.AcknowledgementRange firstRange =
sequenceAcknowledgementMessage.newAcknowledgementRange();
+ RMSequenceAcknowledgement.RMAcknowledgementRange firstRange =
sequenceAcknowledgementMessage.newAcknowledgementRange();
firstRange.setLower(1);
firstRange.setUpper(1);
sequenceAcknowledgementMessage.addAcknowledgementRange(firstRange);
- RMSequenceAcknowledgement.AcknowledgementRange secondRange =
sequenceAcknowledgementMessage.newAcknowledgementRange();
+ RMSequenceAcknowledgement.RMAcknowledgementRange secondRange =
sequenceAcknowledgementMessage.newAcknowledgementRange();
secondRange.setLower(3);
secondRange.setUpper(3);
sequenceAcknowledgementMessage.addAcknowledgementRange(secondRange);
@@ -365,7 +365,7 @@
// perform assertion
assertEquals(createSequenceMessage.getAcksTo(),
"http://Business456.com/serviceA/789");
assertEquals(createSequenceMessage.getExpires(),
RMHelper.stringToDuration("PT0S"));
- RMCreateSequence.Offer offer = createSequenceMessage.getOffer();
+ RMCreateSequence.RMOffer offer = createSequenceMessage.getOffer();
assertEquals(offer.getIdentifier(), "http://Business456.com/RM/ABC");
assertEquals(offer.getEndpoint(),
"http://Business456.com/serviceA/ASDF");
assertEquals(offer.getExpires(), "PT1S");
@@ -378,7 +378,7 @@
// construct message
createSequenceMessage.setAcksTo("http://Business456.com/serviceA/789...;
createSequenceMessage.setExpires(RMHelper.stringToDuration("PT0S"));
- RMCreateSequence.Offer offer = createSequenceMessage.newOffer();
+ RMCreateSequence.RMOffer offer = createSequenceMessage.newOffer();
offer.setIdentifier("http://Business456.com/RM/ABC");
offer.setEndpoint("http://Business456.com/serviceA/ASDF");
offer.setExpires("PT1S");
@@ -396,7 +396,7 @@
assertEquals(createSequenceResponseMessage.getIdentifier(),
"http://Business456.com/RM/ABC");
assertEquals(createSequenceResponseMessage.getExpires(),
RMHelper.stringToDuration("PT0S"));
assertEquals(createSequenceResponseMessage.getIncompleteSequenceBehavior(),
RMIncompleteSequenceBehavior.DISCARD_FOLLOWING_FIRST_GAP);
- RMCreateSequenceResponse.Accept accept =
createSequenceResponseMessage.getAccept();
+ RMCreateSequenceResponse.RMAccept accept =
createSequenceResponseMessage.getAccept();
assertEquals(accept.getAcksTo(),
"http://Business456.com/serviceA/ASDF");
}
@@ -407,7 +407,7 @@
createSequenceResponse.setIdentifier("http://Business456.com/RM/ABC&...;
createSequenceResponse.setExpires(RMHelper.stringToDuration("PT0S"));
createSequenceResponse.setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior.DISCARD_FOLLOWING_FIRST_GAP);
- RMCreateSequenceResponse.Accept accept = createSequenceResponse.newAccept();
+ RMCreateSequenceResponse.RMAccept accept = createSequenceResponse.newAccept();
accept.setAcksTo("http://Business456.com/serviceA/ASDF");
createSequenceResponse.setAccept(accept);
// perform assertion