Author: richard.opalka(a)jboss.com
Date: 2007-11-28 06:17:57 -0500 (Wed, 28 Nov 2007)
New Revision: 5125
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryAssurance.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryAssuranceFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryQuality.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceManager.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMException.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMProvider.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequenceType.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMConstantsImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAbstractSerializable.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAckRequestedSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceResponseSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceSerializer.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/common/serialization/RMSequenceFaultSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationRepository.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceResponseSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMConfig.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMDeliveryAssuranceConfig.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMMessageStoreConfig.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMPortConfig.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMProviderConfig.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMAckRequestedImpl.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/RMMessageFactoryImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMProviderImpl.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/spec200502/RMSequenceFaultImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMTerminateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMAckRequestedImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCloseSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCloseSequenceResponseImpl.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/RMMessageFactoryImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMProviderImpl.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/spec200702/RMSequenceFaultImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMTerminateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMTerminateSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMConstants.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMMessageFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMProvider.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMAckRequested.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCloseSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCloseSequenceResponse.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/RMIncompleteSequenceBehavior.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequence.java
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/RMSequenceFault.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceFaultCode.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSerializable.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMTerminateSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMTerminateSequenceResponse.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannel.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelRequest.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelResponse.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessage.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMTransportHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnassignedMessageListener.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssurance.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssuranceFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryQuality.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannel.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelRequest.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelResponse.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessage.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMetadata.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMUnMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/backchannel/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/ConstantsImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/Serializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/AckRequestedImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/MessageFactoryImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/ProviderImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceAcknowledgementImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceFaultImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Constants.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/MessageFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Provider.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/AckRequested.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequenceResponse.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequenceResponse.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/IncompleteSequenceBehavior.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceAcknowledgement.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFault.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFaultCode.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequenceResponse.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
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/ClientProxy.java
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.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/RMConstant.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/policy/RMPolicyAssertionDeployer.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/WSRMDeSerializationTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java
Log:
refactoring
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -54,9 +54,9 @@
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.config.EndpointProperty;
-import org.jboss.ws.extensions.wsrm.RMHelper;
-import org.jboss.ws.extensions.wsrm.RMChannel;
-import org.jboss.ws.extensions.wsrm.RMMetadata;
+import org.jboss.ws.extensions.wsrm.transport.RMChannel;
+import org.jboss.ws.extensions.wsrm.transport.RMTransportHelper;
+import org.jboss.ws.extensions.wsrm.transport.RMMetadata;
/**
* SOAPConnection implementation.
@@ -194,7 +194,7 @@
try
{
- if (RMHelper.isRMMessage(callProps))
+ if (RMTransportHelper.isRMMessage(callProps))
{
RMMetadata rmMetadata = new RMMetadata(targetAddress, oneway, marshaller,
unmarshaller, callProps, metadata, clientConfig);
return RM_CHANNEL.send(reqMessage, rmMetadata);
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-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -71,11 +71,10 @@
import org.jboss.ws.extensions.addressing.AddressingClientUtil;
import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.wsrm.RMSequenceImpl;
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.client_api.RMProvider;
-import org.jboss.ws.extensions.wsrm.client_api.RMSequence;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.api.RMProvider;
+import org.jboss.ws.extensions.wsrm.api.RMSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
import org.jboss.ws.metadata.config.Configurable;
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
@@ -289,8 +288,8 @@
}
Map<String, Object> rmRequestContext = new HashMap<String,
Object>();
List<QName> outMsgs = new LinkedList<QName>();
- outMsgs.add(Provider.get().getConstants().getSequenceQName());
- outMsgs.add(Provider.get().getConstants().getAckRequestedQName());
+
outMsgs.add(org.jboss.ws.extensions.wsrm.spi.RMProvider.get().getConstants().getSequenceQName());
+
outMsgs.add(org.jboss.ws.extensions.wsrm.spi.RMProvider.get().getConstants().getAckRequestedQName());
rmRequestContext.put(RMConstant.PROTOCOL_MESSAGES, outMsgs);
rmRequestContext.put(RMConstant.SEQUENCE_REFERENCE, wsrmSequence);
reqContext.put(RMConstant.REQUEST_CONTEXT, rmRequestContext);
@@ -515,7 +514,7 @@
Map requestContext = getBindingProvider().getRequestContext();
requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
addressingProps);
// set up wsrm request context
- QName createSequenceQN =
Provider.get().getConstants().getCreateSequenceQName();
+ QName createSequenceQN =
org.jboss.ws.extensions.wsrm.spi.RMProvider.get().getConstants().getCreateSequenceQName();
Map rmRequestContext = new HashMap();
List outMsgs = new LinkedList();
outMsgs.add(createSequenceQN);
@@ -525,7 +524,7 @@
invoke(createSequenceQN, new Object[] {},
getBindingProvider().getResponseContext());
// read WSRM sequence id from response context
Map rmResponseContext =
(Map)getBindingProvider().getResponseContext().get(RMConstant.RESPONSE_CONTEXT);
- String id =
((CreateSequenceResponse)((Map)rmResponseContext.get(RMConstant.PROTOCOL_MESSAGES_MAPPING)).get(Provider.get().getConstants().getCreateSequenceResponseQName())).getIdentifier();
+ String id =
((RMCreateSequenceResponse)((Map)rmResponseContext.get(RMConstant.PROTOCOL_MESSAGES_MAPPING)).get(org.jboss.ws.extensions.wsrm.spi.RMProvider.get().getConstants().getCreateSequenceResponseQName())).getIdentifier();
return this.wsrmSequence = new RMSequenceImpl(this, id, backPort);
}
catch (Exception e)
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -48,7 +48,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.StubExt;
-import org.jboss.ws.extensions.wsrm.client_api.RMProvider;
+import org.jboss.ws.extensions.wsrm.api.RMProvider;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.wsf.common.JavaUtils;
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -57,7 +57,7 @@
import org.jboss.ws.core.jaxws.client.DispatchImpl;
import org.jboss.ws.core.jaxws.client.ServiceObjectFactoryJAXWS;
import org.jboss.ws.core.jaxws.handler.HandlerResolverImpl;
-import org.jboss.ws.extensions.wsrm.client_api.RMProvider;
+import org.jboss.ws.extensions.wsrm.api.RMProvider;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssurance.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssurance.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssurance.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm;
-
-/**
- * Represents message delivery assurance
- *
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.DeliveryAssuranceFactory
- */
-public interface DeliveryAssurance
-{
-
- /**
- * Returns associated message delivery assurance
- * @return non null delivery assurance object
- */
- DeliveryQuality getDeliveryQuality();
-
- /**
- * Specifies whether messages are to be delivered in order to the service instance or
client proxy
- * @return <b>true</b> if in order delivery is required,
<b>false</b> otherwise
- */
- boolean inOrder();
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssuranceFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssuranceFactory.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssuranceFactory.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,154 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.jboss.ws.extensions.wsrm;
-
-/**
- * Encapsulates generation of reliable messaging quality assurance configurations
- *
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.DeliveryQuality
- */
-public final class DeliveryAssuranceFactory
-{
-
- private static final DeliveryAssuranceFactory INSTANCE = new
DeliveryAssuranceFactory();
- private static final String[] ACCEPTABLE_IN_ORDER_VALUES = { "0",
"1", "false", "true" };
- private static final DeliveryAssurance EXACTLY_ONCE_WITH_ORDER;
- private static final DeliveryAssurance EXACTLY_ONCE_WITHOUT_ORDER;
- private static final DeliveryAssurance AT_MOST_ONCE_WITH_ORDER;
- private static final DeliveryAssurance AT_MOST_ONCE_WITHOUT_ORDER;
- private static final DeliveryAssurance AT_LEAST_ONCE_WITH_ORDER;
- private static final DeliveryAssurance AT_LEAST_ONCE_WITHOUT_ORDER;
-
- static
- {
- EXACTLY_ONCE_WITH_ORDER = new DeliveryAssuranceImpl(DeliveryQuality.EXACTLY_ONCE,
true);
- EXACTLY_ONCE_WITHOUT_ORDER = new
DeliveryAssuranceImpl(DeliveryQuality.EXACTLY_ONCE, false);
- AT_MOST_ONCE_WITH_ORDER = new DeliveryAssuranceImpl(DeliveryQuality.AT_MOST_ONCE,
true);
- AT_MOST_ONCE_WITHOUT_ORDER = new
DeliveryAssuranceImpl(DeliveryQuality.AT_MOST_ONCE, false);
- AT_LEAST_ONCE_WITH_ORDER = new DeliveryAssuranceImpl(DeliveryQuality.AT_LEAST_ONCE,
true);
- AT_LEAST_ONCE_WITHOUT_ORDER = new
DeliveryAssuranceImpl(DeliveryQuality.AT_LEAST_ONCE, false);
- }
-
- // immutable object instance
- private static final class DeliveryAssuranceImpl implements DeliveryAssurance
- {
-
- private final DeliveryQuality quality;
- private final boolean inOrder;
-
- private DeliveryAssuranceImpl(DeliveryQuality quality, boolean inOrder)
- {
- this.quality = quality;
- this.inOrder = inOrder;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.DeliveryAssurance#getDeliveryQuality()
- */
- public DeliveryQuality getDeliveryQuality()
- {
- return quality;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.DeliveryAssurance#inOrder()
- */
- public boolean inOrder()
- {
- return inOrder;
- }
-
- }
-
- private DeliveryAssuranceFactory()
- {
- // no instances
- }
-
- /**
- * Factory getter
- * @return factory instance
- */
- public static DeliveryAssuranceFactory getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Returns constructed DeliveryAssurance object
- * @param quality string representing quality value
- * @param inOrder string representing inOrder value
- * @return DeliveryAssurance object
- * @throws IllegalArgumentException if <b>quality</b> or
<b>inOrder</b> are null or contain incorrect values
- */
- public static DeliveryAssurance getDeliveryAssurance(String quality, String inOrder)
- {
- if ((quality == null) || (inOrder == null))
- throw new IllegalArgumentException("Neither quality nor inOrder parameter
cannot be null");
-
- Boolean inOrderBoolean = null;
- for (int i = 0; i < ACCEPTABLE_IN_ORDER_VALUES.length; i++)
- {
- if (ACCEPTABLE_IN_ORDER_VALUES[i].equals(inOrder))
- {
- inOrderBoolean = (i % 2 == 0) ? Boolean.FALSE : Boolean.TRUE;
- break;
- }
- }
-
- if (inOrderBoolean == null)
- throw new IllegalArgumentException("Incorrect inOrder value: " +
inOrder);
-
- return getDeliveryAssurance(DeliveryQuality.parseDeliveryQuality(quality),
inOrderBoolean);
- }
-
- /**
- * Returns constructed DeliveryAssurance object
- * @param quality object representing required quality
- * @param inOrder string representing required inOrder value
- * @return DeliveryAssurance object
- * @throws IllegalArgumentException if <b>quality</b> is null
- */
- public static DeliveryAssurance getDeliveryAssurance(DeliveryQuality quality, boolean
inOrder)
- {
- if (quality == null)
- throw new IllegalArgumentException("Quality cannot be null");
-
- if (inOrder)
- {
- if (quality == DeliveryQuality.EXACTLY_ONCE) return EXACTLY_ONCE_WITH_ORDER;
- if (quality == DeliveryQuality.AT_LEAST_ONCE) return AT_LEAST_ONCE_WITH_ORDER;
- if (quality == DeliveryQuality.AT_MOST_ONCE) return AT_MOST_ONCE_WITH_ORDER;
- }
- else
- {
- if (quality == DeliveryQuality.EXACTLY_ONCE) return EXACTLY_ONCE_WITHOUT_ORDER;
- if (quality == DeliveryQuality.AT_LEAST_ONCE) return
AT_LEAST_ONCE_WITHOUT_ORDER;
- if (quality == DeliveryQuality.AT_MOST_ONCE) return AT_MOST_ONCE_WITHOUT_ORDER;
- }
-
- return null; // never happens
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryQuality.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryQuality.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryQuality.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,89 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm;
-
-/**
- * Represents message delivery quality
- *
- * @author richard.opalka(a)jboss.com
- */
-public enum DeliveryQuality
-{
-
- /**
- * Each message is to be delivered at most once. The RM Source MAY retry transmission
of
- * unacknowledged messages, but is NOT REQUIRED to do so. The requirement on the RM
- * Destination is that it MUST filter out duplicate messages, i.e. that it MUST NOT
- * deliver a duplicate of a message that has already been delivered.
- */
- AT_MOST_ONCE("AtMostOnce"),
-
- /**
- * Each message is to be delivered exactly once; if a message cannot be delivered then
an error
- * MUST be raised by the RM Source and/or RM Destination. The requirement on an RM
Source is
- * that it SHOULD retry transmission of every message sent by the Application Source
until it
- * receives an acknowledgement from the RM Destination. The requirement on the RM
Destination
- * is that it SHOULD retry the transfer to the Application Destination of any message
that it
- * accepts from the RM Source until that message has been successfully delivered, and
that it
- * MUST NOT deliver a duplicate of a message that has already been delivered.
- */
- AT_LEAST_ONCE("AtLeastOnce"),
-
- /**
- * Each message is to be delivered at least once, or else an error MUST be raised by
the RM
- * Source and/or RM Destination. The requirement on an RM Source is that it SHOULD
retry
- * transmission of every message sent by the Application Source until it receives an
- * acknowledgement from the RM Destination. The requirement on the RM Destination is
that it
- * SHOULD retry the transfer to the Application Destination of any message that it
accepts
- * from the RM Source, until that message has been successfully delivered. There is
no
- * requirement for the RM Destination to apply duplicate message filtering.
- */
- EXACTLY_ONCE("ExactlyOnce");
-
- // associated string representation
- private final String quality;
-
- DeliveryQuality(String quality)
- {
- this.quality = quality;
- }
-
- /**
- * Returns associated constant with passed <b>quality</b> string. Note
this method is case sensitive.
- * Allowed values are: <b>AtMostOnce</b>, <b>AtLeastOnce</b>,
<b>ExactlyOnce</b>.
- * @param quality to be parsed
- * @return associated constant
- * @throws IllegalArgumentException if <b>quality</b> string has no
associated enumeration value
- */
- public static DeliveryQuality parseDeliveryQuality(String quality)
- {
- if (AT_MOST_ONCE.quality.equals(quality))
- return AT_MOST_ONCE;
- if (AT_LEAST_ONCE.quality.equals(quality))
- return AT_LEAST_ONCE;
- if (EXACTLY_ONCE.quality.equals(quality))
- return EXACTLY_ONCE;
-
- throw new IllegalArgumentException("Unrecognized string: " + quality);
- }
-
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannel.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannel.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannel.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,137 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm;
-
-import static org.jboss.ws.extensions.wsrm.RMConstant.*;
-
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.ws.core.MessageAbstraction;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.ByteArrayOutputStream;
-
-import java.util.Map;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * RM Channel
- * @author richard.opalka(a)jboss.com
- */
-public class RMChannel
-{
- private static final RMChannel INSTANCE = new RMChannel();
-
- private RMChannel()
- {
- // forbidden inheritance
- }
-
- public static RMChannel getInstance()
- {
- return INSTANCE;
- }
-
- // Holds the list of tasks that will be send to the remoting transport channel
- private static final ExecutorService rmChannelPool = Executors.newFixedThreadPool(5,
new RMThreadFactory());
-
- private static final class RMThreadFactory implements ThreadFactory
- {
- final ThreadGroup group;
- final AtomicInteger threadNumber = new AtomicInteger(1);
- final String namePrefix = "rm-pool-thread-";
-
- private RMThreadFactory()
- {
- SecurityManager sm = System.getSecurityManager();
- group = (sm != null) ? sm.getThreadGroup() :
Thread.currentThread().getThreadGroup();
- }
-
- public Thread newThread(Runnable r)
- {
- Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(),
0);
- if (t.isDaemon())
- t.setDaemon(false);
- if (t.getPriority() != Thread.NORM_PRIORITY)
- t.setPriority(Thread.NORM_PRIORITY);
- return t;
- }
- }
-
- private RMMessage createRMMessage(MessageAbstraction request, RMMetadata rmMetadata)
throws Throwable
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- Marshaller marshaller =
(Marshaller)rmMetadata.getContext(SERIALIZATION_CONTEXT).get(MARSHALLER);
- // we have to serialize message before putting it to the rm pool
- // * contextClassloader not serializable issue
- // * DOMUtil threadlocal issue (if message is de/serialized in separate thread)
- marshaller.write(request, baos);
- RMMessage rmMessage = RMMessageFactory.newMessage(baos.toByteArray(), rmMetadata);
- return rmMessage;
- }
-
- private MessageAbstraction createResponse(RMMessage rmResponse, RMMetadata rmMetadata)
throws Throwable
- {
- Map<String, Object> invocationContext =
rmMetadata.getContext(INVOCATION_CONTEXT);
- boolean oneWay =
(Boolean)rmMetadata.getContext(INVOCATION_CONTEXT).get(ONE_WAY_OPERATION);
- MessageAbstraction response = null;
- //if (!oneWay)
- {
- byte[] payload = rmResponse.getPayload();
- InputStream is = payload == null ? null : new
ByteArrayInputStream(rmResponse.getPayload());
- // we have to deserialize message after pick up from the rm pool
- // * contextClassloader not serializable issue
- // * DOMUtil threadlocal issue (if message is de/serialized in separate
thread)
- UnMarshaller unmarshaller =
(UnMarshaller)rmMetadata.getContext(SERIALIZATION_CONTEXT).get(UNMARSHALLER);
- response = (MessageAbstraction)unmarshaller.read(is,
rmResponse.getMetadata().getContext(REMOTING_INVOCATION_CONTEXT));
- }
- invocationContext.clear();
- invocationContext.putAll(rmMetadata.getContext(REMOTING_INVOCATION_CONTEXT));
- return response;
- }
-
- public MessageAbstraction send(MessageAbstraction request, RMMetadata rmMetadata)
throws Throwable
- {
- RMMessage rmRequest = createRMMessage(request, rmMetadata);
- RMMessage rmResponse = sendToChannel(rmRequest);
- return createResponse(rmResponse, rmMetadata);
- }
-
- private RMMessage sendToChannel(RMMessage request) throws Throwable
- {
- RMChannelResponse result = rmChannelPool.submit(new
RMChannelRequest(request)).get();
-
- Throwable fault = result.getFault();
- if (fault != null)
- {
- throw fault;
- }
- else
- {
- return result.getResponse();
- }
- }
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelRequest.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelRequest.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelRequest.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,145 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm;
-
-import static org.jboss.ws.extensions.wsrm.RMConstant.*;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.callback.Callback;
-import org.jboss.remoting.callback.HandleCallbackException;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
-import org.jboss.ws.core.MessageTrace;
-import org.jboss.ws.extensions.wsrm.backchannel.CallbackHandler;
-import org.jboss.ws.extensions.wsrm.backchannel.CallbackHandlerFactory;
-import org.jboss.ws.extensions.wsrm.backchannel.RMBackPortsServer;
-import org.jboss.ws.extensions.wsrm.backchannel.RMCallbackHandler;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-/**
- * Represents request that goes to the RM channel
- * @see org.jboss.ws.extensions.wsrm.RMChannel
- * @author richard.opalka(a)jboss.com
- */
-public final class RMChannelRequest implements Callable<RMChannelResponse>
-{
- private static final Logger log = Logger.getLogger(RMChannelRequest.class);
- private static final String JBOSSWS_SUBSYSTEM = "jbossws";
- private final RMMessage rmRequest;
-
- RMChannelRequest(RMMessage rmRequest)
- {
- super();
- this.rmRequest = rmRequest;
- }
-
-
-
- public void handleCallback(Callback callback)
- throws HandleCallbackException
- {
- System.out.println("Handling callback: " + callback);
- // TODO: implement this method
- }
-
- public RMChannelResponse call()
- {
- InvokerLocator locator = null;
- try
- {
- locator = new
InvokerLocator((String)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT).get(TARGET_ADDRESS));
- }
- catch (MalformedURLException e)
- {
- return new RMChannelResponse(new IllegalArgumentException("Malformed
endpoint address", e));
- }
-
- try
- {
- Client client = new Client(locator, JBOSSWS_SUBSYSTEM,
rmRequest.getMetadata().getContext(REMOTING_CONFIGURATION_CONTEXT));
- client.connect();
-
- client.setMarshaller(RMMarshaller.getInstance());
-
- URI backPort = RMHelper.getBackPortURI(rmRequest);
- String messageId = RMHelper.getMessageId(rmRequest);
-
- System.out.println("[WS-RM] backport URI is: " + backPort);
- CallbackHandler callbackHandler = null;
- // TODO: we should remember WSA:MessageId here too
-
- if (backPort != null)
- {
- callbackHandler = CallbackHandlerFactory.getCallbackHandler(backPort);
- // TODO: callback must unregister itself
- // TODO: you must call unregister callback as well
- }
- boolean oneWay = RMHelper.isOneWayOperation(rmRequest) && (backPort ==
null); // TODO: backport support
- if (!oneWay)
- client.setUnMarshaller(RMUnMarshaller.getInstance());
-
- Map<String, Object> remotingInvocationContext =
rmRequest.getMetadata().getContext(REMOTING_INVOCATION_CONTEXT);
- if (log.isDebugEnabled())
- log.debug("Remoting metadata: " + remotingInvocationContext);
-
- // debug the outgoing request message
- MessageTrace.traceMessage("Outgoing RM Request Message",
rmRequest.getPayload());
-
- RMMessage rmResponse = null;
- if (oneWay)
- {
- client.invokeOneway(rmRequest.getPayload(), remotingInvocationContext,
false);
- }
- else
- {
- rmResponse = (RMMessage)client.invoke(rmRequest.getPayload(),
remotingInvocationContext);
- }
-
- // Disconnect the remoting client
- client.disconnect();
-
- // trace the incomming response message
- if (rmResponse != null)
- MessageTrace.traceMessage("Incoming RM Response Message",
rmResponse.getPayload());
-
- if (backPort != null) // TODO: backport support
- {
- return new RMChannelResponse(callbackHandler, messageId);
- }
-
- return new RMChannelResponse(rmResponse);
- }
- catch (Throwable t)
- {
- return new RMChannelResponse(t);
- }
- }
-}
\ No newline at end of file
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelResponse.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelResponse.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm;
-
-import org.jboss.ws.extensions.wsrm.backchannel.CallbackHandler;
-
-/**
- * Represents response that goes from the RM channel
- * @see org.jboss.ws.extensions.wsrm.RMChannel
- * @author richard.opalka(a)jboss.com
- */
-final class RMChannelResponse
-{
- private final Throwable fault;
- private final RMMessage result;
- private final CallbackHandler callback;
- private final String messageId; // WS-Addressing: MessageID
-
- public RMChannelResponse(CallbackHandler callback, String messageId)
- {
- this(null, null, callback, messageId);
- }
-
- public RMChannelResponse(Throwable fault)
- {
- this(null, fault, null, null);
- }
-
- public RMChannelResponse(RMMessage result)
- {
- this(result, null, null, null);
- }
-
- private RMChannelResponse(RMMessage result, Throwable fault, CallbackHandler callback,
String messageId)
- {
- super();
- this.result = result;
- this.fault = fault;
- this.callback = callback;
- this.messageId = messageId;
- }
-
- public Throwable getFault()
- {
- return (this.callback != null) ? this.callback.getFault(this.messageId) :
this.fault;
- }
-
- public RMMessage getResponse()
- {
- return (this.callback != null) ? this.callback.getMessage(this.messageId) :
this.result;
- }
-}
\ No newline at end of file
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-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -21,9 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm;
-import java.util.Collections;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -40,21 +38,20 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.MessageFactory;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
+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.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+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.extensions.wsrm.spi.protocol.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
/**
* TODO: add comment
@@ -67,8 +64,8 @@
public final class RMClientHandler extends GenericSOAPHandler
{
private static final Logger log = Logger.getLogger(RMClientHandler.class);
- private static final MessageFactory rmFactory = Provider.get().getMessageFactory();
- private static final Constants rmConstants = Provider.get().getConstants();
+ private static final RMMessageFactory rmFactory =
RMProvider.get().getMessageFactory();
+ private static final RMConstants rmConstants = RMProvider.get().getConstants();
private static final Set headers = RMConstant.PROTOCOL_OPERATION_QNAMES;
public Set getHeaders()
@@ -87,8 +84,9 @@
Map rmRequestContext = (Map)commonMsgContext.get(RMConstant.REQUEST_CONTEXT);
List<QName> outMsgs =
(List<QName>)rmRequestContext.get(RMConstant.PROTOCOL_MESSAGES);
- Map<QName, Serializable> data = new HashMap<QName, Serializable>();
- rmRequestContext.put(RMConstant.WSA_MESSAGE_ID,
addrProps.getMessageID().getURI().toString());
+ Map<QName, RMSerializable> data = new HashMap<QName,
RMSerializable>();
+ String optionalMessageId = (addrProps.getMessageID() != null) ?
addrProps.getMessageID().getURI().toString() : null;
+ rmRequestContext.put(RMConstant.WSA_MESSAGE_ID, optionalMessageId);
rmRequestContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
SOAPMessage soapMessage = ((SOAPMessageContext)commonMsgContext).getMessage();
@@ -97,7 +95,7 @@
{
// try to serialize CreateSequence to message
String replyTo = addrProps.getReplyTo().getAddress().getURI().toString();
- CreateSequence createSequence = rmFactory.newCreateSequence();
+ RMCreateSequence createSequence = rmFactory.newCreateSequence();
createSequence.setAcksTo(replyTo);
createSequence.serializeTo(soapMessage);
data.put(msgQName, createSequence);
@@ -109,8 +107,8 @@
{
// try to serialize Sequence to message
RMSequenceImpl sequenceImpl =
(RMSequenceImpl)rmRequestContext.get(RMConstant.SEQUENCE_REFERENCE);
- Sequence sequence = rmFactory.newSequence();
- sequence.setIdentifier(sequenceImpl.getId());
+ RMSequence sequence = rmFactory.newSequence();
+ sequence.setIdentifier(sequenceImpl.getOutboundId());
sequence.setMessageNumber(sequenceImpl.newMessageNumber());
sequence.serializeTo(soapMessage);
data.put(msgQName, sequence);
@@ -122,8 +120,8 @@
{
// try to serialize AckRequested to message
RMSequenceImpl sequenceImpl =
(RMSequenceImpl)rmRequestContext.get(RMConstant.SEQUENCE_REFERENCE);
- AckRequested ackRequested = rmFactory.newAckRequested();
- ackRequested.setIdentifier(sequenceImpl.getId());
+ RMAckRequested ackRequested = rmFactory.newAckRequested();
+ ackRequested.setIdentifier(sequenceImpl.getOutboundId());
ackRequested.setMessageNumber(sequenceImpl.getLastMessageNumber());
ackRequested.serializeTo(soapMessage);
data.put(msgQName, ackRequested);
@@ -135,8 +133,8 @@
{
// try to serialize CloseSequence to message
RMSequenceImpl sequenceImpl =
(RMSequenceImpl)rmRequestContext.get(RMConstant.SEQUENCE_REFERENCE);
- CloseSequence closeSequence = rmFactory.newCloseSequence();
- closeSequence.setIdentifier(sequenceImpl.getId());
+ RMCloseSequence closeSequence = rmFactory.newCloseSequence();
+ closeSequence.setIdentifier(sequenceImpl.getOutboundId());
closeSequence.setLastMsgNumber(sequenceImpl.getLastMessageNumber());
closeSequence.serializeTo(soapMessage);
data.put(msgQName, closeSequence);
@@ -148,8 +146,8 @@
{
// try to serialize CloseSequenceResponse to message
RMSequenceImpl sequenceImpl =
(RMSequenceImpl)rmRequestContext.get(RMConstant.SEQUENCE_REFERENCE);
- CloseSequenceResponse closeSequenceResponse =
rmFactory.newCloseSequenceResponse();
- closeSequenceResponse.setIdentifier(sequenceImpl.getId());
+ RMCloseSequenceResponse closeSequenceResponse =
rmFactory.newCloseSequenceResponse();
+ closeSequenceResponse.setIdentifier(sequenceImpl.getOutboundId());
data.put(msgQName, closeSequenceResponse);
log.debug(msgQName.getLocalPart() + " WSRM message was serialized to
payload");
}
@@ -159,8 +157,8 @@
{
// try to serialize TerminateSequence to message
RMSequenceImpl sequenceImpl =
(RMSequenceImpl)rmRequestContext.get(RMConstant.SEQUENCE_REFERENCE);
- TerminateSequence terminateSequence = rmFactory.newTerminateSequence();
- terminateSequence.setIdentifier(sequenceImpl.getId());
+ RMTerminateSequence terminateSequence = rmFactory.newTerminateSequence();
+ terminateSequence.setIdentifier(sequenceImpl.getOutboundId());
terminateSequence.setLastMsgNumber(sequenceImpl.getLastMessageNumber());
terminateSequence.serializeTo(soapMessage);
data.put(msgQName, terminateSequence);
@@ -172,13 +170,14 @@
{
// try to serialize terminateSequenceResponse to message
RMSequenceImpl sequenceImpl =
(RMSequenceImpl)rmRequestContext.get(RMConstant.SEQUENCE_REFERENCE);
- TerminateSequenceResponse terminateSequenceResponse =
rmFactory.newTerminateSequenceResponse();
- terminateSequenceResponse.setIdentifier(sequenceImpl.getId());
+ RMTerminateSequenceResponse terminateSequenceResponse =
rmFactory.newTerminateSequenceResponse();
+ terminateSequenceResponse.setIdentifier(sequenceImpl.getOutboundId());
data.put(msgQName, terminateSequenceResponse);
log.debug(msgQName.getLocalPart() + " WSRM message was serialized to
payload");
}
// TODO: implement SequenceAcknowledgement handler part
+ // TODO: implement SequenceFault serialization
return true;
}
@@ -191,7 +190,7 @@
Map rmResponseContext = new HashMap();
List<QName> messages = new LinkedList<QName>();
rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES, messages);
- Map<QName, Serializable> data = new HashMap<QName, Serializable>();
+ Map<QName, RMSerializable> data = new HashMap<QName,
RMSerializable>();
rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
msgContext.put(RMConstant.RESPONSE_CONTEXT, rmResponseContext);
msgContext.setScope(RMConstant.RESPONSE_CONTEXT, Scope.APPLICATION);
@@ -200,7 +199,7 @@
{
// try to deserialize CreateSequenceResponse from message
QName msgQName = rmConstants.getCreateSequenceResponseQName();
- CreateSequenceResponse wsrmMsg = rmFactory.newCreateSequenceResponse();
+ RMCreateSequenceResponse wsrmMsg = rmFactory.newCreateSequenceResponse();
wsrmMsg.deserializeFrom(soapMessage);
messages.add(msgQName);
data.put(msgQName, wsrmMsg);
@@ -212,7 +211,7 @@
{
// try to deserialize AckRequested from message
QName msgQName = rmConstants.getAckRequestedQName();
- AckRequested wsrmMsg = rmFactory.newAckRequested();
+ RMAckRequested wsrmMsg = rmFactory.newAckRequested();
wsrmMsg.deserializeFrom(soapMessage);
messages.add(msgQName);
data.put(msgQName, wsrmMsg);
@@ -224,7 +223,7 @@
{
// try to deserialize Sequence from message
QName msgQName = rmConstants.getSequenceQName();
- Sequence wsrmMsg = rmFactory.newSequence();
+ RMSequence wsrmMsg = rmFactory.newSequence();
wsrmMsg.deserializeFrom(soapMessage);
messages.add(msgQName);
data.put(msgQName, wsrmMsg);
@@ -236,7 +235,7 @@
{
// try to deserialize SequenceAcknowledgement from message
QName msgQName = rmConstants.getSequenceAcknowledgementQName();
- SequenceAcknowledgement wsrmMsg = rmFactory.newSequenceAcknowledgement();
+ RMSequenceAcknowledgement wsrmMsg = rmFactory.newSequenceAcknowledgement();
wsrmMsg.deserializeFrom(soapMessage);
messages.add(msgQName);
data.put(msgQName, wsrmMsg);
@@ -248,7 +247,7 @@
{
// try to deserialize CloseSequence from message
QName msgQName = rmConstants.getCloseSequenceQName();
- CloseSequence wsrmMsg = rmFactory.newCloseSequence();
+ RMCloseSequence wsrmMsg = rmFactory.newCloseSequence();
wsrmMsg.deserializeFrom(soapMessage);
messages.add(msgQName);
data.put(msgQName, wsrmMsg);
@@ -260,7 +259,7 @@
{
// try to deserialize CloseSequence from message
QName msgQName = rmConstants.getCloseSequenceResponseQName();
- CloseSequenceResponse wsrmMsg = rmFactory.newCloseSequenceResponse();
+ RMCloseSequenceResponse wsrmMsg = rmFactory.newCloseSequenceResponse();
wsrmMsg.deserializeFrom(soapMessage);
messages.add(msgQName);
data.put(msgQName, wsrmMsg);
@@ -272,7 +271,7 @@
{
// try to deserialize TerminateSequence from message
QName msgQName = rmConstants.getTerminateSequenceQName();
- TerminateSequence wsrmMsg = rmFactory.newTerminateSequence();
+ RMTerminateSequence wsrmMsg = rmFactory.newTerminateSequence();
wsrmMsg.deserializeFrom(soapMessage);
messages.add(msgQName);
data.put(msgQName, wsrmMsg);
@@ -284,7 +283,7 @@
{
// try to deserialize TerminateSequenceResponse from message
QName msgQName = rmConstants.getTerminateSequenceResponseQName();
- TerminateSequenceResponse wsrmMsg = rmFactory.newTerminateSequenceResponse();
+ RMTerminateSequenceResponse wsrmMsg = rmFactory.newTerminateSequenceResponse();
wsrmMsg.deserializeFrom(soapMessage);
messages.add(msgQName);
data.put(msgQName, wsrmMsg);
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -9,8 +9,8 @@
import javax.xml.namespace.QName;
import javax.xml.ws.addressing.AddressingBuilder;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
public final class RMConstant
{
@@ -41,7 +41,7 @@
static
{
Set<QName> temp = new HashSet<QName>();
- Constants constants = Provider.get().getConstants();
+ RMConstants constants = RMProvider.get().getConstants();
temp.add(constants.getSequenceQName());
temp.add(constants.getSequenceFaultQName());
temp.add(constants.getAcknowledgementRangeQName());
@@ -53,9 +53,9 @@
temp.add(constants.getTerminateSequenceQName());
temp.add(constants.getTerminateSequenceResponseQName());
PROTOCOL_OPERATION_QNAMES = Collections.unmodifiableSet(temp);
- CREATE_SEQUENCE_WSA_ACTION = Provider.get().getConstants().getNamespaceURI() +
"/CreateSequence";
- CLOSE_SEQUENCE_WSA_ACTION = Provider.get().getConstants().getNamespaceURI() +
"/CloseSequence";
- TERMINATE_SEQUENCE_WSA_ACTION = Provider.get().getConstants().getNamespaceURI() +
"/TerminateSequence";
+ CREATE_SEQUENCE_WSA_ACTION = RMProvider.get().getConstants().getNamespaceURI() +
"/CreateSequence";
+ CLOSE_SEQUENCE_WSA_ACTION = RMProvider.get().getConstants().getNamespaceURI() +
"/CloseSequence";
+ TERMINATE_SEQUENCE_WSA_ACTION = RMProvider.get().getConstants().getNamespaceURI() +
"/TerminateSequence";
}
private RMConstant()
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryAssurance.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryAssurance.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryAssurance.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm;
+
+/**
+ * Represents message delivery assurance
+ *
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.RMDeliveryAssuranceFactory
+ */
+public interface RMDeliveryAssurance
+{
+
+ /**
+ * Returns associated message delivery assurance
+ * @return non null delivery assurance object
+ */
+ RMDeliveryQuality getDeliveryQuality();
+
+ /**
+ * Specifies whether messages are to be delivered in order to the service instance or
client proxy
+ * @return <b>true</b> if in order delivery is required,
<b>false</b> otherwise
+ */
+ boolean inOrder();
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryAssurance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryAssuranceFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryAssuranceFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryAssuranceFactory.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.ws.extensions.wsrm;
+
+/**
+ * Encapsulates generation of reliable messaging quality assurance configurations
+ *
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.RMDeliveryQuality
+ */
+public final class RMDeliveryAssuranceFactory
+{
+
+ private static final RMDeliveryAssuranceFactory INSTANCE = new
RMDeliveryAssuranceFactory();
+ private static final String[] ACCEPTABLE_IN_ORDER_VALUES = { "0",
"1", "false", "true" };
+ private static final RMDeliveryAssurance EXACTLY_ONCE_WITH_ORDER;
+ private static final RMDeliveryAssurance EXACTLY_ONCE_WITHOUT_ORDER;
+ private static final RMDeliveryAssurance AT_MOST_ONCE_WITH_ORDER;
+ private static final RMDeliveryAssurance AT_MOST_ONCE_WITHOUT_ORDER;
+ private static final RMDeliveryAssurance AT_LEAST_ONCE_WITH_ORDER;
+ private static final RMDeliveryAssurance AT_LEAST_ONCE_WITHOUT_ORDER;
+
+ static
+ {
+ EXACTLY_ONCE_WITH_ORDER = new DeliveryAssuranceImpl(RMDeliveryQuality.EXACTLY_ONCE,
true);
+ EXACTLY_ONCE_WITHOUT_ORDER = new
DeliveryAssuranceImpl(RMDeliveryQuality.EXACTLY_ONCE, false);
+ AT_MOST_ONCE_WITH_ORDER = new DeliveryAssuranceImpl(RMDeliveryQuality.AT_MOST_ONCE,
true);
+ AT_MOST_ONCE_WITHOUT_ORDER = new
DeliveryAssuranceImpl(RMDeliveryQuality.AT_MOST_ONCE, false);
+ AT_LEAST_ONCE_WITH_ORDER = new
DeliveryAssuranceImpl(RMDeliveryQuality.AT_LEAST_ONCE, true);
+ AT_LEAST_ONCE_WITHOUT_ORDER = new
DeliveryAssuranceImpl(RMDeliveryQuality.AT_LEAST_ONCE, false);
+ }
+
+ // immutable object instance
+ private static final class DeliveryAssuranceImpl implements RMDeliveryAssurance
+ {
+
+ private final RMDeliveryQuality quality;
+ private final boolean inOrder;
+
+ private DeliveryAssuranceImpl(RMDeliveryQuality quality, boolean inOrder)
+ {
+ this.quality = quality;
+ this.inOrder = inOrder;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.DeliveryAssurance#getDeliveryQuality()
+ */
+ public RMDeliveryQuality getDeliveryQuality()
+ {
+ return quality;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.DeliveryAssurance#inOrder()
+ */
+ public boolean inOrder()
+ {
+ return inOrder;
+ }
+
+ }
+
+ private RMDeliveryAssuranceFactory()
+ {
+ // no instances
+ }
+
+ /**
+ * Factory getter
+ * @return factory instance
+ */
+ public static RMDeliveryAssuranceFactory getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Returns constructed DeliveryAssurance object
+ * @param quality string representing quality value
+ * @param inOrder string representing inOrder value
+ * @return DeliveryAssurance object
+ * @throws IllegalArgumentException if <b>quality</b> or
<b>inOrder</b> are null or contain incorrect values
+ */
+ public static RMDeliveryAssurance getDeliveryAssurance(String quality, String
inOrder)
+ {
+ if ((quality == null) || (inOrder == null))
+ throw new IllegalArgumentException("Neither quality nor inOrder parameter
cannot be null");
+
+ Boolean inOrderBoolean = null;
+ for (int i = 0; i < ACCEPTABLE_IN_ORDER_VALUES.length; i++)
+ {
+ if (ACCEPTABLE_IN_ORDER_VALUES[i].equals(inOrder))
+ {
+ inOrderBoolean = (i % 2 == 0) ? Boolean.FALSE : Boolean.TRUE;
+ break;
+ }
+ }
+
+ if (inOrderBoolean == null)
+ throw new IllegalArgumentException("Incorrect inOrder value: " +
inOrder);
+
+ return getDeliveryAssurance(RMDeliveryQuality.parseDeliveryQuality(quality),
inOrderBoolean);
+ }
+
+ /**
+ * Returns constructed DeliveryAssurance object
+ * @param quality object representing required quality
+ * @param inOrder string representing required inOrder value
+ * @return DeliveryAssurance object
+ * @throws IllegalArgumentException if <b>quality</b> is null
+ */
+ public static RMDeliveryAssurance getDeliveryAssurance(RMDeliveryQuality quality,
boolean inOrder)
+ {
+ if (quality == null)
+ throw new IllegalArgumentException("Quality cannot be null");
+
+ if (inOrder)
+ {
+ if (quality == RMDeliveryQuality.EXACTLY_ONCE) return EXACTLY_ONCE_WITH_ORDER;
+ if (quality == RMDeliveryQuality.AT_LEAST_ONCE) return
AT_LEAST_ONCE_WITH_ORDER;
+ if (quality == RMDeliveryQuality.AT_MOST_ONCE) return AT_MOST_ONCE_WITH_ORDER;
+ }
+ else
+ {
+ if (quality == RMDeliveryQuality.EXACTLY_ONCE) return
EXACTLY_ONCE_WITHOUT_ORDER;
+ if (quality == RMDeliveryQuality.AT_LEAST_ONCE) return
AT_LEAST_ONCE_WITHOUT_ORDER;
+ if (quality == RMDeliveryQuality.AT_MOST_ONCE) return
AT_MOST_ONCE_WITHOUT_ORDER;
+ }
+
+ return null; // never happens
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryAssuranceFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryQuality.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryQuality.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryQuality.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm;
+
+/**
+ * Represents message delivery quality
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public enum RMDeliveryQuality
+{
+
+ /**
+ * Each message is to be delivered at most once. The RM Source MAY retry transmission
of
+ * unacknowledged messages, but is NOT REQUIRED to do so. The requirement on the RM
+ * Destination is that it MUST filter out duplicate messages, i.e. that it MUST NOT
+ * deliver a duplicate of a message that has already been delivered.
+ */
+ AT_MOST_ONCE("AtMostOnce"),
+
+ /**
+ * Each message is to be delivered exactly once; if a message cannot be delivered then
an error
+ * MUST be raised by the RM Source and/or RM Destination. The requirement on an RM
Source is
+ * that it SHOULD retry transmission of every message sent by the Application Source
until it
+ * receives an acknowledgement from the RM Destination. The requirement on the RM
Destination
+ * is that it SHOULD retry the transfer to the Application Destination of any message
that it
+ * accepts from the RM Source until that message has been successfully delivered, and
that it
+ * MUST NOT deliver a duplicate of a message that has already been delivered.
+ */
+ AT_LEAST_ONCE("AtLeastOnce"),
+
+ /**
+ * Each message is to be delivered at least once, or else an error MUST be raised by
the RM
+ * Source and/or RM Destination. The requirement on an RM Source is that it SHOULD
retry
+ * transmission of every message sent by the Application Source until it receives an
+ * acknowledgement from the RM Destination. The requirement on the RM Destination is
that it
+ * SHOULD retry the transfer to the Application Destination of any message that it
accepts
+ * from the RM Source, until that message has been successfully delivered. There is
no
+ * requirement for the RM Destination to apply duplicate message filtering.
+ */
+ EXACTLY_ONCE("ExactlyOnce");
+
+ // associated string representation
+ private final String quality;
+
+ RMDeliveryQuality(String quality)
+ {
+ this.quality = quality;
+ }
+
+ /**
+ * Returns associated constant with passed <b>quality</b> string. Note
this method is case sensitive.
+ * Allowed values are: <b>AtMostOnce</b>, <b>AtLeastOnce</b>,
<b>ExactlyOnce</b>.
+ * @param quality to be parsed
+ * @return associated constant
+ * @throws IllegalArgumentException if <b>quality</b> string has no
associated enumeration value
+ */
+ public static RMDeliveryQuality parseDeliveryQuality(String quality)
+ {
+ if (AT_MOST_ONCE.quality.equals(quality))
+ return AT_MOST_ONCE;
+ if (AT_LEAST_ONCE.quality.equals(quality))
+ return AT_LEAST_ONCE;
+ if (EXACTLY_ONCE.quality.equals(quality))
+ return EXACTLY_ONCE;
+
+ throw new IllegalArgumentException("Unrecognized string: " + quality);
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMDeliveryQuality.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHelper.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHelper.java 2007-11-28
11:04:41 UTC (rev 5124)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHelper.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,73 +0,0 @@
-package org.jboss.ws.extensions.wsrm;
-
-import static org.jboss.ws.extensions.wsrm.RMConstant.*;
-
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-public final class RMHelper
-{
- private static final Logger log = Logger.getLogger(RMHelper.class);
-
- private RMHelper()
- {
- // no instances
- }
-
- public static boolean isRMMessage(Map<String, Object> ctx)
- {
- return (ctx != null) && (ctx.containsKey(RMConstant.REQUEST_CONTEXT));
- }
-
- public static String getMessageId(RMMessage rmRequest)
- {
- Map<String, Object> invocationCtx = (Map<String,
Object>)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT);
- Map<String, Object> wsrmRequestCtx = (Map<String,
Object>)invocationCtx.get(REQUEST_CONTEXT);
- String retVal = (String)wsrmRequestCtx.get(WSA_MESSAGE_ID);
- if (retVal == null)
- throw new RuntimeException();
- return retVal;
- }
-
- public static URI getBackPortURI(RMMessage rmRequest)
- {
- Map<String, Object> invocationCtx = (Map<String,
Object>)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT);
- Map<String, Object> wsrmRequestCtx = (Map<String,
Object>)invocationCtx.get(REQUEST_CONTEXT);
- List<Serializable> outMsgs =
(List<Serializable>)wsrmRequestCtx.get(PROTOCOL_MESSAGES);
- Map<QName, Serializable> msgs = (Map<QName,
Serializable>)wsrmRequestCtx.get(PROTOCOL_MESSAGES_MAPPING);
- QName createSequenceQName =
Provider.get().getConstants().getCreateSequenceQName();
- URI retVal = null;
- if (outMsgs.contains(createSequenceQName))
- {
- CreateSequence cs = (CreateSequence)msgs.get(createSequenceQName);
- try
- {
- retVal = RMConstant.WSA_ANONYMOUS_URI.equals(cs.getAcksTo()) ? null : new
URI(cs.getAcksTo());;
- }
- catch (Exception e)
- {
- log.warn(e.getMessage(), e);
- }
- }
- else
- {
- retVal =
((RMSequenceImpl)wsrmRequestCtx.get(SEQUENCE_REFERENCE)).getBackPort();
- }
-
- return retVal;
- }
-
- public static boolean isOneWayOperation(RMMessage rmRequest)
- {
- return
(Boolean)rmRequest.getMetadata().getContext(RMConstant.INVOCATION_CONTEXT).get(ONE_WAY_OPERATION);
- }
-
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMarshaller.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMarshaller.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMarshaller.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.invocation.OnewayInvocation;
-import org.jboss.remoting.marshal.Marshaller;
-
-/**
- * Marshalls byte array to the output stream
- * @author richard.opalka(a)jboss.com
- */
-final class RMMarshaller implements Marshaller
-{
- private static final Marshaller INSTANCE = new RMMarshaller();
-
- public Marshaller cloneMarshaller() throws CloneNotSupportedException
- {
- return getInstance();
- }
-
- public static Marshaller getInstance()
- {
- return INSTANCE;
- }
-
- public void write(Object dataObject, OutputStream output) throws IOException
- {
- if (dataObject instanceof InvocationRequest)
- dataObject = ((InvocationRequest)dataObject).getParameter();
-
- if (dataObject instanceof OnewayInvocation)
- dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
-
- if ((dataObject instanceof byte[]) == false)
- throw new IllegalArgumentException("Not a byte array: " +
dataObject);
-
- output.write((byte[])dataObject);
- output.flush();
- }
-}
-
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessage.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessage.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessage.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,7 +0,0 @@
-package org.jboss.ws.extensions.wsrm;
-
-public interface RMMessage
-{
- byte[] getPayload();
- RMMetadata getMetadata();
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageFactory.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageFactory.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,14 +0,0 @@
-package org.jboss.ws.extensions.wsrm;
-
-public class RMMessageFactory
-{
- private RMMessageFactory()
- {
- // forbidden inheritance
- }
-
- public static RMMessage newMessage(byte[] payload, RMMetadata rmMetadata)
- {
- return new RMMessageImpl(payload, rmMetadata);
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,28 +0,0 @@
-package org.jboss.ws.extensions.wsrm;
-
-/**
- * RM message object
- * @author richard.opalka(a)jboss.com
- */
-public class RMMessageImpl implements RMMessage
-{
- private final byte[] payload;
- private final RMMetadata rmMetadata;
-
- public RMMessageImpl(byte[] payload, RMMetadata rmMetadata)
- {
- super();
- this.payload = payload;
- this.rmMetadata = rmMetadata;
- }
-
- public byte[] getPayload()
- {
- return this.payload;
- }
-
- public RMMetadata getMetadata()
- {
- return this.rmMetadata;
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMetadata.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMetadata.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMetadata.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,64 +0,0 @@
-package org.jboss.ws.extensions.wsrm;
-
-import java.util.Map;
-import java.util.HashMap;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
-
-public final class RMMetadata
-{
- private Map<String, Map<String, Object>> contexts = new HashMap<String,
Map<String, Object>>();
-
- public RMMetadata(
- String targetAddress,
- boolean oneWay,
- Marshaller marshaller,
- UnMarshaller unmarshaller,
- Map<String, Object> invocationContext,
- Map<String, Object> remotingInvocationContext,
- Map<String, Object> remotingConfigurationContext)
- {
- if (targetAddress == null)
- throw new IllegalArgumentException("Target address cannot be null");
-
- invocationContext.put(RMConstant.TARGET_ADDRESS, targetAddress);
- invocationContext.put(RMConstant.ONE_WAY_OPERATION, oneWay);
- setContext(RMConstant.INVOCATION_CONTEXT, invocationContext);
-
- if (marshaller == null || unmarshaller == null)
- throw new IllegalArgumentException("Unable to create de/serialization
context");
-
- Map<String, Object> serializationContext = new HashMap<String,
Object>();
- serializationContext.put(RMConstant.MARSHALLER, marshaller);
- serializationContext.put(RMConstant.UNMARSHALLER, unmarshaller);
- setContext(RMConstant.SERIALIZATION_CONTEXT, serializationContext);
-
- if (remotingInvocationContext == null)
- throw new IllegalArgumentException("Remoting invocation context cannot be
null");
-
- setContext(RMConstant.REMOTING_INVOCATION_CONTEXT, remotingInvocationContext);
-
- if (remotingConfigurationContext == null)
- throw new IllegalArgumentException("Remoting configuraton context cannot be
null");
-
- setContext(RMConstant.REMOTING_CONFIGURATION_CONTEXT,
remotingConfigurationContext);
- }
-
- public RMMetadata(Map<String, Object> remotingInvocationContext)
- {
- if (remotingInvocationContext == null)
- throw new IllegalArgumentException("Remoting invocation context cannot be
null");
-
- setContext(RMConstant.REMOTING_INVOCATION_CONTEXT, remotingInvocationContext);
- }
-
- void setContext(String key, Map<String, Object> ctx)
- {
- this.contexts.put(key, ctx);
- }
-
- Map<String, Object> getContext(String key)
- {
- return this.contexts.get(key);
- }
-}
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-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@@ -36,11 +37,13 @@
import javax.xml.ws.addressing.AddressingProperties;
import javax.xml.ws.addressing.JAXWSAConstants;
+import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.client.ClientImpl;
import org.jboss.ws.extensions.addressing.AddressingClientUtil;
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.client_api.RMSequence;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.api.RMSequence;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.transport.RMUnassignedMessageListener;
/**
* TODO: all termination methods such as terminate, discard, ... etc must unregister the
sequence from client
@@ -51,9 +54,11 @@
* @since Oct 25, 2007
*/
@SuppressWarnings("unchecked")
-public final class RMSequenceImpl implements RMSequence
+public final class RMSequenceImpl implements RMSequence, RMUnassignedMessageListener
{
- private final String id;
+ private static final Logger LOGGER = Logger.getLogger(RMSequenceImpl.class);
+ private final String incomingSequenceId;
+ private final String outgoingSequenceId;
private final URI backPort;
private final ClientImpl client;
// object states variables
@@ -61,13 +66,28 @@
private boolean discarded = false;
private AtomicLong messageNumber = new AtomicLong();
private final Lock objectLock = new ReentrantLock();
+ private AtomicInteger countOfUnassignedMessagesAvailable = new AtomicInteger();
- public RMSequenceImpl(ClientImpl client, String id, URI backPort)
+ public RMSequenceImpl(ClientImpl client, String outId, URI backPort)
{
+ this(client, outId, null, backPort);
+ }
+
+ public void unassignedMessageReceived()
+ {
+ // we can't use objectLock in the method - possible deadlock
+ this.countOfUnassignedMessagesAvailable.addAndGet(1);
+ LOGGER.debug("Unassigned message available in callback handler");
+ }
+
+ public RMSequenceImpl(ClientImpl client, String outId, String inId, URI backPort)
+ {
super();
this.client = client;
- this.id = id;
+ this.incomingSequenceId = inId;
+ this.outgoingSequenceId = outId;
this.backPort = backPort;
+ RMSequenceManager.getInstance().register(this);
}
public final URI getBackPort()
@@ -77,28 +97,12 @@
public final long newMessageNumber()
{
- this.objectLock.lock();
- try
- {
- return this.messageNumber.incrementAndGet();
- }
- finally
- {
- this.objectLock.unlock();
- }
+ return this.messageNumber.incrementAndGet();
}
public final long getLastMessageNumber()
{
- this.objectLock.lock();
- try
- {
- return this.messageNumber.get();
- }
- finally
- {
- this.objectLock.unlock();
- }
+ return this.messageNumber.get();
}
public final void discard() throws RMException
@@ -111,6 +115,7 @@
{
this.client.setWSRMSequence(null);
this.discarded = true;
+ RMSequenceManager.getInstance().unregister(this);
}
finally
{
@@ -155,7 +160,7 @@
props = AddressingClientUtil.createAnonymousProps(action, address);
}
// prepare WS-RM request context
- QName terminateSequenceQN =
Provider.get().getConstants().getTerminateSequenceQName();
+ QName terminateSequenceQN =
RMProvider.get().getConstants().getTerminateSequenceQName();
Map rmRequestContext = new HashMap();
List outMsgs = new LinkedList();
outMsgs.add(terminateSequenceQN);
@@ -167,6 +172,7 @@
requestContext.put(RMConstant.REQUEST_CONTEXT, rmRequestContext);
// call stub method
this.client.invoke(terminateSequenceQN, new Object[] {},
client.getBindingProvider().getResponseContext());
+ RMSequenceManager.getInstance().unregister(this);
}
catch (Exception e)
{
@@ -198,10 +204,15 @@
return true;
}
- public final String getId()
+ public final String getOutboundId()
{
- return id;
+ return outgoingSequenceId;
}
+
+ public final String getInboundId()
+ {
+ return incomingSequenceId;
+ }
public final boolean isTerminated()
{
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceManager.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceManager.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceManager.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 26, 2007
+ */
+public final class RMSequenceManager implements Runnable
+{
+ private static final Logger logger = Logger.getLogger(RMSequenceManager.class);
+
+ private static RMSequenceManager instance;
+ private static final Lock classLock = new ReentrantLock();
+ private final Object instanceLock = new Object();
+ private final List<RMSequenceImpl> sequences = new
LinkedList<RMSequenceImpl>();
+ private boolean destroyed;
+
+ private RMSequenceManager()
+ {
+ // hidden constructor
+ }
+
+ public static RMSequenceManager getInstance()
+ {
+ classLock.lock();
+ try
+ {
+ if (instance == null)
+ {
+ instance = new RMSequenceManager();
+ new Thread(instance, "RMSequenceManager").start();
+ logger.debug("started");
+ }
+ return instance;
+ }
+ finally
+ {
+ classLock.unlock();
+ }
+ }
+
+ public void register(RMSequenceImpl sequence)
+ {
+ synchronized (instanceLock)
+ {
+ this.sequences.add(sequence);
+ }
+ }
+
+ public void unregister(RMSequenceImpl sequence)
+ {
+ synchronized (instanceLock)
+ {
+ this.sequences.remove(sequence);
+ if (this.sequences.size() == 0)
+ this.shutdown();
+ }
+ }
+
+ public void run()
+ {
+ synchronized (instanceLock)
+ {
+ while (this.destroyed == false)
+ {
+ for (int i = 0; i < sequences.size(); i++)
+ {
+ logger.debug("processing sequence " +
sequences.get(i).getOutboundId());
+ }
+
+ try
+ {
+ logger.debug("sleeping for 10 miliseconds");
+ instanceLock.wait(10);
+ }
+ catch (InterruptedException ie)
+ {
+ logger.warn(ie);
+ }
+ }
+ }
+ }
+
+ public void shutdown()
+ {
+ classLock.lock();
+ try
+ {
+ instance = null;
+ }
+ finally
+ {
+ classLock.unlock();
+ }
+ synchronized (this.instanceLock)
+ {
+ this.destroyed = true;
+ logger.debug("destroyed");
+ }
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceManager.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMUnMarshaller.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMUnMarshaller.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMUnMarshaller.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
-
-import org.jboss.remoting.marshal.UnMarshaller;
-
-/**
- * Unmarshalls byte array from the input stream
- * @author richard.opalka(a)jboss.com
- */
-final class RMUnMarshaller implements UnMarshaller
-{
- private static final UnMarshaller INSTANCE = new RMUnMarshaller();
-
- public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
- {
- return getInstance();
- }
-
- public static UnMarshaller getInstance()
- {
- return INSTANCE;
- }
-
- public Object read(InputStream is, Map metadata) throws IOException,
ClassNotFoundException
- {
- if (is == null)
- return RMMessageFactory.newMessage(null, new RMMetadata(metadata)); // TODO:
investigate why is == null (WSAddressing reply-to test)
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- byte[] buffer = new byte[1024];
- int count = -1;
- count = is.read(buffer);
- while (count != -1)
- {
- baos.write(buffer, 0, count);
- count = is.read(buffer);
- }
- return RMMessageFactory.newMessage(baos.toByteArray(), new RMMetadata(metadata));
- }
-
- public void setClassLoader(ClassLoader classloader)
- {
- // do nothing
- }
-}
-
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMException.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMException.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMException.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.api;
+
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Reliable messaging exception
+ * @author richard.opalka(a)jboss.com
+ */
+public class RMException extends WebServiceException
+{
+
+ public RMException()
+ {
+ super();
+ }
+
+ public RMException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public RMException(String message)
+ {
+ super(message);
+ }
+
+ public RMException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMProvider.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMProvider.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMProvider.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.api;
+
+/**
+ * TODO: add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 22, 2007
+ */
+public interface RMProvider
+{
+ /**
+ * Creates new WS-RM sequence
+ * @param addressableClient
+ * @return created sequence
+ * @throws RMException
+ */
+ RMSequence createSequence(boolean addressableClient) throws RMException;
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequence.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequence.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.api;
+
+import java.util.concurrent.TimeUnit;
+
+public interface RMSequence
+{
+ String getOutboundId() throws RMException;
+ String getInboundId() throws RMException;
+ void discard() throws RMException;
+ boolean isDiscarded() throws RMException;
+ void terminate() throws RMException;
+ boolean isTerminated() throws RMException;
+ boolean isCompleted() throws RMException;
+ boolean isCompleted(int timeAmount, TimeUnit timeUnit) throws RMException;
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequence.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequenceType.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequenceType.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequenceType.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.api;
+
+/**
+ * Sequence type
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 28, 2007
+ */
+public enum RMSequenceType
+{
+ /**
+ * Simplex sequences are used for one way message exchange patterns only
+ */
+ SIMPLEX,
+ /**
+ * Duplex sequences are used for both one way and request replay exchange patterns
+ */
+ DUPLEX
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequenceType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/ConstantsImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/ConstantsImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/ConstantsImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,351 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-
-/**
- * Utility class which should be used by all WS-RM protocol providers.
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.Constants
- */
-public final class ConstantsImpl implements Constants
-{
-
- private final String prefix;
- private final String namespaceURI;
- private final QName acceptQName;
- private final QName ackRequestedQName;
- private final QName acknowledgementRangeQName;
- private final QName acksToQName;
- private final QName closeSequenceQName;
- private final QName closeSequenceResponseQName;
- private final QName createSequenceQName;
- private final QName createSequenceResponseQName;
- private final QName detailQName;
- private final QName endpointQName;
- private final QName expiresQName;
- private final QName faultCodeQName;
- private final QName finalQName;
- private final QName identifierQName;
- private final QName incompleteSequenceBehaviorQName;
- private final QName lastMessageNumberQName;
- private final QName lastMessageQName;
- private final QName lastMsgNumberQName;
- private final QName lowerQName;
- private final QName messageNumberQName;
- private final QName nackQName;
- private final QName noneQName;
- private final QName offerQName;
- private final QName sequenceAcknowledgementQName;
- private final QName sequenceFaultQName;
- private final QName equenceQName;
- private final QName terminateSequenceQName;
- private final QName terminateSequenceResponseQName;
- private final QName upperQName;
-
- public ConstantsImpl(String prefix, String namespaceURI)
- {
- this.prefix = prefix;
- this.namespaceURI = namespaceURI;
- this.acceptQName = new QName(namespaceURI, "Accept", prefix);
- this.ackRequestedQName = new QName(namespaceURI, "AckRequested",
prefix);
- this.acknowledgementRangeQName = new QName(namespaceURI,
"AcknowledgementRange", prefix);
- this.acksToQName = new QName(namespaceURI, "AcksTo", prefix);
- this.closeSequenceQName = new QName(namespaceURI, "CloseSequence",
prefix);
- this.closeSequenceResponseQName = new QName(namespaceURI,
"CloseSequenceResponse", prefix);
- this.createSequenceQName = new QName(namespaceURI, "CreateSequence",
prefix);
- this.createSequenceResponseQName = new QName(namespaceURI,
"CreateSequenceResponse", prefix);
- this.detailQName = new QName(namespaceURI, "Detail", prefix);
- this.endpointQName = new QName(namespaceURI, "Endpoint", prefix);
- this.expiresQName = new QName(namespaceURI, "Expires", prefix);
- this.faultCodeQName = new QName(namespaceURI, "FaultCode", prefix);
- this.finalQName = new QName(namespaceURI, "Final", prefix);
- this.identifierQName = new QName(namespaceURI, "Identifier", prefix);
- this.incompleteSequenceBehaviorQName = new QName(namespaceURI,
"IncompleteSequenceBehavior", prefix);
- this.lastMessageNumberQName = new QName(namespaceURI,
"LastMessageNumber", prefix);
- this.lastMessageQName = new QName(namespaceURI, "LastMessage", prefix);
- this.lastMsgNumberQName = new QName(namespaceURI, "LastMsgNumber",
prefix);
- this.lowerQName = new QName(null, "Lower", "");
- this.messageNumberQName = new QName(namespaceURI, "MessageNumber",
prefix);
- this.nackQName = new QName(namespaceURI, "Nack", prefix);
- this.noneQName = new QName(namespaceURI, "None", prefix);
- this.offerQName = new QName(namespaceURI, "Offer", prefix);
- this.sequenceAcknowledgementQName = new QName(namespaceURI,
"SequenceAcknowledgement", prefix);
- this.sequenceFaultQName = new QName(namespaceURI, "SequenceFault",
prefix);
- this.equenceQName = new QName(namespaceURI, "Sequence", prefix);
- this.terminateSequenceQName = new QName(namespaceURI,
"TerminateSequence", prefix);
- this.terminateSequenceResponseQName = new QName(namespaceURI,
"TerminateSequenceResponse", prefix);
- this.upperQName = new QName(null, "Upper", "");
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getPrefix()
- */
- public final String getPrefix()
- {
- return this.prefix;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getNamespaceURI()
- */
- public final String getNamespaceURI()
- {
- return this.namespaceURI;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getAcceptQName()
- */
- public final QName getAcceptQName()
- {
- return this.acceptQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getAckRequestedQName()
- */
- public final QName getAckRequestedQName()
- {
- return this.ackRequestedQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getAcknowledgementRangeQName()
- */
- public final QName getAcknowledgementRangeQName()
- {
- return this.acknowledgementRangeQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getAcksToQName()
- */
- public final QName getAcksToQName()
- {
- return this.acksToQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getCloseSequenceQName()
- */
- public final QName getCloseSequenceQName()
- {
- return this.closeSequenceQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getCloseSequenceResponseQName()
- */
- public final QName getCloseSequenceResponseQName()
- {
- return this.closeSequenceResponseQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getCreateSequenceQName()
- */
- public final QName getCreateSequenceQName()
- {
- return this.createSequenceQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getCreateSequenceResponseQName()
- */
- public final QName getCreateSequenceResponseQName()
- {
- return this.createSequenceResponseQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getDetailQName()
- */
- public final QName getDetailQName()
- {
- return this.detailQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getEndpointQName()
- */
- public final QName getEndpointQName()
- {
- return this.endpointQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getExpiresQName()
- */
- public final QName getExpiresQName()
- {
- return this.expiresQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getFaultCodeQName()
- */
- public final QName getFaultCodeQName()
- {
- return this.faultCodeQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getFinalQName()
- */
- public final QName getFinalQName()
- {
- return this.finalQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getIdentifierQName()
- */
- public final QName getIdentifierQName()
- {
- return this.identifierQName;
- }
-
- /**
- * @see
org.jboss.ws.extensions.wsrm.spi.Constants#getIncompleteSequenceBehaviorQName()
- */
- public final QName getIncompleteSequenceBehaviorQName()
- {
- return this.incompleteSequenceBehaviorQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getLastMessageNumberQName()
- */
- public final QName getLastMessageNumberQName()
- {
- return this.lastMessageNumberQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getLastMessageQName()
- */
- public final QName getLastMessageQName()
- {
- return this.lastMessageQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getLastMsgNumberQName()
- */
- public final QName getLastMsgNumberQName()
- {
- return this.lastMsgNumberQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getLowerQName()
- */
- public final QName getLowerQName()
- {
- return this.lowerQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getMessageNumberQName()
- */
- public final QName getMessageNumberQName()
- {
- return this.messageNumberQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getNackQName()
- */
- public final QName getNackQName()
- {
- return this.nackQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getNoneQName()
- */
- public final QName getNoneQName()
- {
- return this.noneQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getOfferQName()
- */
- public final QName getOfferQName()
- {
- return this.offerQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getSequenceAcknowledgementQName()
- */
- public final QName getSequenceAcknowledgementQName()
- {
- return this.sequenceAcknowledgementQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getSequenceFaultQName()
- */
- public final QName getSequenceFaultQName()
- {
- return this.sequenceFaultQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getSequenceQName()
- */
- public final QName getSequenceQName()
- {
- return this.equenceQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getTerminateSequenceQName()
- */
- public final QName getTerminateSequenceQName()
- {
- return this.terminateSequenceQName;
- }
-
- /**
- * @see
org.jboss.ws.extensions.wsrm.spi.Constants#getTerminateSequenceResponseQName()
- */
- public final QName getTerminateSequenceResponseQName()
- {
- return this.terminateSequenceResponseQName;
- }
-
- /**
- * @see org.jboss.ws.extensions.wsrm.spi.Constants#getUpperQName()
- */
- public final QName getUpperQName()
- {
- return this.upperQName;
- }
-
-}
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMConstantsImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMConstantsImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMConstantsImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,351 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+
+/**
+ * Utility class which should be used by all WS-RM protocol providers.
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants
+ */
+public final class RMConstantsImpl implements RMConstants
+{
+
+ private final String prefix;
+ private final String namespaceURI;
+ private final QName acceptQName;
+ private final QName ackRequestedQName;
+ private final QName acknowledgementRangeQName;
+ private final QName acksToQName;
+ private final QName closeSequenceQName;
+ private final QName closeSequenceResponseQName;
+ private final QName createSequenceQName;
+ private final QName createSequenceResponseQName;
+ private final QName detailQName;
+ private final QName endpointQName;
+ private final QName expiresQName;
+ private final QName faultCodeQName;
+ private final QName finalQName;
+ private final QName identifierQName;
+ private final QName incompleteSequenceBehaviorQName;
+ private final QName lastMessageNumberQName;
+ private final QName lastMessageQName;
+ private final QName lastMsgNumberQName;
+ private final QName lowerQName;
+ private final QName messageNumberQName;
+ private final QName nackQName;
+ private final QName noneQName;
+ private final QName offerQName;
+ private final QName sequenceAcknowledgementQName;
+ private final QName sequenceFaultQName;
+ private final QName equenceQName;
+ private final QName terminateSequenceQName;
+ private final QName terminateSequenceResponseQName;
+ private final QName upperQName;
+
+ public RMConstantsImpl(String prefix, String namespaceURI)
+ {
+ this.prefix = prefix;
+ this.namespaceURI = namespaceURI;
+ this.acceptQName = new QName(namespaceURI, "Accept", prefix);
+ this.ackRequestedQName = new QName(namespaceURI, "AckRequested",
prefix);
+ this.acknowledgementRangeQName = new QName(namespaceURI,
"AcknowledgementRange", prefix);
+ this.acksToQName = new QName(namespaceURI, "AcksTo", prefix);
+ this.closeSequenceQName = new QName(namespaceURI, "CloseSequence",
prefix);
+ this.closeSequenceResponseQName = new QName(namespaceURI,
"CloseSequenceResponse", prefix);
+ this.createSequenceQName = new QName(namespaceURI, "CreateSequence",
prefix);
+ this.createSequenceResponseQName = new QName(namespaceURI,
"CreateSequenceResponse", prefix);
+ this.detailQName = new QName(namespaceURI, "Detail", prefix);
+ this.endpointQName = new QName(namespaceURI, "Endpoint", prefix);
+ this.expiresQName = new QName(namespaceURI, "Expires", prefix);
+ this.faultCodeQName = new QName(namespaceURI, "FaultCode", prefix);
+ this.finalQName = new QName(namespaceURI, "Final", prefix);
+ this.identifierQName = new QName(namespaceURI, "Identifier", prefix);
+ this.incompleteSequenceBehaviorQName = new QName(namespaceURI,
"IncompleteSequenceBehavior", prefix);
+ this.lastMessageNumberQName = new QName(namespaceURI,
"LastMessageNumber", prefix);
+ this.lastMessageQName = new QName(namespaceURI, "LastMessage", prefix);
+ this.lastMsgNumberQName = new QName(namespaceURI, "LastMsgNumber",
prefix);
+ this.lowerQName = new QName(null, "Lower", "");
+ this.messageNumberQName = new QName(namespaceURI, "MessageNumber",
prefix);
+ this.nackQName = new QName(namespaceURI, "Nack", prefix);
+ this.noneQName = new QName(namespaceURI, "None", prefix);
+ this.offerQName = new QName(namespaceURI, "Offer", prefix);
+ this.sequenceAcknowledgementQName = new QName(namespaceURI,
"SequenceAcknowledgement", prefix);
+ this.sequenceFaultQName = new QName(namespaceURI, "SequenceFault",
prefix);
+ this.equenceQName = new QName(namespaceURI, "Sequence", prefix);
+ this.terminateSequenceQName = new QName(namespaceURI,
"TerminateSequence", prefix);
+ this.terminateSequenceResponseQName = new QName(namespaceURI,
"TerminateSequenceResponse", prefix);
+ this.upperQName = new QName(null, "Upper", "");
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getPrefix()
+ */
+ public final String getPrefix()
+ {
+ return this.prefix;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getNamespaceURI()
+ */
+ public final String getNamespaceURI()
+ {
+ return this.namespaceURI;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getAcceptQName()
+ */
+ public final QName getAcceptQName()
+ {
+ return this.acceptQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getAckRequestedQName()
+ */
+ public final QName getAckRequestedQName()
+ {
+ return this.ackRequestedQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getAcknowledgementRangeQName()
+ */
+ public final QName getAcknowledgementRangeQName()
+ {
+ return this.acknowledgementRangeQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getAcksToQName()
+ */
+ public final QName getAcksToQName()
+ {
+ return this.acksToQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getCloseSequenceQName()
+ */
+ public final QName getCloseSequenceQName()
+ {
+ return this.closeSequenceQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getCloseSequenceResponseQName()
+ */
+ public final QName getCloseSequenceResponseQName()
+ {
+ return this.closeSequenceResponseQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getCreateSequenceQName()
+ */
+ public final QName getCreateSequenceQName()
+ {
+ return this.createSequenceQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getCreateSequenceResponseQName()
+ */
+ public final QName getCreateSequenceResponseQName()
+ {
+ return this.createSequenceResponseQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getDetailQName()
+ */
+ public final QName getDetailQName()
+ {
+ return this.detailQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getEndpointQName()
+ */
+ public final QName getEndpointQName()
+ {
+ return this.endpointQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getExpiresQName()
+ */
+ public final QName getExpiresQName()
+ {
+ return this.expiresQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getFaultCodeQName()
+ */
+ public final QName getFaultCodeQName()
+ {
+ return this.faultCodeQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getFinalQName()
+ */
+ public final QName getFinalQName()
+ {
+ return this.finalQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getIdentifierQName()
+ */
+ public final QName getIdentifierQName()
+ {
+ return this.identifierQName;
+ }
+
+ /**
+ * @see
org.jboss.ws.extensions.wsrm.spi.RMConstants#getIncompleteSequenceBehaviorQName()
+ */
+ public final QName getIncompleteSequenceBehaviorQName()
+ {
+ return this.incompleteSequenceBehaviorQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getLastMessageNumberQName()
+ */
+ public final QName getLastMessageNumberQName()
+ {
+ return this.lastMessageNumberQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getLastMessageQName()
+ */
+ public final QName getLastMessageQName()
+ {
+ return this.lastMessageQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getLastMsgNumberQName()
+ */
+ public final QName getLastMsgNumberQName()
+ {
+ return this.lastMsgNumberQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getLowerQName()
+ */
+ public final QName getLowerQName()
+ {
+ return this.lowerQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getMessageNumberQName()
+ */
+ public final QName getMessageNumberQName()
+ {
+ return this.messageNumberQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getNackQName()
+ */
+ public final QName getNackQName()
+ {
+ return this.nackQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getNoneQName()
+ */
+ public final QName getNoneQName()
+ {
+ return this.noneQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getOfferQName()
+ */
+ public final QName getOfferQName()
+ {
+ return this.offerQName;
+ }
+
+ /**
+ * @see
org.jboss.ws.extensions.wsrm.spi.RMConstants#getSequenceAcknowledgementQName()
+ */
+ public final QName getSequenceAcknowledgementQName()
+ {
+ return this.sequenceAcknowledgementQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getSequenceFaultQName()
+ */
+ public final QName getSequenceFaultQName()
+ {
+ return this.sequenceFaultQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getSequenceQName()
+ */
+ public final QName getSequenceQName()
+ {
+ return this.equenceQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getTerminateSequenceQName()
+ */
+ public final QName getTerminateSequenceQName()
+ {
+ return this.terminateSequenceQName;
+ }
+
+ /**
+ * @see
org.jboss.ws.extensions.wsrm.spi.RMConstants#getTerminateSequenceResponseQName()
+ */
+ public final QName getTerminateSequenceResponseQName()
+ {
+ return this.terminateSequenceResponseQName;
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getUpperQName()
+ */
+ public final QName getUpperQName()
+ {
+ return this.upperQName;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMConstantsImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-/**
- * Utility class which should be subclassed by all WS-RM protocol providers.
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Serializable
- */
-public abstract class AbstractSerializable implements Serializable
-{
-
- protected AbstractSerializable()
- {
- // intended to be subclassed
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
- */
- public final void deserializeFrom(SOAPMessage soapMessage) throws RMException
- {
- SerializationRepository.deserialize(this, soapMessage);
- validate(); // finally ensure that object is in correct state
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
- */
- public final void serializeTo(SOAPMessage soapMessage) throws RMException
- {
- validate(); // ensure object is in correct state first
- SerializationRepository.serialize(this, soapMessage);
- }
-
- /**
- * Each subclass must implement this method
- * @return RM provider to be used for de/serialization purposes
- */
- public abstract Provider getProvider();
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,146 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.stringToLong;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getOptionalElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredTextContent;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-/**
- * <b>AckRequested</b> object de/serializer
- * @author richard.opalka(a)jboss.com
- */
-final class AckRequestedSerializer implements Serializer
-{
-
- private static final Serializer INSTANCE = new AckRequestedSerializer();
-
- private AckRequestedSerializer()
- {
- // hide constructor
- }
-
- static Serializer getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Deserialize <b>AckRequested</b> using <b>provider</b> from
the <b>soapMessage</b>
- * @param object to be deserialized
- * @param provider wsrm provider to be used for deserialization process
- * @param soapMessage soap message from which object will be deserialized
- */
- public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- AckRequested o = (AckRequested)object;
- try
- {
- SOAPHeader soapHeader = soapMessage.getSOAPPart().getEnvelope().getHeader();
- Constants wsrmConstants = provider.getConstants();
-
- // read required wsrm:AckRequested element
- QName ackRequestedQName = wsrmConstants.getAckRequestedQName();
- SOAPElement ackRequestedElement = getRequiredElement(soapHeader,
ackRequestedQName, "soap header");
-
- // read required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
- SOAPElement identifierElement = getRequiredElement(ackRequestedElement,
identifierQName, ackRequestedQName);
- String identifier = getRequiredTextContent(identifierElement, identifierQName);
- o.setIdentifier(identifier);
-
- // read optional wsrm:MessageNumber element
- QName messageNumberQName = wsrmConstants.getMessageNumberQName();
- SOAPElement messageNumberElement = getOptionalElement(ackRequestedElement,
messageNumberQName, ackRequestedQName);
- if (messageNumberElement != null)
- {
- String messageNumberString = getRequiredTextContent(messageNumberElement,
messageNumberQName);
- long messageNumberValue = stringToLong(messageNumberString, "Unable to
parse MessageNumber element text content");
- o.setMessageNumber(messageNumberValue);
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to deserialize RM message", se);
- }
- catch (RuntimeException re)
- {
- throw new RMException("Unable to deserialize RM message", re);
- }
- }
-
- /**
- * Serialize <b>AckRequested</b> using <b>provider</b> to the
<b>soapMessage</b>
- * @param object to be serialized
- * @param provider wsrm provider to be used for serialization process
- * @param soapMessage soap message to which object will be serialized
- */
- public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- AckRequested o = (AckRequested)object;
- try
- {
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- Constants wsrmConstants = provider.getConstants();
-
- // Add xmlns:wsrm declaration
- soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
-
- // write required wsrm:AckRequested element
- QName ackRequestedQName = wsrmConstants.getAckRequestedQName();
- SOAPElement ackRequestedElement =
soapEnvelope.getHeader().addChildElement(ackRequestedQName);
-
- // write required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
-
ackRequestedElement.addChildElement(identifierQName).setValue(o.getIdentifier());
-
- if (o.getMessageNumber() != 0)
- {
- // write optional wsrm:MessageNumber element
- QName messageNumberQName = wsrmConstants.getMessageNumberQName();
- SOAPElement messageNumberElement =
ackRequestedElement.addChildElement(messageNumberQName);
- messageNumberElement.setValue(String.valueOf(o.getMessageNumber()));
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to serialize RM message", se);
- }
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,126 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredTextContent;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-/**
- * <b>CloseSequenceResponse</b> object de/serializer
- * @author richard.opalka(a)jboss.com
- */
-final class CloseSequenceResponseSerializer implements Serializer
-{
-
- private static final Serializer INSTANCE = new CloseSequenceResponseSerializer();
-
- private CloseSequenceResponseSerializer()
- {
- // hide constructor
- }
-
- static Serializer getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Deserialize <b>CloseSequenceResponse</b> using
<b>provider</b> from the <b>soapMessage</b>
- * @param object to be deserialized
- * @param provider wsrm provider to be used for deserialization process
- * @param soapMessage soap message from which object will be deserialized
- */
- public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- CloseSequenceResponse o = (CloseSequenceResponse)object;
- try
- {
- SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
- Constants wsrmConstants = provider.getConstants();
-
- // read required wsrm:CloseSequenceResponse element
- QName closeSequenceResponseQName =
wsrmConstants.getCloseSequenceResponseQName();
- SOAPElement closeSequenceResponseElement = getRequiredElement(soapBody,
closeSequenceResponseQName, "soap body");
-
- // read required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
- SOAPElement identifierElement = getRequiredElement(closeSequenceResponseElement,
identifierQName, closeSequenceResponseQName);
- String identifier = getRequiredTextContent(identifierElement, identifierQName);
- o.setIdentifier(identifier);
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to deserialize RM message", se);
- }
- catch (RuntimeException re)
- {
- throw new RMException("Unable to deserialize RM message", re);
- }
- }
-
- /**
- * Serialize <b>CloseSequenceResponse</b> using
<b>provider</b> to the <b>soapMessage</b>
- * @param object to be serialized
- * @param provider wsrm provider to be used for serialization process
- * @param soapMessage soap message to which object will be serialized
- */
- public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- CloseSequenceResponse o = (CloseSequenceResponse)object;
- try
- {
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- Constants wsrmConstants = provider.getConstants();
-
- // Add xmlns:wsrm declaration
- soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
-
- // write required wsrm:CloseSequenceResponse element
- QName closeSequenceResponseQName =
wsrmConstants.getCloseSequenceResponseQName();
- SOAPElement closeSequenceResponseElement =
soapEnvelope.getBody().addChildElement(closeSequenceResponseQName);
-
- // write required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
-
closeSequenceResponseElement.addChildElement(identifierQName).setValue(o.getIdentifier());
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to serialize RM message", se);
- }
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,146 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.stringToLong;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getOptionalElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredTextContent;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-/**
- * <b>CloseSequence</b> object de/serializer
- * @author richard.opalka(a)jboss.com
- */
-final class CloseSequenceSerializer implements Serializer
-{
-
- private static final Serializer INSTANCE = new CloseSequenceSerializer();
-
- private CloseSequenceSerializer()
- {
- // hide constructor
- }
-
- static Serializer getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Deserialize <b>CloseSequence</b> using <b>provider</b> from
the <b>soapMessage</b>
- * @param object to be deserialized
- * @param provider wsrm provider to be used for deserialization process
- * @param soapMessage soap message from which object will be deserialized
- */
- public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- CloseSequence o = (CloseSequence)object;
- try
- {
- SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
- Constants wsrmConstants = provider.getConstants();
-
- // read required wsrm:CloseSequence element
- QName closeSequenceQName = wsrmConstants.getCloseSequenceQName();
- SOAPElement closeSequenceElement = getRequiredElement(soapBody,
closeSequenceQName, "soap body");
-
- // read required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
- SOAPElement identifierElement = getRequiredElement(closeSequenceElement,
identifierQName, closeSequenceQName);
- String identifier = getRequiredTextContent(identifierElement, identifierQName);
- o.setIdentifier(identifier);
-
- // read optional wsrm:LastMsgNumber element
- QName lastMsgNumberQName = wsrmConstants.getLastMsgNumberQName();
- SOAPElement lastMsgNumberElement = getOptionalElement(closeSequenceElement,
lastMsgNumberQName, closeSequenceQName);
- if (lastMsgNumberElement != null)
- {
- String lastMsgNumberString = getRequiredTextContent(lastMsgNumberElement,
lastMsgNumberQName);
- long lastMsgNumberValue = stringToLong(lastMsgNumberString, "Unable to
parse LastMsgNumber element text content");
- o.setLastMsgNumber(lastMsgNumberValue);
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to deserialize RM message", se);
- }
- catch (RuntimeException re)
- {
- throw new RMException("Unable to deserialize RM message", re);
- }
- }
-
- /**
- * Serialize <b>CloseSequence</b> using <b>provider</b> to the
<b>soapMessage</b>
- * @param object to be serialized
- * @param provider wsrm provider to be used for serialization process
- * @param soapMessage soap message to which object will be serialized
- */
- public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- CloseSequence o = (CloseSequence)object;
- try
- {
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- Constants wsrmConstants = provider.getConstants();
-
- // Add xmlns:wsrm declaration
- soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
-
- // write required wsrm:CloseSequence element
- QName closeSequenceQName = wsrmConstants.getCloseSequenceQName();
- SOAPElement closeSequenceElement =
soapEnvelope.getBody().addChildElement(closeSequenceQName);
-
- // write required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
-
closeSequenceElement.addChildElement(identifierQName).setValue(o.getIdentifier());
-
- if (o.getLastMsgNumber() != 0)
- {
- // write optional wsrm:LastMsgNumber element
- QName lastMsgNumberQName = wsrmConstants.getLastMsgNumberQName();
- SOAPElement lastMsgNumberElement =
closeSequenceElement.addChildElement(lastMsgNumberQName);
- lastMsgNumberElement.setValue(String.valueOf(o.getLastMsgNumber()));
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to serialize RM message", se);
- }
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,200 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getOptionalElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredTextContent;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.addressing.AddressingBuilder;
-import javax.xml.ws.addressing.AddressingConstants;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-/**
- * <b>CreateSequenceResponse</b> object de/serializer
- * @author richard.opalka(a)jboss.com
- */
-final class CreateSequenceResponseSerializer implements Serializer
-{
-
- private static final AddressingConstants ADDRESSING_CONSTANTS =
- AddressingBuilder.getAddressingBuilder().newAddressingConstants();
-
- private static final Serializer INSTANCE = new CreateSequenceResponseSerializer();
-
- private CreateSequenceResponseSerializer()
- {
- // hide constructor
- }
-
- static Serializer getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Deserialize <b>CreateSequenceResponse</b> using
<b>provider</b> from the <b>soapMessage</b>
- * @param object to be deserialized
- * @param provider wsrm provider to be used for deserialization process
- * @param soapMessage soap message from which object will be deserialized
- */
- public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- CreateSequenceResponse o = (CreateSequenceResponse)object;
- try
- {
- SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
- Constants wsrmConstants = provider.getConstants();
-
- // read required wsrm:CreateSequenceResponse element
- QName createSequenceResponseQName =
wsrmConstants.getCreateSequenceResponseQName();
- SOAPElement createSequenceResponseElement = getRequiredElement(soapBody,
createSequenceResponseQName, "soap body");
-
- // read required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
- SOAPElement identifierElement =
getRequiredElement(createSequenceResponseElement, identifierQName,
createSequenceResponseQName);
- String identifier = getRequiredTextContent(identifierElement, identifierQName);
- o.setIdentifier(identifier);
-
- // read optional wsrm:Expires element
- QName expiresQName = wsrmConstants.getExpiresQName();
- SOAPElement expiresElement = getOptionalElement(createSequenceResponseElement,
expiresQName, createSequenceResponseQName);
- if (expiresElement != null)
- {
- String duration = getRequiredTextContent(expiresElement, expiresQName);
- o.setExpires(duration);
- }
-
- // read optional wsrm:IncompleteSequenceBehavior element
- QName behaviorQName = wsrmConstants.getIncompleteSequenceBehaviorQName();
- SOAPElement behaviorElement = getOptionalElement(createSequenceResponseElement,
behaviorQName, createSequenceResponseQName);
- if (behaviorElement != null)
- {
- String behaviorString = getRequiredTextContent(behaviorElement,
behaviorQName);
-
o.setIncompleteSequenceBehavior(IncompleteSequenceBehavior.getValue(behaviorString));
- }
-
- // read optional wsrm:Accept element
- QName acceptQName = wsrmConstants.getAcceptQName();
- SOAPElement acceptElement = getOptionalElement(createSequenceResponseElement,
acceptQName, createSequenceResponseQName);
- if (acceptElement != null)
- {
- CreateSequenceResponse.Accept accept = o.newAccept();
-
- // read required wsrm:AcksTo element
- QName acksToQName = wsrmConstants.getAcksToQName();
- SOAPElement acksToElement = getRequiredElement(acceptElement, acksToQName,
acceptQName);
- QName addressQName = ADDRESSING_CONSTANTS.getAddressQName();
- SOAPElement acksToAddressElement = getRequiredElement(acksToElement,
addressQName, acksToQName);
- String acksToAddress = getRequiredTextContent(acksToAddressElement,
addressQName);
- accept.setAcksTo(acksToAddress);
-
- // set created accept
- o.setAccept(accept);
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to deserialize RM message", se);
- }
- catch (RuntimeException re)
- {
- throw new RMException("Unable to deserialize RM message", re);
- }
- }
-
- /**
- * Serialize <b>CreateSequenceResponse</b> using
<b>provider</b> to the <b>soapMessage</b>
- * @param object to be serialized
- * @param provider wsrm provider to be used for serialization process
- * @param soapMessage soap message to which object will be serialized
- */
- public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- CreateSequenceResponse o = (CreateSequenceResponse)object;
- try
- {
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- Constants wsrmConstants = provider.getConstants();
-
- // Add xmlns:wsrm declaration
- soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
-
- // write required wsrm:CreateSequenceResponse element
- QName createSequenceResponseQName =
wsrmConstants.getCreateSequenceResponseQName();
- SOAPElement createSequenceResponseElement =
soapEnvelope.getBody().addChildElement(createSequenceResponseQName);
-
- // write required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
-
createSequenceResponseElement.addChildElement(identifierQName).setValue(o.getIdentifier());
-
- if (o.getExpires() != null)
- {
- // write optional wsrm:Expires element
- QName expiresQName = wsrmConstants.getExpiresQName();
-
createSequenceResponseElement.addChildElement(expiresQName).setValue(o.getExpires());
- }
-
- if (o.getIncompleteSequenceBehavior() != null)
- {
- // write optional wsrm:IncompleteSequenceBehavior element
- IncompleteSequenceBehavior behavior = o.getIncompleteSequenceBehavior();
- QName behaviorQName = wsrmConstants.getIncompleteSequenceBehaviorQName();
- SOAPElement behaviorElement =
createSequenceResponseElement.addChildElement(behaviorQName);
- behaviorElement.setValue(behavior.toString());
- }
-
- if (o.getAccept() != null)
- {
- // write optional wsrm:Accept element
- QName acceptQName = wsrmConstants.getAcceptQName();
- SOAPElement acceptElement =
createSequenceResponseElement.addChildElement(acceptQName);
-
- // write required wsrm:AcksTo element
- QName acksToQName = wsrmConstants.getAcksToQName();
- QName addressQName = ADDRESSING_CONSTANTS.getAddressQName();
- acceptElement.addChildElement(acksToQName)
- .addChildElement(addressQName)
- .setValue(o.getAccept().getAcksTo());
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to serialize RM message", se);
- }
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,236 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getOptionalElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredTextContent;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.addressing.AddressingBuilder;
-import javax.xml.ws.addressing.AddressingConstants;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-/**
- * <b>CreateSequence</b> object de/serializer
- * @author richard.opalka(a)jboss.com
- */
-final class CreateSequenceSerializer implements Serializer
-{
-
- private static final AddressingConstants ADDRESSING_CONSTANTS =
- AddressingBuilder.getAddressingBuilder().newAddressingConstants();
-
- private static final Serializer INSTANCE = new CreateSequenceSerializer();
-
- private CreateSequenceSerializer()
- {
- // hide constructor
- }
-
- static Serializer getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Deserialize <b>CreateSequence</b> using <b>provider</b>
from the <b>soapMessage</b>
- * @param object to be deserialized
- * @param provider wsrm provider to be used for deserialization process
- * @param soapMessage soap message from which object will be deserialized
- */
- public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- CreateSequence o = (CreateSequence)object;
- try
- {
- SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
- Constants wsrmConstants = provider.getConstants();
-
- // read required wsrm:CreateSequence element
- QName createSequenceQName = wsrmConstants.getCreateSequenceQName();
- SOAPElement createSequenceElement = getRequiredElement(soapBody,
createSequenceQName, "soap body");
-
- // read required wsrm:AcksTo element
- QName acksToQName = wsrmConstants.getAcksToQName();
- SOAPElement acksToElement = getRequiredElement(createSequenceElement,
acksToQName, createSequenceQName);
- QName addressQName = ADDRESSING_CONSTANTS.getAddressQName();
- SOAPElement acksToAddressElement = getRequiredElement(acksToElement,
addressQName, acksToQName);
- String acksToAddress = getRequiredTextContent(acksToAddressElement,
addressQName);
- o.setAcksTo(acksToAddress);
-
- // read optional wsrm:Expires element
- QName expiresQName = wsrmConstants.getExpiresQName();
- SOAPElement expiresElement = getOptionalElement(createSequenceElement,
expiresQName, createSequenceQName);
- if (expiresElement != null)
- {
- String duration = getRequiredTextContent(expiresElement, expiresQName);
- o.setExpires(duration);
- }
-
- // read optional wsrm:Offer element
- QName offerQName = wsrmConstants.getOfferQName();
- SOAPElement offerElement = getOptionalElement(createSequenceElement, offerQName,
createSequenceQName);
- if (offerElement != null)
- {
- CreateSequence.Offer offer = o.newOffer();
-
- // read required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
- SOAPElement identifierElement = getRequiredElement(offerElement,
identifierQName, offerQName);
- String identifier = getRequiredTextContent(identifierElement,
identifierQName);
- offer.setIdentifier(identifier);
-
- // read optional wsrm:Endpoint element
- QName endpointQName = wsrmConstants.getEndpointQName();
- SOAPElement endpointElement = getOptionalElement(offerElement, endpointQName,
offerQName);
- if (endpointElement != null)
- {
- SOAPElement endpointAddressElement = getRequiredElement(endpointElement,
addressQName, endpointQName);
- String endpointAddress = getRequiredTextContent(endpointAddressElement,
addressQName);
- offer.setEndpoint(endpointAddress);
- }
-
- // read optional wsrm:Expires element
- SOAPElement offerExpiresElement = getOptionalElement(offerElement,
expiresQName, offerQName);
- if (offerExpiresElement != null)
- {
- String duration = getRequiredTextContent(offerExpiresElement,
expiresQName);
- offer.setExpires(duration);
- }
-
- // read optional wsrm:IncompleteSequenceBehavior element
- QName behaviorQName = wsrmConstants.getIncompleteSequenceBehaviorQName();
- SOAPElement behaviorElement = getOptionalElement(offerElement, behaviorQName,
offerQName);
- if (behaviorElement != null)
- {
- String behaviorString = getRequiredTextContent(behaviorElement,
behaviorQName);
-
offer.setIncompleteSequenceBehavior(IncompleteSequenceBehavior.getValue(behaviorString));
- }
-
- // set created offer
- o.setOffer(offer);
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to deserialize RM message", se);
- }
- catch (RuntimeException re)
- {
- throw new RMException("Unable to deserialize RM message", re);
- }
- }
-
- /**
- * Serialize <b>CreateSequence</b> using <b>provider</b> to
the <b>soapMessage</b>
- * @param object to be serialized
- * @param provider wsrm provider to be used for serialization process
- * @param soapMessage soap message to which object will be serialized
- */
- public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- CreateSequence o = (CreateSequence)object;
- try
- {
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- Constants wsrmConstants = provider.getConstants();
-
- // Add xmlns:wsrm declaration
- soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
-
- // write required wsrm:CreateSequence element
- QName createSequenceQName = wsrmConstants.getCreateSequenceQName();
- SOAPElement createSequenceElement =
soapEnvelope.getBody().addChildElement(createSequenceQName);
-
- // write required wsrm:AcksTo element
- QName acksToQName = wsrmConstants.getAcksToQName();
- QName addressQName = ADDRESSING_CONSTANTS.getAddressQName();
- createSequenceElement.addChildElement(acksToQName)
- .addChildElement(addressQName)
- .setValue(o.getAcksTo());
-
- if (o.getExpires() != null)
- {
- // write optional wsrm:Expires element
- QName expiresQName = wsrmConstants.getExpiresQName();
-
createSequenceElement.addChildElement(expiresQName).setValue(o.getExpires());
- }
-
- if (o.getOffer() != null)
- {
- CreateSequence.Offer offer = o.getOffer();
-
- // write optional wsrm:Offer element
- QName offerQName = wsrmConstants.getOfferQName();
- SOAPElement offerElement =
createSequenceElement.addChildElement(offerQName);
-
- // write required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
-
offerElement.addChildElement(identifierQName).setValue(offer.getIdentifier());
-
- if (offer.getEndpoint() != null)
- {
- // write optional wsrm:Endpoint element
- QName endpointQName = wsrmConstants.getEndpointQName();
- offerElement.addChildElement(endpointQName)
- .addChildElement(addressQName)
- .setValue(offer.getEndpoint());
- }
-
- if (offer.getExpires() != null)
- {
- // write optional wsrm:Expires element
- QName expiresQName = wsrmConstants.getExpiresQName();
- offerElement.addChildElement(expiresQName).setValue(offer.getExpires());
- }
-
- if (offer.getIncompleteSequenceBehavior() != null)
- {
- // write optional wsrm:IncompleteSequenceBehavior element
- IncompleteSequenceBehavior behavior =
offer.getIncompleteSequenceBehavior();
- QName behaviorQName = wsrmConstants.getIncompleteSequenceBehaviorQName();
- SOAPElement behaviorElement =
offerElement.addChildElement(behaviorQName);
- behaviorElement.setValue(behavior.toString());
- }
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to serialize RM message", se);
- }
- }
-
-}
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAbstractSerializable.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAbstractSerializable.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAbstractSerializable.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+/**
+ * Utility class which should be subclassed by all WS-RM protocol providers.
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable
+ */
+public abstract class RMAbstractSerializable implements RMSerializable
+{
+
+ protected RMAbstractSerializable()
+ {
+ // intended to be subclassed
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public final void deserializeFrom(SOAPMessage soapMessage) throws RMException
+ {
+ RMSerializationRepository.deserialize(this, soapMessage);
+ validate(); // finally ensure that object is in correct state
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public final void serializeTo(SOAPMessage soapMessage) throws RMException
+ {
+ validate(); // ensure object is in correct state first
+ RMSerializationRepository.serialize(this, soapMessage);
+ }
+
+ /**
+ * Each subclass must implement this method
+ * @return RM provider to be used for de/serialization purposes
+ */
+ public abstract RMProvider getProvider();
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAbstractSerializable.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAckRequestedSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAckRequestedSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAckRequestedSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,146 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.stringToLong;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getOptionalElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredTextContent;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+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.RMSerializable;
+
+/**
+ * <b>AckRequested</b> object de/serializer
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMAckRequestedSerializer implements RMSerializer
+{
+
+ private static final RMSerializer INSTANCE = new RMAckRequestedSerializer();
+
+ private RMAckRequestedSerializer()
+ {
+ // hide constructor
+ }
+
+ static RMSerializer getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Deserialize <b>AckRequested</b> using <b>provider</b> from
the <b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider wsrm provider to be used for deserialization process
+ * @param soapMessage soap message from which object will be deserialized
+ */
+ public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMAckRequested o = (RMAckRequested)object;
+ try
+ {
+ SOAPHeader soapHeader = soapMessage.getSOAPPart().getEnvelope().getHeader();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // read required wsrm:AckRequested element
+ QName ackRequestedQName = wsrmConstants.getAckRequestedQName();
+ SOAPElement ackRequestedElement = getRequiredElement(soapHeader,
ackRequestedQName, "soap header");
+
+ // read required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+ SOAPElement identifierElement = getRequiredElement(ackRequestedElement,
identifierQName, ackRequestedQName);
+ String identifier = getRequiredTextContent(identifierElement, identifierQName);
+ o.setIdentifier(identifier);
+
+ // read optional wsrm:MessageNumber element
+ QName messageNumberQName = wsrmConstants.getMessageNumberQName();
+ SOAPElement messageNumberElement = getOptionalElement(ackRequestedElement,
messageNumberQName, ackRequestedQName);
+ if (messageNumberElement != null)
+ {
+ String messageNumberString = getRequiredTextContent(messageNumberElement,
messageNumberQName);
+ long messageNumberValue = stringToLong(messageNumberString, "Unable to
parse MessageNumber element text content");
+ o.setMessageNumber(messageNumberValue);
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to deserialize RM message", se);
+ }
+ catch (RuntimeException re)
+ {
+ throw new RMException("Unable to deserialize RM message", re);
+ }
+ }
+
+ /**
+ * Serialize <b>AckRequested</b> using <b>provider</b> to the
<b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider wsrm provider to be used for serialization process
+ * @param soapMessage soap message to which object will be serialized
+ */
+ public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMAckRequested o = (RMAckRequested)object;
+ try
+ {
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // Add xmlns:wsrm declaration
+ soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
+
+ // write required wsrm:AckRequested element
+ QName ackRequestedQName = wsrmConstants.getAckRequestedQName();
+ SOAPElement ackRequestedElement =
soapEnvelope.getHeader().addChildElement(ackRequestedQName);
+
+ // write required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+
ackRequestedElement.addChildElement(identifierQName).setValue(o.getIdentifier());
+
+ if (o.getMessageNumber() != 0)
+ {
+ // write optional wsrm:MessageNumber element
+ QName messageNumberQName = wsrmConstants.getMessageNumberQName();
+ SOAPElement messageNumberElement =
ackRequestedElement.addChildElement(messageNumberQName);
+ messageNumberElement.setValue(String.valueOf(o.getMessageNumber()));
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to serialize RM message", se);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAckRequestedSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceResponseSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceResponseSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceResponseSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredTextContent;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+/**
+ * <b>CloseSequenceResponse</b> object de/serializer
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMCloseSequenceResponseSerializer implements RMSerializer
+{
+
+ private static final RMSerializer INSTANCE = new RMCloseSequenceResponseSerializer();
+
+ private RMCloseSequenceResponseSerializer()
+ {
+ // hide constructor
+ }
+
+ static RMSerializer getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Deserialize <b>CloseSequenceResponse</b> using
<b>provider</b> from the <b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider wsrm provider to be used for deserialization process
+ * @param soapMessage soap message from which object will be deserialized
+ */
+ public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMCloseSequenceResponse o = (RMCloseSequenceResponse)object;
+ try
+ {
+ SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // read required wsrm:CloseSequenceResponse element
+ QName closeSequenceResponseQName =
wsrmConstants.getCloseSequenceResponseQName();
+ SOAPElement closeSequenceResponseElement = getRequiredElement(soapBody,
closeSequenceResponseQName, "soap body");
+
+ // read required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+ SOAPElement identifierElement = getRequiredElement(closeSequenceResponseElement,
identifierQName, closeSequenceResponseQName);
+ String identifier = getRequiredTextContent(identifierElement, identifierQName);
+ o.setIdentifier(identifier);
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to deserialize RM message", se);
+ }
+ catch (RuntimeException re)
+ {
+ throw new RMException("Unable to deserialize RM message", re);
+ }
+ }
+
+ /**
+ * Serialize <b>CloseSequenceResponse</b> using
<b>provider</b> to the <b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider wsrm provider to be used for serialization process
+ * @param soapMessage soap message to which object will be serialized
+ */
+ public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMCloseSequenceResponse o = (RMCloseSequenceResponse)object;
+ try
+ {
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // Add xmlns:wsrm declaration
+ soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
+
+ // write required wsrm:CloseSequenceResponse element
+ QName closeSequenceResponseQName =
wsrmConstants.getCloseSequenceResponseQName();
+ SOAPElement closeSequenceResponseElement =
soapEnvelope.getBody().addChildElement(closeSequenceResponseQName);
+
+ // write required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+
closeSequenceResponseElement.addChildElement(identifierQName).setValue(o.getIdentifier());
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to serialize RM message", se);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceResponseSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,146 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.stringToLong;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getOptionalElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredTextContent;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+/**
+ * <b>CloseSequence</b> object de/serializer
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMCloseSequenceSerializer implements RMSerializer
+{
+
+ private static final RMSerializer INSTANCE = new RMCloseSequenceSerializer();
+
+ private RMCloseSequenceSerializer()
+ {
+ // hide constructor
+ }
+
+ static RMSerializer getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Deserialize <b>CloseSequence</b> using <b>provider</b> from
the <b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider wsrm provider to be used for deserialization process
+ * @param soapMessage soap message from which object will be deserialized
+ */
+ public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMCloseSequence o = (RMCloseSequence)object;
+ try
+ {
+ SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // read required wsrm:CloseSequence element
+ QName closeSequenceQName = wsrmConstants.getCloseSequenceQName();
+ SOAPElement closeSequenceElement = getRequiredElement(soapBody,
closeSequenceQName, "soap body");
+
+ // read required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+ SOAPElement identifierElement = getRequiredElement(closeSequenceElement,
identifierQName, closeSequenceQName);
+ String identifier = getRequiredTextContent(identifierElement, identifierQName);
+ o.setIdentifier(identifier);
+
+ // read optional wsrm:LastMsgNumber element
+ QName lastMsgNumberQName = wsrmConstants.getLastMsgNumberQName();
+ SOAPElement lastMsgNumberElement = getOptionalElement(closeSequenceElement,
lastMsgNumberQName, closeSequenceQName);
+ if (lastMsgNumberElement != null)
+ {
+ String lastMsgNumberString = getRequiredTextContent(lastMsgNumberElement,
lastMsgNumberQName);
+ long lastMsgNumberValue = stringToLong(lastMsgNumberString, "Unable to
parse LastMsgNumber element text content");
+ o.setLastMsgNumber(lastMsgNumberValue);
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to deserialize RM message", se);
+ }
+ catch (RuntimeException re)
+ {
+ throw new RMException("Unable to deserialize RM message", re);
+ }
+ }
+
+ /**
+ * Serialize <b>CloseSequence</b> using <b>provider</b> to the
<b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider wsrm provider to be used for serialization process
+ * @param soapMessage soap message to which object will be serialized
+ */
+ public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMCloseSequence o = (RMCloseSequence)object;
+ try
+ {
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // Add xmlns:wsrm declaration
+ soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
+
+ // write required wsrm:CloseSequence element
+ QName closeSequenceQName = wsrmConstants.getCloseSequenceQName();
+ SOAPElement closeSequenceElement =
soapEnvelope.getBody().addChildElement(closeSequenceQName);
+
+ // write required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+
closeSequenceElement.addChildElement(identifierQName).setValue(o.getIdentifier());
+
+ if (o.getLastMsgNumber() != 0)
+ {
+ // write optional wsrm:LastMsgNumber element
+ QName lastMsgNumberQName = wsrmConstants.getLastMsgNumberQName();
+ SOAPElement lastMsgNumberElement =
closeSequenceElement.addChildElement(lastMsgNumberQName);
+ lastMsgNumberElement.setValue(String.valueOf(o.getLastMsgNumber()));
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to serialize RM message", se);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceResponseSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,200 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getOptionalElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredTextContent;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+/**
+ * <b>CreateSequenceResponse</b> object de/serializer
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMCreateSequenceResponseSerializer implements RMSerializer
+{
+
+ private static final AddressingConstants ADDRESSING_CONSTANTS =
+ AddressingBuilder.getAddressingBuilder().newAddressingConstants();
+
+ private static final RMSerializer INSTANCE = new
RMCreateSequenceResponseSerializer();
+
+ private RMCreateSequenceResponseSerializer()
+ {
+ // hide constructor
+ }
+
+ static RMSerializer getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Deserialize <b>CreateSequenceResponse</b> using
<b>provider</b> from the <b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider wsrm provider to be used for deserialization process
+ * @param soapMessage soap message from which object will be deserialized
+ */
+ public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMCreateSequenceResponse o = (RMCreateSequenceResponse)object;
+ try
+ {
+ SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // read required wsrm:CreateSequenceResponse element
+ QName createSequenceResponseQName =
wsrmConstants.getCreateSequenceResponseQName();
+ SOAPElement createSequenceResponseElement = getRequiredElement(soapBody,
createSequenceResponseQName, "soap body");
+
+ // read required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+ SOAPElement identifierElement =
getRequiredElement(createSequenceResponseElement, identifierQName,
createSequenceResponseQName);
+ String identifier = getRequiredTextContent(identifierElement, identifierQName);
+ o.setIdentifier(identifier);
+
+ // read optional wsrm:Expires element
+ QName expiresQName = wsrmConstants.getExpiresQName();
+ SOAPElement expiresElement = getOptionalElement(createSequenceResponseElement,
expiresQName, createSequenceResponseQName);
+ if (expiresElement != null)
+ {
+ String duration = getRequiredTextContent(expiresElement, expiresQName);
+ o.setExpires(duration);
+ }
+
+ // read optional wsrm:IncompleteSequenceBehavior element
+ QName behaviorQName = wsrmConstants.getIncompleteSequenceBehaviorQName();
+ SOAPElement behaviorElement = getOptionalElement(createSequenceResponseElement,
behaviorQName, createSequenceResponseQName);
+ if (behaviorElement != null)
+ {
+ String behaviorString = getRequiredTextContent(behaviorElement,
behaviorQName);
+
o.setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior.getValue(behaviorString));
+ }
+
+ // read optional wsrm:Accept element
+ QName acceptQName = wsrmConstants.getAcceptQName();
+ SOAPElement acceptElement = getOptionalElement(createSequenceResponseElement,
acceptQName, createSequenceResponseQName);
+ if (acceptElement != null)
+ {
+ RMCreateSequenceResponse.Accept accept = o.newAccept();
+
+ // read required wsrm:AcksTo element
+ QName acksToQName = wsrmConstants.getAcksToQName();
+ SOAPElement acksToElement = getRequiredElement(acceptElement, acksToQName,
acceptQName);
+ QName addressQName = ADDRESSING_CONSTANTS.getAddressQName();
+ SOAPElement acksToAddressElement = getRequiredElement(acksToElement,
addressQName, acksToQName);
+ String acksToAddress = getRequiredTextContent(acksToAddressElement,
addressQName);
+ accept.setAcksTo(acksToAddress);
+
+ // set created accept
+ o.setAccept(accept);
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to deserialize RM message", se);
+ }
+ catch (RuntimeException re)
+ {
+ throw new RMException("Unable to deserialize RM message", re);
+ }
+ }
+
+ /**
+ * Serialize <b>CreateSequenceResponse</b> using
<b>provider</b> to the <b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider wsrm provider to be used for serialization process
+ * @param soapMessage soap message to which object will be serialized
+ */
+ public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMCreateSequenceResponse o = (RMCreateSequenceResponse)object;
+ try
+ {
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // Add xmlns:wsrm declaration
+ soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
+
+ // write required wsrm:CreateSequenceResponse element
+ QName createSequenceResponseQName =
wsrmConstants.getCreateSequenceResponseQName();
+ SOAPElement createSequenceResponseElement =
soapEnvelope.getBody().addChildElement(createSequenceResponseQName);
+
+ // write required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+
createSequenceResponseElement.addChildElement(identifierQName).setValue(o.getIdentifier());
+
+ if (o.getExpires() != null)
+ {
+ // write optional wsrm:Expires element
+ QName expiresQName = wsrmConstants.getExpiresQName();
+
createSequenceResponseElement.addChildElement(expiresQName).setValue(o.getExpires());
+ }
+
+ if (o.getIncompleteSequenceBehavior() != null)
+ {
+ // write optional wsrm:IncompleteSequenceBehavior element
+ RMIncompleteSequenceBehavior behavior = o.getIncompleteSequenceBehavior();
+ QName behaviorQName = wsrmConstants.getIncompleteSequenceBehaviorQName();
+ SOAPElement behaviorElement =
createSequenceResponseElement.addChildElement(behaviorQName);
+ behaviorElement.setValue(behavior.toString());
+ }
+
+ if (o.getAccept() != null)
+ {
+ // write optional wsrm:Accept element
+ QName acceptQName = wsrmConstants.getAcceptQName();
+ SOAPElement acceptElement =
createSequenceResponseElement.addChildElement(acceptQName);
+
+ // write required wsrm:AcksTo element
+ QName acksToQName = wsrmConstants.getAcksToQName();
+ QName addressQName = ADDRESSING_CONSTANTS.getAddressQName();
+ acceptElement.addChildElement(acksToQName)
+ .addChildElement(addressQName)
+ .setValue(o.getAccept().getAcksTo());
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to serialize RM message", se);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceResponseSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,236 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getOptionalElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredTextContent;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+/**
+ * <b>CreateSequence</b> object de/serializer
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMCreateSequenceSerializer implements RMSerializer
+{
+
+ private static final AddressingConstants ADDRESSING_CONSTANTS =
+ AddressingBuilder.getAddressingBuilder().newAddressingConstants();
+
+ private static final RMSerializer INSTANCE = new RMCreateSequenceSerializer();
+
+ private RMCreateSequenceSerializer()
+ {
+ // hide constructor
+ }
+
+ static RMSerializer getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Deserialize <b>CreateSequence</b> using <b>provider</b>
from the <b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider wsrm provider to be used for deserialization process
+ * @param soapMessage soap message from which object will be deserialized
+ */
+ public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMCreateSequence o = (RMCreateSequence)object;
+ try
+ {
+ SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // read required wsrm:CreateSequence element
+ QName createSequenceQName = wsrmConstants.getCreateSequenceQName();
+ SOAPElement createSequenceElement = getRequiredElement(soapBody,
createSequenceQName, "soap body");
+
+ // read required wsrm:AcksTo element
+ QName acksToQName = wsrmConstants.getAcksToQName();
+ SOAPElement acksToElement = getRequiredElement(createSequenceElement,
acksToQName, createSequenceQName);
+ QName addressQName = ADDRESSING_CONSTANTS.getAddressQName();
+ SOAPElement acksToAddressElement = getRequiredElement(acksToElement,
addressQName, acksToQName);
+ String acksToAddress = getRequiredTextContent(acksToAddressElement,
addressQName);
+ o.setAcksTo(acksToAddress);
+
+ // read optional wsrm:Expires element
+ QName expiresQName = wsrmConstants.getExpiresQName();
+ SOAPElement expiresElement = getOptionalElement(createSequenceElement,
expiresQName, createSequenceQName);
+ if (expiresElement != null)
+ {
+ String duration = getRequiredTextContent(expiresElement, expiresQName);
+ o.setExpires(duration);
+ }
+
+ // read optional wsrm:Offer element
+ QName offerQName = wsrmConstants.getOfferQName();
+ SOAPElement offerElement = getOptionalElement(createSequenceElement, offerQName,
createSequenceQName);
+ if (offerElement != null)
+ {
+ RMCreateSequence.Offer offer = o.newOffer();
+
+ // read required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+ SOAPElement identifierElement = getRequiredElement(offerElement,
identifierQName, offerQName);
+ String identifier = getRequiredTextContent(identifierElement,
identifierQName);
+ offer.setIdentifier(identifier);
+
+ // read optional wsrm:Endpoint element
+ QName endpointQName = wsrmConstants.getEndpointQName();
+ SOAPElement endpointElement = getOptionalElement(offerElement, endpointQName,
offerQName);
+ if (endpointElement != null)
+ {
+ SOAPElement endpointAddressElement = getRequiredElement(endpointElement,
addressQName, endpointQName);
+ String endpointAddress = getRequiredTextContent(endpointAddressElement,
addressQName);
+ offer.setEndpoint(endpointAddress);
+ }
+
+ // read optional wsrm:Expires element
+ SOAPElement offerExpiresElement = getOptionalElement(offerElement,
expiresQName, offerQName);
+ if (offerExpiresElement != null)
+ {
+ String duration = getRequiredTextContent(offerExpiresElement,
expiresQName);
+ offer.setExpires(duration);
+ }
+
+ // read optional wsrm:IncompleteSequenceBehavior element
+ QName behaviorQName = wsrmConstants.getIncompleteSequenceBehaviorQName();
+ SOAPElement behaviorElement = getOptionalElement(offerElement, behaviorQName,
offerQName);
+ if (behaviorElement != null)
+ {
+ String behaviorString = getRequiredTextContent(behaviorElement,
behaviorQName);
+
offer.setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior.getValue(behaviorString));
+ }
+
+ // set created offer
+ o.setOffer(offer);
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to deserialize RM message", se);
+ }
+ catch (RuntimeException re)
+ {
+ throw new RMException("Unable to deserialize RM message", re);
+ }
+ }
+
+ /**
+ * Serialize <b>CreateSequence</b> using <b>provider</b> to
the <b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider wsrm provider to be used for serialization process
+ * @param soapMessage soap message to which object will be serialized
+ */
+ public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMCreateSequence o = (RMCreateSequence)object;
+ try
+ {
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // Add xmlns:wsrm declaration
+ soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
+
+ // write required wsrm:CreateSequence element
+ QName createSequenceQName = wsrmConstants.getCreateSequenceQName();
+ SOAPElement createSequenceElement =
soapEnvelope.getBody().addChildElement(createSequenceQName);
+
+ // write required wsrm:AcksTo element
+ QName acksToQName = wsrmConstants.getAcksToQName();
+ QName addressQName = ADDRESSING_CONSTANTS.getAddressQName();
+ createSequenceElement.addChildElement(acksToQName)
+ .addChildElement(addressQName)
+ .setValue(o.getAcksTo());
+
+ if (o.getExpires() != null)
+ {
+ // write optional wsrm:Expires element
+ QName expiresQName = wsrmConstants.getExpiresQName();
+
createSequenceElement.addChildElement(expiresQName).setValue(o.getExpires());
+ }
+
+ if (o.getOffer() != null)
+ {
+ RMCreateSequence.Offer offer = o.getOffer();
+
+ // write optional wsrm:Offer element
+ QName offerQName = wsrmConstants.getOfferQName();
+ SOAPElement offerElement =
createSequenceElement.addChildElement(offerQName);
+
+ // write required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+
offerElement.addChildElement(identifierQName).setValue(offer.getIdentifier());
+
+ if (offer.getEndpoint() != null)
+ {
+ // write optional wsrm:Endpoint element
+ QName endpointQName = wsrmConstants.getEndpointQName();
+ offerElement.addChildElement(endpointQName)
+ .addChildElement(addressQName)
+ .setValue(offer.getEndpoint());
+ }
+
+ if (offer.getExpires() != null)
+ {
+ // write optional wsrm:Expires element
+ QName expiresQName = wsrmConstants.getExpiresQName();
+ offerElement.addChildElement(expiresQName).setValue(offer.getExpires());
+ }
+
+ if (offer.getIncompleteSequenceBehavior() != null)
+ {
+ // write optional wsrm:IncompleteSequenceBehavior element
+ RMIncompleteSequenceBehavior behavior =
offer.getIncompleteSequenceBehavior();
+ QName behaviorQName = wsrmConstants.getIncompleteSequenceBehaviorQName();
+ SOAPElement behaviorElement =
offerElement.addChildElement(behaviorQName);
+ behaviorElement.setValue(behavior.toString());
+ }
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to serialize RM message", se);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceAcknowledgementSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,225 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.stringToLong;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getOptionalElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getOptionalElements;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredTextContent;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+import java.util.List;
+
+/**
+ * <b>SequenceAcknowledgement</b> object de/serializer
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMSequenceAcknowledgementSerializer implements RMSerializer
+{
+
+ private static final RMSerializer INSTANCE = new
RMSequenceAcknowledgementSerializer();
+
+ private RMSequenceAcknowledgementSerializer()
+ {
+ // hide constructor
+ }
+
+ static RMSerializer getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Deserialize <b>SequenceAcknowledgement</b> using
<b>provider</b> from the <b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider wsrm provider to be used for deserialization process
+ * @param soapMessage soap message from which object will be deserialized
+ */
+ public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMSequenceAcknowledgement o = (RMSequenceAcknowledgement)object;
+ try
+ {
+ SOAPHeader soapHeader = soapMessage.getSOAPPart().getEnvelope().getHeader();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // read required wsrm:SequenceAcknowledgement element
+ QName sequenceAckQName = wsrmConstants.getSequenceAcknowledgementQName();
+ SOAPElement sequenceAckElement = getRequiredElement(soapHeader,
sequenceAckQName, "soap header");
+
+ // read required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+ SOAPElement identifierElement = getRequiredElement(sequenceAckElement,
identifierQName, sequenceAckQName);
+ String identifier = getRequiredTextContent(identifierElement, identifierQName);
+ o.setIdentifier(identifier);
+
+ // read optional wsrm:Final element
+ QName finalQName = wsrmConstants.getFinalQName();
+ SOAPElement finalElement = getOptionalElement(sequenceAckElement, finalQName,
sequenceAckQName);
+ if (finalElement != null)
+ {
+ o.setFinal();
+ }
+
+ // read optional wsrm:None element
+ QName noneQName = wsrmConstants.getNoneQName();
+ SOAPElement noneElement = getOptionalElement(sequenceAckElement, noneQName,
sequenceAckQName);
+ if (noneElement != null)
+ {
+ o.setNone();
+ }
+
+ // read optional wsrm:Nack elements
+ QName nackQName = wsrmConstants.getNackQName();
+ List<SOAPElement> nackElements = getOptionalElements(sequenceAckElement,
nackQName, sequenceAckQName);
+ for (SOAPElement nackElement : nackElements)
+ {
+ String messageId = getRequiredTextContent(nackElement, nackQName);
+ o.addNack(stringToLong(messageId, "Unable to parse Nack element text
content"));
+ }
+
+ // read optional wsrm:AcknowledgementRange elements
+ QName ackRangeQName = wsrmConstants.getAcknowledgementRangeQName();
+ List<SOAPElement> ackRangeElements =
getOptionalElements(sequenceAckElement, ackRangeQName, sequenceAckQName);
+ if (ackRangeElements.size() != 0)
+ {
+ QName upperQName = wsrmConstants.getUpperQName();
+ QName lowerQName = wsrmConstants.getLowerQName();
+
+ for (SOAPElement ackRangeElement : ackRangeElements)
+ {
+ RMSequenceAcknowledgement.AcknowledgementRange ackRange =
o.newAcknowledgementRange();
+
+ // read required wsrm:Upper attribute
+ String upper = getRequiredTextContent(ackRangeElement, upperQName,
ackRangeQName);
+ ackRange.setUpper(stringToLong(upper, "Unable to parse Upper
attribute text content"));
+
+ // read required wsrm:Lower attribute
+ String lower = getRequiredTextContent(ackRangeElement, lowerQName,
ackRangeQName);
+ ackRange.setLower(stringToLong(lower, "Unable to parse Lower
attribute text content"));
+
+ // set created acknowledgement range
+ o.addAcknowledgementRange(ackRange);
+ }
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to deserialize RM message", se);
+ }
+ catch (RuntimeException re)
+ {
+ throw new RMException("Unable to deserialize RM message", re);
+ }
+ }
+
+ /**
+ * Serialize <b>SequenceAcknowledgement</b> using
<b>provider</b> to the <b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider wsrm provider to be used for serialization process
+ * @param soapMessage soap message to which object will be serialized
+ */
+ public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMSequenceAcknowledgement o = (RMSequenceAcknowledgement)object;
+ try
+ {
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // Add xmlns:wsrm declaration
+ soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
+
+ // write required wsrm:SequenceAcknowledgement element
+ QName sequenceAckQName = wsrmConstants.getSequenceAcknowledgementQName();
+ SOAPElement sequenceAckElement =
soapEnvelope.getHeader().addChildElement(sequenceAckQName);
+
+ // write required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+
sequenceAckElement.addChildElement(identifierQName).setValue(o.getIdentifier());
+
+ if (o.isFinal())
+ {
+ // write optional wsrm:Final element
+ QName finalQName = wsrmConstants.getFinalQName();
+ sequenceAckElement.addChildElement(finalQName);
+ }
+
+ if (o.isNone())
+ {
+ // write optional wsrm:None element
+ QName noneQName = wsrmConstants.getNoneQName();
+ sequenceAckElement.addChildElement(noneQName);
+ }
+
+ List<Long> nacks = o.getNacks();
+ if (nacks.size() != 0)
+ {
+ QName nackQName = wsrmConstants.getNackQName();
+
+ // write optional wsrm:Nack elements
+ for (Long messageId : nacks)
+ {
+
sequenceAckElement.addChildElement(nackQName).setValue(String.valueOf(messageId));
+ }
+ }
+
+ List<RMSequenceAcknowledgement.AcknowledgementRange> ackRanges =
o.getAcknowledgementRanges();
+ if (ackRanges.size() != 0)
+ {
+ QName acknowledgementRangeQName =
wsrmConstants.getAcknowledgementRangeQName();
+ QName upperQName = wsrmConstants.getUpperQName();
+ QName lowerQName = wsrmConstants.getLowerQName();
+
+ // write optional wsrm:AcknowledgementRange elements
+ for (RMSequenceAcknowledgement.AcknowledgementRange ackRange : ackRanges)
+ {
+ SOAPElement acknowledgementRangeElement =
sequenceAckElement.addChildElement(acknowledgementRangeQName);
+ // write required wsrm:Lower attribute
+ acknowledgementRangeElement.addAttribute(lowerQName,
String.valueOf(ackRange.getLower()));
+ // write required wsrm:Upper attribute
+ acknowledgementRangeElement.addAttribute(upperQName,
String.valueOf(ackRange.getUpper()));
+ }
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to serialize RM message", se);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceAcknowledgementSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceFaultSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceFaultSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceFaultSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+/**
+ * <b>SequenceFault</b> object de/serializer
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMSequenceFaultSerializer implements RMSerializer
+{
+
+ private static final RMSerializer INSTANCE = new RMSequenceFaultSerializer();
+
+ private RMSequenceFaultSerializer()
+ {
+ // hide constructor
+ }
+
+ static RMSerializer getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Deserialize <b>SequenceFault</b> using <b>provider</b> from
the <b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider wsrm provider to be used for deserialization process
+ * @param soapMessage soap message from which object will be deserialized
+ */
+ public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Serialize <b>SequenceFault</b> using <b>provider</b> to the
<b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider wsrm provider to be used for serialization process
+ * @param soapMessage soap message to which object will be serialized
+ */
+ public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ throw new NotImplementedException();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceFaultSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,155 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.stringToLong;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getOptionalElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredTextContent;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+/**
+ * <b>Sequence</b> object de/serializer
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMSequenceSerializer implements RMSerializer
+{
+
+ private static final RMSerializer INSTANCE = new RMSequenceSerializer();
+
+ private RMSequenceSerializer()
+ {
+ // hide constructor
+ }
+
+ static RMSerializer getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Deserialize <b>Sequence</b> using <b>provider</b> from the
<b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider wsrm provider to be used for deserialization process
+ * @param soapMessage soap message from which object will be deserialized
+ */
+ public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMSequence o = (RMSequence)object;
+ try
+ {
+ SOAPHeader soapHeader = soapMessage.getSOAPPart().getEnvelope().getHeader();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // read required wsrm:Sequence element
+ QName sequenceQName = wsrmConstants.getSequenceQName();
+ SOAPElement sequenceElement = getRequiredElement(soapHeader, sequenceQName,
"soap header");
+
+ // read required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+ SOAPElement identifierElement = getRequiredElement(sequenceElement,
identifierQName, sequenceQName);
+ String identifier = getRequiredTextContent(identifierElement, identifierQName);
+ o.setIdentifier(identifier);
+
+ // read required wsrm:MessageNumber element
+ QName messageNumberQName = wsrmConstants.getMessageNumberQName();
+ SOAPElement messageNumberElement = getRequiredElement(sequenceElement,
messageNumberQName, sequenceQName);
+ String messageNumberString = getRequiredTextContent(messageNumberElement,
messageNumberQName);
+ long messageNumberValue = stringToLong(messageNumberString, "Unable to
parse MessageNumber element text content");
+ o.setMessageNumber(messageNumberValue);
+
+ // read optional wsrm:LastMessage element
+ QName lastMessageQName = wsrmConstants.getLastMessageQName();
+ SOAPElement lastMessageElement = getOptionalElement(sequenceElement,
lastMessageQName, sequenceQName);
+ if (lastMessageElement != null)
+ {
+ o.setLastMessage();
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to deserialize RM message", se);
+ }
+ catch (RuntimeException re)
+ {
+ throw new RMException("Unable to deserialize RM message", re);
+ }
+ }
+
+ /**
+ * Serialize <b>Sequence</b> using <b>provider</b> to the
<b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider wsrm provider to be used for serialization process
+ * @param soapMessage soap message to which object will be serialized
+ */
+ public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMSequence o = (RMSequence)object;
+ try
+ {
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // Add xmlns:wsrm declaration
+ soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
+
+ // write required wsrm:Sequence element
+ QName sequenceQName = wsrmConstants.getSequenceQName();
+ SOAPElement sequenceElement =
soapEnvelope.getHeader().addChildElement(sequenceQName);
+
+ // write required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+ sequenceElement.addChildElement(identifierQName).setValue(o.getIdentifier());
+
+ // write required wsrm:MessageNumber element
+ QName messageNumberQName = wsrmConstants.getMessageNumberQName();
+ SOAPElement messageNumberElement =
sequenceElement.addChildElement(messageNumberQName);
+ messageNumberElement.setValue(String.valueOf(o.getMessageNumber()));
+
+ if (o.isLastMessage())
+ {
+ // write optional wsrm:LastMessage element
+ QName lastMessageQName = wsrmConstants.getLastMessageQName();
+ sequenceElement.addChildElement(lastMessageQName);
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to serialize RM message", se);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationHelper.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationHelper.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationHelper.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Collections;
+
+import org.w3c.dom.Element;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+
+/**
+ * Serialization helper
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMSerializationHelper
+{
+
+ private RMSerializationHelper()
+ {
+ // no instances
+ }
+
+ public static String getRequiredTextContent(SOAPElement element, QName elementQName)
+ {
+ if (!DOMUtils.hasTextChildNodesOnly(element))
+ throw new RMException(
+ "Only text content is allowed for element " + elementQName);
+
+ return DOMUtils.getTextContent(element).trim();
+ }
+
+ public static SOAPElement getRequiredElement(SOAPElement element, QName requiredQName,
QName contextQName)
+ {
+ return (SOAPElement)getRequiredElement(element, requiredQName,
contextQName.toString());
+ }
+
+ public static SOAPElement getRequiredElement(SOAPElement element, QName requiredQName,
String context)
+ {
+ List<Element> childElements = DOMUtils.getChildElementsAsList(element,
requiredQName);
+
+ if (childElements.size() < 1)
+ throw new RMException(
+ "Required " + requiredQName + " element not found in " +
context + " element");
+
+ if (childElements.size() > 1)
+ throw new RMException(
+ "Only one " + requiredQName + " element can be present in
" + context + " element");
+
+ return (SOAPElement)childElements.get(0);
+ }
+
+ public static String getRequiredTextContent(SOAPElement element, QName attributeQName,
QName elementQName)
+ {
+ String attributeValue = element.getAttributeValue(attributeQName);
+
+ if (attributeValue == null)
+ throw new RMException(
+ "Required attribute " + attributeQName + " is missing in
element " + elementQName);
+
+ return attributeValue;
+ }
+
+ public static SOAPElement getOptionalElement(SOAPElement contextElement, QName
optionalQName, QName contextQName)
+ {
+ List<Element> list = DOMUtils.getChildElementsAsList(contextElement,
optionalQName);
+
+ if (list.size() > 1)
+ throw new RMException(
+ "At most one " + optionalQName + " element can be present in
" + contextQName + " element");
+
+ return (SOAPElement)((list.size() == 1) ? list.get(0) : null);
+ }
+
+ public static List<SOAPElement> getOptionalElements(SOAPElement contextElement,
QName optionalQName, QName contextQName)
+ {
+ List<Element> temp = DOMUtils.getChildElementsAsList(contextElement,
optionalQName);
+
+ if (temp.size() == 0)
+ {
+ return Collections.emptyList();
+ }
+ else
+ {
+ List<SOAPElement> retVal = new LinkedList<SOAPElement>();
+
+ for (Element e : temp)
+ {
+ retVal.add((SOAPElement)e);
+ }
+
+ return retVal;
+ }
+ }
+
+ public static long stringToLong(String toEvaluate, String errorMessage)
+ {
+ try
+ {
+ return Long.valueOf(toEvaluate);
+ }
+ catch (NumberFormatException nfe)
+ {
+ throw new RMException(errorMessage, nfe);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationRepository.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationRepository.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationRepository.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+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.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+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.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+
+import javax.xml.soap.SOAPMessage;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * Utility class used for de/serialization
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMSerializationRepository
+{
+
+ private static final Map<Class<? extends RMSerializable>, RMSerializer>
SERIALIZER_REGISTRY;
+
+ static
+ {
+ SERIALIZER_REGISTRY = new HashMap<Class<? extends RMSerializable>,
RMSerializer>();
+ SERIALIZER_REGISTRY.put(RMAckRequested.class,
RMAckRequestedSerializer.getInstance());
+ SERIALIZER_REGISTRY.put(RMCloseSequence.class,
RMCloseSequenceSerializer.getInstance());
+ SERIALIZER_REGISTRY.put(RMCloseSequenceResponse.class,
RMCloseSequenceResponseSerializer.getInstance());
+ SERIALIZER_REGISTRY.put(RMCreateSequence.class,
RMCreateSequenceSerializer.getInstance());
+ SERIALIZER_REGISTRY.put(RMCreateSequenceResponse.class,
RMCreateSequenceResponseSerializer.getInstance());
+ SERIALIZER_REGISTRY.put(RMSequenceAcknowledgement.class,
RMSequenceAcknowledgementSerializer.getInstance());
+ SERIALIZER_REGISTRY.put(RMSequenceFault.class,
RMSequenceFaultSerializer.getInstance());
+ SERIALIZER_REGISTRY.put(RMSequence.class, RMSequenceSerializer.getInstance());
+ SERIALIZER_REGISTRY.put(RMTerminateSequence.class,
RMTerminateSequenceSerializer.getInstance());
+ SERIALIZER_REGISTRY.put(RMTerminateSequenceResponse.class,
RMTerminateSequenceResponseSerializer.getInstance());
+ }
+
+ private RMSerializationRepository()
+ {
+ // no instances
+ }
+
+ /**
+ * Serialize passed <b>object</b> data to the
<b>soapMessage</b>
+ * @param object to be serialized
+ * @param soapMessage where to write data
+ * @throws RMException if something went wrong
+ */
+ public static void serialize(RMAbstractSerializable object, SOAPMessage soapMessage)
+ throws RMException
+ {
+ getSerializer(object).serialize(object, object.getProvider(), soapMessage);
+ }
+
+ /**
+ * Initialize passed <b>object</b> using data in
<b>soapMessage</b>
+ * @param object to be initialized
+ * @param soapMessage from which to read the data
+ * @throws RMException if something went wrong
+ */
+ public static void deserialize(RMAbstractSerializable object, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ getSerializer(object).deserialize(object, object.getProvider(), soapMessage);
+ }
+
+ /**
+ * Lookups the serializer associated with the passed <b>object</b>
+ * @param object to lookup serializer for
+ * @return serializer to be used
+ * @throws IllegalArgumentException if passed object has no defined serializer
+ */
+ private static RMSerializer getSerializer(RMSerializable object)
+ {
+ for (Class<? extends RMSerializable> serializable :
SERIALIZER_REGISTRY.keySet())
+ {
+ if (serializable.isAssignableFrom(object.getClass()))
+ return SERIALIZER_REGISTRY.get(serializable);
+ }
+
+ throw new IllegalArgumentException();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationRepository.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+/**
+ * Each WS-RM message de/serializer must implement this interface
+ * @author richard.opalka(a)jboss.com
+ */
+interface RMSerializer
+{
+
+ /**
+ * Serialize the specified <b>object</b> using passed RM
<b>provider</b> to the <b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider RM provider to be used
+ * @param soapMessage where to write the data
+ */
+ void serialize(RMSerializable object, RMProvider provider, SOAPMessage soapMessage);
+
+ /**
+ * Deserialize the specified <b>object</b> using passed RM
<b>provider</b> from the <b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider RM provider to be used
+ * @param soapMessage from which to read the data
+ */
+ void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage);
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceResponseSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceResponseSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceResponseSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredTextContent;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+
+/**
+ * <b>TerminateSequenceResponse</b> object de/serializer
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMTerminateSequenceResponseSerializer implements RMSerializer
+{
+
+ private static final RMSerializer INSTANCE = new
RMTerminateSequenceResponseSerializer();
+
+ private RMTerminateSequenceResponseSerializer()
+ {
+ // hide constructor
+ }
+
+ static RMSerializer getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Deserialize <b>TerminateSequenceResponse</b> using
<b>provider</b> from the <b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider wsrm provider to be used for deserialization process
+ * @param soapMessage soap message from which object will be deserialized
+ */
+ public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMTerminateSequenceResponse o = (RMTerminateSequenceResponse)object;
+ try
+ {
+ SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // read required wsrm:TerminateSequenceResponse element
+ QName terminateSequenceResponseQName =
wsrmConstants.getTerminateSequenceResponseQName();
+ SOAPElement terminateSequenceResponseElement = getRequiredElement(soapBody,
terminateSequenceResponseQName, "soap body");
+
+ // read required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+ SOAPElement identifierElement =
getRequiredElement(terminateSequenceResponseElement, identifierQName,
terminateSequenceResponseQName);
+ String identifier = getRequiredTextContent(identifierElement, identifierQName);
+ o.setIdentifier(identifier);
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to deserialize RM message", se);
+ }
+ catch (RuntimeException re)
+ {
+ throw new RMException("Unable to deserialize RM message", re);
+ }
+ }
+
+ /**
+ * Serialize <b>TerminateSequenceResponse</b> using
<b>provider</b> to the <b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider wsrm provider to be used for serialization process
+ * @param soapMessage soap message to which object will be serialized
+ */
+ public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMTerminateSequenceResponse o = (RMTerminateSequenceResponse)object;
+ try
+ {
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // Add xmlns:wsrm declaration
+ soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
+
+ // write required wsrm:TerminateSequenceResponse element
+ QName terminateSequenceResponseQName =
wsrmConstants.getTerminateSequenceResponseQName();
+ SOAPElement terminateSequenceResponseElement =
soapEnvelope.getBody().addChildElement(terminateSequenceResponseQName);
+
+ // write required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+
terminateSequenceResponseElement.addChildElement(identifierQName).setValue(o.getIdentifier());
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to serialize RM message", se);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceResponseSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,146 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.common.serialization;
+
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.stringToLong;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getOptionalElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredElement;
+import static
org.jboss.ws.extensions.wsrm.common.serialization.RMSerializationHelper.getRequiredTextContent;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
+
+/**
+ * <b>TerminateSequence</b> object de/serializer
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMTerminateSequenceSerializer implements RMSerializer
+{
+
+ private static final RMSerializer INSTANCE = new RMTerminateSequenceSerializer();
+
+ private RMTerminateSequenceSerializer()
+ {
+ // hide constructor
+ }
+
+ static RMSerializer getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Deserialize <b>TerminateSequence</b> using <b>provider</b>
from the <b>soapMessage</b>
+ * @param object to be deserialized
+ * @param provider wsrm provider to be used for deserialization process
+ * @param soapMessage soap message from which object will be deserialized
+ */
+ public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMTerminateSequence o = (RMTerminateSequence)object;
+ try
+ {
+ SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // read required wsrm:TerminateSequence element
+ QName terminateSequenceQName = wsrmConstants.getTerminateSequenceQName();
+ SOAPElement terminateSequenceElement = getRequiredElement(soapBody,
terminateSequenceQName, "soap body");
+
+ // read required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+ SOAPElement identifierElement = getRequiredElement(terminateSequenceElement,
identifierQName, terminateSequenceQName);
+ String identifier = getRequiredTextContent(identifierElement, identifierQName);
+ o.setIdentifier(identifier);
+
+ // read optional wsrm:LastMsgNumber element
+ QName lastMsgNumberQName = wsrmConstants.getLastMsgNumberQName();
+ SOAPElement lastMsgNumberElement = getOptionalElement(terminateSequenceElement,
lastMsgNumberQName, terminateSequenceQName);
+ if (lastMsgNumberElement != null)
+ {
+ String lastMsgNumberString = getRequiredTextContent(lastMsgNumberElement,
lastMsgNumberQName);
+ long lastMsgNumberValue = stringToLong(lastMsgNumberString, "Unable to
parse LastMsgNumber element text content");
+ o.setLastMsgNumber(lastMsgNumberValue);
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to deserialize RM message", se);
+ }
+ catch (RuntimeException re)
+ {
+ throw new RMException("Unable to deserialize RM message", re);
+ }
+ }
+
+ /**
+ * Serialize <b>TerminateSequence</b> using <b>provider</b> to
the <b>soapMessage</b>
+ * @param object to be serialized
+ * @param provider wsrm provider to be used for serialization process
+ * @param soapMessage soap message to which object will be serialized
+ */
+ public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage
soapMessage)
+ throws RMException
+ {
+ RMTerminateSequence o = (RMTerminateSequence)object;
+ try
+ {
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ RMConstants wsrmConstants = provider.getConstants();
+
+ // Add xmlns:wsrm declaration
+ soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
+
+ // write required wsrm:TerminateSequence element
+ QName terminateSequenceQName = wsrmConstants.getTerminateSequenceQName();
+ SOAPElement terminateSequenceElement =
soapEnvelope.getBody().addChildElement(terminateSequenceQName);
+
+ // write required wsrm:Identifier element
+ QName identifierQName = wsrmConstants.getIdentifierQName();
+
terminateSequenceElement.addChildElement(identifierQName).setValue(o.getIdentifier());
+
+ if (o.getLastMsgNumber() != 0)
+ {
+ // write optional wsrm:LastMsgNumber element
+ QName lastMsgNumberQName = wsrmConstants.getLastMsgNumberQName();
+ SOAPElement lastMsgNumberElement =
terminateSequenceElement.addChildElement(lastMsgNumberQName);
+ lastMsgNumberElement.setValue(String.valueOf(o.getLastMsgNumber()));
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new RMException("Unable to serialize RM message", se);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,225 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.stringToLong;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getOptionalElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getOptionalElements;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredTextContent;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-import java.util.List;
-
-/**
- * <b>SequenceAcknowledgement</b> object de/serializer
- * @author richard.opalka(a)jboss.com
- */
-final class SequenceAcknowledgementSerializer implements Serializer
-{
-
- private static final Serializer INSTANCE = new SequenceAcknowledgementSerializer();
-
- private SequenceAcknowledgementSerializer()
- {
- // hide constructor
- }
-
- static Serializer getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Deserialize <b>SequenceAcknowledgement</b> using
<b>provider</b> from the <b>soapMessage</b>
- * @param object to be deserialized
- * @param provider wsrm provider to be used for deserialization process
- * @param soapMessage soap message from which object will be deserialized
- */
- public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- SequenceAcknowledgement o = (SequenceAcknowledgement)object;
- try
- {
- SOAPHeader soapHeader = soapMessage.getSOAPPart().getEnvelope().getHeader();
- Constants wsrmConstants = provider.getConstants();
-
- // read required wsrm:SequenceAcknowledgement element
- QName sequenceAckQName = wsrmConstants.getSequenceAcknowledgementQName();
- SOAPElement sequenceAckElement = getRequiredElement(soapHeader,
sequenceAckQName, "soap header");
-
- // read required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
- SOAPElement identifierElement = getRequiredElement(sequenceAckElement,
identifierQName, sequenceAckQName);
- String identifier = getRequiredTextContent(identifierElement, identifierQName);
- o.setIdentifier(identifier);
-
- // read optional wsrm:Final element
- QName finalQName = wsrmConstants.getFinalQName();
- SOAPElement finalElement = getOptionalElement(sequenceAckElement, finalQName,
sequenceAckQName);
- if (finalElement != null)
- {
- o.setFinal();
- }
-
- // read optional wsrm:None element
- QName noneQName = wsrmConstants.getNoneQName();
- SOAPElement noneElement = getOptionalElement(sequenceAckElement, noneQName,
sequenceAckQName);
- if (noneElement != null)
- {
- o.setNone();
- }
-
- // read optional wsrm:Nack elements
- QName nackQName = wsrmConstants.getNackQName();
- List<SOAPElement> nackElements = getOptionalElements(sequenceAckElement,
nackQName, sequenceAckQName);
- for (SOAPElement nackElement : nackElements)
- {
- String messageId = getRequiredTextContent(nackElement, nackQName);
- o.addNack(stringToLong(messageId, "Unable to parse Nack element text
content"));
- }
-
- // read optional wsrm:AcknowledgementRange elements
- QName ackRangeQName = wsrmConstants.getAcknowledgementRangeQName();
- List<SOAPElement> ackRangeElements =
getOptionalElements(sequenceAckElement, ackRangeQName, sequenceAckQName);
- if (ackRangeElements.size() != 0)
- {
- QName upperQName = wsrmConstants.getUpperQName();
- QName lowerQName = wsrmConstants.getLowerQName();
-
- for (SOAPElement ackRangeElement : ackRangeElements)
- {
- SequenceAcknowledgement.AcknowledgementRange ackRange =
o.newAcknowledgementRange();
-
- // read required wsrm:Upper attribute
- String upper = getRequiredTextContent(ackRangeElement, upperQName,
ackRangeQName);
- ackRange.setUpper(stringToLong(upper, "Unable to parse Upper
attribute text content"));
-
- // read required wsrm:Lower attribute
- String lower = getRequiredTextContent(ackRangeElement, lowerQName,
ackRangeQName);
- ackRange.setLower(stringToLong(lower, "Unable to parse Lower
attribute text content"));
-
- // set created acknowledgement range
- o.addAcknowledgementRange(ackRange);
- }
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to deserialize RM message", se);
- }
- catch (RuntimeException re)
- {
- throw new RMException("Unable to deserialize RM message", re);
- }
- }
-
- /**
- * Serialize <b>SequenceAcknowledgement</b> using
<b>provider</b> to the <b>soapMessage</b>
- * @param object to be serialized
- * @param provider wsrm provider to be used for serialization process
- * @param soapMessage soap message to which object will be serialized
- */
- public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- SequenceAcknowledgement o = (SequenceAcknowledgement)object;
- try
- {
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- Constants wsrmConstants = provider.getConstants();
-
- // Add xmlns:wsrm declaration
- soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
-
- // write required wsrm:SequenceAcknowledgement element
- QName sequenceAckQName = wsrmConstants.getSequenceAcknowledgementQName();
- SOAPElement sequenceAckElement =
soapEnvelope.getHeader().addChildElement(sequenceAckQName);
-
- // write required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
-
sequenceAckElement.addChildElement(identifierQName).setValue(o.getIdentifier());
-
- if (o.isFinal())
- {
- // write optional wsrm:Final element
- QName finalQName = wsrmConstants.getFinalQName();
- sequenceAckElement.addChildElement(finalQName);
- }
-
- if (o.isNone())
- {
- // write optional wsrm:None element
- QName noneQName = wsrmConstants.getNoneQName();
- sequenceAckElement.addChildElement(noneQName);
- }
-
- List<Long> nacks = o.getNacks();
- if (nacks.size() != 0)
- {
- QName nackQName = wsrmConstants.getNackQName();
-
- // write optional wsrm:Nack elements
- for (Long messageId : nacks)
- {
-
sequenceAckElement.addChildElement(nackQName).setValue(String.valueOf(messageId));
- }
- }
-
- List<SequenceAcknowledgement.AcknowledgementRange> ackRanges =
o.getAcknowledgementRanges();
- if (ackRanges.size() != 0)
- {
- QName acknowledgementRangeQName =
wsrmConstants.getAcknowledgementRangeQName();
- QName upperQName = wsrmConstants.getUpperQName();
- QName lowerQName = wsrmConstants.getLowerQName();
-
- // write optional wsrm:AcknowledgementRange elements
- for (SequenceAcknowledgement.AcknowledgementRange ackRange : ackRanges)
- {
- SOAPElement acknowledgementRangeElement =
sequenceAckElement.addChildElement(acknowledgementRangeQName);
- // write required wsrm:Lower attribute
- acknowledgementRangeElement.addAttribute(lowerQName,
String.valueOf(ackRange.getLower()));
- // write required wsrm:Upper attribute
- acknowledgementRangeElement.addAttribute(upperQName,
String.valueOf(ackRange.getUpper()));
- }
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to serialize RM message", se);
- }
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-/**
- * <b>SequenceFault</b> object de/serializer
- * @author richard.opalka(a)jboss.com
- */
-final class SequenceFaultSerializer implements Serializer
-{
-
- private static final Serializer INSTANCE = new SequenceFaultSerializer();
-
- private SequenceFaultSerializer()
- {
- // hide constructor
- }
-
- static Serializer getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Deserialize <b>SequenceFault</b> using <b>provider</b> from
the <b>soapMessage</b>
- * @param object to be deserialized
- * @param provider wsrm provider to be used for deserialization process
- * @param soapMessage soap message from which object will be deserialized
- */
- public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- throw new NotImplementedException();
- }
-
- /**
- * Serialize <b>SequenceFault</b> using <b>provider</b> to the
<b>soapMessage</b>
- * @param object to be serialized
- * @param provider wsrm provider to be used for serialization process
- * @param soapMessage soap message to which object will be serialized
- */
- public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- throw new NotImplementedException();
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,155 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.stringToLong;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getOptionalElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredTextContent;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-/**
- * <b>Sequence</b> object de/serializer
- * @author richard.opalka(a)jboss.com
- */
-final class SequenceSerializer implements Serializer
-{
-
- private static final Serializer INSTANCE = new SequenceSerializer();
-
- private SequenceSerializer()
- {
- // hide constructor
- }
-
- static Serializer getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Deserialize <b>Sequence</b> using <b>provider</b> from the
<b>soapMessage</b>
- * @param object to be deserialized
- * @param provider wsrm provider to be used for deserialization process
- * @param soapMessage soap message from which object will be deserialized
- */
- public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- Sequence o = (Sequence)object;
- try
- {
- SOAPHeader soapHeader = soapMessage.getSOAPPart().getEnvelope().getHeader();
- Constants wsrmConstants = provider.getConstants();
-
- // read required wsrm:Sequence element
- QName sequenceQName = wsrmConstants.getSequenceQName();
- SOAPElement sequenceElement = getRequiredElement(soapHeader, sequenceQName,
"soap header");
-
- // read required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
- SOAPElement identifierElement = getRequiredElement(sequenceElement,
identifierQName, sequenceQName);
- String identifier = getRequiredTextContent(identifierElement, identifierQName);
- o.setIdentifier(identifier);
-
- // read required wsrm:MessageNumber element
- QName messageNumberQName = wsrmConstants.getMessageNumberQName();
- SOAPElement messageNumberElement = getRequiredElement(sequenceElement,
messageNumberQName, sequenceQName);
- String messageNumberString = getRequiredTextContent(messageNumberElement,
messageNumberQName);
- long messageNumberValue = stringToLong(messageNumberString, "Unable to
parse MessageNumber element text content");
- o.setMessageNumber(messageNumberValue);
-
- // read optional wsrm:LastMessage element
- QName lastMessageQName = wsrmConstants.getLastMessageQName();
- SOAPElement lastMessageElement = getOptionalElement(sequenceElement,
lastMessageQName, sequenceQName);
- if (lastMessageElement != null)
- {
- o.setLastMessage();
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to deserialize RM message", se);
- }
- catch (RuntimeException re)
- {
- throw new RMException("Unable to deserialize RM message", re);
- }
- }
-
- /**
- * Serialize <b>Sequence</b> using <b>provider</b> to the
<b>soapMessage</b>
- * @param object to be serialized
- * @param provider wsrm provider to be used for serialization process
- * @param soapMessage soap message to which object will be serialized
- */
- public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- Sequence o = (Sequence)object;
- try
- {
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- Constants wsrmConstants = provider.getConstants();
-
- // Add xmlns:wsrm declaration
- soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
-
- // write required wsrm:Sequence element
- QName sequenceQName = wsrmConstants.getSequenceQName();
- SOAPElement sequenceElement =
soapEnvelope.getHeader().addChildElement(sequenceQName);
-
- // write required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
- sequenceElement.addChildElement(identifierQName).setValue(o.getIdentifier());
-
- // write required wsrm:MessageNumber element
- QName messageNumberQName = wsrmConstants.getMessageNumberQName();
- SOAPElement messageNumberElement =
sequenceElement.addChildElement(messageNumberQName);
- messageNumberElement.setValue(String.valueOf(o.getMessageNumber()));
-
- if (o.isLastMessage())
- {
- // write optional wsrm:LastMessage element
- QName lastMessageQName = wsrmConstants.getLastMessageQName();
- sequenceElement.addChildElement(lastMessageQName);
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to serialize RM message", se);
- }
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,131 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Collections;
-
-import org.w3c.dom.Element;
-import org.jboss.wsf.common.DOMUtils;
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-
-/**
- * Serialization helper
- * @author richard.opalka(a)jboss.com
- */
-final class SerializationHelper
-{
-
- private SerializationHelper()
- {
- // no instances
- }
-
- public static String getRequiredTextContent(SOAPElement element, QName elementQName)
- {
- if (!DOMUtils.hasTextChildNodesOnly(element))
- throw new RMException(
- "Only text content is allowed for element " + elementQName);
-
- return DOMUtils.getTextContent(element).trim();
- }
-
- public static SOAPElement getRequiredElement(SOAPElement element, QName requiredQName,
QName contextQName)
- {
- return (SOAPElement)getRequiredElement(element, requiredQName,
contextQName.toString());
- }
-
- public static SOAPElement getRequiredElement(SOAPElement element, QName requiredQName,
String context)
- {
- List<Element> childElements = DOMUtils.getChildElementsAsList(element,
requiredQName);
-
- if (childElements.size() < 1)
- throw new RMException(
- "Required " + requiredQName + " element not found in " +
context + " element");
-
- if (childElements.size() > 1)
- throw new RMException(
- "Only one " + requiredQName + " element can be present in
" + context + " element");
-
- return (SOAPElement)childElements.get(0);
- }
-
- public static String getRequiredTextContent(SOAPElement element, QName attributeQName,
QName elementQName)
- {
- String attributeValue = element.getAttributeValue(attributeQName);
-
- if (attributeValue == null)
- throw new RMException(
- "Required attribute " + attributeQName + " is missing in
element " + elementQName);
-
- return attributeValue;
- }
-
- public static SOAPElement getOptionalElement(SOAPElement contextElement, QName
optionalQName, QName contextQName)
- {
- List<Element> list = DOMUtils.getChildElementsAsList(contextElement,
optionalQName);
-
- if (list.size() > 1)
- throw new RMException(
- "At most one " + optionalQName + " element can be present in
" + contextQName + " element");
-
- return (SOAPElement)((list.size() == 1) ? list.get(0) : null);
- }
-
- public static List<SOAPElement> getOptionalElements(SOAPElement contextElement,
QName optionalQName, QName contextQName)
- {
- List<Element> temp = DOMUtils.getChildElementsAsList(contextElement,
optionalQName);
-
- if (temp.size() == 0)
- {
- return Collections.emptyList();
- }
- else
- {
- List<SOAPElement> retVal = new LinkedList<SOAPElement>();
-
- for (Element e : temp)
- {
- retVal.add((SOAPElement)e);
- }
-
- return retVal;
- }
- }
-
- public static long stringToLong(String toEvaluate, String errorMessage)
- {
- try
- {
- return Long.valueOf(toEvaluate);
- }
- catch (NumberFormatException nfe)
- {
- throw new RMException(errorMessage, nfe);
- }
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,112 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse;
-
-import javax.xml.soap.SOAPMessage;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * Utility class used for de/serialization
- * @author richard.opalka(a)jboss.com
- */
-final class SerializationRepository
-{
-
- private static final Map<Class<? extends Serializable>, Serializer>
SERIALIZER_REGISTRY;
-
- static
- {
- SERIALIZER_REGISTRY = new HashMap<Class<? extends Serializable>,
Serializer>();
- SERIALIZER_REGISTRY.put(AckRequested.class, AckRequestedSerializer.getInstance());
- SERIALIZER_REGISTRY.put(CloseSequence.class,
CloseSequenceSerializer.getInstance());
- SERIALIZER_REGISTRY.put(CloseSequenceResponse.class,
CloseSequenceResponseSerializer.getInstance());
- SERIALIZER_REGISTRY.put(CreateSequence.class,
CreateSequenceSerializer.getInstance());
- SERIALIZER_REGISTRY.put(CreateSequenceResponse.class,
CreateSequenceResponseSerializer.getInstance());
- SERIALIZER_REGISTRY.put(SequenceAcknowledgement.class,
SequenceAcknowledgementSerializer.getInstance());
- SERIALIZER_REGISTRY.put(SequenceFault.class,
SequenceFaultSerializer.getInstance());
- SERIALIZER_REGISTRY.put(Sequence.class, SequenceSerializer.getInstance());
- SERIALIZER_REGISTRY.put(TerminateSequence.class,
TerminateSequenceSerializer.getInstance());
- SERIALIZER_REGISTRY.put(TerminateSequenceResponse.class,
TerminateSequenceResponseSerializer.getInstance());
- }
-
- private SerializationRepository()
- {
- // no instances
- }
-
- /**
- * Serialize passed <b>object</b> data to the
<b>soapMessage</b>
- * @param object to be serialized
- * @param soapMessage where to write data
- * @throws RMException if something went wrong
- */
- public static void serialize(AbstractSerializable object, SOAPMessage soapMessage)
- throws RMException
- {
- getSerializer(object).serialize(object, object.getProvider(), soapMessage);
- }
-
- /**
- * Initialize passed <b>object</b> using data in
<b>soapMessage</b>
- * @param object to be initialized
- * @param soapMessage from which to read the data
- * @throws RMException if something went wrong
- */
- public static void deserialize(AbstractSerializable object, SOAPMessage soapMessage)
- throws RMException
- {
- getSerializer(object).deserialize(object, object.getProvider(), soapMessage);
- }
-
- /**
- * Lookups the serializer associated with the passed <b>object</b>
- * @param object to lookup serializer for
- * @return serializer to be used
- * @throws IllegalArgumentException if passed object has no defined serializer
- */
- private static Serializer getSerializer(Serializable object)
- {
- for (Class<? extends Serializable> serializable :
SERIALIZER_REGISTRY.keySet())
- {
- if (serializable.isAssignableFrom(object.getClass()))
- return SERIALIZER_REGISTRY.get(serializable);
- }
-
- throw new IllegalArgumentException();
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/Serializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/Serializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/Serializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-
-/**
- * Each WS-RM message de/serializer must implement this interface
- * @author richard.opalka(a)jboss.com
- */
-interface Serializer
-{
-
- /**
- * Serialize the specified <b>object</b> using passed RM
<b>provider</b> to the <b>soapMessage</b>
- * @param object to be serialized
- * @param provider RM provider to be used
- * @param soapMessage where to write the data
- */
- void serialize(Serializable object, Provider provider, SOAPMessage soapMessage);
-
- /**
- * Deserialize the specified <b>object</b> using passed RM
<b>provider</b> from the <b>soapMessage</b>
- * @param object to be deserialized
- * @param provider RM provider to be used
- * @param soapMessage from which to read the data
- */
- void deserialize(Serializable object, Provider provider, SOAPMessage soapMessage);
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,126 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredTextContent;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse;
-
-/**
- * <b>TerminateSequenceResponse</b> object de/serializer
- * @author richard.opalka(a)jboss.com
- */
-final class TerminateSequenceResponseSerializer implements Serializer
-{
-
- private static final Serializer INSTANCE = new TerminateSequenceResponseSerializer();
-
- private TerminateSequenceResponseSerializer()
- {
- // hide constructor
- }
-
- static Serializer getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Deserialize <b>TerminateSequenceResponse</b> using
<b>provider</b> from the <b>soapMessage</b>
- * @param object to be deserialized
- * @param provider wsrm provider to be used for deserialization process
- * @param soapMessage soap message from which object will be deserialized
- */
- public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- TerminateSequenceResponse o = (TerminateSequenceResponse)object;
- try
- {
- SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
- Constants wsrmConstants = provider.getConstants();
-
- // read required wsrm:TerminateSequenceResponse element
- QName terminateSequenceResponseQName =
wsrmConstants.getTerminateSequenceResponseQName();
- SOAPElement terminateSequenceResponseElement = getRequiredElement(soapBody,
terminateSequenceResponseQName, "soap body");
-
- // read required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
- SOAPElement identifierElement =
getRequiredElement(terminateSequenceResponseElement, identifierQName,
terminateSequenceResponseQName);
- String identifier = getRequiredTextContent(identifierElement, identifierQName);
- o.setIdentifier(identifier);
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to deserialize RM message", se);
- }
- catch (RuntimeException re)
- {
- throw new RMException("Unable to deserialize RM message", re);
- }
- }
-
- /**
- * Serialize <b>TerminateSequenceResponse</b> using
<b>provider</b> to the <b>soapMessage</b>
- * @param object to be serialized
- * @param provider wsrm provider to be used for serialization process
- * @param soapMessage soap message to which object will be serialized
- */
- public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- TerminateSequenceResponse o = (TerminateSequenceResponse)object;
- try
- {
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- Constants wsrmConstants = provider.getConstants();
-
- // Add xmlns:wsrm declaration
- soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
-
- // write required wsrm:TerminateSequenceResponse element
- QName terminateSequenceResponseQName =
wsrmConstants.getTerminateSequenceResponseQName();
- SOAPElement terminateSequenceResponseElement =
soapEnvelope.getBody().addChildElement(terminateSequenceResponseQName);
-
- // write required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
-
terminateSequenceResponseElement.addChildElement(identifierQName).setValue(o.getIdentifier());
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to serialize RM message", se);
- }
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,146 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.common.serialization;
-
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.stringToLong;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getOptionalElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredElement;
-import static
org.jboss.ws.extensions.wsrm.common.serialization.SerializationHelper.getRequiredTextContent;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
-
-/**
- * <b>TerminateSequence</b> object de/serializer
- * @author richard.opalka(a)jboss.com
- */
-final class TerminateSequenceSerializer implements Serializer
-{
-
- private static final Serializer INSTANCE = new TerminateSequenceSerializer();
-
- private TerminateSequenceSerializer()
- {
- // hide constructor
- }
-
- static Serializer getInstance()
- {
- return INSTANCE;
- }
-
- /**
- * Deserialize <b>TerminateSequence</b> using <b>provider</b>
from the <b>soapMessage</b>
- * @param object to be deserialized
- * @param provider wsrm provider to be used for deserialization process
- * @param soapMessage soap message from which object will be deserialized
- */
- public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- TerminateSequence o = (TerminateSequence)object;
- try
- {
- SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
- Constants wsrmConstants = provider.getConstants();
-
- // read required wsrm:TerminateSequence element
- QName terminateSequenceQName = wsrmConstants.getTerminateSequenceQName();
- SOAPElement terminateSequenceElement = getRequiredElement(soapBody,
terminateSequenceQName, "soap body");
-
- // read required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
- SOAPElement identifierElement = getRequiredElement(terminateSequenceElement,
identifierQName, terminateSequenceQName);
- String identifier = getRequiredTextContent(identifierElement, identifierQName);
- o.setIdentifier(identifier);
-
- // read optional wsrm:LastMsgNumber element
- QName lastMsgNumberQName = wsrmConstants.getLastMsgNumberQName();
- SOAPElement lastMsgNumberElement = getOptionalElement(terminateSequenceElement,
lastMsgNumberQName, terminateSequenceQName);
- if (lastMsgNumberElement != null)
- {
- String lastMsgNumberString = getRequiredTextContent(lastMsgNumberElement,
lastMsgNumberQName);
- long lastMsgNumberValue = stringToLong(lastMsgNumberString, "Unable to
parse LastMsgNumber element text content");
- o.setLastMsgNumber(lastMsgNumberValue);
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to deserialize RM message", se);
- }
- catch (RuntimeException re)
- {
- throw new RMException("Unable to deserialize RM message", re);
- }
- }
-
- /**
- * Serialize <b>TerminateSequence</b> using <b>provider</b> to
the <b>soapMessage</b>
- * @param object to be serialized
- * @param provider wsrm provider to be used for serialization process
- * @param soapMessage soap message to which object will be serialized
- */
- public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws RMException
- {
- TerminateSequence o = (TerminateSequence)object;
- try
- {
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- Constants wsrmConstants = provider.getConstants();
-
- // Add xmlns:wsrm declaration
- soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(),
wsrmConstants.getNamespaceURI());
-
- // write required wsrm:TerminateSequence element
- QName terminateSequenceQName = wsrmConstants.getTerminateSequenceQName();
- SOAPElement terminateSequenceElement =
soapEnvelope.getBody().addChildElement(terminateSequenceQName);
-
- // write required wsrm:Identifier element
- QName identifierQName = wsrmConstants.getIdentifierQName();
-
terminateSequenceElement.addChildElement(identifierQName).setValue(o.getIdentifier());
-
- if (o.getLastMsgNumber() != 0)
- {
- // write optional wsrm:LastMsgNumber element
- QName lastMsgNumberQName = wsrmConstants.getLastMsgNumberQName();
- SOAPElement lastMsgNumberElement =
terminateSequenceElement.addChildElement(lastMsgNumberQName);
- lastMsgNumberElement.setValue(String.valueOf(o.getLastMsgNumber()));
- }
- }
- catch (SOAPException se)
- {
- throw new RMException("Unable to serialize RM message", se);
- }
- }
-
-}
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMConfig.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMConfig.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMConfig.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.config;
+
+import java.util.List;
+import java.util.LinkedList;
+
+/**
+ * Reliable messaging configuration metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMConfig
+{
+
+ private RMDeliveryAssuranceConfig deliveryAssurance;
+ private RMProviderConfig provider;
+ private RMMessageStoreConfig messageStore;
+ private List<RMPortConfig> ports = new LinkedList<RMPortConfig>();
+
+ public final void setDeliveryAssurance(RMDeliveryAssuranceConfig deliveryAssurance)
+ {
+ if (deliveryAssurance == null)
+ throw new IllegalArgumentException();
+
+ this.deliveryAssurance = deliveryAssurance;
+ }
+
+ public final RMDeliveryAssuranceConfig getDeliveryAssurance()
+ {
+ return this.deliveryAssurance;
+ }
+
+ public final void setProvider(RMProviderConfig provider)
+ {
+ if (provider == null)
+ throw new IllegalArgumentException();
+
+ this.provider = provider;
+ }
+
+ public final RMProviderConfig getProvider()
+ {
+ return this.provider;
+ }
+
+ public final void setMessageStore(RMMessageStoreConfig messageStore)
+ {
+ if (messageStore == null)
+ throw new IllegalArgumentException();
+
+ this.messageStore = messageStore;
+ }
+
+ public final RMMessageStoreConfig getMessageStore()
+ {
+ return this.messageStore;
+ }
+
+ public final List<RMPortConfig> getPorts()
+ {
+ return this.ports;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMConfig.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMDeliveryAssuranceConfig.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMDeliveryAssuranceConfig.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMDeliveryAssuranceConfig.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.config;
+
+/**
+ * Delivery assurance metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMDeliveryAssuranceConfig
+{
+
+ private String quality;
+ private String inOrder;
+
+ public final void setQuality(String quality)
+ {
+ if (quality == null)
+ throw new IllegalArgumentException();
+
+ this.quality = quality;
+ }
+
+ public final String getQuality()
+ {
+ return this.quality;
+ }
+
+ public final void setInOrder(String inOrder)
+ {
+ if (inOrder == null)
+ throw new IllegalArgumentException();
+
+ this.inOrder = inOrder;
+ }
+
+ public final String getInOrder()
+ {
+ return this.inOrder;
+ }
+
+ public final String toString()
+ {
+ return "inOrder=\"" + this.inOrder + "\",
quality=\"" + this.quality + "\"";
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMDeliveryAssuranceConfig.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMMessageStoreConfig.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMMessageStoreConfig.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMMessageStoreConfig.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.config;
+
+/**
+ * Message store metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMMessageStoreConfig
+{
+
+ private String id;
+ private String className;
+ private String configFile;
+
+ public final void setId(String id)
+ {
+ if (id == null)
+ throw new IllegalArgumentException();
+
+ this.id = id;
+ }
+
+ public final String getId()
+ {
+ return this.id;
+ }
+
+ public final void setClassName(String className)
+ {
+ if (className == null)
+ throw new IllegalArgumentException();
+
+ this.className = className;
+ }
+
+ public final String getClassName()
+ {
+ return this.className;
+ }
+
+ public final void setConfigFile(String configFile)
+ {
+ if (configFile == null)
+ throw new IllegalArgumentException();
+
+ this.configFile = configFile;
+ }
+
+ public final String getConfigFile()
+ {
+ return this.configFile;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMMessageStoreConfig.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMPortConfig.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMPortConfig.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMPortConfig.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.config;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Port customization metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMPortConfig
+{
+
+ private QName portName;
+ private RMDeliveryAssuranceConfig deliveryAssurance;
+
+ public final void setPortName(QName portName)
+ {
+ if (portName == null)
+ throw new IllegalArgumentException();
+
+ this.portName = portName;
+ }
+
+ public final QName getPortName()
+ {
+ return this.portName;
+ }
+
+ public final void setDeliveryAssurance(RMDeliveryAssuranceConfig deliveryAssurance)
+ {
+ if (deliveryAssurance == null)
+ throw new IllegalArgumentException();
+
+ this.deliveryAssurance = deliveryAssurance;
+ }
+
+ public final RMDeliveryAssuranceConfig getDeliveryAssurance()
+ {
+ return this.deliveryAssurance;
+ }
+
+ public final String toString()
+ {
+ return "portName=\"" + this.portName + "\",
deliveryAssurance={" + this.deliveryAssurance + "}";
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMPortConfig.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMProviderConfig.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMProviderConfig.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMProviderConfig.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.config;
+
+/**
+ * Reliable messaging provider metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMProviderConfig
+{
+
+ private String specVersion;
+
+ public final void setSpecVersion(String specVersion)
+ {
+ if (specVersion == null)
+ throw new IllegalArgumentException();
+
+ this.specVersion = specVersion;
+ }
+
+ public final String getSpecVersion()
+ {
+ return this.specVersion;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMProviderConfig.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RMPolicyAssertionDeployer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RMPolicyAssertionDeployer.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RMPolicyAssertionDeployer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -32,12 +32,12 @@
import org.apache.ws.policy.XorCompositeAssertion;
import org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
+import org.jboss.ws.extensions.wsrm.config.RMDeliveryAssuranceConfig;
+import org.jboss.ws.extensions.wsrm.config.RMConfig;
+import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
+import org.jboss.ws.extensions.wsrm.config.RMProviderConfig;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
-import org.jboss.ws.metadata.wsrm.DeliveryAssuranceMetaData;
-import org.jboss.ws.metadata.wsrm.PortMetaData;
-import org.jboss.ws.metadata.wsrm.ProviderMetaData;
-import org.jboss.ws.metadata.wsrm.ReliableMessagingMetaData;
/**
* Reliable messaging policy deployer
@@ -82,34 +82,34 @@
EndpointMetaData endpointMD = (EndpointMetaData) extMetaData;
// prepare wsrm metadata
- ReliableMessagingMetaData rmMD = endpointMD.getConfig().getRMMetaData();
+ RMConfig rmMD = endpointMD.getConfig().getRMMetaData();
if (rmMD == null)
{
- rmMD = new ReliableMessagingMetaData();
+ rmMD = new RMConfig();
endpointMD.getConfig().setRMMetaData(rmMD);
}
// construct new port metadata
- PortMetaData portMD = new PortMetaData();
+ RMPortConfig portMD = new RMPortConfig();
portMD.setPortName(endpointMD.getPortName());
List<PrimitiveAssertion> wsrmpAssertions = getWSRMPAssertions(assertion);
portMD.setDeliveryAssurance(constructDeliveryAssurance(wsrmpAssertions));
// ensure port does not exists yet
- for (PortMetaData pMD : rmMD.getPorts())
+ for (RMPortConfig pMD : rmMD.getPorts())
{
assert ! pMD.getPortName().equals(portMD.getPortName());
}
// set up port WSRMP metadata
rmMD.getPorts().add(portMD);
- ProviderMetaData providerMD = new ProviderMetaData();
+ RMProviderConfig providerMD = new RMProviderConfig();
providerMD.setSpecVersion(WSRM_NS);
rmMD.setProvider(providerMD);
}
}
- private static DeliveryAssuranceMetaData
constructDeliveryAssurance(List<PrimitiveAssertion> assertions)
+ private static RMDeliveryAssuranceConfig
constructDeliveryAssurance(List<PrimitiveAssertion> assertions)
throws UnsupportedAssertion
{
if (assertions.size() == 1)
@@ -117,7 +117,7 @@
QName assertionQN = assertions.get(0).getName();
assertIsWSRMPAssertion(assertionQN);
- DeliveryAssuranceMetaData deliveryMD = new DeliveryAssuranceMetaData();
+ RMDeliveryAssuranceConfig deliveryMD = new RMDeliveryAssuranceConfig();
deliveryMD.setInOrder(FALSE);
deliveryMD.setQuality(assertionQN.getLocalPart());
return deliveryMD;
@@ -131,7 +131,7 @@
boolean firstIsInOrder = firstAssertionQN.equals(IN_ORDER);
- DeliveryAssuranceMetaData deliveryMD = new DeliveryAssuranceMetaData();
+ RMDeliveryAssuranceConfig deliveryMD = new RMDeliveryAssuranceConfig();
deliveryMD.setInOrder(TRUE);
if (firstIsInOrder)
{
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200502;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested
- */
-final class AckRequestedImpl extends AbstractSerializable implements AckRequested
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
- private long lastMessageNumber;
-
- AckRequestedImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getMessage()
- */
- public long getMessageNumber()
- {
- return this.lastMessageNumber;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setMessage(long)
- */
- public void setMessageNumber(long lastMessageNumber)
- {
- if (lastMessageNumber <= 0)
- throw new IllegalArgumentException("Value must be greater than 0");
- if (this.lastMessageNumber > 0)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.lastMessageNumber = lastMessageNumber;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- result = prime * result + (int)(lastMessageNumber ^ (lastMessageNumber >>>
32));
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof AckRequestedImpl))
- return false;
- final AckRequestedImpl other = (AckRequestedImpl)obj;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- if (lastMessageNumber != other.lastMessageNumber)
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier not set");
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,320 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200502;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence
- */
-final class CreateSequenceImpl extends AbstractSerializable implements CreateSequence
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String acksTo;
- private String expires;
- private Offer offer;
-
- CreateSequenceImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getAcksTo()
- */
- public String getAcksTo()
- {
- return this.acksTo;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getExpires()
- */
- public String getExpires()
- {
- return this.expires;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getOffer()
- */
- public Offer getOffer()
- {
- return this.offer;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#newOffer()
- */
- public Offer newOffer()
- {
- return new OfferImpl();
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setAcksTo(java.lang.String)
- */
- public void setAcksTo(String address)
- {
- if ((address == null) || (address.trim().equals("")))
- throw new IllegalArgumentException("Address cannot be null nor empty
string");
- if (this.acksTo != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.acksTo = address;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setExpires(java.lang.String)
- */
- public void setExpires(String duration)
- {
- if ((duration == null) || (duration.trim().equals("")))
- throw new IllegalArgumentException("Duration cannot be null nor empty
string");
- if (this.expires != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.expires = duration;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setOffer(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer)
- */
- public void setOffer(Offer offer)
- {
- if (offer == null)
- throw new IllegalArgumentException("Offer cannot be null");
- if (!(offer instanceof OfferImpl))
- throw new IllegalArgumentException();
- if (offer.getIdentifier() == null)
- throw new IllegalArgumentException("Offer identifier must be
specified");
- if (offer.getEndpoint() == null)
- throw new IllegalArgumentException("Offer endpoint address must be
specified");
- if (this.offer != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.offer = offer;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
- result = prime * result + ((expires == null) ? 0 : expires.hashCode());
- result = prime * result + ((offer == null) ? 0 : offer.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof CreateSequenceImpl))
- return false;
- final CreateSequenceImpl other = (CreateSequenceImpl)obj;
- if (acksTo == null)
- {
- if (other.acksTo != null)
- return false;
- }
- else if (!acksTo.equals(other.acksTo))
- return false;
- if (expires == null)
- {
- if (other.expires != null)
- return false;
- }
- else if (!expires.equals(other.expires))
- return false;
- if (offer == null)
- {
- if (other.offer != null)
- return false;
- }
- else if (!offer.equals(other.offer))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.acksTo == null)
- throw new RMException("AcksTo must be set");
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer
- */
- private static class OfferImpl implements CreateSequence.Offer
- {
-
- private String duration;
- private String identifier;
-
- private OfferImpl()
- {
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getEndpoint()
- */
- public String getEndpoint()
- {
- return null; // always return null for this version of the RM protocol
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getExpires()
- */
- public String getExpires()
- {
- return this.duration;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIncompleteSequenceBehavior()
- */
- public IncompleteSequenceBehavior getIncompleteSequenceBehavior()
- {
- return null; // always return null for this version of the RM protocol
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setEndpoint(java.lang.String)
- */
- public void setEndpoint(String address)
- {
- // do nothing for this version of the RM protocol
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setExpires(java.lang.String)
- */
- public void setExpires(String duration)
- {
- if ((duration == null) || (duration.trim().equals("")))
- throw new IllegalArgumentException("Duration cannot be null nor empty
string");
- if (this.duration != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.duration = duration;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
- */
- public void setIncompleteSequenceBehavior(IncompleteSequenceBehavior
incompleteSequenceBehavior)
- {
- // do nothing for this version of the RM protocol
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((duration == null) ? 0 : duration.hashCode());
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof OfferImpl))
- return false;
- final OfferImpl other = (OfferImpl)obj;
- if (duration == null)
- {
- if (other.duration != null)
- return false;
- }
- else if (!duration.equals(other.duration))
- return false;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- return true;
- }
-
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,268 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200502;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse
- */
-final class CreateSequenceResponseImpl extends AbstractSerializable implements
CreateSequenceResponse
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
- private String expires;
- private Accept accept;
-
- CreateSequenceResponseImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getAccept()
- */
- public Accept getAccept()
- {
- return this.accept;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getDuration()
- */
- public String getExpires()
- {
- return this.expires;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIncompleteSequenceBehavior()
- */
- public IncompleteSequenceBehavior getIncompleteSequenceBehavior()
- {
- return null; // always return null for this version of the RM protocol
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#newAccept()
- */
- public Accept newAccept()
- {
- return new AcceptImpl();
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setAccept(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept)
- */
- public void setAccept(Accept accept)
- {
- if (accept == null)
- throw new IllegalArgumentException("Accept cannot be null");
- if (!(accept instanceof AcceptImpl))
- throw new IllegalArgumentException();
- if (accept.getAcksTo() == null)
- throw new IllegalArgumentException("Accept acksTo must be
specified");
- if (this.accept != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.accept = accept;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setExpires(java.lang.String)
- */
- public void setExpires(String duration)
- {
- if ((duration == null) || (duration.trim().equals("")))
- throw new IllegalArgumentException("Duration cannot be null nor empty
string");
- if (this.expires != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.expires = duration;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
- */
- public void setIncompleteSequenceBehavior(IncompleteSequenceBehavior
incompleteSequenceBehavior)
- {
- // do nothing for this version of the RM protocol
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((accept == null) ? 0 : accept.hashCode());
- result = prime * result + ((expires == null) ? 0 : expires.hashCode());
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof CreateSequenceResponseImpl))
- return false;
- final CreateSequenceResponseImpl other = (CreateSequenceResponseImpl)obj;
- if (accept == null)
- {
- if (other.accept != null)
- return false;
- }
- else if (!accept.equals(other.accept))
- return false;
- if (expires == null)
- {
- if (other.expires != null)
- return false;
- }
- else if (!expires.equals(other.expires))
- return false;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier must be set");
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept
- */
- private static class AcceptImpl implements CreateSequenceResponse.Accept
- {
-
- private String acksTo;
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept#getAcksTo()
- */
- public String getAcksTo()
- {
- return this.acksTo;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept#setAcksTo(java.lang.String)
- */
- public void setAcksTo(String address)
- {
- if ((address == null) || (address.trim().equals("")))
- throw new IllegalArgumentException("Address cannot be null nor empty
string");
- if (this.acksTo != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.acksTo = address;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof AcceptImpl))
- return false;
- final AcceptImpl other = (AcceptImpl)obj;
- if (acksTo == null)
- {
- if (other.acksTo != null)
- return false;
- }
- else if (!acksTo.equals(other.acksTo))
- return false;
- return true;
- }
-
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,135 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200502;
-
-import org.jboss.ws.extensions.wsrm.spi.MessageFactory;
-import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory
- */
-final class MessageFactoryImpl implements MessageFactory
-{
-
- private static final MessageFactory INSTANCE = new MessageFactoryImpl();
-
- private MessageFactoryImpl()
- {
- // forbidden inheritance
- }
-
- public static MessageFactory getInstance()
- {
- return INSTANCE;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newAckRequested()
- */
- public AckRequested newAckRequested()
- {
- return new AckRequestedImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequence()
- */
- public CloseSequence newCloseSequence()
- {
- return null; // not supported by this version of the RM protocol
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequenceResponse()
- */
- public CloseSequenceResponse newCloseSequenceResponse()
- {
- return null; // not supported by this version of the RM protocol
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequence()
- */
- public CreateSequence newCreateSequence()
- {
- return new CreateSequenceImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequenceResponse()
- */
- public CreateSequenceResponse newCreateSequenceResponse()
- {
- return new CreateSequenceResponseImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequence()
- */
- public Sequence newSequence()
- {
- return new SequenceImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceAcknowledgement()
- */
- public SequenceAcknowledgement newSequenceAcknowledgement()
- {
- return new SequenceAcknowledgementImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceFault()
- */
- public SequenceFault newSequenceFault()
- {
- return new SequenceFaultImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequence()
- */
- public TerminateSequence newTerminateSequence()
- {
- return new TerminateSequenceImpl();
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequenceResponse()
- */
- public TerminateSequenceResponse newTerminateSequenceResponse()
- {
- return null; // not supported by this version of the RM protocol
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200502;
-
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.MessageFactory;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.common.ConstantsImpl;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.Provider
- */
-public final class ProviderImpl extends Provider
-{
-
- private static final String IMPLEMENTATION_VERSION =
"http://schemas.xmlsoap.org/ws/2005/02/rm";
- private static final Constants CONSTANTS = new ConstantsImpl("wsrm10",
IMPLEMENTATION_VERSION);
- private static final Provider INSTANCE = new ProviderImpl();
-
- private ProviderImpl()
- {
- // forbidden inheritance
- }
-
- public static Provider getInstance()
- {
- return INSTANCE;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.Provider#getMessageFactory()
- */
- @Override
- public MessageFactory getMessageFactory()
- {
- return MessageFactoryImpl.getInstance();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.Provider#getConstants()
- */
- @Override
- public Constants getConstants()
- {
- return CONSTANTS;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.Provider#getNamespaceURI()
- */
- @Override
- public String getNamespaceURI()
- {
- return IMPLEMENTATION_VERSION;
- }
-
-}
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMAckRequestedImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMAckRequestedImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMAckRequestedImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200502;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested
+ */
+final class RMAckRequestedImpl extends RMAbstractSerializable implements RMAckRequested
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private long lastMessageNumber;
+
+ RMAckRequestedImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getMessage()
+ */
+ public long getMessageNumber()
+ {
+ return this.lastMessageNumber;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setMessage(long)
+ */
+ public void setMessageNumber(long lastMessageNumber)
+ {
+ if (lastMessageNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.lastMessageNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.lastMessageNumber = lastMessageNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (int)(lastMessageNumber ^ (lastMessageNumber >>>
32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMAckRequestedImpl))
+ return false;
+ final RMAckRequestedImpl other = (RMAckRequestedImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (lastMessageNumber != other.lastMessageNumber)
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMAckRequestedImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,320 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200502;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence
+ */
+final class RMCreateSequenceImpl extends RMAbstractSerializable implements
RMCreateSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String acksTo;
+ private String expires;
+ private Offer offer;
+
+ RMCreateSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getAcksTo()
+ */
+ public String getAcksTo()
+ {
+ return this.acksTo;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getExpires()
+ */
+ public String getExpires()
+ {
+ return this.expires;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getOffer()
+ */
+ public Offer getOffer()
+ {
+ return this.offer;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#newOffer()
+ */
+ public Offer newOffer()
+ {
+ return new OfferImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setAcksTo(java.lang.String)
+ */
+ public void setAcksTo(String address)
+ {
+ if ((address == null) || (address.trim().equals("")))
+ throw new IllegalArgumentException("Address cannot be null nor empty
string");
+ if (this.acksTo != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.acksTo = address;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty
string");
+ if (this.expires != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.expires = duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setOffer(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer)
+ */
+ public void setOffer(Offer offer)
+ {
+ if (offer == null)
+ throw new IllegalArgumentException("Offer cannot be null");
+ if (!(offer instanceof OfferImpl))
+ throw new IllegalArgumentException();
+ if (offer.getIdentifier() == null)
+ throw new IllegalArgumentException("Offer identifier must be
specified");
+ if (offer.getEndpoint() == null)
+ throw new IllegalArgumentException("Offer endpoint address must be
specified");
+ if (this.offer != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.offer = offer;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
+ result = prime * result + ((expires == null) ? 0 : expires.hashCode());
+ result = prime * result + ((offer == null) ? 0 : offer.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCreateSequenceImpl))
+ return false;
+ final RMCreateSequenceImpl other = (RMCreateSequenceImpl)obj;
+ if (acksTo == null)
+ {
+ if (other.acksTo != null)
+ return false;
+ }
+ else if (!acksTo.equals(other.acksTo))
+ return false;
+ if (expires == null)
+ {
+ if (other.expires != null)
+ return false;
+ }
+ else if (!expires.equals(other.expires))
+ return false;
+ if (offer == null)
+ {
+ if (other.offer != null)
+ return false;
+ }
+ else if (!offer.equals(other.offer))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.acksTo == null)
+ throw new RMException("AcksTo must be set");
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer
+ */
+ private static class OfferImpl implements RMCreateSequence.Offer
+ {
+
+ private String duration;
+ private String identifier;
+
+ private OfferImpl()
+ {
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getEndpoint()
+ */
+ public String getEndpoint()
+ {
+ return null; // always return null for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getExpires()
+ */
+ public String getExpires()
+ {
+ return this.duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIncompleteSequenceBehavior()
+ */
+ public RMIncompleteSequenceBehavior getIncompleteSequenceBehavior()
+ {
+ return null; // always return null for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setEndpoint(java.lang.String)
+ */
+ public void setEndpoint(String address)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty
string");
+ if (this.duration != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.duration = duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
+ */
+ public void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior
incompleteSequenceBehavior)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((duration == null) ? 0 : duration.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof OfferImpl))
+ return false;
+ final OfferImpl other = (OfferImpl)obj;
+ if (duration == null)
+ {
+ if (other.duration != null)
+ return false;
+ }
+ else if (!duration.equals(other.duration))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceResponseImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,268 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200502;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse
+ */
+final class RMCreateSequenceResponseImpl extends RMAbstractSerializable implements
RMCreateSequenceResponse
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private String expires;
+ private Accept accept;
+
+ RMCreateSequenceResponseImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getAccept()
+ */
+ public Accept getAccept()
+ {
+ return this.accept;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getDuration()
+ */
+ public String getExpires()
+ {
+ return this.expires;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIncompleteSequenceBehavior()
+ */
+ public RMIncompleteSequenceBehavior getIncompleteSequenceBehavior()
+ {
+ return null; // always return null for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#newAccept()
+ */
+ public Accept newAccept()
+ {
+ return new AcceptImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setAccept(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept)
+ */
+ public void setAccept(Accept accept)
+ {
+ if (accept == null)
+ throw new IllegalArgumentException("Accept cannot be null");
+ if (!(accept instanceof AcceptImpl))
+ throw new IllegalArgumentException();
+ if (accept.getAcksTo() == null)
+ throw new IllegalArgumentException("Accept acksTo must be
specified");
+ if (this.accept != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.accept = accept;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty
string");
+ if (this.expires != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.expires = duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
+ */
+ public void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior
incompleteSequenceBehavior)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((accept == null) ? 0 : accept.hashCode());
+ result = prime * result + ((expires == null) ? 0 : expires.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCreateSequenceResponseImpl))
+ return false;
+ final RMCreateSequenceResponseImpl other = (RMCreateSequenceResponseImpl)obj;
+ if (accept == null)
+ {
+ if (other.accept != null)
+ return false;
+ }
+ else if (!accept.equals(other.accept))
+ return false;
+ if (expires == null)
+ {
+ if (other.expires != null)
+ return false;
+ }
+ else if (!expires.equals(other.expires))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier must be set");
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept
+ */
+ private static class AcceptImpl implements RMCreateSequenceResponse.Accept
+ {
+
+ private String acksTo;
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept#getAcksTo()
+ */
+ public String getAcksTo()
+ {
+ return this.acksTo;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept#setAcksTo(java.lang.String)
+ */
+ public void setAcksTo(String address)
+ {
+ if ((address == null) || (address.trim().equals("")))
+ throw new IllegalArgumentException("Address cannot be null nor empty
string");
+ if (this.acksTo != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.acksTo = address;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof AcceptImpl))
+ return false;
+ final AcceptImpl other = (AcceptImpl)obj;
+ if (acksTo == null)
+ {
+ if (other.acksTo != null)
+ return false;
+ }
+ else if (!acksTo.equals(other.acksTo))
+ return false;
+ return true;
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMCreateSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMMessageFactoryImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMMessageFactoryImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMMessageFactoryImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200502;
+
+import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+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.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory
+ */
+final class RMMessageFactoryImpl implements RMMessageFactory
+{
+
+ private static final RMMessageFactory INSTANCE = new RMMessageFactoryImpl();
+
+ private RMMessageFactoryImpl()
+ {
+ // forbidden inheritance
+ }
+
+ public static RMMessageFactory getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newAckRequested()
+ */
+ public RMAckRequested newAckRequested()
+ {
+ return new RMAckRequestedImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequence()
+ */
+ public RMCloseSequence newCloseSequence()
+ {
+ return null; // not supported by this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequenceResponse()
+ */
+ public RMCloseSequenceResponse newCloseSequenceResponse()
+ {
+ return null; // not supported by this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequence()
+ */
+ public RMCreateSequence newCreateSequence()
+ {
+ return new RMCreateSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequenceResponse()
+ */
+ public RMCreateSequenceResponse newCreateSequenceResponse()
+ {
+ return new RMCreateSequenceResponseImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequence()
+ */
+ public RMSequence newSequence()
+ {
+ return new RMSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceAcknowledgement()
+ */
+ public RMSequenceAcknowledgement newSequenceAcknowledgement()
+ {
+ return new RMSequenceAcknowledgementImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceFault()
+ */
+ public RMSequenceFault newSequenceFault()
+ {
+ return new RMSequenceFaultImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequence()
+ */
+ public RMTerminateSequence newTerminateSequence()
+ {
+ return new RMTerminateSequenceImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequenceResponse()
+ */
+ public RMTerminateSequenceResponse newTerminateSequenceResponse()
+ {
+ return null; // not supported by this version of the RM protocol
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMMessageFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMProviderImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMProviderImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMProviderImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200502;
+
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.common.RMConstantsImpl;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider
+ */
+public final class RMProviderImpl extends RMProvider
+{
+
+ private static final String IMPLEMENTATION_VERSION =
"http://schemas.xmlsoap.org/ws/2005/02/rm";
+ private static final RMConstants CONSTANTS = new RMConstantsImpl("wsrm10",
IMPLEMENTATION_VERSION);
+ private static final RMProvider INSTANCE = new RMProviderImpl();
+
+ private RMProviderImpl()
+ {
+ // forbidden inheritance
+ }
+
+ public static RMProvider getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getMessageFactory()
+ */
+ @Override
+ public RMMessageFactory getMessageFactory()
+ {
+ return RMMessageFactoryImpl.getInstance();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getConstants()
+ */
+ @Override
+ public RMConstants getConstants()
+ {
+ return CONSTANTS;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getNamespaceURI()
+ */
+ @Override
+ public String getNamespaceURI()
+ {
+ return IMPLEMENTATION_VERSION;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMProviderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceAcknowledgementImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,325 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200502;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Collections;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement
+ */
+final class RMSequenceAcknowledgementImpl extends RMAbstractSerializable implements
RMSequenceAcknowledgement
+{
+
+ // provider used by de/serialization framework
+ 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 String identifier;
+
+ RMSequenceAcknowledgementImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addAcknowledgementRange(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange)
+ */
+ public void addAcknowledgementRange(AcknowledgementRange newAcknowledgementRange)
+ {
+ if ((newAcknowledgementRange == null) || (!(newAcknowledgementRange instanceof
AcknowledgementRangeImpl)))
+ throw new IllegalArgumentException();
+ if (this.nacks.size() != 0)
+ 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)
+ checkOverlap(alreadyAccepted, newAcknowledgementRange);
+
+ this.acknowledgementRanges.add(newAcknowledgementRange);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addNack(long)
+ */
+ public void addNack(long messageNumber)
+ {
+ if (this.acknowledgementRanges.size() != 0)
+ throw new IllegalStateException("There are already some acknowledgement
ranges specified");
+ if (this.nacks.contains(messageNumber))
+ throw new IllegalArgumentException("There is already nack with value "
+ messageNumber + " specified");
+
+ this.nacks.add(messageNumber);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getAcknowledgementRanges()
+ */
+ public List<AcknowledgementRange> getAcknowledgementRanges()
+ {
+ return Collections.unmodifiableList(acknowledgementRanges);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getNacks()
+ */
+ public List<Long> getNacks()
+ {
+ return Collections.unmodifiableList(nacks);
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#isFinal()
+ */
+ public boolean isFinal()
+ {
+ return false; // always return false for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#isNone()
+ */
+ public boolean isNone()
+ {
+ return false; // always return false for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#newAcknowledgementRange()
+ */
+ public AcknowledgementRange newAcknowledgementRange()
+ {
+ return new AcknowledgementRangeImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setFinal(boolean)
+ */
+ public void setFinal()
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setNone(boolean)
+ */
+ public void setNone()
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + ((nacks == null) ? 0 : nacks.hashCode());
+ result = prime * result + ((acknowledgementRanges == null) ? 0 :
acknowledgementRanges.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceAcknowledgementImpl))
+ return false;
+ final RMSequenceAcknowledgementImpl other = (RMSequenceAcknowledgementImpl)obj;
+ if (acknowledgementRanges == null)
+ {
+ if (other.acknowledgementRanges != null)
+ return false;
+ }
+ else if (!acknowledgementRanges.equals(other.acknowledgementRanges))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (nacks == null)
+ {
+ if (other.nacks != null)
+ return false;
+ }
+ else if (!nacks.equals(other.nacks))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ if ((this.acknowledgementRanges.size() == 0) && (this.nacks.size() == 0))
+ throw new RMException("AcknowledgementRange or Nack must be set");
+ }
+
+ private static void checkOverlap(AcknowledgementRange currentRange,
AcknowledgementRange newRange)
+ {
+ if ((currentRange.getLower() <= newRange.getLower()) &&
(newRange.getLower() <= currentRange.getUpper()))
+ throw new IllegalArgumentException(
+ "Overlap detected: " + currentRange + " vs. " +
newRange);
+ if ((currentRange.getLower() <= newRange.getUpper()) &&
(newRange.getUpper() <= currentRange.getUpper()))
+ throw new IllegalArgumentException(
+ "Overlap detected: " + currentRange + " vs. " +
newRange);
+ }
+
+ private static class AcknowledgementRangeImpl implements
RMSequenceAcknowledgement.AcknowledgementRange
+ {
+
+ private long lower;
+ private long upper;
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#getLower()
+ */
+ public long getLower()
+ {
+ return this.lower;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#getUpper()
+ */
+ public long getUpper()
+ {
+ return this.upper;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#setLower(long)
+ */
+ public void setLower(long lower)
+ {
+ if (lower <= 0)
+ throw new IllegalArgumentException("Value must be greater than
0");
+ if (this.lower > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+ if ((this.upper > 0) && (lower > this.upper))
+ throw new IllegalArgumentException("Value must be lower or equal to
" + this.upper);
+
+ this.lower = lower;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#setUpper(long)
+ */
+ public void setUpper(long upper)
+ {
+ if (upper <= 0)
+ throw new IllegalArgumentException("Value must be greater than
0");
+ if (this.upper > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+ if ((this.lower > 0) && (this.lower > upper))
+ throw new IllegalArgumentException("Value must be greater or equal to
" + this.lower);
+
+ this.upper = upper;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (int)(lower ^ (lower >>> 32));
+ result = prime * result + (int)(upper ^ (upper >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof AcknowledgementRangeImpl))
+ return false;
+ final AcknowledgementRangeImpl other = (AcknowledgementRangeImpl)obj;
+ if (lower != other.lower)
+ return false;
+ if (upper != other.upper)
+ return false;
+ return true;
+ }
+
+ public String toString()
+ {
+ return "<" + lower + "; " + upper + ">";
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceAcknowledgementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceFaultImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceFaultImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceFaultImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200502;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceFaultCode;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault
+ */
+final class RMSequenceFaultImpl extends RMAbstractSerializable implements
RMSequenceFault
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private RMSequenceFaultCode faultCode;
+ private Exception detail;
+
+ RMSequenceFaultImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getDetail()
+ */
+ public Exception getDetail()
+ {
+ return this.detail;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getFaultCode()
+ */
+ public RMSequenceFaultCode getFaultCode()
+ {
+ return this.faultCode;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setDetail(java.lang.Exception)
+ */
+ public void setDetail(Exception detail)
+ {
+ if (detail == null)
+ throw new IllegalArgumentException("Detail cannot be null");
+ if (this.detail != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.detail = detail;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setFaultCode(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFaultCode)
+ */
+ public void setFaultCode(RMSequenceFaultCode faultCode)
+ {
+ if (faultCode == null)
+ throw new IllegalArgumentException("Fault code cannot be null");
+ if (this.faultCode != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.faultCode = faultCode;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((detail == null) ? 0 : detail.getMessage().hashCode());
+ result = prime * result + ((faultCode == null) ? 0 : faultCode.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceFaultImpl))
+ return false;
+ final RMSequenceFaultImpl other = (RMSequenceFaultImpl)obj;
+ if (detail == null)
+ {
+ if (other.detail != null)
+ return false;
+ }
+ else if (!detail.getMessage().equals(other.detail.getMessage()))
+ return false;
+ if (faultCode == null)
+ {
+ if (other.faultCode != null)
+ return false;
+ }
+ else if (!faultCode.equals(other.faultCode))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.faultCode == null)
+ throw new RMException("FaultCode must be set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceFaultImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200502;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence
+ */
+final class RMSequenceImpl extends RMAbstractSerializable implements RMSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private long messageNumber;
+ private boolean isLastMessage;
+
+ RMSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getMessageNumber()
+ */
+ public long getMessageNumber()
+ {
+ return messageNumber;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#isLastMessage()
+ */
+ public boolean isLastMessage()
+ {
+ return this.isLastMessage;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setLastMessage(boolean)
+ */
+ public void setLastMessage()
+ {
+ this.isLastMessage = true;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setMessageNumber(long)
+ */
+ public void setMessageNumber(long messageNumber)
+ {
+ if (messageNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.messageNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.messageNumber = messageNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (isLastMessage ? 1231 : 1237);
+ result = prime * result + (int)(messageNumber ^ (messageNumber >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceImpl))
+ return false;
+ final RMSequenceImpl other = (RMSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (isLastMessage != other.isLastMessage)
+ return false;
+ if (messageNumber != other.messageNumber)
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier must be set");
+ if (this.messageNumber == 0)
+ throw new RMException("MessageNumber must be set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMTerminateSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMTerminateSequenceImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMTerminateSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200502;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence
+ */
+final class RMTerminateSequenceImpl extends RMAbstractSerializable implements
RMTerminateSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+
+ RMTerminateSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getLastMsgNumber()
+ */
+ public long getLastMsgNumber()
+ {
+ return 0; // always return zero for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setLastMsgNumber(long)
+ */
+ public void setLastMsgNumber(long lastMsgNumber)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMTerminateSequenceImpl))
+ return false;
+ final RMTerminateSequenceImpl other = (RMTerminateSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/RMTerminateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,325 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200502;
-
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Collections;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement
- */
-final class SequenceAcknowledgementImpl extends AbstractSerializable implements
SequenceAcknowledgement
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private final List<Long> nacks = new LinkedList<Long>();
- private final List<AcknowledgementRange> acknowledgementRanges = new
LinkedList<AcknowledgementRange>();
- private String identifier;
-
- SequenceAcknowledgementImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addAcknowledgementRange(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange)
- */
- public void addAcknowledgementRange(AcknowledgementRange newAcknowledgementRange)
- {
- if ((newAcknowledgementRange == null) || (!(newAcknowledgementRange instanceof
AcknowledgementRangeImpl)))
- throw new IllegalArgumentException();
- if (this.nacks.size() != 0)
- 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)
- checkOverlap(alreadyAccepted, newAcknowledgementRange);
-
- this.acknowledgementRanges.add(newAcknowledgementRange);
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addNack(long)
- */
- public void addNack(long messageNumber)
- {
- if (this.acknowledgementRanges.size() != 0)
- throw new IllegalStateException("There are already some acknowledgement
ranges specified");
- if (this.nacks.contains(messageNumber))
- throw new IllegalArgumentException("There is already nack with value "
+ messageNumber + " specified");
-
- this.nacks.add(messageNumber);
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getAcknowledgementRanges()
- */
- public List<AcknowledgementRange> getAcknowledgementRanges()
- {
- return Collections.unmodifiableList(acknowledgementRanges);
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getNacks()
- */
- public List<Long> getNacks()
- {
- return Collections.unmodifiableList(nacks);
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#isFinal()
- */
- public boolean isFinal()
- {
- return false; // always return false for this version of the RM protocol
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#isNone()
- */
- public boolean isNone()
- {
- return false; // always return false for this version of the RM protocol
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#newAcknowledgementRange()
- */
- public AcknowledgementRange newAcknowledgementRange()
- {
- return new AcknowledgementRangeImpl();
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setFinal(boolean)
- */
- public void setFinal()
- {
- // do nothing for this version of the RM protocol
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setNone(boolean)
- */
- public void setNone()
- {
- // do nothing for this version of the RM protocol
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- result = prime * result + ((nacks == null) ? 0 : nacks.hashCode());
- result = prime * result + ((acknowledgementRanges == null) ? 0 :
acknowledgementRanges.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof SequenceAcknowledgementImpl))
- return false;
- final SequenceAcknowledgementImpl other = (SequenceAcknowledgementImpl)obj;
- if (acknowledgementRanges == null)
- {
- if (other.acknowledgementRanges != null)
- return false;
- }
- else if (!acknowledgementRanges.equals(other.acknowledgementRanges))
- return false;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- if (nacks == null)
- {
- if (other.nacks != null)
- return false;
- }
- else if (!nacks.equals(other.nacks))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier not set");
- if ((this.acknowledgementRanges.size() == 0) && (this.nacks.size() == 0))
- throw new RMException("AcknowledgementRange or Nack must be set");
- }
-
- private static void checkOverlap(AcknowledgementRange currentRange,
AcknowledgementRange newRange)
- {
- if ((currentRange.getLower() <= newRange.getLower()) &&
(newRange.getLower() <= currentRange.getUpper()))
- throw new IllegalArgumentException(
- "Overlap detected: " + currentRange + " vs. " +
newRange);
- if ((currentRange.getLower() <= newRange.getUpper()) &&
(newRange.getUpper() <= currentRange.getUpper()))
- throw new IllegalArgumentException(
- "Overlap detected: " + currentRange + " vs. " +
newRange);
- }
-
- private static class AcknowledgementRangeImpl implements
SequenceAcknowledgement.AcknowledgementRange
- {
-
- private long lower;
- private long upper;
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#getLower()
- */
- public long getLower()
- {
- return this.lower;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#getUpper()
- */
- public long getUpper()
- {
- return this.upper;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#setLower(long)
- */
- public void setLower(long lower)
- {
- if (lower <= 0)
- throw new IllegalArgumentException("Value must be greater than
0");
- if (this.lower > 0)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
- if ((this.upper > 0) && (lower > this.upper))
- throw new IllegalArgumentException("Value must be lower or equal to
" + this.upper);
-
- this.lower = lower;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#setUpper(long)
- */
- public void setUpper(long upper)
- {
- if (upper <= 0)
- throw new IllegalArgumentException("Value must be greater than
0");
- if (this.upper > 0)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
- if ((this.lower > 0) && (this.lower > upper))
- throw new IllegalArgumentException("Value must be greater or equal to
" + this.lower);
-
- this.upper = upper;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + (int)(lower ^ (lower >>> 32));
- result = prime * result + (int)(upper ^ (upper >>> 32));
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof AcknowledgementRangeImpl))
- return false;
- final AcknowledgementRangeImpl other = (AcknowledgementRangeImpl)obj;
- if (lower != other.lower)
- return false;
- if (upper != other.upper)
- return false;
- return true;
- }
-
- public String toString()
- {
- return "<" + lower + "; " + upper + ">";
- }
-
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,144 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200502;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFaultCode;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault
- */
-final class SequenceFaultImpl extends AbstractSerializable implements SequenceFault
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private SequenceFaultCode faultCode;
- private Exception detail;
-
- SequenceFaultImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getDetail()
- */
- public Exception getDetail()
- {
- return this.detail;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getFaultCode()
- */
- public SequenceFaultCode getFaultCode()
- {
- return this.faultCode;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setDetail(java.lang.Exception)
- */
- public void setDetail(Exception detail)
- {
- if (detail == null)
- throw new IllegalArgumentException("Detail cannot be null");
- if (this.detail != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.detail = detail;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setFaultCode(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFaultCode)
- */
- public void setFaultCode(SequenceFaultCode faultCode)
- {
- if (faultCode == null)
- throw new IllegalArgumentException("Fault code cannot be null");
- if (this.faultCode != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.faultCode = faultCode;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((detail == null) ? 0 : detail.getMessage().hashCode());
- result = prime * result + ((faultCode == null) ? 0 : faultCode.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof SequenceFaultImpl))
- return false;
- final SequenceFaultImpl other = (SequenceFaultImpl)obj;
- if (detail == null)
- {
- if (other.detail != null)
- return false;
- }
- else if (!detail.getMessage().equals(other.detail.getMessage()))
- return false;
- if (faultCode == null)
- {
- if (other.faultCode != null)
- return false;
- }
- else if (!faultCode.equals(other.faultCode))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.faultCode == null)
- throw new RMException("FaultCode must be set");
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,160 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200502;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence
- */
-final class SequenceImpl extends AbstractSerializable implements Sequence
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
- private long messageNumber;
- private boolean isLastMessage;
-
- SequenceImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getMessageNumber()
- */
- public long getMessageNumber()
- {
- return messageNumber;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#isLastMessage()
- */
- public boolean isLastMessage()
- {
- return this.isLastMessage;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setLastMessage(boolean)
- */
- public void setLastMessage()
- {
- this.isLastMessage = true;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setMessageNumber(long)
- */
- public void setMessageNumber(long messageNumber)
- {
- if (messageNumber <= 0)
- throw new IllegalArgumentException("Value must be greater than 0");
- if (this.messageNumber > 0)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.messageNumber = messageNumber;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- result = prime * result + (isLastMessage ? 1231 : 1237);
- result = prime * result + (int)(messageNumber ^ (messageNumber >>> 32));
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof SequenceImpl))
- return false;
- final SequenceImpl other = (SequenceImpl)obj;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- if (isLastMessage != other.isLastMessage)
- return false;
- if (messageNumber != other.messageNumber)
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier must be set");
- if (this.messageNumber == 0)
- throw new RMException("MessageNumber must be set");
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200502;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence
- */
-final class TerminateSequenceImpl extends AbstractSerializable implements
TerminateSequence
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
-
- TerminateSequenceImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getLastMsgNumber()
- */
- public long getLastMsgNumber()
- {
- return 0; // always return zero for this version of the RM protocol
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setLastMsgNumber(long)
- */
- public void setLastMsgNumber(long lastMsgNumber)
- {
- // do nothing for this version of the RM protocol
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof TerminateSequenceImpl))
- return false;
- final TerminateSequenceImpl other = (TerminateSequenceImpl)obj;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier not set");
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/AckRequestedImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/AckRequestedImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/AckRequestedImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested
- */
-final class AckRequestedImpl extends AbstractSerializable implements AckRequested
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
-
- AckRequestedImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getMessage()
- */
- public long getMessageNumber()
- {
- return 0; // always return zero for this version of the RM protocol
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setMessage(long)
- */
- public void setMessageNumber(long lastMessageNumber)
- {
- // do nothing for this version of the RM protocol
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof AckRequestedImpl))
- return false;
- final AckRequestedImpl other = (AckRequestedImpl)obj;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier not set");
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence
- */
-final class CloseSequenceImpl extends AbstractSerializable implements CloseSequence
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
- private long lastMsgNumber;
-
- CloseSequenceImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#getLastMsgNumber()
- */
- public long getLastMsgNumber()
- {
- return this.lastMsgNumber;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#setLastMsgNumber(long)
- */
- public void setLastMsgNumber(long lastMsgNumber)
- {
- if (lastMsgNumber <= 0)
- throw new IllegalArgumentException("Value must be greater than 0");
- if (this.lastMsgNumber > 0)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.lastMsgNumber = lastMsgNumber;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- result = prime * result + (int)(lastMsgNumber ^ (lastMsgNumber >>> 32));
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof CloseSequenceImpl))
- return false;
- final CloseSequenceImpl other = (CloseSequenceImpl)obj;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- if (lastMsgNumber != other.lastMsgNumber)
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier not set");
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceResponseImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceResponseImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceResponseImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse
- */
-final class CloseSequenceResponseImpl extends AbstractSerializable implements
CloseSequenceResponse
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
-
- CloseSequenceResponseImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof CloseSequenceResponseImpl))
- return false;
- final CloseSequenceResponseImpl other = (CloseSequenceResponseImpl)obj;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier not set");
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,348 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence
- */
-final class CreateSequenceImpl extends AbstractSerializable implements CreateSequence
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String acksTo;
- private String expires;
- private Offer offer;
-
- CreateSequenceImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getAcksTo()
- */
- public String getAcksTo()
- {
- return this.acksTo;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getExpires()
- */
- public String getExpires()
- {
- return this.expires;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getOffer()
- */
- public Offer getOffer()
- {
- return this.offer;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#newOffer()
- */
- public Offer newOffer()
- {
- return new OfferImpl();
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setAcksTo(java.lang.String)
- */
- public void setAcksTo(String address)
- {
- if ((address == null) || (address.trim().equals("")))
- throw new IllegalArgumentException("Address cannot be null nor empty
string");
- if (this.acksTo != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.acksTo = address;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setExpires(java.lang.String)
- */
- public void setExpires(String duration)
- {
- if ((duration == null) || (duration.trim().equals("")))
- throw new IllegalArgumentException("Duration cannot be null nor empty
string");
- if (this.expires != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.expires = duration;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setOffer(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer)
- */
- public void setOffer(Offer offer)
- {
- if (offer == null)
- throw new IllegalArgumentException("Offer cannot be null");
- if (!(offer instanceof OfferImpl))
- throw new IllegalArgumentException();
- if (offer.getIdentifier() == null)
- throw new IllegalArgumentException("Offer identifier must be
specified");
- if (offer.getEndpoint() == null)
- throw new IllegalArgumentException("Offer endpoint address must be
specified");
- if (this.offer != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.offer = offer;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
- result = prime * result + ((expires == null) ? 0 : expires.hashCode());
- result = prime * result + ((offer == null) ? 0 : offer.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof CreateSequenceImpl))
- return false;
- final CreateSequenceImpl other = (CreateSequenceImpl)obj;
- if (acksTo == null)
- {
- if (other.acksTo != null)
- return false;
- }
- else if (!acksTo.equals(other.acksTo))
- return false;
- if (expires == null)
- {
- if (other.expires != null)
- return false;
- }
- else if (!expires.equals(other.expires))
- return false;
- if (offer == null)
- {
- if (other.offer != null)
- return false;
- }
- else if (!offer.equals(other.offer))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.acksTo == null)
- throw new RMException("AcksTo must be set");
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer
- */
- private static class OfferImpl implements CreateSequence.Offer
- {
-
- private String endpoint;
- private String duration;
- private String identifier;
- private IncompleteSequenceBehavior incompleteSequenceBehavior;
-
- private OfferImpl()
- {
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getEndpoint()
- */
- public String getEndpoint()
- {
- return this.endpoint;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getExpires()
- */
- public String getExpires()
- {
- return this.duration;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIncompleteSequenceBehavior()
- */
- public IncompleteSequenceBehavior getIncompleteSequenceBehavior()
- {
- return this.incompleteSequenceBehavior;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setEndpoint(java.lang.String)
- */
- public void setEndpoint(String address)
- {
- if ((address == null) || (address.trim().equals("")))
- throw new IllegalArgumentException("Address cannot be null nor empty
string");
- if (this.endpoint != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.endpoint = address;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setExpires(java.lang.String)
- */
- public void setExpires(String duration)
- {
- if ((duration == null) || (duration.trim().equals("")))
- throw new IllegalArgumentException("Duration cannot be null nor empty
string");
- if (this.duration != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.duration = duration;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
- */
- public void setIncompleteSequenceBehavior(IncompleteSequenceBehavior
incompleteSequenceBehavior)
- {
- if (incompleteSequenceBehavior == null)
- throw new IllegalArgumentException("Sequence behavior type cannot be
null");
- if (this.incompleteSequenceBehavior != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.incompleteSequenceBehavior = incompleteSequenceBehavior;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((duration == null) ? 0 : duration.hashCode());
- result = prime * result + ((endpoint == null) ? 0 : endpoint.hashCode());
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- result = prime * result + ((incompleteSequenceBehavior == null) ? 0 :
incompleteSequenceBehavior.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof OfferImpl))
- return false;
- final OfferImpl other = (OfferImpl)obj;
- if (duration == null)
- {
- if (other.duration != null)
- return false;
- }
- else if (!duration.equals(other.duration))
- return false;
- if (endpoint == null)
- {
- if (other.endpoint != null)
- return false;
- }
- else if (!endpoint.equals(other.endpoint))
- return false;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- if (incompleteSequenceBehavior == null)
- {
- if (other.incompleteSequenceBehavior != null)
- return false;
- }
- else if (!incompleteSequenceBehavior.equals(other.incompleteSequenceBehavior))
- return false;
- return true;
- }
-
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceResponseImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceResponseImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceResponseImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,282 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse
- */
-final class CreateSequenceResponseImpl extends AbstractSerializable implements
CreateSequenceResponse
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
- private String expires;
- private Accept accept;
- private IncompleteSequenceBehavior incompleteSequenceBehavior;
-
- CreateSequenceResponseImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getAccept()
- */
- public Accept getAccept()
- {
- return this.accept;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getDuration()
- */
- public String getExpires()
- {
- return this.expires;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIncompleteSequenceBehavior()
- */
- public IncompleteSequenceBehavior getIncompleteSequenceBehavior()
- {
- return this.incompleteSequenceBehavior;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#newAccept()
- */
- public Accept newAccept()
- {
- return new AcceptImpl();
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setAccept(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept)
- */
- public void setAccept(Accept accept)
- {
- if (accept == null)
- throw new IllegalArgumentException("Accept cannot be null");
- if (!(accept instanceof AcceptImpl))
- throw new IllegalArgumentException();
- if (accept.getAcksTo() == null)
- throw new IllegalArgumentException("Accept acksTo must be
specified");
- if (this.accept != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.accept = accept;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setExpires(java.lang.String)
- */
- public void setExpires(String duration)
- {
- if ((duration == null) || (duration.trim().equals("")))
- throw new IllegalArgumentException("Duration cannot be null nor empty
string");
- if (this.expires != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.expires = duration;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
- */
- public void setIncompleteSequenceBehavior(IncompleteSequenceBehavior
incompleteSequenceBehavior)
- {
- if (incompleteSequenceBehavior == null)
- throw new IllegalArgumentException("Sequence behavior type cannot be
null");
- if (this.incompleteSequenceBehavior != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.incompleteSequenceBehavior = incompleteSequenceBehavior;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((accept == null) ? 0 : accept.hashCode());
- result = prime * result + ((expires == null) ? 0 : expires.hashCode());
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- result = prime * result + ((incompleteSequenceBehavior == null) ? 0 :
incompleteSequenceBehavior.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof CreateSequenceResponseImpl))
- return false;
- final CreateSequenceResponseImpl other = (CreateSequenceResponseImpl)obj;
- if (accept == null)
- {
- if (other.accept != null)
- return false;
- }
- else if (!accept.equals(other.accept))
- return false;
- if (expires == null)
- {
- if (other.expires != null)
- return false;
- }
- else if (!expires.equals(other.expires))
- return false;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- if (incompleteSequenceBehavior == null)
- {
- if (other.incompleteSequenceBehavior != null)
- return false;
- }
- else if (!incompleteSequenceBehavior.equals(other.incompleteSequenceBehavior))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier must be set");
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept
- */
- private static class AcceptImpl implements CreateSequenceResponse.Accept
- {
-
- private String acksTo;
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept#getAcksTo()
- */
- public String getAcksTo()
- {
- return this.acksTo;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept#setAcksTo(java.lang.String)
- */
- public void setAcksTo(String address)
- {
- if ((address == null) || (address.trim().equals("")))
- throw new IllegalArgumentException("Address cannot be null nor empty
string");
- if (this.acksTo != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.acksTo = address;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof AcceptImpl))
- return false;
- final AcceptImpl other = (AcceptImpl)obj;
- if (acksTo == null)
- {
- if (other.acksTo != null)
- return false;
- }
- else if (!acksTo.equals(other.acksTo))
- return false;
- return true;
- }
-
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/MessageFactoryImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/MessageFactoryImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/MessageFactoryImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,135 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.spi.MessageFactory;
-import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory
- */
-final class MessageFactoryImpl implements MessageFactory
-{
-
- private static final MessageFactory INSTANCE = new MessageFactoryImpl();
-
- private MessageFactoryImpl()
- {
- // forbidden inheritance
- }
-
- public static MessageFactory getInstance()
- {
- return INSTANCE;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newAckRequested()
- */
- public AckRequested newAckRequested()
- {
- return new AckRequestedImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequence()
- */
- public CloseSequence newCloseSequence()
- {
- return new CloseSequenceImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequenceResponse()
- */
- public CloseSequenceResponse newCloseSequenceResponse()
- {
- return new CloseSequenceResponseImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequence()
- */
- public CreateSequence newCreateSequence()
- {
- return new CreateSequenceImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequenceResponse()
- */
- public CreateSequenceResponse newCreateSequenceResponse()
- {
- return new CreateSequenceResponseImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequence()
- */
- public Sequence newSequence()
- {
- return new SequenceImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceAcknowledgement()
- */
- public SequenceAcknowledgement newSequenceAcknowledgement()
- {
- return new SequenceAcknowledgementImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceFault()
- */
- public SequenceFault newSequenceFault()
- {
- return new SequenceFaultImpl();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequence()
- */
- public TerminateSequence newTerminateSequence()
- {
- return new TerminateSequenceImpl();
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequenceResponse()
- */
- public TerminateSequenceResponse newTerminateSequenceResponse()
- {
- return new TerminateSequenceResponseImpl();
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/ProviderImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/ProviderImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/ProviderImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.common.ConstantsImpl;
-import org.jboss.ws.extensions.wsrm.spi.Constants;
-import org.jboss.ws.extensions.wsrm.spi.MessageFactory;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.Provider
- */
-public final class ProviderImpl extends Provider
-{
-
- private static final String IMPLEMENTATION_VERSION =
"http://docs.oasis-open.org/ws-rx/wsrm/200702";
- private static final Constants CONSTANTS = new
ConstantsImpl("wsrm11",IMPLEMENTATION_VERSION);
- private static final Provider INSTANCE = new ProviderImpl();
-
- private ProviderImpl()
- {
- // forbidden inheritance
- }
-
- public static Provider getInstance()
- {
- return INSTANCE;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.Provider#getMessageFactory()
- */
- @Override
- public MessageFactory getMessageFactory()
- {
- return MessageFactoryImpl.getInstance();
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.Provider#getConstants()
- */
- @Override
- public Constants getConstants()
- {
- return CONSTANTS;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.Provider#getNamespaceURI()
- */
- @Override
- public String getNamespaceURI()
- {
- return IMPLEMENTATION_VERSION;
- }
-
-}
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMAckRequestedImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMAckRequestedImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMAckRequestedImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested
+ */
+final class RMAckRequestedImpl extends RMAbstractSerializable implements RMAckRequested
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+
+ RMAckRequestedImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getMessage()
+ */
+ public long getMessageNumber()
+ {
+ return 0; // always return zero for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setMessage(long)
+ */
+ public void setMessageNumber(long lastMessageNumber)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMAckRequestedImpl))
+ return false;
+ final RMAckRequestedImpl other = (RMAckRequestedImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMAckRequestedImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCloseSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCloseSequenceImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCloseSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence
+ */
+final class RMCloseSequenceImpl extends RMAbstractSerializable implements
RMCloseSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private long lastMsgNumber;
+
+ RMCloseSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#getLastMsgNumber()
+ */
+ public long getLastMsgNumber()
+ {
+ return this.lastMsgNumber;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#setLastMsgNumber(long)
+ */
+ public void setLastMsgNumber(long lastMsgNumber)
+ {
+ if (lastMsgNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.lastMsgNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.lastMsgNumber = lastMsgNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (int)(lastMsgNumber ^ (lastMsgNumber >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCloseSequenceImpl))
+ return false;
+ final RMCloseSequenceImpl other = (RMCloseSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (lastMsgNumber != other.lastMsgNumber)
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCloseSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCloseSequenceResponseImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCloseSequenceResponseImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCloseSequenceResponseImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse
+ */
+final class RMCloseSequenceResponseImpl extends RMAbstractSerializable implements
RMCloseSequenceResponse
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+
+ RMCloseSequenceResponseImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCloseSequenceResponseImpl))
+ return false;
+ final RMCloseSequenceResponseImpl other = (RMCloseSequenceResponseImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCloseSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,348 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence
+ */
+final class RMCreateSequenceImpl extends RMAbstractSerializable implements
RMCreateSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String acksTo;
+ private String expires;
+ private Offer offer;
+
+ RMCreateSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getAcksTo()
+ */
+ public String getAcksTo()
+ {
+ return this.acksTo;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getExpires()
+ */
+ public String getExpires()
+ {
+ return this.expires;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getOffer()
+ */
+ public Offer getOffer()
+ {
+ return this.offer;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#newOffer()
+ */
+ public Offer newOffer()
+ {
+ return new OfferImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setAcksTo(java.lang.String)
+ */
+ public void setAcksTo(String address)
+ {
+ if ((address == null) || (address.trim().equals("")))
+ throw new IllegalArgumentException("Address cannot be null nor empty
string");
+ if (this.acksTo != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.acksTo = address;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty
string");
+ if (this.expires != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.expires = duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setOffer(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer)
+ */
+ public void setOffer(Offer offer)
+ {
+ if (offer == null)
+ throw new IllegalArgumentException("Offer cannot be null");
+ if (!(offer instanceof OfferImpl))
+ throw new IllegalArgumentException();
+ if (offer.getIdentifier() == null)
+ throw new IllegalArgumentException("Offer identifier must be
specified");
+ if (offer.getEndpoint() == null)
+ throw new IllegalArgumentException("Offer endpoint address must be
specified");
+ if (this.offer != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.offer = offer;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
+ result = prime * result + ((expires == null) ? 0 : expires.hashCode());
+ result = prime * result + ((offer == null) ? 0 : offer.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCreateSequenceImpl))
+ return false;
+ final RMCreateSequenceImpl other = (RMCreateSequenceImpl)obj;
+ if (acksTo == null)
+ {
+ if (other.acksTo != null)
+ return false;
+ }
+ else if (!acksTo.equals(other.acksTo))
+ return false;
+ if (expires == null)
+ {
+ if (other.expires != null)
+ return false;
+ }
+ else if (!expires.equals(other.expires))
+ return false;
+ if (offer == null)
+ {
+ if (other.offer != null)
+ return false;
+ }
+ else if (!offer.equals(other.offer))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.acksTo == null)
+ throw new RMException("AcksTo must be set");
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer
+ */
+ private static class OfferImpl implements RMCreateSequence.Offer
+ {
+
+ private String endpoint;
+ private String duration;
+ private String identifier;
+ private RMIncompleteSequenceBehavior incompleteSequenceBehavior;
+
+ private OfferImpl()
+ {
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getEndpoint()
+ */
+ public String getEndpoint()
+ {
+ return this.endpoint;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getExpires()
+ */
+ public String getExpires()
+ {
+ return this.duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIncompleteSequenceBehavior()
+ */
+ public RMIncompleteSequenceBehavior getIncompleteSequenceBehavior()
+ {
+ return this.incompleteSequenceBehavior;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setEndpoint(java.lang.String)
+ */
+ public void setEndpoint(String address)
+ {
+ if ((address == null) || (address.trim().equals("")))
+ throw new IllegalArgumentException("Address cannot be null nor empty
string");
+ if (this.endpoint != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.endpoint = address;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty
string");
+ if (this.duration != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.duration = duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
+ */
+ public void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior
incompleteSequenceBehavior)
+ {
+ if (incompleteSequenceBehavior == null)
+ throw new IllegalArgumentException("Sequence behavior type cannot be
null");
+ if (this.incompleteSequenceBehavior != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.incompleteSequenceBehavior = incompleteSequenceBehavior;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((duration == null) ? 0 : duration.hashCode());
+ result = prime * result + ((endpoint == null) ? 0 : endpoint.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + ((incompleteSequenceBehavior == null) ? 0 :
incompleteSequenceBehavior.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof OfferImpl))
+ return false;
+ final OfferImpl other = (OfferImpl)obj;
+ if (duration == null)
+ {
+ if (other.duration != null)
+ return false;
+ }
+ else if (!duration.equals(other.duration))
+ return false;
+ if (endpoint == null)
+ {
+ if (other.endpoint != null)
+ return false;
+ }
+ else if (!endpoint.equals(other.endpoint))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (incompleteSequenceBehavior == null)
+ {
+ if (other.incompleteSequenceBehavior != null)
+ return false;
+ }
+ else if (!incompleteSequenceBehavior.equals(other.incompleteSequenceBehavior))
+ return false;
+ return true;
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceResponseImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,282 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse
+ */
+final class RMCreateSequenceResponseImpl extends RMAbstractSerializable implements
RMCreateSequenceResponse
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private String expires;
+ private Accept accept;
+ private RMIncompleteSequenceBehavior incompleteSequenceBehavior;
+
+ RMCreateSequenceResponseImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getAccept()
+ */
+ public Accept getAccept()
+ {
+ return this.accept;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getDuration()
+ */
+ public String getExpires()
+ {
+ return this.expires;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIncompleteSequenceBehavior()
+ */
+ public RMIncompleteSequenceBehavior getIncompleteSequenceBehavior()
+ {
+ return this.incompleteSequenceBehavior;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#newAccept()
+ */
+ public Accept newAccept()
+ {
+ return new AcceptImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setAccept(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept)
+ */
+ public void setAccept(Accept accept)
+ {
+ if (accept == null)
+ throw new IllegalArgumentException("Accept cannot be null");
+ if (!(accept instanceof AcceptImpl))
+ throw new IllegalArgumentException();
+ if (accept.getAcksTo() == null)
+ throw new IllegalArgumentException("Accept acksTo must be
specified");
+ if (this.accept != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.accept = accept;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty
string");
+ if (this.expires != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.expires = duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
+ */
+ public void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior
incompleteSequenceBehavior)
+ {
+ if (incompleteSequenceBehavior == null)
+ throw new IllegalArgumentException("Sequence behavior type cannot be
null");
+ if (this.incompleteSequenceBehavior != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.incompleteSequenceBehavior = incompleteSequenceBehavior;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((accept == null) ? 0 : accept.hashCode());
+ result = prime * result + ((expires == null) ? 0 : expires.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + ((incompleteSequenceBehavior == null) ? 0 :
incompleteSequenceBehavior.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCreateSequenceResponseImpl))
+ return false;
+ final RMCreateSequenceResponseImpl other = (RMCreateSequenceResponseImpl)obj;
+ if (accept == null)
+ {
+ if (other.accept != null)
+ return false;
+ }
+ else if (!accept.equals(other.accept))
+ return false;
+ if (expires == null)
+ {
+ if (other.expires != null)
+ return false;
+ }
+ else if (!expires.equals(other.expires))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (incompleteSequenceBehavior == null)
+ {
+ if (other.incompleteSequenceBehavior != null)
+ return false;
+ }
+ else if (!incompleteSequenceBehavior.equals(other.incompleteSequenceBehavior))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier must be set");
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept
+ */
+ private static class AcceptImpl implements RMCreateSequenceResponse.Accept
+ {
+
+ private String acksTo;
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept#getAcksTo()
+ */
+ public String getAcksTo()
+ {
+ return this.acksTo;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept#setAcksTo(java.lang.String)
+ */
+ public void setAcksTo(String address)
+ {
+ if ((address == null) || (address.trim().equals("")))
+ throw new IllegalArgumentException("Address cannot be null nor empty
string");
+ if (this.acksTo != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.acksTo = address;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof AcceptImpl))
+ return false;
+ final AcceptImpl other = (AcceptImpl)obj;
+ if (acksTo == null)
+ {
+ if (other.acksTo != null)
+ return false;
+ }
+ else if (!acksTo.equals(other.acksTo))
+ return false;
+ return true;
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMCreateSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMMessageFactoryImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMMessageFactoryImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMMessageFactoryImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+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.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory
+ */
+final class RMMessageFactoryImpl implements RMMessageFactory
+{
+
+ private static final RMMessageFactory INSTANCE = new RMMessageFactoryImpl();
+
+ private RMMessageFactoryImpl()
+ {
+ // forbidden inheritance
+ }
+
+ public static RMMessageFactory getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newAckRequested()
+ */
+ public RMAckRequested newAckRequested()
+ {
+ return new RMAckRequestedImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequence()
+ */
+ public RMCloseSequence newCloseSequence()
+ {
+ return new RMCloseSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequenceResponse()
+ */
+ public RMCloseSequenceResponse newCloseSequenceResponse()
+ {
+ return new RMCloseSequenceResponseImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequence()
+ */
+ public RMCreateSequence newCreateSequence()
+ {
+ return new RMCreateSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequenceResponse()
+ */
+ public RMCreateSequenceResponse newCreateSequenceResponse()
+ {
+ return new RMCreateSequenceResponseImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequence()
+ */
+ public RMSequence newSequence()
+ {
+ return new RMSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceAcknowledgement()
+ */
+ public RMSequenceAcknowledgement newSequenceAcknowledgement()
+ {
+ return new RMSequenceAcknowledgementImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceFault()
+ */
+ public RMSequenceFault newSequenceFault()
+ {
+ return new RMSequenceFaultImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequence()
+ */
+ public RMTerminateSequence newTerminateSequence()
+ {
+ return new RMTerminateSequenceImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequenceResponse()
+ */
+ public RMTerminateSequenceResponse newTerminateSequenceResponse()
+ {
+ return new RMTerminateSequenceResponseImpl();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMMessageFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMProviderImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMProviderImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMProviderImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.common.RMConstantsImpl;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider
+ */
+public final class RMProviderImpl extends RMProvider
+{
+
+ private static final String IMPLEMENTATION_VERSION =
"http://docs.oasis-open.org/ws-rx/wsrm/200702";
+ private static final RMConstants CONSTANTS = new
RMConstantsImpl("wsrm11",IMPLEMENTATION_VERSION);
+ private static final RMProvider INSTANCE = new RMProviderImpl();
+
+ private RMProviderImpl()
+ {
+ // forbidden inheritance
+ }
+
+ public static RMProvider getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getMessageFactory()
+ */
+ @Override
+ public RMMessageFactory getMessageFactory()
+ {
+ return RMMessageFactoryImpl.getInstance();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getConstants()
+ */
+ @Override
+ public RMConstants getConstants()
+ {
+ return CONSTANTS;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getNamespaceURI()
+ */
+ @Override
+ public String getNamespaceURI()
+ {
+ return IMPLEMENTATION_VERSION;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMProviderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceAcknowledgementImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,347 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Collections;
+
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement
+ */
+final class RMSequenceAcknowledgementImpl extends RMAbstractSerializable implements
RMSequenceAcknowledgement
+{
+
+ // provider used by de/serialization framework
+ 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 String identifier;
+ private boolean isFinal;
+ private boolean isNone;
+
+ RMSequenceAcknowledgementImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addAcknowledgementRange(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange)
+ */
+ public void addAcknowledgementRange(AcknowledgementRange newAcknowledgementRange)
+ {
+ if ((newAcknowledgementRange == null) || (!(newAcknowledgementRange instanceof
AcknowledgementRangeImpl)))
+ throw new IllegalArgumentException();
+ if (this.nacks.size() != 0)
+ throw new IllegalStateException("There are already some nacks
specified");
+ if (this.isNone)
+ 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)
+ checkOverlap(alreadyAccepted, newAcknowledgementRange);
+
+ this.acknowledgementRanges.add(newAcknowledgementRange);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addNack(long)
+ */
+ public void addNack(long messageNumber)
+ {
+ if (this.isFinal)
+ throw new IllegalStateException("There is already final specified");
+ if (this.isNone)
+ throw new IllegalStateException("There is already none specified");
+ if (this.acknowledgementRanges.size() != 0)
+ throw new IllegalStateException("There are already some acknowledgement
ranges specified");
+ if (this.nacks.contains(messageNumber))
+ throw new IllegalArgumentException("There is already nack with value "
+ messageNumber + " specified");
+
+ this.nacks.add(messageNumber);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getAcknowledgementRanges()
+ */
+ public List<AcknowledgementRange> getAcknowledgementRanges()
+ {
+ return Collections.unmodifiableList(acknowledgementRanges);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getNacks()
+ */
+ public List<Long> getNacks()
+ {
+ return Collections.unmodifiableList(nacks);
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#isFinal()
+ */
+ public boolean isFinal()
+ {
+ return this.isFinal;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#isNone()
+ */
+ public boolean isNone()
+ {
+ return this.isNone;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#newAcknowledgementRange()
+ */
+ public AcknowledgementRange newAcknowledgementRange()
+ {
+ return new AcknowledgementRangeImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setFinal(boolean)
+ */
+ public void setFinal()
+ {
+ if (this.nacks.size() != 0)
+ throw new IllegalStateException("There are already some nacks
specified");
+
+ this.isFinal = true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setNone(boolean)
+ */
+ public void setNone()
+ {
+ if (this.acknowledgementRanges.size() != 0)
+ throw new IllegalStateException("There are already some acknowledgement
ranges specified");
+ if (this.nacks.size() != 0)
+ throw new IllegalStateException("There are already some nacks
specified");
+
+ this.isNone = true;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (isFinal ? 1231 : 1237);
+ result = prime * result + (isNone ? 1231 : 1237);
+ result = prime * result + ((nacks == null) ? 0 : nacks.hashCode());
+ result = prime * result + ((acknowledgementRanges == null) ? 0 :
acknowledgementRanges.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceAcknowledgementImpl))
+ return false;
+ final RMSequenceAcknowledgementImpl other = (RMSequenceAcknowledgementImpl)obj;
+ if (acknowledgementRanges == null)
+ {
+ if (other.acknowledgementRanges != null)
+ return false;
+ }
+ else if (!acknowledgementRanges.equals(other.acknowledgementRanges))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (isFinal != other.isFinal)
+ return false;
+ if (isNone != other.isNone)
+ return false;
+ if (nacks == null)
+ {
+ if (other.nacks != null)
+ return false;
+ }
+ else if (!nacks.equals(other.nacks))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ if ((this.acknowledgementRanges.size() == 0) && (this.nacks.size() == 0)
&& (!this.isNone))
+ throw new RMException("AcknowledgementRange or Nack or None must be
set");
+ }
+
+ private static void checkOverlap(AcknowledgementRange currentRange,
AcknowledgementRange newRange)
+ {
+ if ((currentRange.getLower() <= newRange.getLower()) &&
(newRange.getLower() <= currentRange.getUpper()))
+ throw new IllegalArgumentException(
+ "Overlap detected: " + currentRange + " vs. " +
newRange);
+ if ((currentRange.getLower() <= newRange.getUpper()) &&
(newRange.getUpper() <= currentRange.getUpper()))
+ throw new IllegalArgumentException(
+ "Overlap detected: " + currentRange + " vs. " +
newRange);
+ }
+
+ private static class AcknowledgementRangeImpl implements
RMSequenceAcknowledgement.AcknowledgementRange
+ {
+
+ private long lower;
+ private long upper;
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#getLower()
+ */
+ public long getLower()
+ {
+ return this.lower;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#getUpper()
+ */
+ public long getUpper()
+ {
+ return this.upper;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#setLower(long)
+ */
+ public void setLower(long lower)
+ {
+ if (lower <= 0)
+ throw new IllegalArgumentException("Value must be greater than
0");
+ if (this.lower > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+ if ((this.upper > 0) && (lower > this.upper))
+ throw new IllegalArgumentException("Value must be lower or equal to
" + this.upper);
+
+ this.lower = lower;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#setUpper(long)
+ */
+ public void setUpper(long upper)
+ {
+ if (upper <= 0)
+ throw new IllegalArgumentException("Value must be greater than
0");
+ if (this.upper > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+ if ((this.lower > 0) && (this.lower > upper))
+ throw new IllegalArgumentException("Value must be greater or equal to
" + this.lower);
+
+ this.upper = upper;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (int)(lower ^ (lower >>> 32));
+ result = prime * result + (int)(upper ^ (upper >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof AcknowledgementRangeImpl))
+ return false;
+ final AcknowledgementRangeImpl other = (AcknowledgementRangeImpl)obj;
+ if (lower != other.lower)
+ return false;
+ if (upper != other.upper)
+ return false;
+ return true;
+ }
+
+ public String toString()
+ {
+ return "<" + lower + "; " + upper + ">";
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceAcknowledgementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceFaultImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceFaultImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceFaultImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceFaultCode;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault
+ */
+final class RMSequenceFaultImpl extends RMAbstractSerializable implements
RMSequenceFault
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private RMSequenceFaultCode faultCode;
+ private Exception detail;
+
+ RMSequenceFaultImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getDetail()
+ */
+ public Exception getDetail()
+ {
+ return this.detail;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getFaultCode()
+ */
+ public RMSequenceFaultCode getFaultCode()
+ {
+ return this.faultCode;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setDetail(java.lang.Exception)
+ */
+ public void setDetail(Exception detail)
+ {
+ if (detail == null)
+ throw new IllegalArgumentException("Detail cannot be null");
+ if (this.detail != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.detail = detail;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setFaultCode(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFaultCode)
+ */
+ public void setFaultCode(RMSequenceFaultCode faultCode)
+ {
+ if (faultCode == null)
+ throw new IllegalArgumentException("Fault code cannot be null");
+ if (this.faultCode != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.faultCode = faultCode;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((detail == null) ? 0 : detail.getMessage().hashCode());
+ result = prime * result + ((faultCode == null) ? 0 : faultCode.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceFaultImpl))
+ return false;
+ final RMSequenceFaultImpl other = (RMSequenceFaultImpl)obj;
+ if (detail == null)
+ {
+ if (other.detail != null)
+ return false;
+ }
+ else if (!detail.getMessage().equals(other.detail.getMessage()))
+ return false;
+ if (faultCode == null)
+ {
+ if (other.faultCode != null)
+ return false;
+ }
+ else if (!faultCode.equals(other.faultCode))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.faultCode == null)
+ throw new RMException("FaultCode must be set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceFaultImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence
+ */
+final class RMSequenceImpl extends RMAbstractSerializable implements RMSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private long messageNumber;
+
+ RMSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getMessageNumber()
+ */
+ public long getMessageNumber()
+ {
+ return messageNumber;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#isLastMessage()
+ */
+ public boolean isLastMessage()
+ {
+ return false; // always return false for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setLastMessage(boolean)
+ */
+ public void setLastMessage()
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setMessageNumber(long)
+ */
+ public void setMessageNumber(long messageNumber)
+ {
+ if (messageNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.messageNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.messageNumber = messageNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (int)(messageNumber ^ (messageNumber >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceImpl))
+ return false;
+ final RMSequenceImpl other = (RMSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (messageNumber != other.messageNumber)
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier must be set");
+ if (this.messageNumber == 0)
+ throw new RMException("MessageNumber must be set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMTerminateSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMTerminateSequenceImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMTerminateSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence
+ */
+final class RMTerminateSequenceImpl extends RMAbstractSerializable implements
RMTerminateSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private long lastMsgNumber;
+
+ RMTerminateSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getLastMsgNumber()
+ */
+ public long getLastMsgNumber()
+ {
+ return this.lastMsgNumber;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setLastMsgNumber(long)
+ */
+ public void setLastMsgNumber(long lastMsgNumber)
+ {
+ if (lastMsgNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.lastMsgNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.lastMsgNumber = lastMsgNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (int)(lastMsgNumber ^ (lastMsgNumber >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMTerminateSequenceImpl))
+ return false;
+ final RMTerminateSequenceImpl other = (RMTerminateSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (lastMsgNumber != other.lastMsgNumber)
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMTerminateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMTerminateSequenceResponseImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMTerminateSequenceResponseImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMTerminateSequenceResponseImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse
+ */
+final class RMTerminateSequenceResponseImpl extends RMAbstractSerializable implements
RMTerminateSequenceResponse
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+
+ RMTerminateSequenceResponseImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMTerminateSequenceResponseImpl))
+ return false;
+ final RMTerminateSequenceResponseImpl other =
(RMTerminateSequenceResponseImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/RMTerminateSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceAcknowledgementImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceAcknowledgementImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceAcknowledgementImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,347 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Collections;
-
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement
- */
-final class SequenceAcknowledgementImpl extends AbstractSerializable implements
SequenceAcknowledgement
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private final List<Long> nacks = new LinkedList<Long>();
- private final List<AcknowledgementRange> acknowledgementRanges = new
LinkedList<AcknowledgementRange>();
- private String identifier;
- private boolean isFinal;
- private boolean isNone;
-
- SequenceAcknowledgementImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addAcknowledgementRange(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange)
- */
- public void addAcknowledgementRange(AcknowledgementRange newAcknowledgementRange)
- {
- if ((newAcknowledgementRange == null) || (!(newAcknowledgementRange instanceof
AcknowledgementRangeImpl)))
- throw new IllegalArgumentException();
- if (this.nacks.size() != 0)
- throw new IllegalStateException("There are already some nacks
specified");
- if (this.isNone)
- 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)
- checkOverlap(alreadyAccepted, newAcknowledgementRange);
-
- this.acknowledgementRanges.add(newAcknowledgementRange);
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addNack(long)
- */
- public void addNack(long messageNumber)
- {
- if (this.isFinal)
- throw new IllegalStateException("There is already final specified");
- if (this.isNone)
- throw new IllegalStateException("There is already none specified");
- if (this.acknowledgementRanges.size() != 0)
- throw new IllegalStateException("There are already some acknowledgement
ranges specified");
- if (this.nacks.contains(messageNumber))
- throw new IllegalArgumentException("There is already nack with value "
+ messageNumber + " specified");
-
- this.nacks.add(messageNumber);
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getAcknowledgementRanges()
- */
- public List<AcknowledgementRange> getAcknowledgementRanges()
- {
- return Collections.unmodifiableList(acknowledgementRanges);
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getNacks()
- */
- public List<Long> getNacks()
- {
- return Collections.unmodifiableList(nacks);
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#isFinal()
- */
- public boolean isFinal()
- {
- return this.isFinal;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#isNone()
- */
- public boolean isNone()
- {
- return this.isNone;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#newAcknowledgementRange()
- */
- public AcknowledgementRange newAcknowledgementRange()
- {
- return new AcknowledgementRangeImpl();
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setFinal(boolean)
- */
- public void setFinal()
- {
- if (this.nacks.size() != 0)
- throw new IllegalStateException("There are already some nacks
specified");
-
- this.isFinal = true;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setNone(boolean)
- */
- public void setNone()
- {
- if (this.acknowledgementRanges.size() != 0)
- throw new IllegalStateException("There are already some acknowledgement
ranges specified");
- if (this.nacks.size() != 0)
- throw new IllegalStateException("There are already some nacks
specified");
-
- this.isNone = true;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- result = prime * result + (isFinal ? 1231 : 1237);
- result = prime * result + (isNone ? 1231 : 1237);
- result = prime * result + ((nacks == null) ? 0 : nacks.hashCode());
- result = prime * result + ((acknowledgementRanges == null) ? 0 :
acknowledgementRanges.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof SequenceAcknowledgementImpl))
- return false;
- final SequenceAcknowledgementImpl other = (SequenceAcknowledgementImpl)obj;
- if (acknowledgementRanges == null)
- {
- if (other.acknowledgementRanges != null)
- return false;
- }
- else if (!acknowledgementRanges.equals(other.acknowledgementRanges))
- return false;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- if (isFinal != other.isFinal)
- return false;
- if (isNone != other.isNone)
- return false;
- if (nacks == null)
- {
- if (other.nacks != null)
- return false;
- }
- else if (!nacks.equals(other.nacks))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier not set");
- if ((this.acknowledgementRanges.size() == 0) && (this.nacks.size() == 0)
&& (!this.isNone))
- throw new RMException("AcknowledgementRange or Nack or None must be
set");
- }
-
- private static void checkOverlap(AcknowledgementRange currentRange,
AcknowledgementRange newRange)
- {
- if ((currentRange.getLower() <= newRange.getLower()) &&
(newRange.getLower() <= currentRange.getUpper()))
- throw new IllegalArgumentException(
- "Overlap detected: " + currentRange + " vs. " +
newRange);
- if ((currentRange.getLower() <= newRange.getUpper()) &&
(newRange.getUpper() <= currentRange.getUpper()))
- throw new IllegalArgumentException(
- "Overlap detected: " + currentRange + " vs. " +
newRange);
- }
-
- private static class AcknowledgementRangeImpl implements
SequenceAcknowledgement.AcknowledgementRange
- {
-
- private long lower;
- private long upper;
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#getLower()
- */
- public long getLower()
- {
- return this.lower;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#getUpper()
- */
- public long getUpper()
- {
- return this.upper;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#setLower(long)
- */
- public void setLower(long lower)
- {
- if (lower <= 0)
- throw new IllegalArgumentException("Value must be greater than
0");
- if (this.lower > 0)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
- if ((this.upper > 0) && (lower > this.upper))
- throw new IllegalArgumentException("Value must be lower or equal to
" + this.upper);
-
- this.lower = lower;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#setUpper(long)
- */
- public void setUpper(long upper)
- {
- if (upper <= 0)
- throw new IllegalArgumentException("Value must be greater than
0");
- if (this.upper > 0)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
- if ((this.lower > 0) && (this.lower > upper))
- throw new IllegalArgumentException("Value must be greater or equal to
" + this.lower);
-
- this.upper = upper;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + (int)(lower ^ (lower >>> 32));
- result = prime * result + (int)(upper ^ (upper >>> 32));
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof AcknowledgementRangeImpl))
- return false;
- final AcknowledgementRangeImpl other = (AcknowledgementRangeImpl)obj;
- if (lower != other.lower)
- return false;
- if (upper != other.upper)
- return false;
- return true;
- }
-
- public String toString()
- {
- return "<" + lower + "; " + upper + ">";
- }
-
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceFaultImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceFaultImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceFaultImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,144 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFaultCode;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault
- */
-final class SequenceFaultImpl extends AbstractSerializable implements SequenceFault
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private SequenceFaultCode faultCode;
- private Exception detail;
-
- SequenceFaultImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getDetail()
- */
- public Exception getDetail()
- {
- return this.detail;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getFaultCode()
- */
- public SequenceFaultCode getFaultCode()
- {
- return this.faultCode;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setDetail(java.lang.Exception)
- */
- public void setDetail(Exception detail)
- {
- if (detail == null)
- throw new IllegalArgumentException("Detail cannot be null");
- if (this.detail != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.detail = detail;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setFaultCode(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFaultCode)
- */
- public void setFaultCode(SequenceFaultCode faultCode)
- {
- if (faultCode == null)
- throw new IllegalArgumentException("Fault code cannot be null");
- if (this.faultCode != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.faultCode = faultCode;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((detail == null) ? 0 : detail.getMessage().hashCode());
- result = prime * result + ((faultCode == null) ? 0 : faultCode.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof SequenceFaultImpl))
- return false;
- final SequenceFaultImpl other = (SequenceFaultImpl)obj;
- if (detail == null)
- {
- if (other.detail != null)
- return false;
- }
- else if (!detail.getMessage().equals(other.detail.getMessage()))
- return false;
- if (faultCode == null)
- {
- if (other.faultCode != null)
- return false;
- }
- else if (!faultCode.equals(other.faultCode))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.faultCode == null)
- throw new RMException("FaultCode must be set");
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,156 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence
- */
-final class SequenceImpl extends AbstractSerializable implements Sequence
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
- private long messageNumber;
-
- SequenceImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getMessageNumber()
- */
- public long getMessageNumber()
- {
- return messageNumber;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#isLastMessage()
- */
- public boolean isLastMessage()
- {
- return false; // always return false for this version of the RM protocol
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setLastMessage(boolean)
- */
- public void setLastMessage()
- {
- // do nothing for this version of the RM protocol
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setMessageNumber(long)
- */
- public void setMessageNumber(long messageNumber)
- {
- if (messageNumber <= 0)
- throw new IllegalArgumentException("Value must be greater than 0");
- if (this.messageNumber > 0)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.messageNumber = messageNumber;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- result = prime * result + (int)(messageNumber ^ (messageNumber >>> 32));
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof SequenceImpl))
- return false;
- final SequenceImpl other = (SequenceImpl)obj;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- if (messageNumber != other.messageNumber)
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier must be set");
- if (this.messageNumber == 0)
- throw new RMException("MessageNumber must be set");
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence
- */
-final class TerminateSequenceImpl extends AbstractSerializable implements
TerminateSequence
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
- private long lastMsgNumber;
-
- TerminateSequenceImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getLastMsgNumber()
- */
- public long getLastMsgNumber()
- {
- return this.lastMsgNumber;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setLastMsgNumber(long)
- */
- public void setLastMsgNumber(long lastMsgNumber)
- {
- if (lastMsgNumber <= 0)
- throw new IllegalArgumentException("Value must be greater than 0");
- if (this.lastMsgNumber > 0)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.lastMsgNumber = lastMsgNumber;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- result = prime * result + (int)(lastMsgNumber ^ (lastMsgNumber >>> 32));
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof TerminateSequenceImpl))
- return false;
- final TerminateSequenceImpl other = (TerminateSequenceImpl)obj;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- if (lastMsgNumber != other.lastMsgNumber)
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier not set");
- }
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceResponseImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceResponseImpl.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceResponseImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spec200702;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse;
-
-/*
- * @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse
- */
-final class TerminateSequenceResponseImpl extends AbstractSerializable implements
TerminateSequenceResponse
-{
-
- // provider used by de/serialization framework
- private static final Provider PROVIDER = ProviderImpl.getInstance();
- // internal fields
- private String identifier;
-
- TerminateSequenceResponseImpl()
- {
- // allow inside package use only
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse#getIdentifier()
- */
- public String getIdentifier()
- {
- return this.identifier;
- }
-
- /*
- * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse#setIdentifier(java.lang.String)
- */
- public void setIdentifier(String identifier)
- {
- if ((identifier == null) || (identifier.trim().equals("")))
- throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
- if (this.identifier != null)
- throw new UnsupportedOperationException("Value already set, cannot be
overriden");
-
- this.identifier = identifier;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof TerminateSequenceResponseImpl))
- return false;
- final TerminateSequenceResponseImpl other = (TerminateSequenceResponseImpl)obj;
- if (identifier == null)
- {
- if (other.identifier != null)
- return false;
- }
- else if (!identifier.equals(other.identifier))
- return false;
- return true;
- }
-
- public Provider getProvider()
- {
- return PROVIDER;
- }
-
- public void validate()
- {
- if (this.identifier == null)
- throw new RMException("Identifier not set");
- }
-
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Constants.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Constants.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Constants.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,220 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi;
-
-import javax.xml.namespace.QName;
-
-/**
- * WS-RM protocol elements SPI facade. Each WS-RM provider must implement this
interface.
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface Constants
-{
-
- /**
- * getter
- * @return wsrm <b>prefix</b>
- */
- String getPrefix();
-
- /**
- * getter
- * @return wsrm <b>namespace</b>
- */
- String getNamespaceURI();
-
- /**
- * getter
- * @return <b>LastMessage</b> QName
- */
- QName getLastMessageQName();
-
- /**
- * getter
- * @return <b>CreateSequence</b> QName
- */
- QName getCreateSequenceQName();
-
- /**
- * getter
- * @return <b>AcksTo</b> QName
- */
- QName getAcksToQName();
-
- /**
- * getter
- * @return <b>Expires</b> QName
- */
- QName getExpiresQName();
-
- /**
- * getter
- * @return <b>Offer</b> QName
- */
- QName getOfferQName();
-
- /**
- * getter
- * @return <b>Identifier</b> QName
- */
- QName getIdentifierQName();
-
- /**
- * getter
- * @return <b>Endpoint</b> QName
- */
- QName getEndpointQName();
-
- /**
- * getter
- * @return <b>IncompleteSequenceBehavior</b> QName
- */
- QName getIncompleteSequenceBehaviorQName();
-
- /**
- * getter
- * @return <b>CreateSequenceResponse</b> QName
- */
- QName getCreateSequenceResponseQName();
-
- /**
- * getter
- * @return <b>Accept</b> QName
- */
- QName getAcceptQName();
-
- /**
- * getter
- * @return <b>CloseSequence</b> QName
- */
- QName getCloseSequenceQName();
-
- /**
- * getter
- * @return <b>LastMessageNumber</b> QName
- */
- QName getLastMessageNumberQName();
-
- /**
- * getter
- * @return <b>CloseSequenceResponse</b> QName
- */
- QName getCloseSequenceResponseQName();
-
- /**
- * getter
- * @return <b>TerminateSequence</b> QName
- */
- QName getTerminateSequenceQName();
-
- /**
- * getter
- * @return <b>LastMsgNumber</b> QName
- */
- QName getLastMsgNumberQName();
-
- /**
- * getter
- * @return <b>TerminateSequenceResponse</b> QName
- */
- QName getTerminateSequenceResponseQName();
-
- /**
- * getter
- * @return <b>Sequence</b> QName
- */
- QName getSequenceQName();
-
- /**
- * getter
- * @return <b>MessageNumber</b> QName
- */
- QName getMessageNumberQName();
-
- /**
- * getter
- * @return <b>AckRequested</b> QName
- */
- QName getAckRequestedQName();
-
- /**
- * getter
- * @return <b>SequenceAcknowledgement</b> QName
- */
- QName getSequenceAcknowledgementQName();
-
- /**
- * getter
- * @return <b>AcknowledgementRange</b> QName
- */
- QName getAcknowledgementRangeQName();
-
- /**
- * getter
- * @return <b>Upper</b> QName
- */
- QName getUpperQName();
-
- /**
- * getter
- * @return <b>Lower</b> QName
- */
- QName getLowerQName();
-
- /**
- * getter
- * @return <b>None</b> QName
- */
- QName getNoneQName();
-
- /**
- * getter
- * @return <b>Final</b> QName
- */
- QName getFinalQName();
-
- /**
- * getter
- * @return <b>Nack</b> QName
- */
- QName getNackQName();
-
- /**
- * getter
- * @return <b>SequenceFault</b> QName
- */
- QName getSequenceFaultQName();
-
- /**
- * getter
- * @return <b>FaultCode</b> QName
- */
- QName getFaultCodeQName();
-
- /**
- * getter
- * @return <b>Detail</b> QName
- */
- QName getDetailQName();
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/MessageFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/MessageFactory.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/MessageFactory.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,101 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi;
-
-import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse;
-
-/**
- * WS-RM protocol elements SPI facade. Each WS-RM provider must implement this
interface.
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface MessageFactory
-{
- /**
- * Factory method
- * @return new CreateSequence instance
- */
- CreateSequence newCreateSequence();
-
- /**
- * Factory method
- * @return new CreateSequenceResponse instance
- */
- CreateSequenceResponse newCreateSequenceResponse();
-
- /**
- * Factory method
- * @return new CloseSequence instance or null if this message is not supported by
underlying WS-RM provider
- */
- CloseSequence newCloseSequence();
-
- /**
- * Factory method
- * @return new CloseSequenceResponse instance or null if this message is not supported
by underlying WS-RM provider
- */
- CloseSequenceResponse newCloseSequenceResponse();
-
- /**
- * Factory method
- * @return new TerminateSequence instance
- */
- TerminateSequence newTerminateSequence();
-
- /**
- * Factory method
- * @return new TerminateSequenceResponse instance or null if this message is not
supported by underlying WS-RM provider
- */
- TerminateSequenceResponse newTerminateSequenceResponse();
-
- /**
- * Factory method
- * @return new Sequence instance
- */
- Sequence newSequence();
-
- /**
- * Factory method
- * @return new AckRequested instance
- */
- AckRequested newAckRequested();
-
- /**
- * Factory method
- * @return new SequenceAcknowledgement instance
- */
- SequenceAcknowledgement newSequenceAcknowledgement();
-
- /**
- * Factory method
- * @return new SequenceFault instance
- */
- SequenceFault newSequenceFault();
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Provider.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Provider.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Provider.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * WS-RM Provider SPI facade. Each WS-RM provider must override this class.
- *
- * @author richard.opalka(a)jboss.com
- */
-public abstract class Provider
-{
-
- private static final Map<String, Provider> REGISTERED_PROVIDERS = new
HashMap<String, Provider>();
-
- static
- {
- REGISTERED_PROVIDERS.put(
-
org.jboss.ws.extensions.wsrm.spec200702.ProviderImpl.getInstance().getNamespaceURI(),
- org.jboss.ws.extensions.wsrm.spec200702.ProviderImpl.getInstance()
- );
- REGISTERED_PROVIDERS.put(
-
org.jboss.ws.extensions.wsrm.spec200502.ProviderImpl.getInstance().getNamespaceURI(),
- org.jboss.ws.extensions.wsrm.spec200502.ProviderImpl.getInstance()
- );
- }
-
- /**
- * Must be overriden in subclasses
- * @param targetNamespace
- */
- protected Provider()
- {
- }
-
- /**
- * Returns the namespace associated with current WS-RM provider implementation
- * @return
- */
- public abstract String getNamespaceURI();
-
- /**
- * Returns WS-RM provider specific message factory
- * @return message factory
- */
- public abstract MessageFactory getMessageFactory();
-
- /**
- * Returns WS-RM provider specific constants
- * @return constants
- */
- public abstract Constants getConstants();
-
- /**
- * Gets WS-RM provider by <b>wsrmNamespace</b>
- * @param namespace associated with the WS-RM provider
- * @return WS-RM provider instance
- * @throws IllegalArgumentException if specified <b>wsrmNamespace</b> has
no associated WS-RM provider
- */
- public static final Provider getInstance(String wsrmNamespace)
- {
- if (!REGISTERED_PROVIDERS.keySet().contains(wsrmNamespace))
- throw new IllegalArgumentException("No WS-RM provider registered for
namespace " + wsrmNamespace);
-
- return REGISTERED_PROVIDERS.get(wsrmNamespace);
- }
-
- public static final Provider get()
- {
- return org.jboss.ws.extensions.wsrm.spec200702.ProviderImpl.getInstance();
- }
-
-}
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMConstants.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMConstants.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMConstants.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,220 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi;
+
+import javax.xml.namespace.QName;
+
+/**
+ * WS-RM protocol elements SPI facade. Each WS-RM provider must implement this
interface.
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMConstants
+{
+
+ /**
+ * getter
+ * @return wsrm <b>prefix</b>
+ */
+ String getPrefix();
+
+ /**
+ * getter
+ * @return wsrm <b>namespace</b>
+ */
+ String getNamespaceURI();
+
+ /**
+ * getter
+ * @return <b>LastMessage</b> QName
+ */
+ QName getLastMessageQName();
+
+ /**
+ * getter
+ * @return <b>CreateSequence</b> QName
+ */
+ QName getCreateSequenceQName();
+
+ /**
+ * getter
+ * @return <b>AcksTo</b> QName
+ */
+ QName getAcksToQName();
+
+ /**
+ * getter
+ * @return <b>Expires</b> QName
+ */
+ QName getExpiresQName();
+
+ /**
+ * getter
+ * @return <b>Offer</b> QName
+ */
+ QName getOfferQName();
+
+ /**
+ * getter
+ * @return <b>Identifier</b> QName
+ */
+ QName getIdentifierQName();
+
+ /**
+ * getter
+ * @return <b>Endpoint</b> QName
+ */
+ QName getEndpointQName();
+
+ /**
+ * getter
+ * @return <b>IncompleteSequenceBehavior</b> QName
+ */
+ QName getIncompleteSequenceBehaviorQName();
+
+ /**
+ * getter
+ * @return <b>CreateSequenceResponse</b> QName
+ */
+ QName getCreateSequenceResponseQName();
+
+ /**
+ * getter
+ * @return <b>Accept</b> QName
+ */
+ QName getAcceptQName();
+
+ /**
+ * getter
+ * @return <b>CloseSequence</b> QName
+ */
+ QName getCloseSequenceQName();
+
+ /**
+ * getter
+ * @return <b>LastMessageNumber</b> QName
+ */
+ QName getLastMessageNumberQName();
+
+ /**
+ * getter
+ * @return <b>CloseSequenceResponse</b> QName
+ */
+ QName getCloseSequenceResponseQName();
+
+ /**
+ * getter
+ * @return <b>TerminateSequence</b> QName
+ */
+ QName getTerminateSequenceQName();
+
+ /**
+ * getter
+ * @return <b>LastMsgNumber</b> QName
+ */
+ QName getLastMsgNumberQName();
+
+ /**
+ * getter
+ * @return <b>TerminateSequenceResponse</b> QName
+ */
+ QName getTerminateSequenceResponseQName();
+
+ /**
+ * getter
+ * @return <b>Sequence</b> QName
+ */
+ QName getSequenceQName();
+
+ /**
+ * getter
+ * @return <b>MessageNumber</b> QName
+ */
+ QName getMessageNumberQName();
+
+ /**
+ * getter
+ * @return <b>AckRequested</b> QName
+ */
+ QName getAckRequestedQName();
+
+ /**
+ * getter
+ * @return <b>SequenceAcknowledgement</b> QName
+ */
+ QName getSequenceAcknowledgementQName();
+
+ /**
+ * getter
+ * @return <b>AcknowledgementRange</b> QName
+ */
+ QName getAcknowledgementRangeQName();
+
+ /**
+ * getter
+ * @return <b>Upper</b> QName
+ */
+ QName getUpperQName();
+
+ /**
+ * getter
+ * @return <b>Lower</b> QName
+ */
+ QName getLowerQName();
+
+ /**
+ * getter
+ * @return <b>None</b> QName
+ */
+ QName getNoneQName();
+
+ /**
+ * getter
+ * @return <b>Final</b> QName
+ */
+ QName getFinalQName();
+
+ /**
+ * getter
+ * @return <b>Nack</b> QName
+ */
+ QName getNackQName();
+
+ /**
+ * getter
+ * @return <b>SequenceFault</b> QName
+ */
+ QName getSequenceFaultQName();
+
+ /**
+ * getter
+ * @return <b>FaultCode</b> QName
+ */
+ QName getFaultCodeQName();
+
+ /**
+ * getter
+ * @return <b>Detail</b> QName
+ */
+ QName getDetailQName();
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMMessageFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMMessageFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMMessageFactory.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi;
+
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+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.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+
+/**
+ * WS-RM protocol elements SPI facade. Each WS-RM provider must implement this
interface.
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMMessageFactory
+{
+ /**
+ * Factory method
+ * @return new CreateSequence instance
+ */
+ RMCreateSequence newCreateSequence();
+
+ /**
+ * Factory method
+ * @return new CreateSequenceResponse instance
+ */
+ RMCreateSequenceResponse newCreateSequenceResponse();
+
+ /**
+ * Factory method
+ * @return new CloseSequence instance or null if this message is not supported by
underlying WS-RM provider
+ */
+ RMCloseSequence newCloseSequence();
+
+ /**
+ * Factory method
+ * @return new CloseSequenceResponse instance or null if this message is not supported
by underlying WS-RM provider
+ */
+ RMCloseSequenceResponse newCloseSequenceResponse();
+
+ /**
+ * Factory method
+ * @return new TerminateSequence instance
+ */
+ RMTerminateSequence newTerminateSequence();
+
+ /**
+ * Factory method
+ * @return new TerminateSequenceResponse instance or null if this message is not
supported by underlying WS-RM provider
+ */
+ RMTerminateSequenceResponse newTerminateSequenceResponse();
+
+ /**
+ * Factory method
+ * @return new Sequence instance
+ */
+ RMSequence newSequence();
+
+ /**
+ * Factory method
+ * @return new AckRequested instance
+ */
+ RMAckRequested newAckRequested();
+
+ /**
+ * Factory method
+ * @return new SequenceAcknowledgement instance
+ */
+ RMSequenceAcknowledgement newSequenceAcknowledgement();
+
+ /**
+ * Factory method
+ * @return new SequenceFault instance
+ */
+ RMSequenceFault newSequenceFault();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMMessageFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMProvider.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMProvider.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMProvider.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * WS-RM Provider SPI facade. Each WS-RM provider must override this class.
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public abstract class RMProvider
+{
+
+ private static final Map<String, RMProvider> REGISTERED_PROVIDERS = new
HashMap<String, RMProvider>();
+
+ static
+ {
+ REGISTERED_PROVIDERS.put(
+
org.jboss.ws.extensions.wsrm.spec200702.RMProviderImpl.getInstance().getNamespaceURI(),
+ org.jboss.ws.extensions.wsrm.spec200702.RMProviderImpl.getInstance()
+ );
+ REGISTERED_PROVIDERS.put(
+
org.jboss.ws.extensions.wsrm.spec200502.RMProviderImpl.getInstance().getNamespaceURI(),
+ org.jboss.ws.extensions.wsrm.spec200502.RMProviderImpl.getInstance()
+ );
+ }
+
+ /**
+ * Must be overriden in subclasses
+ * @param targetNamespace
+ */
+ protected RMProvider()
+ {
+ }
+
+ /**
+ * Returns the namespace associated with current WS-RM provider implementation
+ * @return
+ */
+ public abstract String getNamespaceURI();
+
+ /**
+ * Returns WS-RM provider specific message factory
+ * @return message factory
+ */
+ public abstract RMMessageFactory getMessageFactory();
+
+ /**
+ * Returns WS-RM provider specific constants
+ * @return constants
+ */
+ public abstract RMConstants getConstants();
+
+ /**
+ * Gets WS-RM provider by <b>wsrmNamespace</b>
+ * @param namespace associated with the WS-RM provider
+ * @return WS-RM provider instance
+ * @throws IllegalArgumentException if specified <b>wsrmNamespace</b> has
no associated WS-RM provider
+ */
+ public static final RMProvider getInstance(String wsrmNamespace)
+ {
+ if (!REGISTERED_PROVIDERS.keySet().contains(wsrmNamespace))
+ throw new IllegalArgumentException("No WS-RM provider registered for
namespace " + wsrmNamespace);
+
+ return REGISTERED_PROVIDERS.get(wsrmNamespace);
+ }
+
+ public static final RMProvider get()
+ {
+ return org.jboss.ws.extensions.wsrm.spec200702.RMProviderImpl.getInstance();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/RMProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/AckRequested.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/AckRequested.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/AckRequested.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * <p><b>AckRequested</b> element requests an Acknowledgement for the
identified Sequence.</p>
- *
- * The following infoset defines its syntax:
- * <p><blockquote><pre>
- * <wsrm:AckRequested ...>
- * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
- * <wsrm:MessageNumber> xs:unsignedLong
</wsrm:MessageNumber> ?
- * ...
- * </wsrm:AckRequested>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface AckRequested extends Serializable
-{
- /**
- * An RM Source that includes an <b>AckRequested</b> header block in a
SOAP envelope MUST include
- * this element in that header block. The RM Source MUST set the value of this element
to the
- * absolute URI, (conformant with RFC3986), that uniquely identifies the Sequence to
which the
- * request applies.
- * @param identifier
- */
- void setIdentifier(String identifier);
-
- /**
- * Getter
- * @return sequence identifier
- */
- String getIdentifier();
-
- /**
- * This optional element, if present, MUST contain an
<b>xs:unsignedLong</b> representing the highest
- * <b>MessageNumber</b> sent by the RM Source within a Sequence. If
present, it MAY be treated
- * as a hint to the RM Destination as an optimization to the process of preparing to
transmit a
- * <b>SequenceAcknowledgement</b>.
- * @param lastMessageNumber
- */
- void setMessageNumber(long lastMessageNumber);
-
- /**
- * Getter
- * @return last message number in the sequence
- */
- long getMessageNumber();
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequence.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequence.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * <p><b>CloseSequence</b> element MAY be sent by an RM Source to
indicate that the RM Destination MUST NOT
- * accept any new messages for this Sequence This element MAY also be sent by an RM
- * Destination to indicate that it will not accept any new messages for this
Sequence.</p>
- *
- * The following infoset defines its syntax:
- * <p><blockquote><pre>
- * <wsrm:CloseSequence ...>
- * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
- * <wsrm:LastMsgNumber> wsrm:MessageNumberType
</wsrm:LastMsgNumber> ?
- * ...
- * </wsrm:CloseSequence>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface CloseSequence extends Serializable
-{
- /**
- * The RM Source or RM Destination MUST include this element in any
<b>CloseSequence</b> messages it
- * sends. The RM Source or RM Destination MUST set the value of this element to the
absolute URI
- * (conformant with RFC3986) of the closing Sequence.
- * @param identifier
- */
- void setIdentifier(String identifier);
-
- /**
- * Getter
- * @return sequence identifier
- */
- String getIdentifier();
-
- /**
- * The RM Source SHOULD include this element in any <b>CloseSequence</b>
message it sends. The
- * <b>LastMsgNumber</b> element specifies the highest assigned message
number of all the Sequence
- * Traffic Messages for the closing Sequence.
- * @param lastMsgNumber
- */
- void setLastMsgNumber(long lastMsgNumber);
-
- /**
- * Getter
- * @return last message number
- */
- long getLastMsgNumber();
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequenceResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequenceResponse.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequenceResponse.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * <p><b>CloseSequenceResponse</b> element is sent in the body of a
message in response to receipt of a <b>CloseSequence</b>
- * request message. It indicates that the responder has closed the Sequence.</p>
- *
- * The following infoset defines its syntax:
- * <p><blockquote><pre>
- * <wsrm:CloseSequenceResponse ...>
- * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
- * ...
- * </wsrm:CloseSequenceResponse>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface CloseSequenceResponse extends Serializable
-{
- /**
- * The responder (RM Source or RM Destination) MUST include this element in any
- * <b>CloseSequenceResponse</b> message it sends. The responder MUST set
the value of this
- * element to the absolute URI (conformant with RFC3986) of the closing Sequence.
- * @param identifier
- */
- void setIdentifier(String identifier);
-
- /**
- * Getter
- * @return sequence identifier
- */
- String getIdentifier();
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequence.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequence.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,180 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * <p><b>CreateSequence</b> element requests creation of a new Sequence
between the RM Source that sends it, and the
- * RM Destination to which it is sent. The RM Source MUST NOT send this element as a
header
- * block. The RM Destination MUST respond either with a
<b>CreateSequenceResponse</b> response
- * message or a <b>CreateSequenceRefused</b> fault.</p>
- *
- * The following infoset defines its syntax:
- * <p><blockquote><pre>
- * <wsrm:CreateSequence ...>
- * <wsrm:AcksTo> wsa:EndpointReferenceType
</wsrm:AcksTo>
- * <wsrm:Expires ...> xs:duration </wsrm:Expires> ?
- * <wsrm:Offer ...>
- * <wsrm:Identifier ...> xs:anyURI
</wsrm:Identifier>
- * <wsrm:Endpoint> wsa:EndpointReferenceType
</wsrm:Endpoint>
- * <wsrm:Expires ...> xs:duration </wsrm:Expires> ?
- * <wsrm:IncompleteSequenceBehavior>
- * wsrm:IncompleteSequenceBehaviorType
- * </wsrm:IncompleteSequenceBehavior> ?
- * ...
- * </wsrm:Offer> ?
- * ...
- * </wsrm:CreateSequence>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface CreateSequence extends Serializable
-{
- /**
- * <p>The RM Source MUST include this element in any CreateSequence message it
sends. This
- * element is of type wsa:EndpointReferenceType (as specified by WS-Addressing). It
specifies
- * the endpoint reference to which messages containing SequenceAcknowledgement header
- * blocks and faults related to the created Sequence are to be sent, unless otherwise
noted in this
- * specification.</p>
- * <p>Implementations MUST NOT use an endpoint reference in the AcksTo element
that would prevent
- * the sending of Sequence Acknowledgements back to the RM Source. For example, using
the WS-Addressing
- * "http://www.w3.org/2005/08/addressing/none" URI would make it impossible
for the RM
- * Destination to ever send Sequence Acknowledgements.</p>
- * @param address
- */
- void setAcksTo(String address);
-
- /**
- * Getter
- * @return address
- */
- String getAcksTo();
-
- /**
- * This element, if present, of type <b>xs:duration</b> specifies the RM
Source's requested duration for
- * the Sequence. The RM Destination MAY either accept the requested duration or assign
a lesser
- * value of its choosing. A value of <b>"PT0S"</b>
indicates that the Sequence will never expire. Absence of
- * the element indicates an implied value of
<b>"PT0S"</b>.
- * @param duration
- */
- void setExpires(String duration);
-
- /**
- * Getter
- * @return duration
- */
- String getExpires();
-
- /**
- * Factory method
- * @return new instance of Offer
- */
- Offer newOffer();
-
- /**
- * Setter
- * @param offer
- */
- void setOffer(Offer offer);
-
- /**
- * Getter
- * @return offer
- */
- Offer 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
- {
- /**
- * The RM Source MUST set the value of this element to an absolute URI (conformant
with
- * RFC3986 [URI]) that uniquely identifies the offered Sequence.
- * @param identifier
- */
- void setIdentifier(String identifier);
-
- /**
- * Getter
- * @return offered sequence identifier
- */
- String getIdentifier();
-
- /**
- * <p>An RM Source MUST include this element, of type
<b>wsa:EndpointReferenceType</b> (as
- * specified by WS-Addressing). This element specifies the endpoint reference to
which Sequence
- * Lifecycle Messages, Acknowledgement Requests, and fault messages related to the
offered
- * Sequence are to be sent.</p>
- *
- * <p>Implementations MUST NOT use an endpoint reference in the Endpoint
element that would
- * prevent the sending of Sequence Lifecycle Message, etc. For example, using the
WS-Addressing
- * "http://www.w3.org/2005/08/addressing/none" URI would make it
impossible for the RM Destination
- * to ever send Sequence Lifecycle Messages (e.g.
<b>TerminateSequence</b>) to the RM Source for
- * the Offered Sequence.</p>
- *
- * <p>The Offer of an Endpoint containing the
"http://www.w3.org/2005/08/addressing/anonymous" URI
- * as its address is problematic due to the inability of a source to connect to
this address and retry
- * unacknowledged messages. Note that this specification does not
- * define any mechanisms for providing this assurance. In the absence of an
extension that
- * addresses this issue, an RM Destination MUST NOT accept (via the
- * <b>/wsrm:CreateSequenceResponse/wsrm:Accept</b>) an Offer that
- * contains the "http://www.w3.org/2005/08/addressing/anonymous" URI as
its address.</p>
- * @param address
- */
- void setEndpoint(String address);
-
- /**
- * Getter
- * @return offered endpoint address
- */
- String getEndpoint();
-
- /**
- * This element, if present, of type <b>xs:duration</b> specifies the
duration for the offered Sequence. A
- * value of <b>"PT0S"</b> indicates that the offered
Sequence will never expire. Absence of the element
- * indicates an implied value of <b>"PT0S"</b>.
- * @param duration
- */
- void setExpires(String duration);
-
- /**
- * Getter
- * @return offered sequence duration
- */
- String getExpires();
-
- /**
- * This element, if present, specifies the behavior that the destination will
exhibit upon the closure or
- * termination of an incomplete Sequence.
- * @param incompleteSequenceBehavior
- */
- void setIncompleteSequenceBehavior(IncompleteSequenceBehavior
incompleteSequenceBehavior);
-
- /**
- * Getter
- * @return offered incomplete sequence behavior
- */
- IncompleteSequenceBehavior getIncompleteSequenceBehavior();
- }
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequenceResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequenceResponse.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequenceResponse.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,144 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * <p><b>CreateSequenceResponse</b> element is sent in the body of the
response message in response to a <b>CreateSequence</b>
- * request message. It indicates that the RM Destination has created a new Sequence at
the
- * request of the RM Source. The RM Destination MUST NOT send this element as a header
block.</p>
- *
- * The following infoset defines its syntax:
- * <p><blockquote><pre>
- * <CreateSequenceResponse ...>
- * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
- * <wsrm:Expires ...> xs:duration </wsrm:Expires> ?
- * <wsrm:IncompleteSequenceBehavior>
- * wsrm:IncompleteSequenceBehaviorType
- * </wsrm:IncompleteSequenceBehavior> ?
- * <wsrm:Accept ...>
- * <wsrm:AcksTo> wsa:EndpointReferenceType
</wsrm:AcksTo>
- * ...
- * </wsrm:Accept> ?
- * ...
- * </CreateSequenceResponse>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface CreateSequenceResponse extends Serializable
-{
- /**
- * The RM Destination MUST include this element within any CreateSequenceResponse
message it
- * sends. The RM Destination MUST set the value of this element to the absolute URI
(conformant
- * with RFC3986) that uniquely identifies the Sequence that has been created by the RM
Destination.
- * @param identifier
- */
- void setIdentifier(String identifier);
-
- /**
- * Getter
- * @return sequence identifier
- */
- String getIdentifier();
-
- /**
- * This element, if present, of type <b>xs:duration</b> accepts or refines
the RM Source's requested
- * duration for the Sequence. It specifies the amount of time after which any
resources associated
- * with the Sequence SHOULD be reclaimed thus causing the Sequence to be silently
terminated. At
- * the RM Destination this duration is measured from a point proximate to Sequence
creation and at
- * the RM Source this duration is measured from a point approximate to the successful
processing of
- * the <b>CreateSequenceResponse</b>. A value of "PT0S"
indicates that the Sequence will never
- * expire. Absence of the element indicates an implied value of "PT0S". The
RM Destination MUST
- * set the value of this element to be equal to or less than the value requested by
the RM Source in
- * the corresponding <b>CreateSequence</b> message.
- * @param duration
- */
- void setExpires(String duration);
-
- /**
- * Getter
- * @return sequence duration
- */
- String getExpires();
-
- /**
- * This element, if present, specifies the behavior that the destination will exhibit
upon the closure or
- * termination of an incomplete Sequence.
- * @param incompleteSequenceBehavior
- */
- void setIncompleteSequenceBehavior(IncompleteSequenceBehavior
incompleteSequenceBehavior);
-
- /**
- * Getter
- * @return used incomplete sequence behavior type
- */
- IncompleteSequenceBehavior getIncompleteSequenceBehavior();
-
- /**
- * Factory method
- * @return new instance of accept
- */
- Accept newAccept();
-
- /**
- * Setter
- * @param accept
- */
- void setAccept(Accept accept);
-
- /**
- * Getter
- * @return accept
- */
- Accept getAccept();
-
- /**
- * <p>This element, if present, enables an RM Destination to accept the offer of
a corresponding
- * Sequence for the reliable exchange of messages Transmitted from RM Destination to
RM Source.</p>
- *
- * <p>Note: If a <b>CreateSequenceResponse</b> is returned without a
child Accept in response to a
- * <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
- {
- /**
- * <p>The RM Destination MUST include this element, of type
<b>wsa:EndpointReferenceType</b> (as
- * specified by WS-Addressing). It specifies the endpoint reference to which
messages containing
- * <b>SequenceAcknowledgement</b> header blocks and faults related to
the created Sequence are to
- * be sent, unless otherwise noted in this specification.</p>
- *
- * <p>Implementations MUST NOT use an endpoint reference in the AcksTo
element that would prevent
- * the sending of Sequence Acknowledgements back to the RM Source. For example,
using the
- * WS-Addressing "http://www.w3.org/2005/08/addressing/none" URI would
make it impossible for the RM
- * Destination to ever send Sequence Acknowledgements.</p>
- * @param address
- */
- void setAcksTo(String address);
-
- /**
- * Getter
- * @return address
- */
- String getAcksTo();
- }
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/IncompleteSequenceBehavior.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/IncompleteSequenceBehavior.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/IncompleteSequenceBehavior.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * <p>This element, if present, specifies the behavior that the destination will
exhibit upon the closure or
- * termination of an incomplete Sequence. For the purposes of defining the values used,
the term
- * "discard" refers to behavior equivalent to the Application Destination never
processing a particular message.</p>
- *
- * The following schema snippet defines allowed values:
- * <p><blockquote><pre>
- * <xs:simpleType name="IncompleteSequenceBehaviorType">
- * <xs:restriction base="xs:string">
- * <xs:enumeration
value="DiscardEntireSequence"/>
- * <xs:enumeration
value="DiscardFollowingFirstGap"/>
- * <xs:enumeration value="NoDiscard"/>
- * </xs:restriction>
- * </xs:simpleType>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public enum IncompleteSequenceBehavior
-{
- /**
- * A value of <b>"DiscardEntireSequence"</b> indicates
that the entire Sequence MUST be discarded if the
- * Sequence is closed, or terminated, when there are one or more gaps in the final
<b>SequenceAcknowledgement</b>.
- */
- DISCARD_ENTIRE_SEQUENCE("DiscardEntireSequence"),
-
- /**
- * A value of <b>"DiscardFollowingFirstGap"</b>
indicates that messages in the Sequence beyond the first
- * gap MUST be discarded when there are one or more gaps in the final
<b>SequenceAcknowledgement</b>.
- */
- DISCARD_FOLLOWING_FIRST_GAP("DiscardFollowingFirstGap"),
-
- /**
- * The default value of <b>"NoDiscard"</b> indicates
that no acknowledged messages in the Sequence will
- * be discarded.
- */
- NO_DISCARD("NoDiscard");
-
- private final String value;
-
- IncompleteSequenceBehavior(String value)
- {
- this.value = value;
- }
-
- public String toString()
- {
- return value;
- }
-
- /**
- * Returns this enum instance if value string matches, <b>null</b>
otherwise
- * @param stringValue value in the form of string
- * @return enum or null if string not recognized
- */
- public static IncompleteSequenceBehavior getValue(String stringValue)
- {
- if (DISCARD_ENTIRE_SEQUENCE.toString().equals(stringValue)) return
DISCARD_ENTIRE_SEQUENCE;
- if (DISCARD_FOLLOWING_FIRST_GAP.toString().equals(stringValue)) return
DISCARD_FOLLOWING_FIRST_GAP;
- if (NO_DISCARD.toString().equals(stringValue)) return NO_DISCARD;
- return null;
- }
-
-}
\ No newline at end of file
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMAckRequested.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMAckRequested.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMAckRequested.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * <p><b>AckRequested</b> element requests an Acknowledgement for the
identified Sequence.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:AckRequested ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:MessageNumber> xs:unsignedLong
</wsrm:MessageNumber> ?
+ * ...
+ * </wsrm:AckRequested>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMAckRequested extends RMSerializable
+{
+ /**
+ * An RM Source that includes an <b>AckRequested</b> header block in a
SOAP envelope MUST include
+ * this element in that header block. The RM Source MUST set the value of this element
to the
+ * absolute URI, (conformant with RFC3986), that uniquely identifies the Sequence to
which the
+ * request applies.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * This optional element, if present, MUST contain an
<b>xs:unsignedLong</b> representing the highest
+ * <b>MessageNumber</b> sent by the RM Source within a Sequence. If
present, it MAY be treated
+ * as a hint to the RM Destination as an optimization to the process of preparing to
transmit a
+ * <b>SequenceAcknowledgement</b>.
+ * @param lastMessageNumber
+ */
+ void setMessageNumber(long lastMessageNumber);
+
+ /**
+ * Getter
+ * @return last message number in the sequence
+ */
+ long getMessageNumber();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMAckRequested.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCloseSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCloseSequence.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCloseSequence.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * <p><b>CloseSequence</b> element MAY be sent by an RM Source to
indicate that the RM Destination MUST NOT
+ * accept any new messages for this Sequence This element MAY also be sent by an RM
+ * Destination to indicate that it will not accept any new messages for this
Sequence.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:CloseSequence ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:LastMsgNumber> wsrm:MessageNumberType
</wsrm:LastMsgNumber> ?
+ * ...
+ * </wsrm:CloseSequence>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMCloseSequence extends RMSerializable
+{
+ /**
+ * The RM Source or RM Destination MUST include this element in any
<b>CloseSequence</b> messages it
+ * sends. The RM Source or RM Destination MUST set the value of this element to the
absolute URI
+ * (conformant with RFC3986) of the closing Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * The RM Source SHOULD include this element in any <b>CloseSequence</b>
message it sends. The
+ * <b>LastMsgNumber</b> element specifies the highest assigned message
number of all the Sequence
+ * Traffic Messages for the closing Sequence.
+ * @param lastMsgNumber
+ */
+ void setLastMsgNumber(long lastMsgNumber);
+
+ /**
+ * Getter
+ * @return last message number
+ */
+ long getLastMsgNumber();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCloseSequence.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCloseSequenceResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCloseSequenceResponse.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCloseSequenceResponse.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * <p><b>CloseSequenceResponse</b> element is sent in the body of a
message in response to receipt of a <b>CloseSequence</b>
+ * request message. It indicates that the responder has closed the Sequence.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:CloseSequenceResponse ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * ...
+ * </wsrm:CloseSequenceResponse>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMCloseSequenceResponse extends RMSerializable
+{
+ /**
+ * The responder (RM Source or RM Destination) MUST include this element in any
+ * <b>CloseSequenceResponse</b> message it sends. The responder MUST set
the value of this
+ * element to the absolute URI (conformant with RFC3986) of the closing Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCloseSequenceResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequence.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * <p><b>CreateSequence</b> element requests creation of a new Sequence
between the RM Source that sends it, and the
+ * RM Destination to which it is sent. The RM Source MUST NOT send this element as a
header
+ * block. The RM Destination MUST respond either with a
<b>CreateSequenceResponse</b> response
+ * message or a <b>CreateSequenceRefused</b> fault.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:CreateSequence ...>
+ * <wsrm:AcksTo> wsa:EndpointReferenceType
</wsrm:AcksTo>
+ * <wsrm:Expires ...> xs:duration </wsrm:Expires> ?
+ * <wsrm:Offer ...>
+ * <wsrm:Identifier ...> xs:anyURI
</wsrm:Identifier>
+ * <wsrm:Endpoint> wsa:EndpointReferenceType
</wsrm:Endpoint>
+ * <wsrm:Expires ...> xs:duration </wsrm:Expires> ?
+ * <wsrm:IncompleteSequenceBehavior>
+ * wsrm:IncompleteSequenceBehaviorType
+ * </wsrm:IncompleteSequenceBehavior> ?
+ * ...
+ * </wsrm:Offer> ?
+ * ...
+ * </wsrm:CreateSequence>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMCreateSequence extends RMSerializable
+{
+ /**
+ * <p>The RM Source MUST include this element in any CreateSequence message it
sends. This
+ * element is of type wsa:EndpointReferenceType (as specified by WS-Addressing). It
specifies
+ * the endpoint reference to which messages containing SequenceAcknowledgement header
+ * blocks and faults related to the created Sequence are to be sent, unless otherwise
noted in this
+ * specification.</p>
+ * <p>Implementations MUST NOT use an endpoint reference in the AcksTo element
that would prevent
+ * the sending of Sequence Acknowledgements back to the RM Source. For example, using
the WS-Addressing
+ * "http://www.w3.org/2005/08/addressing/none" URI would make it impossible
for the RM
+ * Destination to ever send Sequence Acknowledgements.</p>
+ * @param address
+ */
+ void setAcksTo(String address);
+
+ /**
+ * Getter
+ * @return address
+ */
+ String getAcksTo();
+
+ /**
+ * This element, if present, of type <b>xs:duration</b> specifies the RM
Source's requested duration for
+ * the Sequence. The RM Destination MAY either accept the requested duration or assign
a lesser
+ * value of its choosing. A value of <b>"PT0S"</b>
indicates that the Sequence will never expire. Absence of
+ * the element indicates an implied value of
<b>"PT0S"</b>.
+ * @param duration
+ */
+ void setExpires(String duration);
+
+ /**
+ * Getter
+ * @return duration
+ */
+ String getExpires();
+
+ /**
+ * Factory method
+ * @return new instance of Offer
+ */
+ Offer newOffer();
+
+ /**
+ * Setter
+ * @param offer
+ */
+ void setOffer(Offer offer);
+
+ /**
+ * Getter
+ * @return offer
+ */
+ Offer 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
+ {
+ /**
+ * The RM Source MUST set the value of this element to an absolute URI (conformant
with
+ * RFC3986 [URI]) that uniquely identifies the offered Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return offered sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * <p>An RM Source MUST include this element, of type
<b>wsa:EndpointReferenceType</b> (as
+ * specified by WS-Addressing). This element specifies the endpoint reference to
which Sequence
+ * Lifecycle Messages, Acknowledgement Requests, and fault messages related to the
offered
+ * Sequence are to be sent.</p>
+ *
+ * <p>Implementations MUST NOT use an endpoint reference in the Endpoint
element that would
+ * prevent the sending of Sequence Lifecycle Message, etc. For example, using the
WS-Addressing
+ * "http://www.w3.org/2005/08/addressing/none" URI would make it
impossible for the RM Destination
+ * to ever send Sequence Lifecycle Messages (e.g.
<b>TerminateSequence</b>) to the RM Source for
+ * the Offered Sequence.</p>
+ *
+ * <p>The Offer of an Endpoint containing the
"http://www.w3.org/2005/08/addressing/anonymous" URI
+ * as its address is problematic due to the inability of a source to connect to
this address and retry
+ * unacknowledged messages. Note that this specification does not
+ * define any mechanisms for providing this assurance. In the absence of an
extension that
+ * addresses this issue, an RM Destination MUST NOT accept (via the
+ * <b>/wsrm:CreateSequenceResponse/wsrm:Accept</b>) an Offer that
+ * contains the "http://www.w3.org/2005/08/addressing/anonymous" URI as
its address.</p>
+ * @param address
+ */
+ void setEndpoint(String address);
+
+ /**
+ * Getter
+ * @return offered endpoint address
+ */
+ String getEndpoint();
+
+ /**
+ * This element, if present, of type <b>xs:duration</b> specifies the
duration for the offered Sequence. A
+ * value of <b>"PT0S"</b> indicates that the offered
Sequence will never expire. Absence of the element
+ * indicates an implied value of <b>"PT0S"</b>.
+ * @param duration
+ */
+ void setExpires(String duration);
+
+ /**
+ * Getter
+ * @return offered sequence duration
+ */
+ String getExpires();
+
+ /**
+ * This element, if present, specifies the behavior that the destination will
exhibit upon the closure or
+ * termination of an incomplete Sequence.
+ * @param incompleteSequenceBehavior
+ */
+ void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior
incompleteSequenceBehavior);
+
+ /**
+ * Getter
+ * @return offered incomplete sequence behavior
+ */
+ RMIncompleteSequenceBehavior getIncompleteSequenceBehavior();
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequence.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequenceResponse.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * <p><b>CreateSequenceResponse</b> element is sent in the body of the
response message in response to a <b>CreateSequence</b>
+ * request message. It indicates that the RM Destination has created a new Sequence at
the
+ * request of the RM Source. The RM Destination MUST NOT send this element as a header
block.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <CreateSequenceResponse ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:Expires ...> xs:duration </wsrm:Expires> ?
+ * <wsrm:IncompleteSequenceBehavior>
+ * wsrm:IncompleteSequenceBehaviorType
+ * </wsrm:IncompleteSequenceBehavior> ?
+ * <wsrm:Accept ...>
+ * <wsrm:AcksTo> wsa:EndpointReferenceType
</wsrm:AcksTo>
+ * ...
+ * </wsrm:Accept> ?
+ * ...
+ * </CreateSequenceResponse>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMCreateSequenceResponse extends RMSerializable
+{
+ /**
+ * The RM Destination MUST include this element within any CreateSequenceResponse
message it
+ * sends. The RM Destination MUST set the value of this element to the absolute URI
(conformant
+ * with RFC3986) that uniquely identifies the Sequence that has been created by the RM
Destination.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * This element, if present, of type <b>xs:duration</b> accepts or refines
the RM Source's requested
+ * duration for the Sequence. It specifies the amount of time after which any
resources associated
+ * with the Sequence SHOULD be reclaimed thus causing the Sequence to be silently
terminated. At
+ * the RM Destination this duration is measured from a point proximate to Sequence
creation and at
+ * the RM Source this duration is measured from a point approximate to the successful
processing of
+ * the <b>CreateSequenceResponse</b>. A value of "PT0S"
indicates that the Sequence will never
+ * expire. Absence of the element indicates an implied value of "PT0S". The
RM Destination MUST
+ * set the value of this element to be equal to or less than the value requested by
the RM Source in
+ * the corresponding <b>CreateSequence</b> message.
+ * @param duration
+ */
+ void setExpires(String duration);
+
+ /**
+ * Getter
+ * @return sequence duration
+ */
+ String getExpires();
+
+ /**
+ * This element, if present, specifies the behavior that the destination will exhibit
upon the closure or
+ * termination of an incomplete Sequence.
+ * @param incompleteSequenceBehavior
+ */
+ void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior
incompleteSequenceBehavior);
+
+ /**
+ * Getter
+ * @return used incomplete sequence behavior type
+ */
+ RMIncompleteSequenceBehavior getIncompleteSequenceBehavior();
+
+ /**
+ * Factory method
+ * @return new instance of accept
+ */
+ Accept newAccept();
+
+ /**
+ * Setter
+ * @param accept
+ */
+ void setAccept(Accept accept);
+
+ /**
+ * Getter
+ * @return accept
+ */
+ Accept getAccept();
+
+ /**
+ * <p>This element, if present, enables an RM Destination to accept the offer of
a corresponding
+ * Sequence for the reliable exchange of messages Transmitted from RM Destination to
RM Source.</p>
+ *
+ * <p>Note: If a <b>CreateSequenceResponse</b> is returned without a
child Accept in response to a
+ * <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
+ {
+ /**
+ * <p>The RM Destination MUST include this element, of type
<b>wsa:EndpointReferenceType</b> (as
+ * specified by WS-Addressing). It specifies the endpoint reference to which
messages containing
+ * <b>SequenceAcknowledgement</b> header blocks and faults related to
the created Sequence are to
+ * be sent, unless otherwise noted in this specification.</p>
+ *
+ * <p>Implementations MUST NOT use an endpoint reference in the AcksTo
element that would prevent
+ * the sending of Sequence Acknowledgements back to the RM Source. For example,
using the
+ * WS-Addressing "http://www.w3.org/2005/08/addressing/none" URI would
make it impossible for the RM
+ * Destination to ever send Sequence Acknowledgements.</p>
+ * @param address
+ */
+ void setAcksTo(String address);
+
+ /**
+ * Getter
+ * @return address
+ */
+ String getAcksTo();
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMCreateSequenceResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMIncompleteSequenceBehavior.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMIncompleteSequenceBehavior.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMIncompleteSequenceBehavior.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * <p>This element, if present, specifies the behavior that the destination will
exhibit upon the closure or
+ * termination of an incomplete Sequence. For the purposes of defining the values used,
the term
+ * "discard" refers to behavior equivalent to the Application Destination never
processing a particular message.</p>
+ *
+ * The following schema snippet defines allowed values:
+ * <p><blockquote><pre>
+ * <xs:simpleType name="IncompleteSequenceBehaviorType">
+ * <xs:restriction base="xs:string">
+ * <xs:enumeration
value="DiscardEntireSequence"/>
+ * <xs:enumeration
value="DiscardFollowingFirstGap"/>
+ * <xs:enumeration value="NoDiscard"/>
+ * </xs:restriction>
+ * </xs:simpleType>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public enum RMIncompleteSequenceBehavior
+{
+ /**
+ * A value of <b>"DiscardEntireSequence"</b> indicates
that the entire Sequence MUST be discarded if the
+ * Sequence is closed, or terminated, when there are one or more gaps in the final
<b>SequenceAcknowledgement</b>.
+ */
+ DISCARD_ENTIRE_SEQUENCE("DiscardEntireSequence"),
+
+ /**
+ * A value of <b>"DiscardFollowingFirstGap"</b>
indicates that messages in the Sequence beyond the first
+ * gap MUST be discarded when there are one or more gaps in the final
<b>SequenceAcknowledgement</b>.
+ */
+ DISCARD_FOLLOWING_FIRST_GAP("DiscardFollowingFirstGap"),
+
+ /**
+ * The default value of <b>"NoDiscard"</b> indicates
that no acknowledged messages in the Sequence will
+ * be discarded.
+ */
+ NO_DISCARD("NoDiscard");
+
+ private final String value;
+
+ RMIncompleteSequenceBehavior(String value)
+ {
+ this.value = value;
+ }
+
+ public String toString()
+ {
+ return value;
+ }
+
+ /**
+ * Returns this enum instance if value string matches, <b>null</b>
otherwise
+ * @param stringValue value in the form of string
+ * @return enum or null if string not recognized
+ */
+ public static RMIncompleteSequenceBehavior getValue(String stringValue)
+ {
+ if (DISCARD_ENTIRE_SEQUENCE.toString().equals(stringValue)) return
DISCARD_ENTIRE_SEQUENCE;
+ if (DISCARD_FOLLOWING_FIRST_GAP.toString().equals(stringValue)) return
DISCARD_FOLLOWING_FIRST_GAP;
+ if (NO_DISCARD.toString().equals(stringValue)) return NO_DISCARD;
+ return null;
+ }
+
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMIncompleteSequenceBehavior.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequence.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequence.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * <p><b>Sequence</b> protocol element associates the message in which
it is contained with a previously
+ * established RM Sequence. It contains the Sequence's unique identifier and the
containing
+ * message's ordinal position within that Sequence. The RM Destination MUST
understand the
+ * <b>Sequence</b> header block. The RM Source MUST assign a
<b>mustUnderstand</b> attribute with a
+ * value 1/true (from the namespace corresponding to the version of SOAP to which the
<b>Sequence</b>
+ * SOAP header block is bound) to the <b>Sequence</b> header block
element.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:Sequence ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:MessageNumber> wsrm:MessageNumberType
</wsrm:MessageNumber>
+ * <wsrm:LastMessage/> ?
+ * ...
+ * </wsrm:Sequence>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSequence extends RMSerializable
+{
+ /**
+ * An RM Source that includes a <b>Sequence</b> header block in a SOAP
envelope MUST include this
+ * element in that header block. The RM Source MUST set the value of this element to
the absolute
+ * URI (conformant with RFC3986) that uniquely identifies the Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * The RM Source MUST include this element within any Sequence headers it creates.
This element
+ * is of type <b>MessageNumberType</b>. It represents the ordinal position
of the message within a
+ * Sequence. Sequence message numbers start at 1 and monotonically increase by 1
throughout
+ * the Sequence.
+ * @param messageNumber
+ */
+ void setMessageNumber(long messageNumber);
+
+ /**
+ * Getter
+ * @return message number within specified sequence
+ */
+ long getMessageNumber();
+
+ /**
+ * This element MAY be included by the RM Source endpoint. The
<b>LastMessage</b> element has no content.
+ * @param lastMessage
+ */
+ void setLastMessage();
+
+ /**
+ * Getter
+ * @return last message indicator
+ */
+ boolean isLastMessage();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequence.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceAcknowledgement.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,170 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+import java.util.List;
+
+/**
+ *
+ * <p><b>wsrm:SequenceAcknowledgement</b> element contains the sequence
acknowledgement information</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:SequenceAcknowledgement ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * [ [ [ <wsrm:AcknowledgementRange ...
+ * Upper="wsrm:MessageNumberType"
+ * Lower="wsrm:MessageNumberType"/> +
+ * | <wsrm:None/> ]
+ * <wsrm:Final/> ? ]
+ * | <wsrm:Nack> wsrm:MessageNumberType </wsrm:Nack> + ]
+ *
+ * ...
+ * </wsrm:SequenceAcknowledgement>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSequenceAcknowledgement extends RMSerializable
+{
+ /**
+ * An RM Destination that includes a <b>SequenceAcknowledgement</b> header
block in a SOAP
+ * envelope MUST include this element in that header block. The RM Destination MUST
set the
+ * value of this element to the absolute URI (conformant with RFC3986) that uniquely
identifies the
+ * Sequence. The RM Destination MUST NOT include multiple
<b>SequenceAcknowledgement</b>
+ * header blocks that share the same value for <b>Identifier</b> within
the same SOAP envelope.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * The RM Destination MAY include this element within a
<b>SequenceAcknowledgement</b> header
+ * block. This element indicates that the RM Destination is not receiving new messages
for the
+ * specified Sequence. The RM Source can be assured that the ranges of messages
acknowledged
+ * by this SequenceAcknowledgement header block will not change in the future. The RM
+ * Destination MUST include this element when the Sequence is closed. The RM
Destination MUST
+ * NOT include this element when sending a <b>Nack</b>; it can only be
used when sending
+ * <b>AcknowledgementRange</b> elements or a <b>None</b>.
+ */
+ void setFinal();
+
+ /**
+ * Getter
+ * @return true if <b>SequenceAcknowledgement</b> is
<b>Final</b>, false otherwise
+ */
+ boolean isFinal();
+
+ /**
+ * The RM Destination MUST include this element within a
<b>SequenceAcknowledgement</b> header
+ * block if the RM Destination has not accepted any messages for the specified
Sequence. The RM
+ * Destination MUST NOT include this element if a sibling
<b>AcknowledgementRange</b> or <b>Nack</b>
+ * element is also present as a child of the
<b>SequenceAcknowledgement</b>.
+ */
+ void setNone();
+
+ /**
+ * Getter
+ * @return true if <b>SequenceAcknowledgement</b> is
<b>None</b>, false otherwise
+ */
+ boolean isNone();
+
+ /**
+ * The RM Destination MAY include this element within a
<b>SequenceAcknowledgement</b> header
+ * block. If used, the RM Destination MUST set the value of this element to a
<b>MessageNumberType</b>
+ * representing the <b>MessageNumber</b> of an unreceived message in a
Sequence. The RM Destination
+ * MUST NOT include a <b>Nack</b> element if a sibling
<b>AcknowledgementRange</b> or <b>None</b> element is
+ * also present as a child of <b>SequenceAcknowledgement</b>. Upon the
receipt of a <b>Nack</b>, an RM
+ * Source SHOULD retransmit the message identified by the <b>Nack</b>. The
RM Destination MUST NOT
+ * issue a <b>SequenceAcknowledgement</b> containing a
<b>Nack</b> for a message that it has previously
+ * acknowledged within an <b>AcknowledgementRange</b>. The RM Source
SHOULD ignore a
+ * <b>SequenceAcknowledgement</b> containing a <b>Nack</b> for
a message that has previously been
+ * acknowledged within an <b>AcknowledgementRange</b>.
+ * @param messageNumber
+ */
+ void addNack(long messageNumber);
+
+ /**
+ * Getter
+ * @return list of not ackonwledged message numbers
+ */
+ List<Long> getNacks();
+
+ /**
+ * Factory method
+ * @return new instance of AcknowledgementRange
+ */
+ AcknowledgementRange newAcknowledgementRange();
+
+ /**
+ * Setter
+ * @param acknowledgementRange
+ */
+ void addAcknowledgementRange(AcknowledgementRange acknowledgementRange);
+
+ /**
+ * Getter
+ * @return list of acknowledged ranges
+ */
+ List<AcknowledgementRange> getAcknowledgementRanges();
+
+ /**
+ * The RM Destination MAY include one or more instances of this element within a
+ * <b>SequenceAcknowledgement</b> header block. It contains a range of
Sequence message numbers
+ * successfully accepted by the RM Destination. The ranges MUST NOT overlap. The RM
+ * 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
+ {
+ /**
+ * The RM Destination MUST set the value of this attribute equal to the message
number of the
+ * highest contiguous message in a Sequence range accepted by the RM Destination.
+ * @param upper
+ */
+ void setUpper(long upper);
+
+ /**
+ * Getter
+ * @return upper value
+ */
+ long getUpper();
+
+ /**
+ * The RM Destination MUST set the value of this attribute equal to the message
number of the
+ * lowest contiguous message in a Sequence range accepted by the RM Destination.
+ * @param lower
+ */
+ void setLower(long lower);
+
+ /**
+ * Getter
+ * @return lower value
+ */
+ long getLower();
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceAcknowledgement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceFault.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceFault.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceFault.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * <p><b>SequenceFault</b> element purpose is to carry the specific
details of a fault generated during the
+ * reliable messaging specific processing of a message belonging to a Sequence.
WS-ReliableMessaging
+ * nodes MUST use the <b>SequenceFault</b> container only in conjunction with
the SOAP 1.1 fault mechanism.
+ * WS-ReliableMessaging nodes MUST NOT use the <b>SequenceFault</b> container
in conjunction with the
+ * SOAP 1.2 binding.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <SequenceFault ...>
+ * <wsrm:FaultCode> wsrm:FaultCode </wsrm:FaultCode>
+ * <wsrm:Detail> ... </wsrm:Detail> ?
+ * ...
+ * </SequenceFault>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSequenceFault extends RMSerializable
+{
+ /**
+ * WS-ReliableMessaging nodes that generate a <b>SequenceFault</b> MUST
set the value of this
+ * element to a qualified name from the set of faults [Subcodes] defined below.
+ * @param faultCode
+ */
+ void setFaultCode(RMSequenceFaultCode faultCode);
+
+ /**
+ * Getter
+ * @return sequence fault code
+ */
+ RMSequenceFaultCode getFaultCode();
+
+ /**
+ * This element, if present, carries application specific error information
+ * related to the fault being described.
+ * @param detail
+ */
+ void setDetail(Exception detail);
+
+ /**
+ * Getter
+ * @return application specific fault detail
+ */
+ Exception getDetail();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceFault.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceFaultCode.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceFaultCode.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceFaultCode.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * WS-ReliableMessaging nodes that generate a <b>SequenceFault</b> MUST set
the value of this
+ * element to a qualified name from the set of faults [Subcodes] defined below.
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public enum RMSequenceFaultCode
+{
+ /**
+ * Sequence terminated
+ */
+ SEQUENCE_TERMINATED,
+
+ /**
+ * Unknown sequence
+ */
+ UNKNOWN_SEQUENCE,
+
+ /**
+ * Invalid acknowledgement
+ */
+ INVALID_ACKNOWLEDGEMENT,
+
+ /**
+ * Message number rollover
+ */
+ MESSAGE_NUMBER_ROLLOVER,
+
+ /**
+ * Create sequence refused
+ */
+ CREATE_SEQUENCE_REFUSED,
+
+ /**
+ * Sequence closed
+ */
+ SEQUENCE_CLOSED,
+
+ /**
+ * WSRM required
+ */
+ WSRM_REQUIRED,
+
+ /**
+ * Last message number exceeded
+ */
+ LAST_MESSAGE_NUMBER_EXCEEDED
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSequenceFaultCode.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSerializable.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSerializable.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSerializable.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+
+/**
+ * This interface identifies classes that are de/serializable from/to SOAP messages
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSerializable
+{
+
+ /**
+ * Serialize object instance to SOAP message
+ * @param soapMessage
+ * @throws RMException is something went wrong
+ */
+ void serializeTo(SOAPMessage soapMessage) throws RMException;
+
+ /**
+ * Deserialize object instance from SOAP message
+ * @param soapMessage ReliableMessagingException is something went wrong
+ */
+ void deserializeFrom(SOAPMessage soapMessage) throws RMException;
+
+ /**
+ * Validate object state if everything is all right
+ * @throws RMException if object is in incorrect state
+ */
+ void validate() throws RMException;
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMSerializable.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMTerminateSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMTerminateSequence.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMTerminateSequence.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * <p><b>TerminateSequence</b> MAY be sent by an RM Source to indicate
it has completed its use of the Sequence.
+ * It indicates that the RM Destination can safely reclaim any resources related to the
identified
+ * Sequence. The RM Source MUST NOT send this element as a header block. The RM Source
+ * MAY retransmit this element. Once this element is sent, other than this element, the
RM Source
+ * MUST NOT send any additional message to the RM Destination referencing this
Sequence.</p>
+ *
+ * <p>This element MAY also be sent by the RM Destination to indicate that it has
unilaterally
+ * terminated the Sequence. Upon sending this message the RM Destination MUST NOT accept
+ * any additional messages (with the exception of the corresponding
+ * <b>TerminateSequenceResponse</b>) for this Sequence. Upon receipt of a
<b>TerminateSequence</b>
+ * the RM Source MUST NOT send any additional messages (with the exception of the
+ * corresponding <b>TerminateSequenceResponse</b>) for this
Sequence.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:TerminateSequence ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:LastMsgNumber> wsrm:MessageNumberType
</wsrm:LastMsgNumber> ?
+ * ...
+ * </wsrm:TerminateSequence>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMTerminateSequence extends RMSerializable
+{
+ /**
+ * The RM Source or RM Destination MUST include this element in any TerminateSequence
+ * message it sends. The RM Source or RM Destination MUST set the value of this
element to the
+ * absolute URI (conformant with RFC3986) of the terminating Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * The RM Source SHOULD include this element in any TerminateSequence message it
sends. The
+ * <b>LastMsgNumber</b> element specifies the highest assigned message
number of all the Sequence
+ * Traffic Messages for the terminating Sequence.
+ * @param lastMsgNumber
+ */
+ void setLastMsgNumber(long lastMsgNumber);
+
+ /**
+ * Getter
+ * @return last message number
+ */
+ long getLastMsgNumber();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMTerminateSequence.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMTerminateSequenceResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMTerminateSequenceResponse.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMTerminateSequenceResponse.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.spi.protocol;
+
+/**
+ * <p><b>TerminateSequenceResponse</b> is sent in the body of a message
in response to receipt of a <b>TerminateSequence</b>
+ * request message. It indicates that the responder has terminated the Sequence. The
responder
+ * MUST NOT send this element as a header block.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:TerminateSequenceResponse ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * ...
+ * </wsrm:TerminateSequenceResponse>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMTerminateSequenceResponse extends RMSerializable
+{
+ /**
+ * The responder (RM Source or RM Destination) MUST include this element in any
+ * <b>TerminateSequenceResponse</b> message it sends. The responder MUST
set the value of this
+ * element to the absolute URI (conformant with RFC3986) of the terminating Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/RMTerminateSequenceResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * <p><b>Sequence</b> protocol element associates the message in which
it is contained with a previously
- * established RM Sequence. It contains the Sequence's unique identifier and the
containing
- * message's ordinal position within that Sequence. The RM Destination MUST
understand the
- * <b>Sequence</b> header block. The RM Source MUST assign a
<b>mustUnderstand</b> attribute with a
- * value 1/true (from the namespace corresponding to the version of SOAP to which the
<b>Sequence</b>
- * SOAP header block is bound) to the <b>Sequence</b> header block
element.</p>
- *
- * The following infoset defines its syntax:
- * <p><blockquote><pre>
- * <wsrm:Sequence ...>
- * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
- * <wsrm:MessageNumber> wsrm:MessageNumberType
</wsrm:MessageNumber>
- * <wsrm:LastMessage/> ?
- * ...
- * </wsrm:Sequence>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface Sequence extends Serializable
-{
- /**
- * An RM Source that includes a <b>Sequence</b> header block in a SOAP
envelope MUST include this
- * element in that header block. The RM Source MUST set the value of this element to
the absolute
- * URI (conformant with RFC3986) that uniquely identifies the Sequence.
- * @param identifier
- */
- void setIdentifier(String identifier);
-
- /**
- * Getter
- * @return sequence identifier
- */
- String getIdentifier();
-
- /**
- * The RM Source MUST include this element within any Sequence headers it creates.
This element
- * is of type <b>MessageNumberType</b>. It represents the ordinal position
of the message within a
- * Sequence. Sequence message numbers start at 1 and monotonically increase by 1
throughout
- * the Sequence.
- * @param messageNumber
- */
- void setMessageNumber(long messageNumber);
-
- /**
- * Getter
- * @return message number within specified sequence
- */
- long getMessageNumber();
-
- /**
- * This element MAY be included by the RM Source endpoint. The
<b>LastMessage</b> element has no content.
- * @param lastMessage
- */
- void setLastMessage();
-
- /**
- * Getter
- * @return last message indicator
- */
- boolean isLastMessage();
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceAcknowledgement.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceAcknowledgement.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceAcknowledgement.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,170 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-import java.util.List;
-
-/**
- *
- * <p><b>wsrm:SequenceAcknowledgement</b> element contains the sequence
acknowledgement information</p>
- *
- * The following infoset defines its syntax:
- * <p><blockquote><pre>
- * <wsrm:SequenceAcknowledgement ...>
- * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
- * [ [ [ <wsrm:AcknowledgementRange ...
- * Upper="wsrm:MessageNumberType"
- * Lower="wsrm:MessageNumberType"/> +
- * | <wsrm:None/> ]
- * <wsrm:Final/> ? ]
- * | <wsrm:Nack> wsrm:MessageNumberType </wsrm:Nack> + ]
- *
- * ...
- * </wsrm:SequenceAcknowledgement>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface SequenceAcknowledgement extends Serializable
-{
- /**
- * An RM Destination that includes a <b>SequenceAcknowledgement</b> header
block in a SOAP
- * envelope MUST include this element in that header block. The RM Destination MUST
set the
- * value of this element to the absolute URI (conformant with RFC3986) that uniquely
identifies the
- * Sequence. The RM Destination MUST NOT include multiple
<b>SequenceAcknowledgement</b>
- * header blocks that share the same value for <b>Identifier</b> within
the same SOAP envelope.
- * @param identifier
- */
- void setIdentifier(String identifier);
-
- /**
- * Getter
- * @return sequence identifier
- */
- String getIdentifier();
-
- /**
- * The RM Destination MAY include this element within a
<b>SequenceAcknowledgement</b> header
- * block. This element indicates that the RM Destination is not receiving new messages
for the
- * specified Sequence. The RM Source can be assured that the ranges of messages
acknowledged
- * by this SequenceAcknowledgement header block will not change in the future. The RM
- * Destination MUST include this element when the Sequence is closed. The RM
Destination MUST
- * NOT include this element when sending a <b>Nack</b>; it can only be
used when sending
- * <b>AcknowledgementRange</b> elements or a <b>None</b>.
- */
- void setFinal();
-
- /**
- * Getter
- * @return true if <b>SequenceAcknowledgement</b> is
<b>Final</b>, false otherwise
- */
- boolean isFinal();
-
- /**
- * The RM Destination MUST include this element within a
<b>SequenceAcknowledgement</b> header
- * block if the RM Destination has not accepted any messages for the specified
Sequence. The RM
- * Destination MUST NOT include this element if a sibling
<b>AcknowledgementRange</b> or <b>Nack</b>
- * element is also present as a child of the
<b>SequenceAcknowledgement</b>.
- */
- void setNone();
-
- /**
- * Getter
- * @return true if <b>SequenceAcknowledgement</b> is
<b>None</b>, false otherwise
- */
- boolean isNone();
-
- /**
- * The RM Destination MAY include this element within a
<b>SequenceAcknowledgement</b> header
- * block. If used, the RM Destination MUST set the value of this element to a
<b>MessageNumberType</b>
- * representing the <b>MessageNumber</b> of an unreceived message in a
Sequence. The RM Destination
- * MUST NOT include a <b>Nack</b> element if a sibling
<b>AcknowledgementRange</b> or <b>None</b> element is
- * also present as a child of <b>SequenceAcknowledgement</b>. Upon the
receipt of a <b>Nack</b>, an RM
- * Source SHOULD retransmit the message identified by the <b>Nack</b>. The
RM Destination MUST NOT
- * issue a <b>SequenceAcknowledgement</b> containing a
<b>Nack</b> for a message that it has previously
- * acknowledged within an <b>AcknowledgementRange</b>. The RM Source
SHOULD ignore a
- * <b>SequenceAcknowledgement</b> containing a <b>Nack</b> for
a message that has previously been
- * acknowledged within an <b>AcknowledgementRange</b>.
- * @param messageNumber
- */
- void addNack(long messageNumber);
-
- /**
- * Getter
- * @return list of not ackonwledged message numbers
- */
- List<Long> getNacks();
-
- /**
- * Factory method
- * @return new instance of AcknowledgementRange
- */
- AcknowledgementRange newAcknowledgementRange();
-
- /**
- * Setter
- * @param acknowledgementRange
- */
- void addAcknowledgementRange(AcknowledgementRange acknowledgementRange);
-
- /**
- * Getter
- * @return list of acknowledged ranges
- */
- List<AcknowledgementRange> getAcknowledgementRanges();
-
- /**
- * The RM Destination MAY include one or more instances of this element within a
- * <b>SequenceAcknowledgement</b> header block. It contains a range of
Sequence message numbers
- * successfully accepted by the RM Destination. The ranges MUST NOT overlap. The RM
- * 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
- {
- /**
- * The RM Destination MUST set the value of this attribute equal to the message
number of the
- * highest contiguous message in a Sequence range accepted by the RM Destination.
- * @param upper
- */
- void setUpper(long upper);
-
- /**
- * Getter
- * @return upper value
- */
- long getUpper();
-
- /**
- * The RM Destination MUST set the value of this attribute equal to the message
number of the
- * lowest contiguous message in a Sequence range accepted by the RM Destination.
- * @param lower
- */
- void setLower(long lower);
-
- /**
- * Getter
- * @return lower value
- */
- long getLower();
- }
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFault.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFault.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFault.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * <p><b>SequenceFault</b> element purpose is to carry the specific
details of a fault generated during the
- * reliable messaging specific processing of a message belonging to a Sequence.
WS-ReliableMessaging
- * nodes MUST use the <b>SequenceFault</b> container only in conjunction with
the SOAP 1.1 fault mechanism.
- * WS-ReliableMessaging nodes MUST NOT use the <b>SequenceFault</b> container
in conjunction with the
- * SOAP 1.2 binding.</p>
- *
- * The following infoset defines its syntax:
- * <p><blockquote><pre>
- * <SequenceFault ...>
- * <wsrm:FaultCode> wsrm:FaultCode </wsrm:FaultCode>
- * <wsrm:Detail> ... </wsrm:Detail> ?
- * ...
- * </SequenceFault>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface SequenceFault extends Serializable
-{
- /**
- * WS-ReliableMessaging nodes that generate a <b>SequenceFault</b> MUST
set the value of this
- * element to a qualified name from the set of faults [Subcodes] defined below.
- * @param faultCode
- */
- void setFaultCode(SequenceFaultCode faultCode);
-
- /**
- * Getter
- * @return sequence fault code
- */
- SequenceFaultCode getFaultCode();
-
- /**
- * This element, if present, carries application specific error information
- * related to the fault being described.
- * @param detail
- */
- void setDetail(Exception detail);
-
- /**
- * Getter
- * @return application specific fault detail
- */
- Exception getDetail();
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFaultCode.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFaultCode.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFaultCode.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * WS-ReliableMessaging nodes that generate a <b>SequenceFault</b> MUST set
the value of this
- * element to a qualified name from the set of faults [Subcodes] defined below.
- *
- * @author richard.opalka(a)jboss.com
- */
-public enum SequenceFaultCode
-{
- /**
- * Sequence terminated
- */
- SEQUENCE_TERMINATED,
-
- /**
- * Unknown sequence
- */
- UNKNOWN_SEQUENCE,
-
- /**
- * Invalid acknowledgement
- */
- INVALID_ACKNOWLEDGEMENT,
-
- /**
- * Message number rollover
- */
- MESSAGE_NUMBER_ROLLOVER,
-
- /**
- * Create sequence refused
- */
- CREATE_SEQUENCE_REFUSED,
-
- /**
- * Sequence closed
- */
- SEQUENCE_CLOSED,
-
- /**
- * WSRM required
- */
- WSRM_REQUIRED,
-
- /**
- * Last message number exceeded
- */
- LAST_MESSAGE_NUMBER_EXCEEDED
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.extensions.wsrm.client_api.RMException;
-
-/**
- * This interface identifies classes that are de/serializable from/to SOAP messages
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface Serializable
-{
-
- /**
- * Serialize object instance to SOAP message
- * @param soapMessage
- * @throws RMException is something went wrong
- */
- void serializeTo(SOAPMessage soapMessage) throws RMException;
-
- /**
- * Deserialize object instance from SOAP message
- * @param soapMessage ReliableMessagingException is something went wrong
- */
- void deserializeFrom(SOAPMessage soapMessage) throws RMException;
-
- /**
- * Validate object state if everything is all right
- * @throws RMException if object is in incorrect state
- */
- void validate() throws RMException;
-
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequence.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequence.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * <p><b>TerminateSequence</b> MAY be sent by an RM Source to indicate
it has completed its use of the Sequence.
- * It indicates that the RM Destination can safely reclaim any resources related to the
identified
- * Sequence. The RM Source MUST NOT send this element as a header block. The RM Source
- * MAY retransmit this element. Once this element is sent, other than this element, the
RM Source
- * MUST NOT send any additional message to the RM Destination referencing this
Sequence.</p>
- *
- * <p>This element MAY also be sent by the RM Destination to indicate that it has
unilaterally
- * terminated the Sequence. Upon sending this message the RM Destination MUST NOT accept
- * any additional messages (with the exception of the corresponding
- * <b>TerminateSequenceResponse</b>) for this Sequence. Upon receipt of a
<b>TerminateSequence</b>
- * the RM Source MUST NOT send any additional messages (with the exception of the
- * corresponding <b>TerminateSequenceResponse</b>) for this
Sequence.</p>
- *
- * The following infoset defines its syntax:
- * <p><blockquote><pre>
- * <wsrm:TerminateSequence ...>
- * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
- * <wsrm:LastMsgNumber> wsrm:MessageNumberType
</wsrm:LastMsgNumber> ?
- * ...
- * </wsrm:TerminateSequence>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface TerminateSequence extends Serializable
-{
- /**
- * The RM Source or RM Destination MUST include this element in any TerminateSequence
- * message it sends. The RM Source or RM Destination MUST set the value of this
element to the
- * absolute URI (conformant with RFC3986) of the terminating Sequence.
- * @param identifier
- */
- void setIdentifier(String identifier);
-
- /**
- * Getter
- * @return sequence identifier
- */
- String getIdentifier();
-
- /**
- * The RM Source SHOULD include this element in any TerminateSequence message it
sends. The
- * <b>LastMsgNumber</b> element specifies the highest assigned message
number of all the Sequence
- * Traffic Messages for the terminating Sequence.
- * @param lastMsgNumber
- */
- void setLastMsgNumber(long lastMsgNumber);
-
- /**
- * Getter
- * @return last message number
- */
- long getLastMsgNumber();
-}
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequenceResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequenceResponse.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequenceResponse.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.spi.protocol;
-
-/**
- * <p><b>TerminateSequenceResponse</b> is sent in the body of a message
in response to receipt of a <b>TerminateSequence</b>
- * request message. It indicates that the responder has terminated the Sequence. The
responder
- * MUST NOT send this element as a header block.</p>
- *
- * The following infoset defines its syntax:
- * <p><blockquote><pre>
- * <wsrm:TerminateSequenceResponse ...>
- * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
- * ...
- * </wsrm:TerminateSequenceResponse>
- * </pre></blockquote></p>
- *
- * @author richard.opalka(a)jboss.com
- */
-public interface TerminateSequenceResponse extends Serializable
-{
- /**
- * The responder (RM Source or RM Destination) MUST include this element in any
- * <b>TerminateSequenceResponse</b> message it sends. The responder MUST
set the value of this
- * element to the absolute URI (conformant with RFC3986) of the terminating Sequence.
- * @param identifier
- */
- void setIdentifier(String identifier);
-
- /**
- * Getter
- * @return sequence identifier
- */
- String getIdentifier();
-}
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannel.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannel.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannel.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,137 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport;
+
+import static org.jboss.ws.extensions.wsrm.RMConstant.*;
+
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.MessageAbstraction;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.ByteArrayOutputStream;
+
+import java.util.Map;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * RM Channel
+ * @author richard.opalka(a)jboss.com
+ */
+public class RMChannel
+{
+ private static final RMChannel INSTANCE = new RMChannel();
+
+ private RMChannel()
+ {
+ // forbidden inheritance
+ }
+
+ public static RMChannel getInstance()
+ {
+ return INSTANCE;
+ }
+
+ // Holds the list of tasks that will be send to the remoting transport channel
+ private static final ExecutorService rmChannelPool = Executors.newFixedThreadPool(5,
new RMThreadFactory());
+
+ private static final class RMThreadFactory implements ThreadFactory
+ {
+ final ThreadGroup group;
+ final AtomicInteger threadNumber = new AtomicInteger(1);
+ final String namePrefix = "rm-pool-thread-";
+
+ private RMThreadFactory()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ group = (sm != null) ? sm.getThreadGroup() :
Thread.currentThread().getThreadGroup();
+ }
+
+ public Thread newThread(Runnable r)
+ {
+ Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(),
0);
+ if (t.isDaemon())
+ t.setDaemon(false);
+ if (t.getPriority() != Thread.NORM_PRIORITY)
+ t.setPriority(Thread.NORM_PRIORITY);
+ return t;
+ }
+ }
+
+ private RMMessage createRMMessage(MessageAbstraction request, RMMetadata rmMetadata)
throws Throwable
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ Marshaller marshaller =
(Marshaller)rmMetadata.getContext(SERIALIZATION_CONTEXT).get(MARSHALLER);
+ // we have to serialize message before putting it to the rm pool
+ // * contextClassloader not serializable issue
+ // * DOMUtil threadlocal issue (if message is de/serialized in separate thread)
+ marshaller.write(request, baos);
+ RMMessage rmMessage = RMMessageFactory.newMessage(baos.toByteArray(), rmMetadata);
+ return rmMessage;
+ }
+
+ private MessageAbstraction createResponse(RMMessage rmResponse, RMMetadata rmMetadata)
throws Throwable
+ {
+ Map<String, Object> invocationContext =
rmMetadata.getContext(INVOCATION_CONTEXT);
+ boolean oneWay =
(Boolean)rmMetadata.getContext(INVOCATION_CONTEXT).get(ONE_WAY_OPERATION);
+ MessageAbstraction response = null;
+ //if (!oneWay)
+ {
+ byte[] payload = rmResponse.getPayload();
+ InputStream is = payload == null ? null : new
ByteArrayInputStream(rmResponse.getPayload());
+ // we have to deserialize message after pick up from the rm pool
+ // * contextClassloader not serializable issue
+ // * DOMUtil threadlocal issue (if message is de/serialized in separate
thread)
+ UnMarshaller unmarshaller =
(UnMarshaller)rmMetadata.getContext(SERIALIZATION_CONTEXT).get(UNMARSHALLER);
+ response = (MessageAbstraction)unmarshaller.read(is,
rmResponse.getMetadata().getContext(REMOTING_INVOCATION_CONTEXT));
+ }
+ invocationContext.clear();
+ invocationContext.putAll(rmMetadata.getContext(REMOTING_INVOCATION_CONTEXT));
+ return response;
+ }
+
+ public MessageAbstraction send(MessageAbstraction request, RMMetadata rmMetadata)
throws Throwable
+ {
+ RMMessage rmRequest = createRMMessage(request, rmMetadata);
+ RMMessage rmResponse = sendToChannel(rmRequest);
+ return createResponse(rmResponse, rmMetadata);
+ }
+
+ private RMMessage sendToChannel(RMMessage request) throws Throwable
+ {
+ RMChannelResponse result = rmChannelPool.submit(new
RMChannelRequest(request)).get();
+
+ Throwable fault = result.getFault();
+ if (fault != null)
+ {
+ throw fault;
+ }
+ else
+ {
+ return result.getResponse();
+ }
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannel.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelRequest.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelRequest.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelRequest.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,147 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport;
+
+import static org.jboss.ws.extensions.wsrm.RMConstant.*;
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.util.Map;
+import java.util.concurrent.Callable;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.callback.Callback;
+import org.jboss.remoting.callback.HandleCallbackException;
+import org.jboss.ws.core.MessageTrace;
+import org.jboss.ws.extensions.wsrm.RMSequenceImpl;
+import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandler;
+import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandlerFactory;
+
+/**
+ * Represents request that goes to the RM channel
+ * @see org.jboss.ws.extensions.wsrm.transport.RMChannel
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMChannelRequest implements Callable<RMChannelResponse>
+{
+ private static final Logger log = Logger.getLogger(RMChannelRequest.class);
+ private static final String JBOSSWS_SUBSYSTEM = "jbossws";
+ private final RMMessage rmRequest;
+
+ RMChannelRequest(RMMessage rmRequest)
+ {
+ super();
+ this.rmRequest = rmRequest;
+ }
+
+
+
+ public void handleCallback(Callback callback)
+ throws HandleCallbackException
+ {
+ System.out.println("Handling callback: " + callback);
+ // TODO: implement this method
+ }
+
+ public RMChannelResponse call()
+ {
+ InvokerLocator locator = null;
+ try
+ {
+ locator = new
InvokerLocator((String)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT).get(TARGET_ADDRESS));
+ }
+ catch (MalformedURLException e)
+ {
+ return new RMChannelResponse(new IllegalArgumentException("Malformed
endpoint address", e));
+ }
+
+ try
+ {
+ URI backPort = RMTransportHelper.getBackPortURI(rmRequest);
+ String messageId = RMTransportHelper.getMessageId(rmRequest);
+
+ System.out.println("[WS-RM] backport URI is: " + backPort);
+ RMCallbackHandler callbackHandler = null;
+ // TODO: we should remember WSA:MessageId here too
+
+ if (backPort != null)
+ {
+ callbackHandler = RMCallbackHandlerFactory.getCallbackHandler(backPort);
+ RMSequenceImpl sequence = RMTransportHelper.getSequence(rmRequest);
+ if (sequence != null)
+ {
+ callbackHandler.addUnassignedMessageListener(sequence);
+ }
+ }
+ boolean oneWay = RMTransportHelper.isOneWayOperation(rmRequest) &&
(backPort == null); // TODO: backport support
+
+ Client client = new Client(locator, JBOSSWS_SUBSYSTEM,
rmRequest.getMetadata().getContext(REMOTING_CONFIGURATION_CONTEXT));
+ client.connect();
+
+ client.setMarshaller(RMMarshaller.getInstance());
+
+ if (!oneWay)
+ client.setUnMarshaller(RMUnMarshaller.getInstance());
+
+ Map<String, Object> remotingInvocationContext =
rmRequest.getMetadata().getContext(REMOTING_INVOCATION_CONTEXT);
+ if (log.isDebugEnabled())
+ log.debug("Remoting metadata: " + remotingInvocationContext);
+
+ // debug the outgoing request message
+ MessageTrace.traceMessage("Outgoing RM Request Message",
rmRequest.getPayload());
+
+ RMMessage rmResponse = null;
+ if (oneWay)
+ {
+ client.invokeOneway(rmRequest.getPayload(), remotingInvocationContext,
false);
+ }
+ else
+ {
+ rmResponse = (RMMessage)client.invoke(rmRequest.getPayload(),
remotingInvocationContext);
+ }
+
+ // Disconnect the remoting client
+ client.disconnect();
+
+ // trace the incomming response message
+ if (rmResponse != null)
+ MessageTrace.traceMessage("Incoming RM Response Message",
rmResponse.getPayload());
+
+ if (backPort != null) // TODO: backport support
+ {
+ if (messageId != null)
+ {
+ // register callbacks only for outbound messages with messageId
+ return new RMChannelResponse(callbackHandler, messageId);
+ }
+ }
+
+ return new RMChannelResponse(rmResponse);
+ }
+ catch (Throwable t)
+ {
+ return new RMChannelResponse(t);
+ }
+ }
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelRequest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelResponse.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelResponse.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport;
+
+import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandler;
+
+/**
+ * Represents response that goes from the RM channel
+ * @see org.jboss.ws.extensions.wsrm.transport.RMChannel
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMChannelResponse
+{
+ private final Throwable fault;
+ private final RMMessage result;
+ private final RMCallbackHandler callback;
+ private final String messageId; // WS-Addressing: MessageID
+
+ public RMChannelResponse(RMCallbackHandler callback, String messageId)
+ {
+ this(null, null, callback, messageId);
+ }
+
+ public RMChannelResponse(Throwable fault)
+ {
+ this(null, fault, null, null);
+ }
+
+ public RMChannelResponse(RMMessage result)
+ {
+ this(result, null, null, null);
+ }
+
+ private RMChannelResponse(RMMessage result, Throwable fault, RMCallbackHandler
callback, String messageId)
+ {
+ super();
+ this.result = result;
+ this.fault = fault;
+ this.callback = callback;
+ this.messageId = messageId;
+ }
+
+ public Throwable getFault()
+ {
+ return (this.callback != null) ? this.callback.getFault(this.messageId) :
this.fault;
+ }
+
+ public RMMessage getResponse()
+ {
+ return (this.callback != null) ? this.callback.getMessage(this.messageId) :
this.result;
+ }
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMarshaller.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMarshaller.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMarshaller.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.invocation.OnewayInvocation;
+import org.jboss.remoting.marshal.Marshaller;
+
+/**
+ * Marshalls byte array to the output stream
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMMarshaller implements Marshaller
+{
+ private static final Marshaller INSTANCE = new RMMarshaller();
+
+ public Marshaller cloneMarshaller() throws CloneNotSupportedException
+ {
+ return getInstance();
+ }
+
+ public static Marshaller getInstance()
+ {
+ return INSTANCE;
+ }
+
+ public void write(Object dataObject, OutputStream output) throws IOException
+ {
+ if (dataObject instanceof InvocationRequest)
+ dataObject = ((InvocationRequest)dataObject).getParameter();
+
+ if (dataObject instanceof OnewayInvocation)
+ dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
+
+ if ((dataObject instanceof byte[]) == false)
+ throw new IllegalArgumentException("Not a byte array: " +
dataObject);
+
+ output.write((byte[])dataObject);
+ output.flush();
+ }
+}
+
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessage.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessage.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessage.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,7 @@
+package org.jboss.ws.extensions.wsrm.transport;
+
+public interface RMMessage
+{
+ byte[] getPayload();
+ RMMetadata getMetadata();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessage.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageFactory.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,14 @@
+package org.jboss.ws.extensions.wsrm.transport;
+
+public class RMMessageFactory
+{
+ private RMMessageFactory()
+ {
+ // forbidden inheritance
+ }
+
+ public static RMMessage newMessage(byte[] payload, RMMetadata rmMetadata)
+ {
+ return new RMMessageImpl(payload, rmMetadata);
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,28 @@
+package org.jboss.ws.extensions.wsrm.transport;
+
+/**
+ * RM message object
+ * @author richard.opalka(a)jboss.com
+ */
+public class RMMessageImpl implements RMMessage
+{
+ private final byte[] payload;
+ private final RMMetadata rmMetadata;
+
+ public RMMessageImpl(byte[] payload, RMMetadata rmMetadata)
+ {
+ super();
+ this.payload = payload;
+ this.rmMetadata = rmMetadata;
+ }
+
+ public byte[] getPayload()
+ {
+ return this.payload;
+ }
+
+ public RMMetadata getMetadata()
+ {
+ return this.rmMetadata;
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,65 @@
+package org.jboss.ws.extensions.wsrm.transport;
+
+import java.util.Map;
+import java.util.HashMap;
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.extensions.wsrm.RMConstant;
+
+public final class RMMetadata
+{
+ private Map<String, Map<String, Object>> contexts = new HashMap<String,
Map<String, Object>>();
+
+ public RMMetadata(
+ String targetAddress,
+ boolean oneWay,
+ Marshaller marshaller,
+ UnMarshaller unmarshaller,
+ Map<String, Object> invocationContext,
+ Map<String, Object> remotingInvocationContext,
+ Map<String, Object> remotingConfigurationContext)
+ {
+ if (targetAddress == null)
+ throw new IllegalArgumentException("Target address cannot be null");
+
+ invocationContext.put(RMConstant.TARGET_ADDRESS, targetAddress);
+ invocationContext.put(RMConstant.ONE_WAY_OPERATION, oneWay);
+ setContext(RMConstant.INVOCATION_CONTEXT, invocationContext);
+
+ if (marshaller == null || unmarshaller == null)
+ throw new IllegalArgumentException("Unable to create de/serialization
context");
+
+ Map<String, Object> serializationContext = new HashMap<String,
Object>();
+ serializationContext.put(RMConstant.MARSHALLER, marshaller);
+ serializationContext.put(RMConstant.UNMARSHALLER, unmarshaller);
+ setContext(RMConstant.SERIALIZATION_CONTEXT, serializationContext);
+
+ if (remotingInvocationContext == null)
+ throw new IllegalArgumentException("Remoting invocation context cannot be
null");
+
+ setContext(RMConstant.REMOTING_INVOCATION_CONTEXT, remotingInvocationContext);
+
+ if (remotingConfigurationContext == null)
+ throw new IllegalArgumentException("Remoting configuraton context cannot be
null");
+
+ setContext(RMConstant.REMOTING_CONFIGURATION_CONTEXT,
remotingConfigurationContext);
+ }
+
+ public RMMetadata(Map<String, Object> remotingInvocationContext)
+ {
+ if (remotingInvocationContext == null)
+ throw new IllegalArgumentException("Remoting invocation context cannot be
null");
+
+ setContext(RMConstant.REMOTING_INVOCATION_CONTEXT, remotingInvocationContext);
+ }
+
+ void setContext(String key, Map<String, Object> ctx)
+ {
+ this.contexts.put(key, ctx);
+ }
+
+ Map<String, Object> getContext(String key)
+ {
+ return this.contexts.get(key);
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMTransportHelper.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMTransportHelper.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMTransportHelper.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,79 @@
+package org.jboss.ws.extensions.wsrm.transport;
+
+import static org.jboss.ws.extensions.wsrm.RMConstant.*;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.wsrm.RMConstant;
+import org.jboss.ws.extensions.wsrm.RMSequenceImpl;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+public final class RMTransportHelper
+{
+ private static final Logger log = Logger.getLogger(RMTransportHelper.class);
+
+ private RMTransportHelper()
+ {
+ // no instances
+ }
+
+ public static boolean isRMMessage(Map<String, Object> ctx)
+ {
+ return (ctx != null) && (ctx.containsKey(RMConstant.REQUEST_CONTEXT));
+ }
+
+ public static String getMessageId(RMMessage rmRequest)
+ {
+ Map<String, Object> invocationCtx = (Map<String,
Object>)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT);
+ Map<String, Object> wsrmRequestCtx = (Map<String,
Object>)invocationCtx.get(REQUEST_CONTEXT);
+ return (String)wsrmRequestCtx.get(WSA_MESSAGE_ID);
+ }
+
+ public static URI getBackPortURI(RMMessage rmRequest)
+ {
+ Map<String, Object> invocationCtx = (Map<String,
Object>)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT);
+ Map<String, Object> wsrmRequestCtx = (Map<String,
Object>)invocationCtx.get(REQUEST_CONTEXT);
+ List<RMSerializable> outMsgs =
(List<RMSerializable>)wsrmRequestCtx.get(PROTOCOL_MESSAGES);
+ Map<QName, RMSerializable> msgs = (Map<QName,
RMSerializable>)wsrmRequestCtx.get(PROTOCOL_MESSAGES_MAPPING);
+ QName createSequenceQName =
RMProvider.get().getConstants().getCreateSequenceQName();
+ URI retVal = null;
+ if (outMsgs.contains(createSequenceQName))
+ {
+ RMCreateSequence cs = (RMCreateSequence)msgs.get(createSequenceQName);
+ try
+ {
+ retVal = RMConstant.WSA_ANONYMOUS_URI.equals(cs.getAcksTo()) ? null : new
URI(cs.getAcksTo());;
+ }
+ catch (Exception e)
+ {
+ log.warn(e.getMessage(), e);
+ }
+ }
+ else
+ {
+ retVal =
((RMSequenceImpl)wsrmRequestCtx.get(SEQUENCE_REFERENCE)).getBackPort();
+ }
+
+ return retVal;
+ }
+
+ public static RMSequenceImpl getSequence(RMMessage rmRequest)
+ {
+ Map<String, Object> invocationCtx = (Map<String,
Object>)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT);
+ Map<String, Object> wsrmRequestCtx = (Map<String,
Object>)invocationCtx.get(REQUEST_CONTEXT);
+ return (RMSequenceImpl)wsrmRequestCtx.get(SEQUENCE_REFERENCE);
+ }
+
+ public static boolean isOneWayOperation(RMMessage rmRequest)
+ {
+ return
(Boolean)rmRequest.getMetadata().getContext(RMConstant.INVOCATION_CONTEXT).get(ONE_WAY_OPERATION);
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMTransportHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnMarshaller.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnMarshaller.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnMarshaller.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import org.jboss.remoting.marshal.UnMarshaller;
+
+/**
+ * Unmarshalls byte array from the input stream
+ * @author richard.opalka(a)jboss.com
+ */
+final class RMUnMarshaller implements UnMarshaller
+{
+ private static final UnMarshaller INSTANCE = new RMUnMarshaller();
+
+ public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
+ {
+ return getInstance();
+ }
+
+ public static UnMarshaller getInstance()
+ {
+ return INSTANCE;
+ }
+
+ public Object read(InputStream is, Map metadata) throws IOException,
ClassNotFoundException
+ {
+ if (is == null)
+ return RMMessageFactory.newMessage(null, new RMMetadata(metadata)); // TODO:
investigate why is == null (WSAddressing reply-to test)
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ byte[] buffer = new byte[1024];
+ int count = -1;
+ count = is.read(buffer);
+ while (count != -1)
+ {
+ baos.write(buffer, 0, count);
+ count = is.read(buffer);
+ }
+ return RMMessageFactory.newMessage(baos.toByteArray(), new RMMetadata(metadata));
+ }
+
+ public void setClassLoader(ClassLoader classloader)
+ {
+ // do nothing
+ }
+}
+
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnassignedMessageListener.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnassignedMessageListener.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnassignedMessageListener.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport;
+
+/**
+ * Implementations of this interface must be registered in callback handler
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 27, 2007
+ */
+public interface RMUnassignedMessageListener
+{
+ /**
+ * This event is fired when there's new unassigned message available in
+ * callback handler this sequence is associated with. Each implementation
+ * of this class should remember the count of this notification method calls
+ * and must initiate new dummy message request to pick up all unassigned
+ * messages from the callback handler
+ */
+ void unassignedMessageReceived();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnassignedMessageListener.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport.backchannel;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import javax.management.MBeanServer;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.ServerInvocationHandler;
+import org.jboss.remoting.ServerInvoker;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.transport.coyote.RequestMap;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 20, 2007
+ */
+public final class RMBackPortsInvocationHandler implements ServerInvocationHandler
+{
+ private static final Logger LOG =
Logger.getLogger(RMBackPortsInvocationHandler.class);
+ private final List<RMCallbackHandler> callbacks = new
LinkedList<RMCallbackHandler>();
+ private final Lock lock = new ReentrantLock();
+
+ public RMBackPortsInvocationHandler()
+ {
+ }
+
+ public RMCallbackHandler getCallback(String requestPath)
+ {
+ this.lock.lock();
+ try
+ {
+ for (RMCallbackHandler handler : this.callbacks)
+ {
+ if (handler.getHandledPath().equals(requestPath))
+ return handler;
+ }
+ }
+ finally
+ {
+ this.lock.unlock();
+ }
+
+ return null;
+ }
+
+ public void registerCallback(RMCallbackHandler callbackHandler)
+ {
+ this.lock.lock();
+ try
+ {
+ this.callbacks.add(callbackHandler);
+ }
+ finally
+ {
+ this.lock.unlock();
+ }
+ }
+
+ public void unregisterCallback(RMCallbackHandler callbackHandler)
+ {
+ this.lock.lock();
+ try
+ {
+ this.callbacks.remove(callbackHandler);
+ }
+ finally
+ {
+ this.lock.unlock();
+ }
+ }
+
+ public Object invoke(InvocationRequest request) throws Throwable
+ {
+ this.lock.lock();
+ try
+ {
+ RequestMap rm = (RequestMap)request.getRequestPayload();
+ String requestPath = (String)rm.get(HTTPMetadataConstants.PATH);
+ boolean handlerExists = false;
+ for (RMCallbackHandler handler : this.callbacks)
+ {
+ if (handler.getHandledPath().equals(requestPath))
+ {
+ handlerExists = true;
+ LOG.debug("Handling request path: " + requestPath);
+ handler.handle(request);
+ break;
+ }
+ }
+ if (handlerExists == false)
+ LOG.warn("No callback handler registered for path: " +
requestPath);
+
+ return null;
+ }
+ finally
+ {
+ this.lock.unlock();
+ }
+ }
+
+ public void addListener(InvokerCallbackHandler callbackHandler)
+ {
+ // do nothing - we're using custom callback handlers
+ }
+
+ public void removeListener(InvokerCallbackHandler callbackHandler)
+ {
+ // do nothing - we're using custom callback handlers
+ }
+
+ public void setInvoker(ServerInvoker arg0)
+ {
+ // do nothing
+ }
+
+ public void setMBeanServer(MBeanServer arg0)
+ {
+ // do nothing
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,216 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport.backchannel;
+
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.transport.Connector;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+
+/**
+ * Back ports server used by addressable clients
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 20, 2007
+ */
+public final class RMBackPortsServer implements Runnable
+{
+ private static final Logger LOG = Logger.getLogger(RMBackPortsServer.class);
+ private static final Lock CLASS_LOCK = new ReentrantLock();
+ private static final long WAIT_PERIOD = 100;
+ private static RMBackPortsServer INSTANCE;
+
+ private final Object instanceLock = new Object();
+ private final Connector connector;
+ private final String scheme;
+ private final String host;
+ private final int port;
+ private RMBackPortsInvocationHandler handler;
+ private boolean started;
+ private boolean stopped;
+ private boolean terminated;
+
+ public final void registerCallback(RMCallbackHandler callbackHandler)
+ {
+ this.handler.registerCallback(callbackHandler);
+ }
+
+ public final void unregisterCallback(RMCallbackHandler callbackHandler)
+ {
+ this.handler.unregisterCallback(callbackHandler);
+ }
+
+ public final RMCallbackHandler getCallback(String requestPath)
+ {
+ return this.handler.getCallback(requestPath);
+ }
+
+ private RMBackPortsServer(String scheme, String host, int port)
+ throws RMException
+ {
+ super();
+ this.scheme = scheme;
+ this.host = host;
+ this.port = port;
+ try
+ {
+ InvokerLocator il = new InvokerLocator(this.scheme + "://" + this.host
+ ":" + this.port);
+ this.connector = new Connector();
+ this.connector.setInvokerLocator(il.getLocatorURI());
+ this.connector.create();
+
+ this.handler = new RMBackPortsInvocationHandler();
+ this.connector.addInvocationHandler("wsrmBackPortsHandler",
this.handler);
+ this.connector.start();
+ LOG.debug("WS-RM Backports Server started on: " +
il.getLocatorURI());
+ }
+ catch (Exception e)
+ {
+ LOG.warn(e.getMessage(), e);
+ throw new RMException(e.getMessage(), e);
+ }
+ }
+
+ public final String getScheme()
+ {
+ return this.scheme;
+ }
+
+ public final String getHost()
+ {
+ return this.host;
+ }
+
+ public final int getPort()
+ {
+ return this.port;
+ }
+
+ public final void run()
+ {
+ synchronized (this.instanceLock)
+ {
+ if (this.started)
+ return;
+
+ this.started = true;
+
+ while (this.stopped == false)
+ {
+ try
+ {
+ this.instanceLock.wait(WAIT_PERIOD);
+ LOG.debug("serving requests");
+ }
+ catch (InterruptedException ie)
+ {
+ LOG.warn(ie.getMessage(), ie);
+ }
+ }
+ try
+ {
+ connector.stop();
+ }
+ finally
+ {
+ LOG.debug("terminated");
+ this.terminated = true;
+ }
+ }
+ }
+
+ public final void terminate()
+ {
+ synchronized (this.instanceLock)
+ {
+ if (this.stopped == true)
+ return;
+
+ this.stopped = true;
+ LOG.debug("termination forced");
+ while (this.terminated == false)
+ {
+ try
+ {
+ LOG.debug("waiting for termination");
+ this.instanceLock.wait(WAIT_PERIOD);
+ }
+ catch (InterruptedException ie)
+ {
+ LOG.warn(ie.getMessage(), ie);
+ }
+ }
+ }
+ }
+
+ /**
+ * Starts back ports server on the background if method is called for the first time
+ * @param scheme protocol
+ * @param host hostname
+ * @param port port
+ * @return WS-RM back ports server
+ * @throws RMException
+ */
+ public static RMBackPortsServer getInstance(String scheme, String host, int port)
+ throws RMException
+ {
+ CLASS_LOCK.lock();
+ try
+ {
+ if (INSTANCE == null)
+ {
+ INSTANCE = new RMBackPortsServer(scheme, host, (port == -1) ? 80 : port);
+ // forking back ports server
+ Thread t = new Thread(INSTANCE, "RMBackPortsServer");
+ t.setDaemon(true);
+ t.start();
+ // registering shutdown hook
+ final RMBackPortsServer server = INSTANCE;
+ Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
+ public void run()
+ {
+ server.terminate();
+ }
+ }, "RMBackPortsServerShutdownHook"));
+ }
+ else
+ {
+ boolean schemeEquals = INSTANCE.getScheme().equals(scheme);
+ boolean hostEquals = INSTANCE.getHost().equals(host);
+ boolean portEquals = INSTANCE.getPort() == ((port == -1) ? 80 : port);
+ if ((schemeEquals == false) || (hostEquals == false) || (portEquals ==
false))
+ throw new IllegalArgumentException();
+ }
+ return INSTANCE;
+ }
+ finally
+ {
+ CLASS_LOCK.unlock();
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandler.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandler.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandler.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport.backchannel;
+
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.ws.extensions.wsrm.transport.RMMessage;
+import org.jboss.ws.extensions.wsrm.transport.RMUnassignedMessageListener;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 21, 2007
+ */
+public interface RMCallbackHandler
+{
+ String getHandledPath();
+ void handle(InvocationRequest payload);
+ RMMessage getMessage(String messageId);
+ Throwable getFault(String messageId);
+ void addUnassignedMessageListener(RMUnassignedMessageListener listener);
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerFactory.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport.backchannel;
+
+import java.net.URI;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * Callback factory
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 21, 2007
+ */
+public final class RMCallbackHandlerFactory
+{
+ private static RMBackPortsServer server;
+ private static Lock lock = new ReentrantLock();
+
+ private RMCallbackHandlerFactory()
+ {
+ // no instances
+ }
+
+ public static RMCallbackHandler getCallbackHandler(URI backPort)
+ {
+ lock.lock();
+ try
+ {
+ if (server == null)
+ {
+ server = RMBackPortsServer.getInstance(backPort.getScheme(),
backPort.getHost(), backPort.getPort());
+ }
+ RMCallbackHandler callbackHandler = server.getCallback(backPort.getPath());
+ if (callbackHandler == null)
+ {
+ callbackHandler = new RMCallbackHandlerImpl(backPort.getPath());
+ server.registerCallback(callbackHandler);
+ }
+
+ return callbackHandler;
+ }
+ finally
+ {
+ lock.unlock();
+ }
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport.backchannel;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.ws.core.MessageTrace;
+import org.jboss.ws.extensions.wsrm.transport.RMMessage;
+import org.jboss.ws.extensions.wsrm.transport.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.transport.RMMetadata;
+import org.jboss.ws.extensions.wsrm.transport.RMUnassignedMessageListener;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 21, 2007
+ */
+public final class RMCallbackHandlerImpl implements RMCallbackHandler
+{
+ private static final Logger LOG = Logger.getLogger(RMCallbackHandlerImpl.class);
+ private final String handledPath;
+ private final Object instanceLock = new Object();
+ private Map<String, RMMessage> arrivedMessages = new HashMap<String,
RMMessage>();
+ private List<RMMessage> arrivedUnassignedMessages = new
LinkedList<RMMessage>();
+ private RMUnassignedMessageListener listener;
+
+ public RMCallbackHandlerImpl(String handledPath)
+ {
+ super();
+ this.handledPath = handledPath;
+ }
+
+ public Throwable getFault(String messageId)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public final String getHandledPath()
+ {
+ return this.handledPath;
+ }
+
+ public final void handle(InvocationRequest request)
+ {
+ String requestMessage = (String)request.getParameter();
+ System.out.println("=================================================");
+ System.out.println("4 - " + request.getRequestPayload());
+ System.out.println("5 - " + request.getReturnPayload());
+ synchronized (instanceLock)
+ {
+ LOG.debug("Setting response object");
+ MessageTrace.traceMessage("Incoming RM Response Message",
requestMessage.getBytes());
+ RMMessage message = RMMessageFactory.newMessage(requestMessage.getBytes(), new
RMMetadata(new java.util.HashMap<String, Object>())); // TODO create map metadata
+ String startPattern = "<wsa:RelatesTo>"; // TODO: remove this
with XML content inspection
+ String endPattern = "</wsa:RelatesTo>";
+ int begin = requestMessage.indexOf(startPattern) + startPattern.length();
+ int end = requestMessage.indexOf(endPattern);
+ if (begin != -1)
+ {
+ String messageId = requestMessage.substring(begin, end);
+ System.out.println("Arrived message id: " + messageId);
+ this.arrivedMessages.put(messageId, message);
+ }
+ else
+ {
+ System.out.println("Arrived message has no id");
+ this.arrivedUnassignedMessages.add(message);
+ if (this.listener != null)
+ {
+ this.listener.unassignedMessageReceived();
+ }
+ }
+ System.out.println("Message content is: " + requestMessage);
+
System.out.println("=================================================");
+ }
+ }
+
+ public void addUnassignedMessageListener(RMUnassignedMessageListener listener)
+ {
+ synchronized (instanceLock)
+ {
+ if (this.listener == null)
+ {
+ this.listener = listener;
+ }
+ }
+ }
+
+ public RMMessage getMessage(String messageId)
+ {
+ synchronized (instanceLock)
+ {
+ while (this.arrivedMessages.get(messageId) == null)
+ {
+ try
+ {
+ LOG.debug("waiting for response object associated with message id:
" + messageId);
+ instanceLock.wait(100);
+ }
+ catch (InterruptedException ignore)
+ {
+ // TODO: never ignore exceptions - LOG it using logger
+ }
+ }
+ return this.arrivedMessages.get(messageId);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -36,7 +36,7 @@
import org.jboss.ws.core.jaxws.client.ServiceObjectFactoryJAXWS;
import org.jboss.ws.core.soap.Style;
import org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -116,7 +116,7 @@
private void setupRMOperations(EndpointMetaData endpointMD)
{
String rmSpecVersion =
endpointMD.getConfig().getRMMetaData().getProvider().getSpecVersion();
- Provider rmProvider = Provider.getInstance(rmSpecVersion);
+ RMProvider rmProvider = RMProvider.getInstance(rmSpecVersion);
// register createSequence method
QName createSequenceQName = rmProvider.getConstants().getCreateSequenceQName();
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -28,9 +28,9 @@
import java.util.ArrayList;
import java.util.List;
+import org.jboss.ws.extensions.wsrm.config.RMConfig;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.wsrm.ReliableMessagingMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
/**
@@ -42,7 +42,7 @@
public abstract class CommonConfig
{
private String configName;
- private ReliableMessagingMetaData wsrmCfg;
+ private RMConfig wsrmCfg;
private List<URI> features = new ArrayList<URI>();
private List<EndpointProperty> properties = new
ArrayList<EndpointProperty>();
@@ -76,12 +76,12 @@
features.remove(nameToURI(type));
}
- public void setRMMetaData(ReliableMessagingMetaData wsrmCfg)
+ public void setRMMetaData(RMConfig wsrmCfg)
{
this.wsrmCfg = wsrmCfg;
}
- public ReliableMessagingMetaData getRMMetaData()
+ public RMConfig getRMMetaData()
{
return this.wsrmCfg;
}
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -32,18 +32,18 @@
import org.jboss.ws.metadata.config.jaxws.ConfigRootJAXWS;
import org.jboss.ws.metadata.config.jaxws.EndpointConfigJAXWS;
import org.jboss.ws.metadata.config.jaxws.HandlerChainsConfigJAXWS;
-import org.jboss.ws.metadata.wsrm.DeliveryAssuranceMetaData;
-import org.jboss.ws.metadata.wsrm.MessageStoreMetaData;
-import org.jboss.ws.metadata.wsrm.PortMetaData;
-import org.jboss.ws.metadata.wsrm.ProviderMetaData;
-import org.jboss.ws.metadata.wsrm.ReliableMessagingMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.HandlerChainsObjectFactory;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
-import org.jboss.ws.extensions.wsrm.DeliveryAssurance;
-import org.jboss.ws.extensions.wsrm.DeliveryAssuranceFactory;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
+import org.jboss.ws.extensions.wsrm.RMDeliveryAssurance;
+import org.jboss.ws.extensions.wsrm.RMDeliveryAssuranceFactory;
+import org.jboss.ws.extensions.wsrm.config.RMDeliveryAssuranceConfig;
+import org.jboss.ws.extensions.wsrm.config.RMMessageStoreConfig;
+import org.jboss.ws.extensions.wsrm.config.RMConfig;
+import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
+import org.jboss.ws.extensions.wsrm.config.RMProviderConfig;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
/**
* ObjectModelFactory for JAXRPC configurations.
@@ -134,7 +134,7 @@
}
if ("reliable-messaging".equals(localName))
{
- ReliableMessagingMetaData wsrmCfg = new ReliableMessagingMetaData();
+ RMConfig wsrmCfg = new RMConfig();
commonConfig.setRMMetaData(wsrmCfg);
return wsrmCfg;
}
@@ -142,13 +142,13 @@
return null;
}
- public Object newChild(ReliableMessagingMetaData wsrmConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ public Object newChild(RMConfig wsrmConfig, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
{
int countOfAttributes = attrs.getLength();
if (localName.equals("delivery-assurance"))
{
- DeliveryAssuranceMetaData deliveryAssurance = getDeliveryAssurance(attrs);
+ RMDeliveryAssuranceConfig deliveryAssurance = getDeliveryAssurance(attrs);
wsrmConfig.setDeliveryAssurance(deliveryAssurance);
return deliveryAssurance;
}
@@ -163,7 +163,7 @@
break;
}
}
- ProviderMetaData provider = new ProviderMetaData();
+ RMProviderConfig provider = new RMProviderConfig();
provider.setSpecVersion(specVersion);
wsrmConfig.setProvider(provider);
return provider;
@@ -180,7 +180,7 @@
className = attrs.getValue(i);
}
- MessageStoreMetaData messageStore = new MessageStoreMetaData();
+ RMMessageStoreConfig messageStore = new RMMessageStoreConfig();
messageStore.setId(id);
messageStore.setClassName(className);
wsrmConfig.setMessageStore(messageStore);
@@ -197,7 +197,7 @@
break;
}
}
- PortMetaData port = new PortMetaData();
+ RMPortConfig port = new RMPortConfig();
port.setPortName(QName.valueOf(portName));
wsrmConfig.getPorts().add(port);
return port;
@@ -206,11 +206,11 @@
return null;
}
- public Object newChild(PortMetaData port, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ public Object newChild(RMPortConfig port, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
{
if (localName.equals("delivery-assurance"))
{
- DeliveryAssuranceMetaData deliveryAssurance = getDeliveryAssurance(attrs);
+ RMDeliveryAssuranceConfig deliveryAssurance = getDeliveryAssurance(attrs);
port.setDeliveryAssurance(deliveryAssurance);
return deliveryAssurance;
}
@@ -218,7 +218,7 @@
return null;
}
- private DeliveryAssuranceMetaData getDeliveryAssurance(Attributes attrs)
+ private RMDeliveryAssuranceConfig getDeliveryAssurance(Attributes attrs)
{
String inOrder = null, quality = null;
for (int i = 0; i < attrs.getLength() && (inOrder == null || quality ==
null); i++)
@@ -229,13 +229,13 @@
if (attrLocalName.equals("quality"))
quality = attrs.getValue(i);
}
- DeliveryAssuranceMetaData deliveryAssurance = new DeliveryAssuranceMetaData();
+ RMDeliveryAssuranceConfig deliveryAssurance = new RMDeliveryAssuranceConfig();
deliveryAssurance.setQuality(quality);
deliveryAssurance.setInOrder(inOrder);
return deliveryAssurance;
}
- public void setValue(MessageStoreMetaData messageStore, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ public void setValue(RMMessageStoreConfig messageStore, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
{
if (localName.equals("config-file"))
{
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -59,13 +59,13 @@
import org.jboss.ws.core.jaxws.client.DispatchBinding;
import org.jboss.ws.core.soap.Style;
import org.jboss.ws.core.soap.Use;
+import org.jboss.ws.extensions.wsrm.config.RMConfig;
+import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
import org.jboss.ws.metadata.config.CommonConfig;
import org.jboss.ws.metadata.config.Configurable;
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.config.EndpointFeature;
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
-import org.jboss.ws.metadata.wsrm.PortMetaData;
-import org.jboss.ws.metadata.wsrm.ReliableMessagingMetaData;
import org.jboss.wsf.common.JavaUtils;
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
@@ -703,14 +703,14 @@
{
log.debug("Create new config [name=" + getConfigName() +
",file=" + getConfigFile() + "]");
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
- List<PortMetaData> rmPortMetaData = backupRMMD();
+ List<RMPortConfig> rmPortMetaData = backupRMMD();
config = factory.getConfig(getRootFile(), getConfigName(), getConfigFile());
propagateRMMD(rmPortMetaData);
reconfigHandlerMetaData();
}
- private List<PortMetaData> backupRMMD()
+ private List<RMPortConfig> backupRMMD()
{
if ((config != null) && (config.getRMMetaData() != null))
return config.getRMMetaData().getPorts();
@@ -718,20 +718,20 @@
return null;
}
- private void propagateRMMD(List<PortMetaData> backedUpMD)
+ private void propagateRMMD(List<RMPortConfig> backedUpMD)
{
if ((backedUpMD != null) && (backedUpMD.size() > 0))
{
if (config.getRMMetaData() == null)
{
- config.setRMMetaData(new ReliableMessagingMetaData());
+ config.setRMMetaData(new RMConfig());
config.getRMMetaData().getPorts().addAll(backedUpMD);
}
else
{
// RM policy specified in config file will be always used
- List<PortMetaData> ports = config.getRMMetaData().getPorts();
- for (PortMetaData portMD : backedUpMD)
+ List<RMPortConfig> ports = config.getRMMetaData().getPorts();
+ for (RMPortConfig portMD : backedUpMD)
{
QName portName = portMD.getPortName();
if (!contains(ports, portName))
@@ -743,9 +743,9 @@
}
}
- private boolean contains(List<PortMetaData> ports, QName portName)
+ private boolean contains(List<RMPortConfig> ports, QName portName)
{
- for (PortMetaData pMD : ports)
+ for (RMPortConfig pMD : ports)
{
if (pMD.getPortName().equals(portName))
return true;
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -26,9 +26,14 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.extensions.wsrm.DeliveryAssurance;
-import org.jboss.ws.extensions.wsrm.DeliveryQuality;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
+import org.jboss.ws.extensions.wsrm.RMDeliveryAssurance;
+import org.jboss.ws.extensions.wsrm.RMDeliveryQuality;
+import org.jboss.ws.extensions.wsrm.config.RMDeliveryAssuranceConfig;
+import org.jboss.ws.extensions.wsrm.config.RMMessageStoreConfig;
+import org.jboss.ws.extensions.wsrm.config.RMConfig;
+import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
+import org.jboss.ws.extensions.wsrm.config.RMProviderConfig;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
import org.jboss.ws.metadata.config.EndpointProperty;
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
import org.jboss.ws.metadata.config.jaxrpc.CommonConfigJAXRPC;
@@ -36,11 +41,6 @@
import org.jboss.ws.metadata.config.jaxrpc.EndpointConfigJAXRPC;
import org.jboss.ws.metadata.config.jaxws.ConfigRootJAXWS;
import org.jboss.ws.metadata.config.jaxws.EndpointConfigJAXWS;
-import org.jboss.ws.metadata.wsrm.DeliveryAssuranceMetaData;
-import org.jboss.ws.metadata.wsrm.MessageStoreMetaData;
-import org.jboss.ws.metadata.wsrm.PortMetaData;
-import org.jboss.ws.metadata.wsrm.ProviderMetaData;
-import org.jboss.ws.metadata.wsrm.ReliableMessagingMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.test.JBossWSTest;
@@ -137,23 +137,23 @@
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
ConfigRootJAXWS config = (ConfigRootJAXWS)factory.parse(confFile.toURL());
EndpointConfigJAXWS epConfig =
(EndpointConfigJAXWS)config.getConfigByName("Standard WSRM Endpoint");
- ReliableMessagingMetaData wsrmConfig = epConfig.getRMMetaData();
+ RMConfig wsrmConfig = epConfig.getRMMetaData();
assertNotNull(wsrmConfig);
- DeliveryAssuranceMetaData deliveryAssurance = wsrmConfig.getDeliveryAssurance();
+ RMDeliveryAssuranceConfig deliveryAssurance = wsrmConfig.getDeliveryAssurance();
assertEquals(deliveryAssurance.getInOrder(), "true");
assertEquals(deliveryAssurance.getQuality(), "AtLeastOnce");
- ProviderMetaData provider = wsrmConfig.getProvider();
+ RMProviderConfig provider = wsrmConfig.getProvider();
assertEquals(provider.getSpecVersion(),
"http://docs.oasis-open.org/ws-rx/wsrm/200702");
- MessageStoreMetaData messageStore = wsrmConfig.getMessageStore();
+ RMMessageStoreConfig messageStore = wsrmConfig.getMessageStore();
assertEquals(messageStore.getId(), "wsrmStoreId");
assertEquals(messageStore.getClassName(), "custom.MessageStoreImpl");
assertEquals(messageStore.getConfigFile(), "META-INF/config.xml");
- List<PortMetaData> ports = wsrmConfig.getPorts();
- PortMetaData port1 = ports.get(0);
+ List<RMPortConfig> ports = wsrmConfig.getPorts();
+ RMPortConfig port1 = ports.get(0);
assertEquals(port1.getPortName(), new QName("http://custom/namespace/",
"Port1"));
assertEquals(port1.getDeliveryAssurance().getInOrder(), "false");
assertEquals(port1.getDeliveryAssurance().getQuality(), "AtMostOnce");
- PortMetaData port2 = ports.get(1);
+ RMPortConfig port2 = ports.get(1);
assertEquals(port2.getPortName(), new QName("http://custom/namespace/",
"Port2"));
assertEquals(port2.getDeliveryAssurance().getInOrder(), "true");
assertEquals(port2.getDeliveryAssurance().getQuality(), "ExactlyOnce");
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/WSRMDeSerializationTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/WSRMDeSerializationTestCase.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/WSRMDeSerializationTestCase.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -26,19 +26,19 @@
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
-import org.jboss.ws.extensions.wsrm.spi.MessageFactory;
-import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
+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.extensions.wsrm.spi.protocol.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
import org.jboss.wsf.test.JBossWSTest;
/**
@@ -48,7 +48,7 @@
public final class WSRMDeSerializationTestCase extends JBossWSTest
{
private static final String WSRM_200702_NS =
"http://docs.oasis-open.org/ws-rx/wsrm/200702";
- private static final MessageFactory WSRM_200702_FACTORY =
Provider.getInstance(WSRM_200702_NS).getMessageFactory();
+ private static final RMMessageFactory WSRM_200702_FACTORY =
RMProvider.getInstance(WSRM_200702_NS).getMessageFactory();
private static final String CREATE_SEQUENCE_MESSAGE
= "<soap:Envelope "
@@ -276,34 +276,34 @@
public void testSequenceAcknowledgementDeserialization1() throws Exception
{
- SequenceAcknowledgement sequenceAcknowledgement =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+ RMSequenceAcknowledgement sequenceAcknowledgement =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
sequenceAcknowledgement.deserializeFrom(toSOAPMessage(SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_1));
// perform assertion
assertEquals(sequenceAcknowledgement.getIdentifier(),
"http://Business456.com/RM/ABC");
assertTrue(sequenceAcknowledgement.isFinal());
assertFalse(sequenceAcknowledgement.isNone());
assertEquals(sequenceAcknowledgement.getNacks().size(), 0);
- List<SequenceAcknowledgement.AcknowledgementRange> ranges =
sequenceAcknowledgement.getAcknowledgementRanges();
+ List<RMSequenceAcknowledgement.AcknowledgementRange> ranges =
sequenceAcknowledgement.getAcknowledgementRanges();
assertEquals(ranges.size(), 2);
- SequenceAcknowledgement.AcknowledgementRange firstRange = ranges.get(0);
+ RMSequenceAcknowledgement.AcknowledgementRange firstRange = ranges.get(0);
assertEquals(firstRange.getLower(), 1);
assertEquals(firstRange.getLower(), 1);
- SequenceAcknowledgement.AcknowledgementRange secondRange = ranges.get(1);
+ RMSequenceAcknowledgement.AcknowledgementRange secondRange = ranges.get(1);
assertEquals(secondRange.getLower(), 3);
assertEquals(secondRange.getLower(), 3);
}
public void testSequenceAcknowledgementSerialization1() throws Exception
{
- SequenceAcknowledgement sequenceAcknowledgementMessage =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+ RMSequenceAcknowledgement sequenceAcknowledgementMessage =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
// construct message
sequenceAcknowledgementMessage.setIdentifier("http://Business456.com...;
sequenceAcknowledgementMessage.setFinal();
- SequenceAcknowledgement.AcknowledgementRange firstRange =
sequenceAcknowledgementMessage.newAcknowledgementRange();
+ RMSequenceAcknowledgement.AcknowledgementRange firstRange =
sequenceAcknowledgementMessage.newAcknowledgementRange();
firstRange.setLower(1);
firstRange.setUpper(1);
sequenceAcknowledgementMessage.addAcknowledgementRange(firstRange);
- SequenceAcknowledgement.AcknowledgementRange secondRange =
sequenceAcknowledgementMessage.newAcknowledgementRange();
+ RMSequenceAcknowledgement.AcknowledgementRange secondRange =
sequenceAcknowledgementMessage.newAcknowledgementRange();
secondRange.setLower(3);
secondRange.setUpper(3);
sequenceAcknowledgementMessage.addAcknowledgementRange(secondRange);
@@ -313,7 +313,7 @@
public void testSequenceAcknowledgementDeserialization2() throws Exception
{
- SequenceAcknowledgement sequenceAcknowledgement =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+ RMSequenceAcknowledgement sequenceAcknowledgement =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
sequenceAcknowledgement.deserializeFrom(toSOAPMessage(SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_2));
// perform assertion
assertEquals(sequenceAcknowledgement.getIdentifier(),
"http://Business456.com/RM/ABC");
@@ -327,7 +327,7 @@
public void testSequenceAcknowledgementSerialization2() throws Exception
{
- SequenceAcknowledgement sequenceAcknowledgementMessage =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+ RMSequenceAcknowledgement sequenceAcknowledgementMessage =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
// construct message
sequenceAcknowledgementMessage.setIdentifier("http://Business456.com...;
sequenceAcknowledgementMessage.addNack(2);
@@ -337,7 +337,7 @@
public void testSequenceAcknowledgementDeserialization3() throws Exception
{
- SequenceAcknowledgement sequenceAcknowledgement =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+ RMSequenceAcknowledgement sequenceAcknowledgement =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
sequenceAcknowledgement.deserializeFrom(toSOAPMessage(SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_3));
// perform assertion
assertEquals(sequenceAcknowledgement.getIdentifier(),
"http://Business456.com/RM/ABC");
@@ -349,7 +349,7 @@
public void testSequenceAcknowledgementSerialization3() throws Exception
{
- SequenceAcknowledgement sequenceAcknowledgementMessage =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+ RMSequenceAcknowledgement sequenceAcknowledgementMessage =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
// construct message
sequenceAcknowledgementMessage.setIdentifier("http://Business456.com...;
sequenceAcknowledgementMessage.setNone();
@@ -359,29 +359,29 @@
public void testCreateSequenceMessageDeserialization() throws Exception
{
- CreateSequence createSequenceMessage = WSRM_200702_FACTORY.newCreateSequence();
+ RMCreateSequence createSequenceMessage = WSRM_200702_FACTORY.newCreateSequence();
createSequenceMessage.deserializeFrom(toSOAPMessage(CREATE_SEQUENCE_MESSAGE));
// perform assertion
assertEquals(createSequenceMessage.getAcksTo(),
"http://Business456.com/serviceA/789");
assertEquals(createSequenceMessage.getExpires(), "PT0S");
- CreateSequence.Offer offer = createSequenceMessage.getOffer();
+ RMCreateSequence.Offer offer = createSequenceMessage.getOffer();
assertEquals(offer.getIdentifier(), "http://Business456.com/RM/ABC");
assertEquals(offer.getEndpoint(),
"http://Business456.com/serviceA/ASDF");
assertEquals(offer.getExpires(), "PT1S");
- assertEquals(offer.getIncompleteSequenceBehavior(),
IncompleteSequenceBehavior.DISCARD_ENTIRE_SEQUENCE);
+ assertEquals(offer.getIncompleteSequenceBehavior(),
RMIncompleteSequenceBehavior.DISCARD_ENTIRE_SEQUENCE);
}
public void testCreateSequenceMessageSerialization() throws Exception
{
- CreateSequence createSequenceMessage = WSRM_200702_FACTORY.newCreateSequence();
+ RMCreateSequence createSequenceMessage = WSRM_200702_FACTORY.newCreateSequence();
// construct message
createSequenceMessage.setAcksTo("http://Business456.com/serviceA/789...;
createSequenceMessage.setExpires("PT0S");
- CreateSequence.Offer offer = createSequenceMessage.newOffer();
+ RMCreateSequence.Offer offer = createSequenceMessage.newOffer();
offer.setIdentifier("http://Business456.com/RM/ABC");
offer.setEndpoint("http://Business456.com/serviceA/ASDF");
offer.setExpires("PT1S");
-
offer.setIncompleteSequenceBehavior(IncompleteSequenceBehavior.DISCARD_ENTIRE_SEQUENCE);
+
offer.setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior.DISCARD_ENTIRE_SEQUENCE);
createSequenceMessage.setOffer(offer);
// perform assertion
assertEquals(createSequenceMessage, CREATE_SEQUENCE_MESSAGE, WSRM_200702_FACTORY);
@@ -389,24 +389,24 @@
public void testCreateSequenceResponseMessageDeserialization() throws Exception
{
- CreateSequenceResponse createSequenceResponseMessage =
WSRM_200702_FACTORY.newCreateSequenceResponse();
+ RMCreateSequenceResponse createSequenceResponseMessage =
WSRM_200702_FACTORY.newCreateSequenceResponse();
createSequenceResponseMessage.deserializeFrom(toSOAPMessage(CREATE_SEQUENCE_RESPONSE_MESSAGE));
// perform assertion
assertEquals(createSequenceResponseMessage.getIdentifier(),
"http://Business456.com/RM/ABC");
assertEquals(createSequenceResponseMessage.getExpires(), "PT0S");
- assertEquals(createSequenceResponseMessage.getIncompleteSequenceBehavior(),
IncompleteSequenceBehavior.DISCARD_FOLLOWING_FIRST_GAP);
- CreateSequenceResponse.Accept accept = createSequenceResponseMessage.getAccept();
+ assertEquals(createSequenceResponseMessage.getIncompleteSequenceBehavior(),
RMIncompleteSequenceBehavior.DISCARD_FOLLOWING_FIRST_GAP);
+ RMCreateSequenceResponse.Accept accept =
createSequenceResponseMessage.getAccept();
assertEquals(accept.getAcksTo(),
"http://Business456.com/serviceA/ASDF");
}
public void testCreateSequenceResponseMessageSerialization() throws Exception
{
- CreateSequenceResponse createSequenceResponse =
WSRM_200702_FACTORY.newCreateSequenceResponse();
+ RMCreateSequenceResponse createSequenceResponse =
WSRM_200702_FACTORY.newCreateSequenceResponse();
// construct message
createSequenceResponse.setIdentifier("http://Business456.com/RM/ABC&...;
createSequenceResponse.setExpires("PT0S");
-
createSequenceResponse.setIncompleteSequenceBehavior(IncompleteSequenceBehavior.DISCARD_FOLLOWING_FIRST_GAP);
- CreateSequenceResponse.Accept accept = createSequenceResponse.newAccept();
+
createSequenceResponse.setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior.DISCARD_FOLLOWING_FIRST_GAP);
+ RMCreateSequenceResponse.Accept accept = createSequenceResponse.newAccept();
accept.setAcksTo("http://Business456.com/serviceA/ASDF");
createSequenceResponse.setAccept(accept);
// perform assertion
@@ -415,7 +415,7 @@
public void testCloseSequenceMessageDeserialization() throws Exception
{
- CloseSequence closeSequence = WSRM_200702_FACTORY.newCloseSequence();
+ RMCloseSequence closeSequence = WSRM_200702_FACTORY.newCloseSequence();
closeSequence.deserializeFrom(toSOAPMessage(CLOSE_SEQUENCE_MESSAGE));
// perform assertion
assertEquals(closeSequence.getIdentifier(),
"http://Business456.com/RM/ABC");
@@ -424,7 +424,7 @@
public void testCloseSequenceMessageSerialization() throws Exception
{
- CloseSequence closeSequence = WSRM_200702_FACTORY.newCloseSequence();
+ RMCloseSequence closeSequence = WSRM_200702_FACTORY.newCloseSequence();
// construct message
closeSequence.setIdentifier("http://Business456.com/RM/ABC");
closeSequence.setLastMsgNumber(3);
@@ -434,7 +434,7 @@
public void testCloseSequenceResponseMessageDeserialization() throws Exception
{
- CloseSequenceResponse closeSequenceResponse =
WSRM_200702_FACTORY.newCloseSequenceResponse();
+ RMCloseSequenceResponse closeSequenceResponse =
WSRM_200702_FACTORY.newCloseSequenceResponse();
closeSequenceResponse.deserializeFrom(toSOAPMessage(CLOSE_SEQUENCE_RESPONSE_MESSAGE));
// perform assertion
assertEquals(closeSequenceResponse.getIdentifier(),
"http://Business456.com/RM/ABC");
@@ -442,7 +442,7 @@
public void testCloseSequenceResponseMessageSerialization() throws Exception
{
- CloseSequenceResponse closeSequenceResponse =
WSRM_200702_FACTORY.newCloseSequenceResponse();
+ RMCloseSequenceResponse closeSequenceResponse =
WSRM_200702_FACTORY.newCloseSequenceResponse();
// construct message
closeSequenceResponse.setIdentifier("http://Business456.com/RM/ABC&q...;
// perform assertion
@@ -451,7 +451,7 @@
public void testTerminateSequenceMessageDeserialization() throws Exception
{
- TerminateSequence terminateSequence = WSRM_200702_FACTORY.newTerminateSequence();
+ RMTerminateSequence terminateSequence =
WSRM_200702_FACTORY.newTerminateSequence();
terminateSequence.deserializeFrom(toSOAPMessage(TERMINATE_SEQUENCE_MESSAGE));
// perform assertion
assertEquals(terminateSequence.getIdentifier(),
"http://Business456.com/RM/ABC");
@@ -460,7 +460,7 @@
public void testTerminateSequenceMessageSerialization() throws Exception
{
- TerminateSequence terminateSequence = WSRM_200702_FACTORY.newTerminateSequence();
+ RMTerminateSequence terminateSequence =
WSRM_200702_FACTORY.newTerminateSequence();
// construct message
terminateSequence.setIdentifier("http://Business456.com/RM/ABC");
terminateSequence.setLastMsgNumber(3);
@@ -470,7 +470,7 @@
public void testTerminateSequenceResponseMessageDeserialization() throws Exception
{
- TerminateSequenceResponse terminateSequenceResponse =
WSRM_200702_FACTORY.newTerminateSequenceResponse();
+ RMTerminateSequenceResponse terminateSequenceResponse =
WSRM_200702_FACTORY.newTerminateSequenceResponse();
terminateSequenceResponse.deserializeFrom(toSOAPMessage(TERMINATE_SEQUENCE_RESPONSE_MESSAGE));
// perform assertion
assertEquals(terminateSequenceResponse.getIdentifier(),
"http://Business456.com/RM/ABC");
@@ -478,7 +478,7 @@
public void testTerminateSequenceResponseMessageSerialization() throws Exception
{
- TerminateSequenceResponse terminateSequenceResponse =
WSRM_200702_FACTORY.newTerminateSequenceResponse();
+ RMTerminateSequenceResponse terminateSequenceResponse =
WSRM_200702_FACTORY.newTerminateSequenceResponse();
// construct message
terminateSequenceResponse.setIdentifier("http://Business456.com/RM/A...;
// perform assertion
@@ -487,7 +487,7 @@
public void testSequenceMessageSerialization() throws Exception
{
- Sequence sequence = WSRM_200702_FACTORY.newSequence();
+ RMSequence sequence = WSRM_200702_FACTORY.newSequence();
sequence.deserializeFrom(toSOAPMessage(SEQUENCE_PLUS_ACKREQUESTED_MESSAGE));
// perform assertion
assertEquals(sequence.getIdentifier(), "http://Business456.com/RM/ABC");
@@ -496,7 +496,7 @@
public void testSequenceMessageDeserialization() throws Exception
{
- Sequence sequence = WSRM_200702_FACTORY.newSequence();
+ RMSequence sequence = WSRM_200702_FACTORY.newSequence();
// construct message
sequence.setIdentifier("http://Business456.com/RM/ABC");
sequence.setMessageNumber(1);
@@ -506,7 +506,7 @@
public void testAckRequestedMessageSerialization() throws Exception
{
- AckRequested ackRequested = WSRM_200702_FACTORY.newAckRequested();
+ RMAckRequested ackRequested = WSRM_200702_FACTORY.newAckRequested();
ackRequested.deserializeFrom(toSOAPMessage(SEQUENCE_PLUS_ACKREQUESTED_MESSAGE));
// perform assertion
assertEquals(ackRequested.getIdentifier(),
"http://Business456.com/RM/ABC");
@@ -514,7 +514,7 @@
public void testAckRequestedMessageDeserialization() throws Exception
{
- AckRequested ackRequested = WSRM_200702_FACTORY.newAckRequested();
+ RMAckRequested ackRequested = WSRM_200702_FACTORY.newAckRequested();
// construct message
ackRequested.setIdentifier("http://Business456.com/RM/ABC");
// perform assertion
@@ -523,40 +523,40 @@
// TODO: implement other de/serializations
- private static void assertEquals(Serializable serializable, String exemplar,
MessageFactory factory) throws Exception
+ private static void assertEquals(RMSerializable serializable, String exemplar,
RMMessageFactory factory) throws Exception
{
// serialize constructed message
SOAPMessage createdSOAPMessage = newEmptySOAPMessage();
serializable.serializeTo(createdSOAPMessage);
// deserialize from constructed message
- Serializable serializable1 = newEmptySerializable(factory, serializable);
+ RMSerializable serializable1 = newEmptySerializable(factory, serializable);
serializable1.deserializeFrom(createdSOAPMessage);
// deserialize from reference message
- Serializable serializable2 = newEmptySerializable(factory, serializable);
+ RMSerializable serializable2 = newEmptySerializable(factory, serializable);
serializable2.deserializeFrom(toSOAPMessage(exemplar));
// perform assertion
assertEquals(serializable1, serializable2);
}
- private static Serializable newEmptySerializable(MessageFactory factory, Serializable
helper)
+ private static RMSerializable newEmptySerializable(RMMessageFactory factory,
RMSerializable helper)
{
- if (helper instanceof CreateSequence)
+ if (helper instanceof RMCreateSequence)
return factory.newCreateSequence();
- if (helper instanceof CreateSequenceResponse)
+ if (helper instanceof RMCreateSequenceResponse)
return factory.newCreateSequenceResponse();
- if (helper instanceof CloseSequence)
+ if (helper instanceof RMCloseSequence)
return factory.newCloseSequence();
- if (helper instanceof CloseSequenceResponse)
+ if (helper instanceof RMCloseSequenceResponse)
return factory.newCloseSequenceResponse();
- if (helper instanceof TerminateSequence)
+ if (helper instanceof RMTerminateSequence)
return factory.newTerminateSequence();
- if (helper instanceof TerminateSequenceResponse)
+ if (helper instanceof RMTerminateSequenceResponse)
return factory.newTerminateSequenceResponse();
- if (helper instanceof Sequence)
+ if (helper instanceof RMSequence)
return factory.newSequence();
- if (helper instanceof AckRequested)
+ if (helper instanceof RMAckRequested)
return factory.newAckRequested();
- if (helper instanceof SequenceAcknowledgement)
+ if (helper instanceof RMSequenceAcknowledgement)
return factory.newSequenceAcknowledgement();
throw new IllegalArgumentException();
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -36,8 +36,8 @@
import junit.framework.Test;
-import org.jboss.ws.extensions.wsrm.client_api.RMProvider;
-import org.jboss.ws.extensions.wsrm.client_api.RMSequence;
+import org.jboss.ws.extensions.wsrm.api.RMProvider;
+import org.jboss.ws.extensions.wsrm.api.RMSequence;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
import org.jboss.test.ws.jaxws.wsrm.OneWayServiceIface;
@@ -91,14 +91,14 @@
System.out.println("FIXME [JBWS-515] Provide an initial implementation for
WS-ReliableMessaging");
System.out.println("FIXME [JBWS-1699] Implement the basic message exchange
that is required for WS-RM");
System.out.println("FIXME [JBWS-1700] Provide a comprehensive test case for
WS-RM");
- if (true) return; // disable WS-RM tests - they cause regression in hudson
+ //if (true) return; // disable WS-RM tests - they cause regression in hudson
RMSequence sequence = null;
if (emulatorOn)
{
RMProvider wsrmProvider = (RMProvider)proxy;
sequence = wsrmProvider.createSequence(addressable);
- System.out.println("Created sequence with id=" + sequence.getId());
+ System.out.println("Created sequence with id=" +
sequence.getOutboundId());
}
setAddrProps(proxy, "http://useless/action1", serviceURL);
proxy.method1();
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java 2007-11-28
11:04:41 UTC (rev 5124)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java 2007-11-28
11:17:57 UTC (rev 5125)
@@ -42,8 +42,8 @@
import org.jboss.wsf.test.JBossWSTestSetup;
import org.jboss.test.ws.jaxws.wsrm.ReqResServiceIface;
-import org.jboss.ws.extensions.wsrm.client_api.RMProvider;
-import org.jboss.ws.extensions.wsrm.client_api.RMSequence;
+import org.jboss.ws.extensions.wsrm.api.RMProvider;
+import org.jboss.ws.extensions.wsrm.api.RMSequence;
/**
* Reliable JBoss WebService client invoking req/res methods
@@ -173,14 +173,15 @@
System.out.println("FIXME [JBWS-515] Provide an initial implementation for
WS-ReliableMessaging");
System.out.println("FIXME [JBWS-1699] Implement the basic message exchange
that is required for WS-RM");
System.out.println("FIXME [JBWS-1700] Provide a comprehensive test case for
WS-RM");
- if (true) return; // disable WS-RM tests - they cause regression in hudson
+ //if (true) return; // disable WS-RM tests - they cause regression in hudson
RMSequence sequence = null;
if (emulatorOn)
{
RMProvider wsrmProvider = (RMProvider)proxyObject;
sequence = wsrmProvider.createSequence(addressable);
- System.out.println("Created sequence with id=" + sequence.getId());
+ System.out.println("Created sequence with outbound id=" +
sequence.getOutboundId());
+ System.out.println("Created sequence with inbound id=" +
sequence.getInboundId());
}
setAddrProps(proxy, "http://useless/action", serviceURL);
invokeWebServiceMethod(invocationType);