Author: richard.opalka(a)jboss.com
Date: 2007-11-05 16:51:06 -0500 (Mon, 05 Nov 2007)
New Revision: 4990
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/
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/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/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/RMSequenceImpl.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/client_api/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMException.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMProvider.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/
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/
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/policy/
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/spec200502/
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/
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/
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/
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/
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/DeliveryAssuranceMetaData.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/MessageStoreMetaData.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/PortMetaData.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ProviderMetaData.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ReliableMessagingMetaData.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceIface.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceImpl.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceIface.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceImpl.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/
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/emulator/
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/
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/
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java
stack/native/trunk/src/test/resources/jaxws/wsrm/
stack/native/trunk/src/test/resources/jaxws/wsrm/META-INF/
stack/native/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/web.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-exactly-once-in-order-policy.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-jaxws-endpoint-config.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/OneWayService.wsdl
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/ReqResService.wsdl
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/createSequenceResponse.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/echoResponse.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/terminateSequenceResponse.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
stack/native/trunk/src/main/java/org/jboss/ws/core/MessageTrace.java
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/policy/deployer/PolicyDeployer.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/main/resources/schema/jaxws-config_2_0.xsd
stack/native/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
stack/native/trunk/src/test/resources/common/config/jaxws-endpoint-config.xml
Log:
merging ropalka branch to trunk
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-11-05
18:33:05 UTC (rev 4989)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -72,6 +72,7 @@
import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
import org.jboss.ws.core.soap.attachment.CIDGenerator;
import org.jboss.ws.core.utils.MimeUtils;
+import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
@@ -167,21 +168,38 @@
SOAPElement soapBodyElement = soapBody;
if (style == Style.RPC)
{
- QName opQName = opMetaData.getQName();
- Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
+ boolean serialize = true;
+
+ if (opMetaData.getEndpointMetaData().getConfig().getRMMetaData() != null)
+ {
+ for (QName wsrmQN : RMConstant.PROTOCOL_OPERATION_QNAMES)
+ {
+ if (wsrmQN.equals(opMetaData.getQName()))
+ {
+ serialize = false;
+ break;
+ }
+ }
+ }
+
+ if (serialize)
+ {
+ QName opQName = opMetaData.getQName();
+ Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
- if (log.isDebugEnabled())
- log.debug("Create RPC body element: " + opName);
+ if (log.isDebugEnabled())
+ log.debug("Create RPC body element: " + opName);
- soapBodyElement = new SOAPBodyElementRpc(opName);
- soapBodyElement =
(SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
+ soapBodyElement = new SOAPBodyElementRpc(opName);
+ soapBodyElement =
(SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
- // Add soap encodingStyle
- if (opMetaData.getUse() == Use.ENCODED)
- {
- String envURI = soapEnvelope.getNamespaceURI();
- String envPrefix = soapEnvelope.getPrefix();
- soapBodyElement.setAttributeNS(envURI, envPrefix +
":encodingStyle", Constants.URI_SOAP11_ENC);
+ // Add soap encodingStyle
+ if (opMetaData.getUse() == Use.ENCODED)
+ {
+ String envURI = soapEnvelope.getNamespaceURI();
+ String envPrefix = soapEnvelope.getPrefix();
+ soapBodyElement.setAttributeNS(envURI, envPrefix +
":encodingStyle", Constants.URI_SOAP11_ENC);
+ }
}
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/MessageTrace.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/MessageTrace.java 2007-11-05
18:33:05 UTC (rev 4989)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/MessageTrace.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -41,44 +41,47 @@
*/
public final class MessageTrace
{
- private static Logger msgLog = Logger.getLogger(MessageTrace.class);
+ private static final Logger msgLog = Logger.getLogger(MessageTrace.class);
- // Hide ctor
private MessageTrace()
{
+ // forbidden constructor
}
- public static void traceMessage(String messagePrefix, MessageAbstraction message)
+ public static void traceMessage(String messagePrefix, Object message)
{
- if (msgLog.isTraceEnabled())
+ if (!msgLog.isTraceEnabled()) return;
+
+ if (message instanceof SOAPMessage)
{
- if (message instanceof SOAPMessage)
+ try
{
- try
+ SOAPEnvelope soapEnv = ((SOAPMessage)message).getSOAPPart().getEnvelope();
+ if (soapEnv != null)
{
- SOAPEnvelope soapEnv =
((SOAPMessage)message).getSOAPPart().getEnvelope();
- if (soapEnv != null)
- {
- String envStr =
SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv, true);
- msgLog.trace(messagePrefix + "\n" + envStr);
- }
+ String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv,
true);
+ msgLog.trace(messagePrefix + "\n" + envStr);
}
- catch (SOAPException ex)
- {
- msgLog.error("Cannot trace SOAPMessage", ex);
- }
}
- else if (message instanceof HTTPMessageImpl)
+ catch (SOAPException ex)
{
- HTTPMessageImpl httpMessage = (HTTPMessageImpl)message;
- Element root = httpMessage.getXmlFragment().toElement();
- String xmlString = DOMWriter.printNode(root, true);
- msgLog.trace(messagePrefix + "\n" + xmlString);
+ msgLog.error("Cannot trace SOAPMessage", ex);
}
- else
- {
- msgLog.warn("Unsupported message type: " + message);
- }
}
+ else if (message instanceof HTTPMessageImpl)
+ {
+ HTTPMessageImpl httpMessage = (HTTPMessageImpl)message;
+ Element root = httpMessage.getXmlFragment().toElement();
+ String xmlString = DOMWriter.printNode(root, true);
+ msgLog.trace(messagePrefix + "\n" + xmlString);
+ }
+ else if (message instanceof byte[])
+ {
+ msgLog.trace(messagePrefix + "\n" + String.valueOf((byte[])message));
+ }
+ else
+ {
+ msgLog.warn("Unsupported message type: " + message);
+ }
}
}
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-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -54,6 +54,10 @@
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;
+
/**
* SOAPConnection implementation.
* <p/>
@@ -85,14 +89,6 @@
private static Map<String, String> configMap = new HashMap<String,
String>();
static
{
- // Remoting constants since 2.0.0.GA
- //configMap.put(StubExt.PROPERTY_KEY_STORE,
SSLSocketBuilder.REMOTING_KEY_STORE_FILE_PATH);
- //configMap.put(StubExt.PROPERTY_KEY_STORE_PASSWORD,
SSLSocketBuilder.REMOTING_KEY_STORE_PASSWORD);
- //configMap.put(StubExt.PROPERTY_KEY_STORE_TYPE,
SSLSocketBuilder.REMOTING_KEY_STORE_TYPE);
- //configMap.put(StubExt.PROPERTY_TRUST_STORE,
SSLSocketBuilder.REMOTING_TRUST_STORE_FILE_PATH);
- //configMap.put(StubExt.PROPERTY_TRUST_STORE_PASSWORD,
SSLSocketBuilder.REMOTING_TRUST_STORE_PASSWORD);
- //configMap.put(StubExt.PROPERTY_TRUST_STORE_TYPE,
SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE);
-
configMap.put(StubExt.PROPERTY_KEY_STORE,
"org.jboss.remoting.keyStore");
configMap.put(StubExt.PROPERTY_KEY_STORE_PASSWORD,
"org.jboss.remoting.keyStorePassword");
configMap.put(StubExt.PROPERTY_KEY_STORE_TYPE,
"org.jboss.remoting.keyStoreType");
@@ -102,7 +98,9 @@
}
private boolean closed;
-
+
+ private static final RMChannel RM_CHANNEL = RMChannel.getInstance();
+
public RemotingConnectionImpl()
{
// HTTPClientInvoker conect sends gratuitous POST
@@ -162,37 +160,83 @@
// setup remoting client
Map<String, Object> metadata = createRemotingMetaData(reqMessage,
callProps);
- Client client = createRemotingClient(endpoint, targetAddress, oneway);
-
+ Marshaller marshaller = getMarshaller();
+ UnMarshaller unmarshaller = getUnmarshaller();
+ InvokerLocator locator = null;
try
{
- if (log.isDebugEnabled())
- log.debug("Remoting metadata: " + metadata);
+ // Get the invoker from Remoting for a given endpoint address
+ log.debug("Get locator for: " + endpoint);
+
+ /**
+ * [JBWS-1704] The Use Of Remoting Causes An Additional 'datatype'
Parameter To Be Sent On All Requests
+ *
+ * An HTTPClientInvoker may disconnect from the server and recreated by the
remoting layer.
+ * In that case the new invoker does not inherit the marshaller/unmarshaller
from the disconnected invoker.
+ * We therefore explicitly specify the invoker locator datatype and register the
SOAP marshaller/unmarshaller
+ * with the MarshalFactory.
+ *
+ * This applies to remoting-1.4.5 and less
+ */
+ String version = getRemotingVersion();
+ if (version.startsWith("1.4"))
+ {
+ targetAddress = addURLParameter(targetAddress, InvokerLocator.DATATYPE,
"JBossWSMessage");
+ MarshalFactory.addMarshaller("JBossWSMessage", marshaller,
unmarshaller);
+ }
- // debug the outgoing message
- MessageTrace.traceMessage("Outgoing Request Message", reqMessage);
+ locator = new InvokerLocator(targetAddress);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new IllegalArgumentException("Malformed endpoint address", e);
+ }
- MessageAbstraction resMessage = null;
-
- if (oneway == true)
+ try
+ {
+ if (RMHelper.isRMMessage(reqMessage))
{
- client.invokeOneway(reqMessage, metadata, false);
+ RMMetadata rmMetadata = new RMMetadata(targetAddress, oneway, marshaller,
unmarshaller, callProps, metadata, clientConfig);
+ return RM_CHANNEL.send(reqMessage, rmMetadata);
}
- else
+ else
{
- resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata);
- }
+ Client client = new Client(locator, "jbossws", clientConfig);
+ client.connect();
- // Disconnect the remoting client
- client.disconnect();
+ client.setMarshaller(marshaller);
- callProps.clear();
- callProps.putAll(metadata);
+ if (oneway == false)
+ client.setUnMarshaller(unmarshaller);
+
+ if (log.isDebugEnabled())
+ log.debug("Remoting metadata: " + metadata);
- // trace the incomming response message
- MessageTrace.traceMessage("Incoming Response Message", resMessage);
+ // debug the outgoing message
+ MessageTrace.traceMessage("Outgoing Request Message", reqMessage);
- return resMessage;
+ MessageAbstraction resMessage = null;
+
+ if (oneway == true)
+ {
+ client.invokeOneway(reqMessage, metadata, false);
+ }
+ else
+ {
+ resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata);
+ }
+
+ // Disconnect the remoting client
+ client.disconnect();
+
+ callProps.clear();
+ callProps.putAll(metadata);
+
+ // trace the incomming response message
+ MessageTrace.traceMessage("Incoming Response Message",
resMessage);
+
+ return resMessage;
+ }
}
catch (Throwable th)
{
@@ -206,7 +250,7 @@
throw io;
}
}
-
+
private String addURLParameter(String urlStr, String key, String value) throws
MalformedURLException
{
URL url = new URL(urlStr);
@@ -214,54 +258,6 @@
return urlStr;
}
- private Client createRemotingClient(Object endpoint, String targetAddress, boolean
oneway)
- {
- Client client;
- try
- {
- // Get the invoker from Remoting for a given endpoint address
- log.debug("Get locator for: " + endpoint);
-
- Marshaller marshaller = getMarshaller();
- UnMarshaller unmarshaller = getUnmarshaller();
-
- /**
- * [JBWS-1704] The Use Of Remoting Causes An Additional 'datatype'
Parameter To Be Sent On All Requests
- *
- * An HTTPClientInvoker may disconnect from the server and recreated by the
remoting layer.
- * In that case the new invoker does not inherit the marshaller/unmarshaller
from the disconnected invoker.
- * We therefore explicitly specify the invoker locator datatype and register the
SOAP marshaller/unmarshaller
- * with the MarshalFactory.
- *
- * This applies to remoting-1.4.5 and less
- */
- String version = getRemotingVersion();
- if (version.startsWith("1.4"))
- {
- targetAddress = addURLParameter(targetAddress, InvokerLocator.DATATYPE,
"JBossWSMessage");
- MarshalFactory.addMarshaller("JBossWSMessage", marshaller,
unmarshaller);
- }
-
- InvokerLocator locator = new InvokerLocator(targetAddress);
- client = new Client(locator, "jbossws", clientConfig);
- client.connect();
-
- client.setMarshaller(marshaller);
-
- if (oneway == false)
- client.setUnMarshaller(unmarshaller);
- }
- catch (MalformedURLException e)
- {
- throw new IllegalArgumentException("Malformed endpoint address", e);
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Could not setup remoting client",
e);
- }
- return client;
- }
-
private String getRemotingVersion()
{
String version = null;
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-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -30,6 +30,8 @@
import java.util.Map;
import java.util.Observable;
import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
@@ -37,6 +39,8 @@
import javax.xml.ws.BindingProvider;
import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.HandlerResolver;
import javax.xml.ws.handler.MessageContext;
@@ -61,6 +65,14 @@
import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
+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.metadata.config.Configurable;
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
@@ -74,7 +86,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 04-Jul-2006
*/
-public class ClientImpl extends CommonClient implements BindingProvider21, Configurable
+public class ClientImpl extends CommonClient implements RMProvider, BindingProvider21,
Configurable
{
// provide logging
private static Logger log = Logger.getLogger(ClientImpl.class);
@@ -88,6 +100,26 @@
private Map<HandlerType, HandlerChainExecutor> executorMap = new
HashMap<HandlerType, HandlerChainExecutor>();
private static HandlerType[] HANDLER_TYPES = new HandlerType[] { HandlerType.PRE,
HandlerType.ENDPOINT, HandlerType.POST };
+ // WS-RM locking utility
+ private final Lock wsrmLock = new ReentrantLock();
+ // WS-RM sequence associated with the proxy
+ private RMSequence wsrmSequence;
+
+ public final Lock getWSRMLock()
+ {
+ return this.wsrmLock;
+ }
+
+ public final void setWSRMSequence(RMSequence wsrmSequence)
+ {
+ this.wsrmSequence = wsrmSequence;
+ }
+
+ public final RMSequence getWSRMSequence()
+ {
+ return this.wsrmSequence;
+ }
+
public ClientImpl(EndpointMetaData epMetaData, HandlerResolver handlerResolver)
{
super(epMetaData);
@@ -228,16 +260,38 @@
// Invoked by the proxy invokation handler
public Object invoke(QName opName, Object[] args, Map<String, Object>
resContext) throws RemoteException
{
- // Associate a message context with the current thread
- CommonMessageContext msgContext = new SOAPMessageContextJAXWS();
- MessageContextAssociation.pushMessageContext(msgContext);
+ this.wsrmLock.lock();
- // The contents of the request context are used to initialize the message context
(see section 9.4.1)
- // prior to invoking any handlers (see chapter 9) for the outbound message. Each
property within the
- // request context is copied to the message context with a scope of HANDLER.
- Map<String, Object> reqContext = getBindingProvider().getRequestContext();
- msgContext.putAll(reqContext);
+ try
+ {
+ // Associate a message context with the current thread
+ CommonMessageContext msgContext = new SOAPMessageContextJAXWS();
+ MessageContextAssociation.pushMessageContext(msgContext);
+ // The contents of the request context are used to initialize the message
context (see section 9.4.1)
+ // prior to invoking any handlers (see chapter 9) for the outbound message. Each
property within the
+ // request context is copied to the message context with a scope of HANDLER.
+ Map<String, Object> reqContext =
getBindingProvider().getRequestContext();
+
+ if (this.wsrmSequence != null)
+ {
+ if (RMConstant.PROTOCOL_OPERATION_QNAMES.contains(opName) == false)
+ {
+ Map<String, Object> rmRequestContext = new HashMap<String,
Object>();
+ QName sequenceQName = Provider.get().getConstants().getSequenceQName();
+ rmRequestContext.put(RMConstant.OPERATION_QNAME, sequenceQName);
+ rmRequestContext.put(RMConstant.SEQUENCE_REFERENCE, wsrmSequence);
+ reqContext.put(RMConstant.REQUEST_CONTEXT, rmRequestContext);
+ }
+ }
+
+ msgContext.putAll(reqContext);
+ }
+ finally
+ {
+ this.wsrmLock.unlock();
+ }
+
try
{
Object retObj = invoke(opName, args, false);
@@ -259,7 +313,7 @@
finally
{
// Copy the inbound msg properties to the binding's response context
- msgContext = MessageContextAssociation.peekMessageContext();
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
for (String key : msgContext.keySet())
{
Object value = msgContext.get(key);
@@ -416,4 +470,48 @@
Object bool = getRequestContext().get(BindingProvider.SESSION_MAINTAIN_PROPERTY);
return Boolean.TRUE.equals(bool);
}
-}
\ No newline at end of file
+
+ ///////////////////
+ // WS-RM support //
+ ///////////////////
+ @SuppressWarnings("unchecked")
+ public RMSequence createSequence() throws RMException
+ {
+ this.getWSRMLock().lock();
+ try
+ {
+ if (this.wsrmSequence != null)
+ throw new IllegalStateException("Sequence already registered with proxy
instance");
+
+ try
+ {
+ // set up addressing data
+ String address = getEndpointMetaData().getEndpointAddress();
+ String action = RMConstant.CREATE_SEQUENCE_WSA_ACTION;
+ AddressingProperties addressingProps =
AddressingClientUtil.createAnonymousProps(action, address);
+ Map requestContext = getBindingProvider().getRequestContext();
+ requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
addressingProps);
+ // set up wsrm request context
+ QName createSequenceQN =
Provider.get().getConstants().getCreateSequenceQName();
+ Map rmRequestContext = new HashMap();
+ rmRequestContext.put(RMConstant.OPERATION_QNAME, createSequenceQN);
+ requestContext.put(RMConstant.REQUEST_CONTEXT, rmRequestContext);
+ // invoke stub method
+ 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)((List)rmResponseContext.get(RMConstant.DATA)).get(0)).getIdentifier();
+ return this.wsrmSequence = new RMSequenceImpl(this, id);
+ }
+ catch (Exception e)
+ {
+ throw new RMException("Unable to create WSRM sequence", e);
+ }
+ }
+ finally
+ {
+ this.getWSRMLock().unlock();
+ }
+ }
+
+}
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-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -48,6 +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.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.wsf.common.JavaUtils;
@@ -91,6 +92,7 @@
this.executor = executor;
this.stubMethods = new
ArrayList(Arrays.asList(BindingProvider.class.getMethods()));
this.stubMethods.addAll(Arrays.asList(StubExt.class.getMethods()));
+ this.stubMethods.addAll(Arrays.asList(RMProvider.class.getMethods()));
this.objectMethods = Arrays.asList(Object.class.getMethods());
}
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-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -57,6 +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.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
@@ -391,7 +392,7 @@
T proxy;
try
{
- proxy = (T)Proxy.newProxyInstance(cl, new Class[] { seiClass,
BindingProvider.class, StubExt.class }, handler);
+ proxy = (T)Proxy.newProxyInstance(cl, new Class[] { seiClass,
RMProvider.class, BindingProvider.class, StubExt.class }, handler);
}
catch (RuntimeException rte)
{
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-11-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -39,6 +39,7 @@
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAlternative;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy;
+import org.jboss.ws.extensions.wsrm.policy.RMPolicyAssertionDeployer;
import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
/**
@@ -56,6 +57,7 @@
{
me = new PolicyDeployer();
me.domainDeployerMap.put("http://www.jboss.com/ws-security/schema/jb...;,
WSSecurityAssertionDeployer.class);
+
me.domainDeployerMap.put("http://docs.oasis-open.org/ws-rx/wsrmp/200...;,
RMPolicyAssertionDeployer.class);
}
//hide constructor
@@ -82,6 +84,7 @@
{
PolicyDeployer instance = new PolicyDeployer();
instance.domainDeployerMap.put("http://www.jboss.com/ws-security/sch...;,
NopAssertionDeployer.class);
+
instance.domainDeployerMap.put("http://docs.oasis-open.org/ws-rx/wsr...;,
NopAssertionDeployer.class);
return instance;
}
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssurance.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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();
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssurance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssuranceFactory.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryAssuranceFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryQuality.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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);
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/DeliveryQuality.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannel.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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;
+
+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/RMChannel.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelRequest.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,110 @@
+/*
+ * 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.INVOCATION_CONTEXT;
+import static org.jboss.ws.extensions.wsrm.RMConstant.ONE_WAY_OPERATION;
+import static org.jboss.ws.extensions.wsrm.RMConstant.REMOTING_CONFIGURATION_CONTEXT;
+import static org.jboss.ws.extensions.wsrm.RMConstant.REMOTING_INVOCATION_CONTEXT;
+import static org.jboss.ws.extensions.wsrm.RMConstant.TARGET_ADDRESS;
+
+import java.net.MalformedURLException;
+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.ws.core.MessageTrace;
+
+/**
+ * Represents request that goes to the RM channel
+ * @see org.jboss.ws.extensions.wsrm.RMChannel
+ * @author richard.opalka(a)jboss.com
+ */
+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 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());
+
+ boolean oneWay =
(Boolean)rmRequest.getMetadata().getContext(RMConstant.INVOCATION_CONTEXT).get(ONE_WAY_OPERATION);
+ 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());
+
+ 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/RMChannelRequest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelResponse.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,60 @@
+/*
+ * 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 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;
+
+ public RMChannelResponse(Throwable fault)
+ {
+ this(null, fault);
+ }
+
+ public RMChannelResponse(RMMessage result)
+ {
+ this(result, null);
+ }
+
+ private RMChannelResponse(RMMessage result, Throwable fault)
+ {
+ super();
+ this.result = result;
+ this.fault = fault;
+ }
+
+ public Throwable getFault()
+ {
+ return this.fault;
+ }
+
+ public RMMessage getResponse()
+ {
+ return this.result;
+ }
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMChannelResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,182 @@
+/*
+ * 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.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+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.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.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.Serializable;
+import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
+
+/**
+ * TODO: add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 23, 2007
+ */
+@SuppressWarnings("unchecked")
+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 Set headers;
+
+ static
+ {
+ Set temp = new HashSet();
+ temp.add(rmConstants.getCreateSequenceQName());
+ temp.add(rmConstants.getCloseSequenceQName());
+ temp.add(rmConstants.getTerminateSequenceQName());
+ temp.add(rmConstants.getCreateSequenceResponseQName());
+ temp.add(rmConstants.getCloseSequenceResponseQName());
+ temp.add(rmConstants.getTerminateSequenceResponseQName());
+ headers = Collections.unmodifiableSet(temp);
+ }
+
+ public Set getHeaders()
+ {
+ return headers;
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ log.debug("WS-RM handleOutbound");
+
+ CommonMessageContext commonMsgContext = (CommonMessageContext)msgContext;
+ SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)commonMsgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ Map rmRequestContext = (Map)commonMsgContext.get(RMConstant.REQUEST_CONTEXT);
+ QName operation = (QName)rmRequestContext.get(RMConstant.OPERATION_QNAME);
+ if (addrProps != null)
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)commonMsgContext).getMessage();
+ if (rmConstants.getCreateSequenceQName().equals(operation))
+ {
+ String replyTo = addrProps.getReplyTo().getAddress().getURI().toString();
+ CreateSequence createSequence = rmFactory.newCreateSequence();
+ createSequence.setAcksTo(replyTo);
+ createSequence.serializeTo(soapMessage);
+ List<Serializable> data = new LinkedList<Serializable>();
+ data.add(createSequence);
+ rmRequestContext.put(RMConstant.DATA, data);
+
+ return true;
+ }
+
+ if (rmConstants.getSequenceQName().equals(operation))
+ {
+ RMSequenceImpl sequenceImpl =
(RMSequenceImpl)rmRequestContext.get(RMConstant.SEQUENCE_REFERENCE);
+ Sequence sequence = rmFactory.newSequence();
+ sequence.setIdentifier(sequenceImpl.getId());
+ sequence.setMessageNumber(sequenceImpl.newMessageNumber());
+ sequence.serializeTo(soapMessage);
+
+ List<Serializable> data = new LinkedList<Serializable>();
+ data.add(sequence);
+
+ if (commonMsgContext.getOperationMetaData().isOneWay() == false)
+ {
+ // TODO: ask msgStore if there are other sequences related to the same
+ // endpoint that requires ack and serialize it here
+ AckRequested ackRequested = rmFactory.newAckRequested();
+ ackRequested.setIdentifier(sequenceImpl.getId());
+ ackRequested.setMessageNumber(sequenceImpl.getLastMessageNumber());
+ ackRequested.serializeTo(soapMessage);
+ data.add(ackRequested);
+ }
+ rmRequestContext.put(RMConstant.DATA, data);
+
+ return true;
+ }
+
+ if (rmConstants.getTerminateSequenceQName().equals(operation))
+ {
+ RMSequenceImpl sequenceImpl =
(RMSequenceImpl)rmRequestContext.get(RMConstant.SEQUENCE_REFERENCE);
+ TerminateSequence terminateSequence = rmFactory.newTerminateSequence();
+ terminateSequence.setIdentifier(sequenceImpl.getId());
+ terminateSequence.setLastMsgNumber(sequenceImpl.getLastMessageNumber());
+ terminateSequence.serializeTo(soapMessage);
+
+ List<Serializable> data = new LinkedList<Serializable>();
+ data.add(terminateSequence);
+ rmRequestContext.put(RMConstant.DATA, data);
+
+ return true;
+ }
+ }
+ else
+ {
+ throw new IllegalStateException();
+ }
+
+ return true;
+ }
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ log.debug("WS-RM handleInbound");
+
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ // TODO: inspect operation type different way - don't forget on piggy-backing
+ Map rmRequestContext = (Map)msgContext.get(RMConstant.REQUEST_CONTEXT);
+ QName operation = (QName)rmRequestContext.get(RMConstant.OPERATION_QNAME);
+ if (rmConstants.getCreateSequenceQName().equals(operation))
+ {
+ CreateSequenceResponse createSequenceResponse =
rmFactory.newCreateSequenceResponse();
+ createSequenceResponse.deserializeFrom(soapMessage);
+ List<Serializable> data = new LinkedList<Serializable>();
+ data.add(createSequenceResponse);
+ Map rmResponseContext = new HashMap();
+ rmResponseContext.put(RMConstant.OPERATION_QNAME,
rmConstants.getCreateSequenceResponseQName());
+ rmResponseContext.put(RMConstant.DATA, data);
+ msgContext.put(RMConstant.RESPONSE_CONTEXT, rmResponseContext);
+ msgContext.setScope(RMConstant.RESPONSE_CONTEXT, Scope.APPLICATION);
+ }
+
+ return true;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,56 @@
+package org.jboss.ws.extensions.wsrm;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.wsrm.spi.Constants;
+import org.jboss.ws.extensions.wsrm.spi.Provider;
+
+public final class RMConstant
+{
+ private static final String PREFIX = RMConstant.class.getName();
+ public static final String TARGET_ADDRESS = PREFIX + ".targetAddress";
+ public static final String ONE_WAY_OPERATION = PREFIX + ".oneWayOperation";
+ public static final String INVOCATION_CONTEXT = PREFIX +
".invocationContext";
+ public static final String MARSHALLER = PREFIX + ".marshaller";
+ public static final String UNMARSHALLER = PREFIX + ".unmarshaller";
+ public static final String SERIALIZATION_CONTEXT = PREFIX +
".serializationContext";
+ public static final String REMOTING_INVOCATION_CONTEXT = PREFIX +
".remotingInvocationContext";
+ public static final String REMOTING_CONFIGURATION_CONTEXT = PREFIX +
".remotingConfigurationContext";
+ public static final String OPERATION_QNAME = PREFIX + ".operationType";
+ public static final String REQUEST_CONTEXT = PREFIX + ".requestContext";
+ public static final String RESPONSE_CONTEXT = PREFIX + ".responseContext";
+ public static final String SEQUENCE_REFERENCE = PREFIX +
".sequenceReference";
+ public static final String DATA = PREFIX + ".data";
+ // WS-Addressing related actions
+ public static final String CREATE_SEQUENCE_WSA_ACTION;
+ public static final String TERMINATE_SEQUENCE_WSA_ACTION;
+
+ public static final List<QName> PROTOCOL_OPERATION_QNAMES;
+
+ static
+ {
+ LinkedList<QName> temp = new LinkedList<QName>();
+ Constants constants = Provider.get().getConstants();
+ temp.add(constants.getCreateSequenceQName());
+ temp.add(constants.getCreateSequenceResponseQName());
+ temp.add(constants.getSequenceQName());
+ temp.add(constants.getAckRequestedQName());
+ temp.add(constants.getCloseSequenceQName());
+ temp.add(constants.getSequenceAcknowledgementQName());
+ temp.add(constants.getCloseSequenceResponseQName());
+ temp.add(constants.getTerminateSequenceQName());
+ temp.add(constants.getTerminateSequenceResponseQName());
+ PROTOCOL_OPERATION_QNAMES = Collections.unmodifiableList(temp);
+ CREATE_SEQUENCE_WSA_ACTION = Provider.get().getConstants().getNamespaceURI() +
"/CreateSequence";
+ TERMINATE_SEQUENCE_WSA_ACTION = Provider.get().getConstants().getNamespaceURI() +
"/TerminateSequence";
+ }
+
+ private RMConstant()
+ {
+ // no instances
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHelper.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,17 @@
+package org.jboss.ws.extensions.wsrm;
+
+import org.jboss.ws.core.MessageAbstraction;
+
+public final class RMHelper
+{
+ private RMHelper()
+ {
+ // no instances
+ }
+
+ public static boolean isRMMessage(MessageAbstraction requestMessage)
+ {
+ // TODO: here is the most suitable place to start RM resender
+ return (new java.io.File("/home/ropalka/rm.enabled").exists()) &&
(requestMessage != null);
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMarshaller.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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;
+
+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/RMMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessage.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,7 @@
+package org.jboss.ws.extensions.wsrm;
+
+public interface RMMessage
+{
+ byte[] getPayload();
+ RMMetadata getMetadata();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessage.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageFactory.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,14 @@
+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);
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,28 @@
+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;
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMessageImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMetadata.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,64 @@
+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);
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMMetadata.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,209 @@
+/*
+ * 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.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+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;
+
+/**
+ * TODO: all termination methods such as terminate, discard, ... etc must unregister the
sequence from client
+ * Reliable messaging sequence implementation
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 25, 2007
+ */
+@SuppressWarnings("unchecked")
+public final class RMSequenceImpl implements RMSequence
+{
+ private final String id;
+ private final ClientImpl client;
+ // object states variables
+ private boolean terminated = false;
+ private boolean discarded = false;
+ private AtomicLong messageNumber = new AtomicLong();
+ private final Lock objectLock = new ReentrantLock();
+
+ public RMSequenceImpl(ClientImpl client, String id)
+ {
+ super();
+ this.client = client;
+ this.id = id;
+ }
+
+ public final long newMessageNumber()
+ {
+ this.objectLock.lock();
+ try
+ {
+ return this.messageNumber.incrementAndGet();
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+
+ public final long getLastMessageNumber()
+ {
+ this.objectLock.lock();
+ try
+ {
+ return this.messageNumber.get();
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+
+ public final void discard() throws RMException
+ {
+ this.objectLock.lock();
+ try
+ {
+ this.client.getWSRMLock().lock();
+ try
+ {
+ this.client.setWSRMSequence(null);
+ this.discarded = true;
+ }
+ finally
+ {
+ this.client.getWSRMLock().unlock();
+ }
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+
+ /**
+ * Sets up terminated flag to true.
+ */
+ public final void terminate() throws RMException
+ {
+ this.objectLock.lock();
+ try
+ {
+ if (this.terminated)
+ return;
+
+ this.terminated = true;
+
+ client.getWSRMLock().lock();
+ try
+ {
+ try
+ {
+ // set up addressing properties
+ String address = client.getEndpointMetaData().getEndpointAddress();
+ String action = RMConstant.TERMINATE_SEQUENCE_WSA_ACTION;
+ AddressingProperties props =
AddressingClientUtil.createAnonymousProps(action, address);
+ // prepare WS-RM request context
+ QName terminateSequenceQN =
Provider.get().getConstants().getTerminateSequenceQName();
+ Map rmRequestContext = new HashMap();
+ rmRequestContext.put(RMConstant.OPERATION_QNAME, terminateSequenceQN);
+ rmRequestContext.put(RMConstant.SEQUENCE_REFERENCE,
client.getWSRMSequence());
+ // set up method invocation context
+ Map requestContext = client.getBindingProvider().getRequestContext();
+ requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
props);
+ requestContext.put(RMConstant.REQUEST_CONTEXT, rmRequestContext);
+ // call stub method
+ this.client.invoke(terminateSequenceQN, new Object[] {},
client.getBindingProvider().getResponseContext());
+ }
+ catch (Exception e)
+ {
+ throw new RMException("Unable to terminate WSRM sequence", e);
+ }
+ finally
+ {
+ this.client.setWSRMSequence(null); // TODO: do not remove this
+ }
+ }
+ finally
+ {
+ this.client.getWSRMLock().unlock();
+ }
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+
+ public final boolean isCompleted()
+ {
+ return true;
+ }
+
+ public final boolean isCompleted(int timeAmount, TimeUnit timeUnit)
+ {
+ return true;
+ }
+
+ public final String getId()
+ {
+ return id;
+ }
+
+ public final boolean isTerminated()
+ {
+ this.objectLock.lock();
+ try
+ {
+ return this.terminated;
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+
+ public final boolean isDiscarded()
+ {
+ this.objectLock.lock();
+ try
+ {
+ return this.discarded;
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMUnMarshaller.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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;
+
+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/RMUnMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMException.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMException.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMException.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.client_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/client_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/client_api/RMProvider.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMProvider.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMProvider.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,34 @@
+/*
+ * 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.client_api;
+
+/**
+ * TODO: add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 22, 2007
+ */
+public interface RMProvider
+{
+ RMSequence createSequence() throws RMException;
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_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/client_api/RMSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMSequence.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMSequence.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,35 @@
+/*
+ * 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.client_api;
+
+import java.util.concurrent.TimeUnit;
+
+public interface RMSequence
+{
+ void discard() throws RMException;
+ boolean isDiscarded() throws RMException;
+ void terminate() throws RMException;
+ boolean isTerminated() throws RMException;
+ String getId() 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/client_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/common/ConstantsImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/ConstantsImpl.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/ConstantsImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/ConstantsImpl.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/AbstractSerializable.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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();
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.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/AckRequestedSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.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/CloseSequenceResponseSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.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/CloseSequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.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/CreateSequenceResponseSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.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/CreateSequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.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/SequenceAcknowledgementSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.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/SequenceFaultSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.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/SequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.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/SerializationHelper.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.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/SerializationRepository.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.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/Serializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/Serializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/Serializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/Serializer.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/TerminateSequenceResponseSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.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/TerminateSequenceSerializer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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);
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RMPolicyAssertionDeployer.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.policy;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ws.policy.AndCompositeAssertion;
+import org.apache.ws.policy.Policy;
+import org.apache.ws.policy.PrimitiveAssertion;
+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.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
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMPolicyAssertionDeployer implements AssertionDeployer
+{
+
+ private static final String WSRMP_NS =
"http://docs.oasis-open.org/ws-rx/wsrmp/200702";
+ private static final String WSRM_NS =
"http://docs.oasis-open.org/ws-rx/wsrm/200702";
+ private static final QName EXACTLY_ONCE = new QName(WSRMP_NS,
"ExactlyOnce");
+ private static final QName AT_LEAST_ONCE = new QName(WSRMP_NS,
"AtLeastOnce");
+ private static final QName AT_MOST_ONCE = new QName(WSRMP_NS,
"AtMostOnce");
+ private static final QName IN_ORDER = new QName(WSRMP_NS, "InOrder");
+ private static final String FALSE = "false";
+ private static final String TRUE = "true";
+
+ /*
+ * @see
org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer#deployClientSide(org.apache.ws.policy.PrimitiveAssertion,
org.jboss.ws.metadata.umdm.ExtensibleMetaData)
+ */
+ public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData
extMetaData)
+ throws UnsupportedAssertion
+ {
+ deploy(assertion, extMetaData);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer#deployServerSide(org.apache.ws.policy.PrimitiveAssertion,
org.jboss.ws.metadata.umdm.ExtensibleMetaData)
+ */
+ public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData
extMetaData)
+ throws UnsupportedAssertion
+ {
+ deploy(assertion, extMetaData);
+ }
+
+ private static void deploy(PrimitiveAssertion assertion, ExtensibleMetaData
extMetaData)
+ throws UnsupportedAssertion
+ {
+ if (extMetaData instanceof EndpointMetaData)
+ {
+ EndpointMetaData endpointMD = (EndpointMetaData) extMetaData;
+
+ // prepare wsrm metadata
+ ReliableMessagingMetaData rmMD = endpointMD.getConfig().getRMMetaData();
+ if (rmMD == null)
+ {
+ rmMD = new ReliableMessagingMetaData();
+ endpointMD.getConfig().setRMMetaData(rmMD);
+ }
+
+ // construct new port metadata
+ PortMetaData portMD = new PortMetaData();
+ portMD.setPortName(endpointMD.getPortName());
+ List<PrimitiveAssertion> wsrmpAssertions = getWSRMPAssertions(assertion);
+ portMD.setDeliveryAssurance(constructDeliveryAssurance(wsrmpAssertions));
+
+ // ensure port does not exists yet
+ for (PortMetaData pMD : rmMD.getPorts())
+ {
+ assert ! pMD.getPortName().equals(portMD.getPortName());
+ }
+
+ // set up port WSRMP metadata
+ rmMD.getPorts().add(portMD);
+ ProviderMetaData providerMD = new ProviderMetaData();
+ providerMD.setSpecVersion(WSRM_NS);
+ rmMD.setProvider(providerMD);
+ }
+ }
+
+ private static DeliveryAssuranceMetaData
constructDeliveryAssurance(List<PrimitiveAssertion> assertions)
+ throws UnsupportedAssertion
+ {
+ if (assertions.size() == 1)
+ {
+ QName assertionQN = assertions.get(0).getName();
+ assertIsWSRMPAssertion(assertionQN);
+
+ DeliveryAssuranceMetaData deliveryMD = new DeliveryAssuranceMetaData();
+ deliveryMD.setInOrder(FALSE);
+ deliveryMD.setQuality(assertionQN.getLocalPart());
+ return deliveryMD;
+ }
+ if (assertions.size() == 2)
+ {
+ QName firstAssertionQN = assertions.get(0).getName();
+ assertIsWSRMPAssertion(firstAssertionQN);
+ QName secondAssertionQN = assertions.get(1).getName();
+ assertIsWSRMPAssertion(secondAssertionQN);
+
+ boolean firstIsInOrder = firstAssertionQN.equals(IN_ORDER);
+
+ DeliveryAssuranceMetaData deliveryMD = new DeliveryAssuranceMetaData();
+ deliveryMD.setInOrder(TRUE);
+ if (firstIsInOrder)
+ {
+ deliveryMD.setQuality(secondAssertionQN.getLocalPart());
+ }
+ else
+ {
+ deliveryMD.setQuality(firstAssertionQN.getLocalPart());
+ }
+
+ return deliveryMD;
+ }
+
+ throw new IllegalArgumentException();
+ }
+
+ private static void assertIsWSRMPAssertion(QName assertionQN) throws
UnsupportedAssertion
+ {
+ if (assertionQN.equals(EXACTLY_ONCE)
+ || assertionQN.equals(AT_LEAST_ONCE)
+ || assertionQN.equals(AT_MOST_ONCE)
+ || assertionQN.equals(IN_ORDER))
+ {
+ return; // recognized assertion - silently return
+ }
+
+ throw new UnsupportedAssertion();
+ }
+
+ private static List<PrimitiveAssertion> getWSRMPAssertions(PrimitiveAssertion
assertion)
+ {
+ Policy policy = (Policy)assertion.getTerms().get(0);
+ XorCompositeAssertion xor = (XorCompositeAssertion)policy.getTerms().get(0);
+ AndCompositeAssertion and = (AndCompositeAssertion)xor.getTerms().get(0);
+ List<?> primitiveAssertions = and.getTerms();
+
+ List<PrimitiveAssertion> retVal = new
LinkedList<PrimitiveAssertion>();
+ for (int i = 0; i < primitiveAssertions.size(); i++)
+ {
+ retVal.add((PrimitiveAssertion)primitiveAssertions.get(i));
+ }
+
+ return retVal;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RMPolicyAssertionDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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;
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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;
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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 + ">";
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/AckRequestedImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/AckRequestedImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceResponseImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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;
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceResponseImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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;
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/MessageFactoryImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/MessageFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/ProviderImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/ProviderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceAcknowledgementImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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 + ">";
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceAcknowledgementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceFaultImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceFaultImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceResponseImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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");
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Constants.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Constants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/MessageFactory.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/MessageFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Provider.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/Provider.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/AckRequested.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/AckRequested.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/AckRequested.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/AckRequested.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/CloseSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequence.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequence.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequence.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/CloseSequenceResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequenceResponse.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequenceResponse.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CloseSequenceResponse.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/CreateSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequence.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequence.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequence.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/CreateSequenceResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequenceResponse.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequenceResponse.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/CreateSequenceResponse.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/IncompleteSequenceBehavior.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/IncompleteSequenceBehavior.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/IncompleteSequenceBehavior.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/IncompleteSequenceBehavior.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/Sequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.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/SequenceAcknowledgement.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceAcknowledgement.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceAcknowledgement.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+ }
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceAcknowledgement.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/SequenceFault.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFault.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFault.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFault.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/SequenceFaultCode.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFaultCode.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFaultCode.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/SequenceFaultCode.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/Serializable.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.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;
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.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/TerminateSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequence.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequence.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequence.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/TerminateSequenceResponse.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequenceResponse.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequenceResponse.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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 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();
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/TerminateSequenceResponse.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-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -36,6 +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.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -111,6 +112,30 @@
}
}
+ private void setupRMOperations(EndpointMetaData endpointMD)
+ {
+ String rmSpecVersion =
endpointMD.getConfig().getRMMetaData().getProvider().getSpecVersion();
+ Provider rmProvider = Provider.getInstance(rmSpecVersion);
+
+ // register createSequence method
+ QName createSequenceQName = rmProvider.getConstants().getCreateSequenceQName();
+ OperationMetaData createSequenceMD = new OperationMetaData(endpointMD,
createSequenceQName, "createSequence");
+ createSequenceMD.setOneWay(false);
+ endpointMD.addOperation(createSequenceMD);
+
+ // register closeSequence method
+ QName closeSequenceQName = rmProvider.getConstants().getCloseSequenceQName();
+ OperationMetaData closeSequenceMD = new OperationMetaData(endpointMD,
closeSequenceQName, "closeSequence");
+ closeSequenceMD.setOneWay(false);
+ endpointMD.addOperation(closeSequenceMD);
+
+ // register terminateSequence method
+ QName terminateSequenceQName =
rmProvider.getConstants().getTerminateSequenceQName();
+ OperationMetaData terminateSequenceMD = new OperationMetaData(endpointMD,
terminateSequenceQName, "terminateSequence");
+ terminateSequenceMD.setOneWay(false);
+ endpointMD.addOperation(terminateSequenceMD);
+ }
+
/** Build from WSDL and service name
*/
public ServiceMetaData buildMetaData(QName serviceName, URL wsdlURL)
@@ -312,6 +337,12 @@
// Eager initialization
epMetaData.eagerInitialize();
+ // wsrm initialization
+ if (epMetaData.getConfig().getRMMetaData() != null)
+ {
+ setupRMOperations(epMetaData);
+ }
+
if(log.isDebugEnabled()) log.debug("END: rebuildMetaData\n" +
epMetaData.getServiceMetaData());
}
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-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -30,6 +30,7 @@
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;
/**
@@ -41,6 +42,7 @@
public abstract class CommonConfig
{
private String configName;
+ private ReliableMessagingMetaData wsrmCfg;
private List<URI> features = new ArrayList<URI>();
private List<EndpointProperty> properties = new
ArrayList<EndpointProperty>();
@@ -64,7 +66,7 @@
{
return hasFeature(nameToURI(uri));
}
-
+
public void setFeature(String type, boolean enabled) {
if(enabled) {
@@ -74,6 +76,16 @@
features.remove(nameToURI(type));
}
+ public void setRMMetaData(ReliableMessagingMetaData wsrmCfg)
+ {
+ this.wsrmCfg = wsrmCfg;
+ }
+
+ public ReliableMessagingMetaData getRMMetaData()
+ {
+ return this.wsrmCfg;
+ }
+
public void addProperty(String name, String value)
{
EndpointProperty p = new EndpointProperty();
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-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -23,6 +23,8 @@
//$Id$
+import javax.xml.namespace.QName;
+
import org.jboss.logging.Logger;
import org.jboss.ws.metadata.config.EndpointProperty;
import org.jboss.ws.metadata.config.jaxws.ClientConfigJAXWS;
@@ -30,10 +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;
/**
* ObjectModelFactory for JAXRPC configurations.
@@ -122,10 +132,117 @@
commonConfig.setPostHandlerChains(postHandlerChains);
return postHandlerChains;
}
+ if ("reliable-messaging".equals(localName))
+ {
+ ReliableMessagingMetaData wsrmCfg = new ReliableMessagingMetaData();
+ commonConfig.setRMMetaData(wsrmCfg);
+ return wsrmCfg;
+ }
return null;
}
+
+ public Object newChild(ReliableMessagingMetaData wsrmConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ int countOfAttributes = attrs.getLength();
+ if (localName.equals("delivery-assurance"))
+ {
+ DeliveryAssuranceMetaData deliveryAssurance = getDeliveryAssurance(attrs);
+ wsrmConfig.setDeliveryAssurance(deliveryAssurance);
+ return deliveryAssurance;
+ }
+ if (localName.equals("provider"))
+ {
+ String specVersion = null;
+ for (int i = 0; i < countOfAttributes; i++)
+ {
+ if (attrs.getLocalName(i).equals("specVersion"))
+ {
+ specVersion = attrs.getValue(i);
+ break;
+ }
+ }
+ ProviderMetaData provider = new ProviderMetaData();
+ provider.setSpecVersion(specVersion);
+ wsrmConfig.setProvider(provider);
+ return provider;
+ }
+ if (localName.equals("message-store"))
+ {
+ String className = null, id = null;
+ for (int i = 0; i < countOfAttributes && (className == null || id ==
null); i++)
+ {
+ String attrLocalName = attrs.getLocalName(i);
+ if (attrLocalName.equals("id"))
+ id = attrs.getValue(i);
+ if (attrLocalName.equals("class"))
+ className = attrs.getValue(i);
+ }
+
+ MessageStoreMetaData messageStore = new MessageStoreMetaData();
+ messageStore.setId(id);
+ messageStore.setClassName(className);
+ wsrmConfig.setMessageStore(messageStore);
+ return messageStore;
+ }
+ if (localName.equals("port"))
+ {
+ String portName = null;
+ for (int i = 0; i < countOfAttributes; i++)
+ {
+ if (attrs.getLocalName(i).equals("name"))
+ {
+ portName = attrs.getValue(i);
+ break;
+ }
+ }
+ PortMetaData port = new PortMetaData();
+ port.setPortName(QName.valueOf(portName));
+ wsrmConfig.getPorts().add(port);
+ return port;
+ }
+
+ return null;
+ }
+
+ public Object newChild(PortMetaData port, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ if (localName.equals("delivery-assurance"))
+ {
+ DeliveryAssuranceMetaData deliveryAssurance = getDeliveryAssurance(attrs);
+ port.setDeliveryAssurance(deliveryAssurance);
+ return deliveryAssurance;
+ }
+
+ return null;
+ }
+
+ private DeliveryAssuranceMetaData getDeliveryAssurance(Attributes attrs)
+ {
+ String inOrder = null, quality = null;
+ for (int i = 0; i < attrs.getLength() && (inOrder == null || quality ==
null); i++)
+ {
+ String attrLocalName = attrs.getLocalName(i);
+ if (attrLocalName.equals("inOrder"))
+ inOrder = attrs.getValue(i);
+ if (attrLocalName.equals("quality"))
+ quality = attrs.getValue(i);
+ }
+ DeliveryAssuranceMetaData deliveryAssurance = new DeliveryAssuranceMetaData();
+ deliveryAssurance.setQuality(quality);
+ deliveryAssurance.setInOrder(inOrder);
+ return deliveryAssurance;
+ }
+
+ public void setValue(MessageStoreMetaData messageStore, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("config-file"))
+ {
+ messageStore.setConfigFile(value);
+ }
+ }
+
/**
* Called when parsing of a new element started.
*/
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-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -64,6 +64,8 @@
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;
@@ -701,11 +703,57 @@
{
log.debug("Create new config [name=" + getConfigName() +
",file=" + getConfigFile() + "]");
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
+ List<PortMetaData> rmPortMetaData = backupRMMD();
config = factory.getConfig(getRootFile(), getConfigName(), getConfigFile());
+ propagateRMMD(rmPortMetaData);
reconfigHandlerMetaData();
}
+ private List<PortMetaData> backupRMMD()
+ {
+ if ((config != null) && (config.getRMMetaData() != null))
+ return config.getRMMetaData().getPorts();
+
+ return null;
+ }
+
+ private void propagateRMMD(List<PortMetaData> backedUpMD)
+ {
+ if ((backedUpMD != null) && (backedUpMD.size() > 0))
+ {
+ if (config.getRMMetaData() == null)
+ {
+ config.setRMMetaData(new ReliableMessagingMetaData());
+ 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)
+ {
+ QName portName = portMD.getPortName();
+ if (!contains(ports, portName))
+ {
+ ports.add(portMD);
+ }
+ }
+ }
+ }
+ }
+
+ private boolean contains(List<PortMetaData> ports, QName portName)
+ {
+ for (PortMetaData pMD : ports)
+ {
+ if (pMD.getPortName().equals(portName))
+ return true;
+ }
+
+ return false;
+ }
+
private void reconfigHandlerMetaData()
{
log.debug("Configure EndpointMetaData");
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/DeliveryAssuranceMetaData.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/DeliveryAssuranceMetaData.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/DeliveryAssuranceMetaData.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.metadata.wsrm;
+
+/**
+ * Delivery assurance metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class DeliveryAssuranceMetaData
+{
+
+ 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/metadata/wsrm/DeliveryAssuranceMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/MessageStoreMetaData.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/MessageStoreMetaData.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/MessageStoreMetaData.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.metadata.wsrm;
+
+/**
+ * Message store metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class MessageStoreMetaData
+{
+
+ 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/metadata/wsrm/MessageStoreMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/PortMetaData.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/PortMetaData.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/PortMetaData.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.metadata.wsrm;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Port customization metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class PortMetaData
+{
+
+ private QName portName;
+ private DeliveryAssuranceMetaData 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(DeliveryAssuranceMetaData deliveryAssurance)
+ {
+ if (deliveryAssurance == null)
+ throw new IllegalArgumentException();
+
+ this.deliveryAssurance = deliveryAssurance;
+ }
+
+ public final DeliveryAssuranceMetaData 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/metadata/wsrm/PortMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ProviderMetaData.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ProviderMetaData.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ProviderMetaData.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.metadata.wsrm;
+
+/**
+ * Reliable messaging provider metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class ProviderMetaData
+{
+
+ 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/metadata/wsrm/ProviderMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ReliableMessagingMetaData.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ReliableMessagingMetaData.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ReliableMessagingMetaData.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.metadata.wsrm;
+
+import java.util.List;
+import java.util.LinkedList;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Reliable messaging configuration metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class ReliableMessagingMetaData
+{
+
+ private DeliveryAssuranceMetaData deliveryAssurance;
+ private ProviderMetaData provider;
+ private MessageStoreMetaData messageStore;
+ private List<PortMetaData> ports = new LinkedList<PortMetaData>();
+
+ public final void setDeliveryAssurance(DeliveryAssuranceMetaData deliveryAssurance)
+ {
+ if (deliveryAssurance == null)
+ throw new IllegalArgumentException();
+
+ this.deliveryAssurance = deliveryAssurance;
+ }
+
+ public final DeliveryAssuranceMetaData getDeliveryAssurance()
+ {
+ return this.deliveryAssurance;
+ }
+
+ public final void setProvider(ProviderMetaData provider)
+ {
+ if (provider == null)
+ throw new IllegalArgumentException();
+
+ this.provider = provider;
+ }
+
+ public final ProviderMetaData getProvider()
+ {
+ return this.provider;
+ }
+
+ public final void setMessageStore(MessageStoreMetaData messageStore)
+ {
+ if (messageStore == null)
+ throw new IllegalArgumentException();
+
+ this.messageStore = messageStore;
+ }
+
+ public final MessageStoreMetaData getMessageStore()
+ {
+ return this.messageStore;
+ }
+
+ public final List<PortMetaData> getPorts()
+ {
+ return this.ports;
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ReliableMessagingMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/src/main/resources/schema/jaxws-config_2_0.xsd
===================================================================
--- stack/native/trunk/src/main/resources/schema/jaxws-config_2_0.xsd 2007-11-05 18:33:05
UTC (rev 4989)
+++ stack/native/trunk/src/main/resources/schema/jaxws-config_2_0.xsd 2007-11-05 21:51:06
UTC (rev 4990)
@@ -3,10 +3,11 @@
<xsd:schema
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:jboss:jaxws-config:2.0"
xmlns:tns="urn:jboss:jaxws-config:2.0"
-
xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
attributeFormDefault="unqualified" version="1.1">
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.1">
<xsd:annotation>
<xsd:documentation>
@@ -33,7 +34,6 @@
</xsd:complexContent>
</xsd:complexType>
- <!-- client config -->
<xsd:complexType name="clientConfigType">
<xsd:complexContent>
<xsd:extension base="tns:commonConfigType"/>
@@ -43,6 +43,7 @@
<xsd:complexType name="commonConfigType">
<xsd:sequence>
<xsd:element name="config-name" type="xsd:string"/>
+ <xsd:element name="reliable-messaging"
type="tns:rmConfigType" minOccurs="0"/>
<xsd:element name="pre-handler-chains"
type="javaee:handler-chainsType" minOccurs="0"/>
<xsd:element name="post-handler-chains"
type="javaee:handler-chainsType" minOccurs="0"/>
<xsd:element name="feature" type="xsd:anyURI"
minOccurs="0" maxOccurs="unbounded"/>
@@ -51,17 +52,133 @@
</xsd:complexType>
<xsd:complexType name="propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- A property models name value pairs.
-
- </xsd:documentation>
- </xsd:annotation>
<xsd:sequence>
<xsd:element name="property-name" type="xsd:anyURI"/>
<xsd:element name="property-value"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
+ <!-- WSRM configuration -->
+ <xsd:complexType name="rmConfigType">
+ <xsd:sequence>
+ <xsd:element name="delivery-assurance"
type="tns:deliveryAssuranceType" minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+ Global WS-RM delivery assurance configuration that applies to all WSDL
ports.
+ If there is the WS-Policy with attached WS-RM assertion in WSDL
+ associated with some port or its associated binding it
+ will always override this global configuration.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="provider" type="tns:providerType">
+ <xsd:annotation>
+ <xsd:documentation>
+ WS-RM specification version to be used for reliable messaging.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="message-store"
type="tns:msgStoreType">
+ <xsd:annotation>
+ <xsd:documentation>
+ WS-RM message store to be used for reliable messaging.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="port" type="tns:portType"
minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+ WSDL port specific WS-RM delivery assurance configuration.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="msgStoreType">
+ <xsd:sequence>
+ <xsd:element name="config-file" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation>
+ Message store specific configuration file.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:string"
use="required">
+ <xsd:annotation>
+ <xsd:documentation>
+ Message store identifier.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="class" type="xsd:string"
use="required">
+ <xsd:annotation>
+ <xsd:documentation>
+ Message store class name providing public default constructor.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:complexType name="deliveryAssuranceType">
+ <xsd:attribute name="quality" use="required">
+ <xsd:annotation>
+ <xsd:documentation>
+ Quality of service to be ensured.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="AtLeastOnce"/>
+ <xsd:enumeration value="AtMostOnce"/>
+ <xsd:enumeration value="ExactlyOnce"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="inOrder" type="xsd:boolean"
use="required">
+ <xsd:annotation>
+ <xsd:documentation>
+ In order quality of service to be ensured. Set this attribute to 'true'
to ensure in order message delivery.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:complexType name="providerType">
+ <xsd:attribute name="specVersion" use="required">
+ <xsd:annotation>
+ <xsd:documentation>
+ WS-RM spec. version to be used for reliable messaging.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration
value="http://docs.oasis-open.org/ws-rx/wsrm/200702"/>
+ <xsd:enumeration
value="http://schemas.xmlsoap.org/ws/2005/02/rm"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:complexType name="portType">
+ <xsd:sequence>
+ <xsd:element name="delivery-assurance"
type="tns:deliveryAssuranceType">
+ <xsd:annotation>
+ <xsd:documentation>
+ This WSDL port specific WS-RM delivery assurance configuration
+ applies to all its operations.
+ This configuration always overrides the global configuration.
+ If there is a WS-Policy with attached WS-RM assertion in WSDL
+ associated with this port or its associated binding it
+ will be always overriden this port specific configuration.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"
use="required">
+ <xsd:annotation>
+ <xsd:documentation>
+ WSDL port name specified in the form {namespace}localPart.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+
</xsd:schema>
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-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -22,7 +22,13 @@
package org.jboss.test.ws.common.config;
import java.io.File;
+import java.util.List;
+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.metadata.config.EndpointProperty;
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
import org.jboss.ws.metadata.config.jaxrpc.CommonConfigJAXRPC;
@@ -30,6 +36,11 @@
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;
@@ -117,4 +128,34 @@
assertNotNull("Property does not exist", value);
assertEquals("Wrong property valule", value, "5000");
}
+
+ public void testWSRMConfiguration() throws Exception
+ {
+ File confFile = new
File("resources/common/config/jaxws-endpoint-config.xml");
+ assertTrue(confFile.exists());
+
+ JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
+ ConfigRootJAXWS config = (ConfigRootJAXWS)factory.parse(confFile.toURL());
+ EndpointConfigJAXWS epConfig =
(EndpointConfigJAXWS)config.getConfigByName("Standard WSRM Endpoint");
+ ReliableMessagingMetaData wsrmConfig = epConfig.getRMMetaData();
+ assertNotNull(wsrmConfig);
+ DeliveryAssuranceMetaData deliveryAssurance = wsrmConfig.getDeliveryAssurance();
+ assertEquals(deliveryAssurance.getInOrder(), "true");
+ assertEquals(deliveryAssurance.getQuality(), "AtLeastOnce");
+ ProviderMetaData provider = wsrmConfig.getProvider();
+ assertEquals(provider.getSpecVersion(),
"http://docs.oasis-open.org/ws-rx/wsrm/200702");
+ MessageStoreMetaData 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);
+ assertEquals(port1.getPortName(), new QName("http://custom/namespace/",
"Port1"));
+ assertEquals(port1.getDeliveryAssurance().getInOrder(), "false");
+ assertEquals(port1.getDeliveryAssurance().getQuality(), "AtMostOnce");
+ PortMetaData port2 = ports.get(1);
+ assertEquals(port2.getPortName(), new QName("http://custom/namespace/",
"Port2"));
+ assertEquals(port2.getDeliveryAssurance().getInOrder(), "true");
+ assertEquals(port2.getDeliveryAssurance().getQuality(), "ExactlyOnce");
+ }
}
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
(rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.test.ws.jaxws.wsrm;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+
+/**
+ * Test helper
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 29, 2007
+ */
+public final class Helper
+{
+
+ private Helper()
+ {
+ // no instances
+ }
+
+ public static void setAddrProps(Object proxy, String wsaAction, String serviceURL)
+ {
+ BindingProvider bp = (BindingProvider)proxy;
+ AddressingProperties props = AddressingClientUtil.createAnonymousProps(wsaAction,
serviceURL);
+ bp.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
props);
+ }
+
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceIface.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceIface.java
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceIface.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,24 @@
+package org.jboss.test.ws.jaxws.wsrm;
+
+import javax.jws.Oneway;
+import javax.jws.WebService;
+import javax.xml.ws.addressing.Action;
+
+import org.jboss.ws.annotation.EndpointConfig;
+
+@WebService
+@EndpointConfig(configName = "Standard WSRM Client", configFile =
"META-INF/wsrm-jaxws-client-config.xml")
+public interface OneWayServiceIface
+{
+ @Oneway
+ @Action(input="http://wsrm.example/oneway/method1")
+ void method1();
+
+ @Action(input="http://wsrm.example/oneway/method2")
+ @Oneway
+ void method2(String s);
+
+ @Action(input="http://wsrm.example/oneway/method3")
+ @Oneway
+ void method3(String[] sa);
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceIface.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceImpl.java
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,52 @@
+package org.jboss.test.ws.jaxws.wsrm;
+
+import javax.jws.Oneway;
+import javax.jws.WebService;
+import javax.xml.ws.addressing.Action;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.annotation.Policy;
+import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
+
+import java.util.Arrays;
+
+@WebService
+(
+ name = "OneWay",
+ serviceName = "OneWayService",
+ endpointInterface = "org.jboss.test.ws.jaxws.wsrm.OneWayServiceIface"
+)
+@PolicyAttachment
+(
+ @Policy
+ (
+ policyFileLocation = "WEB-INF/wsrm-exactly-once-in-order-policy.xml",
+ scope = PolicyScopeLevel.WSDL_BINDING
+ )
+)
+public class OneWayServiceImpl implements OneWayServiceIface
+{
+ private Logger log = Logger.getLogger(OneWayServiceImpl.class);
+
+ @Action(input="http://wsrm.example/oneway/method1")
+ @Oneway
+ public void method1()
+ {
+ log.info("method1()");
+ }
+
+ @Action(input="http://wsrm.example/oneway/method2")
+ @Oneway
+ public void method2(String s)
+ {
+ log.info("method2(" + s + ")");
+ }
+
+ @Action(input="http://wsrm.example/oneway/method3")
+ @Oneway
+ public void method3(String[] sa)
+ {
+ log.info("method3(" + Arrays.asList(sa) + ")");
+ }
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceIface.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceIface.java
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceIface.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,35 @@
+package org.jboss.test.ws.jaxws.wsrm;
+
+import java.util.concurrent.Future;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+import javax.xml.ws.addressing.Action;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.jboss.ws.annotation.EndpointConfig;
+
+@WebService(name = "ReqRes", targetNamespace =
"http://org.jboss.ws/jaxws/wsrm")
+@SOAPBinding(style = Style.RPC)
+@EndpointConfig(configName = "Standard WSRM Client", configFile =
"META-INF/wsrm-jaxws-client-config.xml")
+public interface ReqResServiceIface
+{
+ @WebMethod(operationName = "echo")
+ @Action(input="http://wsrm.example/reqres/echo/input",
output="http://wsrm.example/reqres/echo/output")
+ public Response<String> echoAsync(@WebParam(name = "String_1") String
string1);
+
+ @WebMethod(operationName = "echo")
+ @Action(input="http://wsrm.example/reqres/echo/input",
output="http://wsrm.example/reqres/echo/output")
+ public Future<?> echoAsync(@WebParam(name = "String_1") String
string1, @WebParam(name = "asyncHandler") AsyncHandler<String>
asyncHandler);
+
+ @WebMethod
+ @WebResult(name = "result")
+ @Action(input="http://wsrm.example/reqres/echo/input",
output="http://wsrm.example/reqres/echo/output")
+ public String echo(@WebParam(name = "String_1") String string1);
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceIface.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceImpl.java
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceImpl.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,46 @@
+package org.jboss.test.ws.jaxws.wsrm;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.ws.addressing.Action;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.annotation.Policy;
+import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
+
+@WebService
+(
+ name = "ReqRes",
+ serviceName = "ReqResService",
+ targetNamespace = "http://org.jboss.ws/jaxws/wsrm"
+)
+@SOAPBinding
+(
+ style = Style.RPC
+)
+@PolicyAttachment
+(
+ @Policy
+ (
+ policyFileLocation = "WEB-INF/wsrm-exactly-once-in-order-policy.xml",
+ scope = PolicyScopeLevel.WSDL_BINDING
+ )
+)
+public class ReqResServiceImpl
+{
+ private static Logger log = Logger.getLogger(ReqResServiceImpl.class);
+
+ @WebMethod
+ @WebResult(name = "result")
+ @Action(input="http://wsrm.example/reqres/echo/input",
output="http://wsrm.example/reqres/echo/output")
+ public String echo(@WebParam(name = "String_1") String msg)
+ {
+ log.info("echo: " + msg);
+ return msg;
+ }
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/WSRMDeSerializationTestCase.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,577 @@
+/*
+ * 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.test.ws.jaxws.wsrm.deserialization;
+
+import java.io.ByteArrayInputStream;
+import java.util.List;
+
+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.wsf.test.JBossWSTest;
+
+/**
+ * WS-RM messages de/serialization test case
+ * @author richard.opalka(a)jboss.com
+ */
+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 String CREATE_SEQUENCE_MESSAGE
+ = "<soap:Envelope "
+ + "
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
+ + "
xmlns:wsrm=\"http://docs.oasis-open.org/ws-rx/wsrm/200702\""
+ + "
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
+ + " <soap:Header>"
+ + "
<
wsa:MessageID>http://Business456.com/guid/0baaf88d-483b-4ecf-a6d8</...
+ + " <
wsa:To>http://example.com/serviceB/123</wsa:To>"
+ + "
<
wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence...
+ + " <wsa:ReplyTo>"
+ + "
<
wsa:Address>http://Business456.com/serviceA/789</wsa:Address>"
+ + " </wsa:ReplyTo>"
+ + " </soap:Header>"
+ + " <soap:Body>"
+ + " <wsrm:CreateSequence>"
+ + " <wsrm:AcksTo>"
+ + "
<
wsa:Address>http://Business456.com/serviceA/789</wsa:Address>"
+ + " </wsrm:AcksTo>"
+ + " <wsrm:Expires>PT0S</wsrm:Expires>"
+ + " <wsrm:Offer>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " <wsrm:Endpoint>"
+ + "
<
wsa:Address>http://Business456.com/serviceA/ASDF</wsa:Address>&q...
+ + " </wsrm:Endpoint>"
+ + " <wsrm:Expires>PT1S</wsrm:Expires>"
+ + "
<wsrm:IncompleteSequenceBehavior>DiscardEntireSequence</wsrm:IncompleteSequenceBehavior>"
+ + " </wsrm:Offer>"
+ + " </wsrm:CreateSequence>"
+ + " </soap:Body>"
+ + "</soap:Envelope>";
+
+ private static final String CREATE_SEQUENCE_RESPONSE_MESSAGE
+ = "<soap:Envelope"
+ + "
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
+ + "
xmlns:wsrm=\"http://docs.oasis-open.org/ws-rx/wsrm/200702\""
+ + "
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
+ + " <soap:Header>"
+ + "
<
wsa:To>http://Business456.com/serviceA/789</wsa:To>"
+ + "
<
wsa:RelatesTo>http://Business456.com/guid/0baaf88d-483b-4ecf-a6d8</...
+ + "
<
wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence...
+ + " </soap:Header>"
+ + " <soap:Body>"
+ + " <wsrm:CreateSequenceResponse>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " <wsrm:Expires>PT0S</wsrm:Expires>"
+ + "
<wsrm:IncompleteSequenceBehavior>DiscardFollowingFirstGap</wsrm:IncompleteSequenceBehavior>"
+ + " <wsrm:Accept>"
+ + " <wsrm:AcksTo>"
+ + "
<
wsa:Address>http://Business456.com/serviceA/ASDF</wsa:Address>&q...
+ + " </wsrm:AcksTo>"
+ + " </wsrm:Accept>"
+ + " </wsrm:CreateSequenceResponse>"
+ + " </soap:Body>"
+ + "</soap:Envelope>";
+
+ private static final String SEQUENCE_PLUS_ACKREQUESTED_MESSAGE
+ = "<soap:Envelope"
+ + "
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
+ + "
xmlns:wsrm=\"http://docs.oasis-open.org/ws-rx/wsrm/200702\""
+ + "
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
+ + " <soap:Header>"
+ + "
<
wsa:MessageID>http://Business456.com/guid/71e0654e-5ce8-477b-bb9d</...
+ + " <
wsa:To>http://example.com/serviceB/123</wsa:To>"
+ + " <wsa:From>"
+ + "
<
wsa:Address>http://Business456.com/serviceA/789</wsa:Address>"
+ + " </wsa:From>"
+ + "
<
wsa:Action>http://example.com/serviceB/123/request</wsa:Action>&...
+ + " <wsrm:Sequence>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " <wsrm:MessageNumber>1</wsrm:MessageNumber>"
+ + " </wsrm:Sequence>"
+ + " <wsrm:AckRequested>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " </wsrm:AckRequested>"
+ + " </soap:Header>"
+ + " <soap:Body><!-- Some Application Data
--></soap:Body>"
+ + "</soap:Envelope>";
+
+ private static final String SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_1
+ = "<soap:Envelope"
+ + "
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
+ + "
xmlns:wsrm=\"http://docs.oasis-open.org/ws-rx/wsrm/200702\""
+ + "
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
+ + " <soap:Header>"
+ + "
<
wsa:MessageID>http://example.com/guid/0baaf88d-483b-4ecf-a6d8</wsa:...
+ + "
<
wsa:To>http://Business456.com/serviceA/789</wsa:To>"
+ + " <wsa:From>"
+ + "
<
wsa:Address>http://example.com/serviceB/123</wsa:Address>"
+ + " </wsa:From>"
+ + "
<
wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/SequenceAcknow...
+ + " <wsrm:SequenceAcknowledgement>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " <wsrm:AcknowledgementRange Upper='1'
Lower='1'/>"
+ + " <wsrm:AcknowledgementRange Upper='3'
Lower='3'/>"
+ + " <wsrm:Final/>"
+ + " </wsrm:SequenceAcknowledgement>"
+ + " </soap:Header>"
+ + " <soap:Body/>"
+ + "</soap:Envelope>";
+
+ private static final String SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_2
+ = "<soap:Envelope"
+ + "
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
+ + "
xmlns:wsrm=\"http://docs.oasis-open.org/ws-rx/wsrm/200702\""
+ + "
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
+ + " <soap:Header>"
+ + "
<
wsa:MessageID>http://example.com/guid/0baaf88d-483b-4ecf-a6d8</wsa:...
+ + " <
wsa:To>http://Business456.com/serviceA/789</wsa:To>"
+ + " <wsa:From>"
+ + "
<
wsa:Address>http://example.com/serviceB/123</wsa:Address>"
+ + " </wsa:From>"
+ + "
<
wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/SequenceAcknow...
+ + " <wsrm:SequenceAcknowledgement>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " <wsrm:Nack>2</wsrm:Nack>"
+ + " </wsrm:SequenceAcknowledgement>"
+ + " </soap:Header>"
+ + " <soap:Body/>"
+ + "</soap:Envelope>";
+
+ private static final String SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_3
+ = "<soap:Envelope"
+ + "
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
+ + "
xmlns:wsrm=\"http://docs.oasis-open.org/ws-rx/wsrm/200702\""
+ + "
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
+ + " <soap:Header>"
+ + "
<
wsa:MessageID>http://example.com/guid/0baaf88d-483b-4ecf-a6d8</wsa:...
+ + " <
wsa:To>http://Business456.com/serviceA/789</wsa:To>"
+ + " <wsa:From>"
+ + "
<
wsa:Address>http://example.com/serviceB/123</wsa:Address>"
+ + " </wsa:From>"
+ + "
<
wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/SequenceAcknow...
+ + " <wsrm:SequenceAcknowledgement>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " <wsrm:None/>"
+ + " </wsrm:SequenceAcknowledgement>"
+ + " </soap:Header>"
+ + " <soap:Body/>"
+ + "</soap:Envelope>";
+
+ private static final String CLOSE_SEQUENCE_MESSAGE
+ = "<soap:Envelope"
+ + "
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
+ + "
xmlns:wsrm=\"http://docs.oasis-open.org/ws-rx/wsrm/200702\""
+ + "
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
+ + " <soap:Header>"
+ + "
<
wsa:MessageID>http://Business456.com/guid/0baaf88d-483b-4ecf-a6d8</...
+ + " <
wsa:To>http://example.com/serviceB/123</wsa:To>"
+ + "
<
wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSeque...
+ + " <wsa:From>"
+ + "
<
wsa:Address>http://Business456.com/serviceA/789</wsa:Address>"
+ + " </wsa:From>"
+ + " </soap:Header>"
+ + " <soap:Body>"
+ + " <wsrm:CloseSequence>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " <wsrm:LastMsgNumber>3</wsrm:LastMsgNumber>"
+ + " </wsrm:CloseSequence>"
+ + " </soap:Body>"
+ + "</soap:Envelope>";
+
+ private static final String TERMINATE_SEQUENCE_MESSAGE
+ = "<soap:Envelope"
+ + "
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
+ + "
xmlns:wsrm=\"http://docs.oasis-open.org/ws-rx/wsrm/200702\""
+ + "
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
+ + " <soap:Header>"
+ + "
<
wsa:MessageID>http://Business456.com/guid/0baaf88d-483b-4ecf-a6d8</...
+ + " <
wsa:To>http://example.com/serviceB/123</wsa:To>"
+ + "
<
wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSeque...
+ + " <wsa:From>"
+ + "
<
wsa:Address>http://Business456.com/serviceA/789</wsa:Address>"
+ + " </wsa:From>"
+ + " </soap:Header>"
+ + " <soap:Body>"
+ + " <wsrm:TerminateSequence>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " <wsrm:LastMsgNumber>3</wsrm:LastMsgNumber>"
+ + " </wsrm:TerminateSequence>"
+ + " </soap:Body>"
+ + "</soap:Envelope>";
+
+ private static final String CLOSE_SEQUENCE_RESPONSE_MESSAGE
+ = "<soap:Envelope"
+ + "
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
+ + "
xmlns:wsrm=\"http://docs.oasis-open.org/ws-rx/wsrm/200702\""
+ + "
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
+ + " <soap:Header>"
+ + "
<
wsa:MessageID>http://Business456.com/guid/0baaf88d-483b-4ecf-a6d8</...
+ + " <
wsa:To>http://example.com/serviceA/789</wsa:To>"
+ + "
<
wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSeque...
+ + "
<
wsa:RelatesTo>http://Business456.com/guid/0baaf88d-483b-4ecf-a6d8</...
+ + " <wsa:From>"
+ + "
<
wsa:Address>http://Business456.com/serviceA/789</wsa:Address>"
+ + " </wsa:From>"
+ + " </soap:Header>"
+ + " <soap:Body>"
+ + " <wsrm:CloseSequenceResponse>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " </wsrm:CloseSequenceResponse>"
+ + " </soap:Body>"
+ + "</soap:Envelope>";
+
+ private static final String TERMINATE_SEQUENCE_RESPONSE_MESSAGE
+ = "<soap:Envelope"
+ + "
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
+ + "
xmlns:wsrm=\"http://docs.oasis-open.org/ws-rx/wsrm/200702\""
+ + "
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
+ + " <soap:Header>"
+ + "
<
wsa:MessageID>http://Business456.com/guid/0baaf88d-483b-4ecf-a6d8</...
+ + " <
wsa:To>http://example.com/serviceA/789</wsa:To>"
+ + "
<
wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSeque...
+ + "
<
wsa:RelatesTo>http://Business456.com/guid/0baaf88d-483b-4ecf-a6d8</...
+ + " <wsa:From>"
+ + "
<
wsa:Address>http://Business456.com/serviceA/789</wsa:Address>"
+ + " </wsa:From>"
+ + " </soap:Header>"
+ + " <soap:Body>"
+ + " <wsrm:TerminateSequenceResponse>"
+ + "
<
wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>&...
+ + " </wsrm:TerminateSequenceResponse>"
+ + " </soap:Body>"
+ + "</soap:Envelope>";
+
+ public void testSequenceAcknowledgementDeserialization1() throws Exception
+ {
+ SequenceAcknowledgement 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();
+ assertEquals(ranges.size(), 2);
+ SequenceAcknowledgement.AcknowledgementRange firstRange = ranges.get(0);
+ assertEquals(firstRange.getLower(), 1);
+ assertEquals(firstRange.getLower(), 1);
+ SequenceAcknowledgement.AcknowledgementRange secondRange = ranges.get(1);
+ assertEquals(secondRange.getLower(), 3);
+ assertEquals(secondRange.getLower(), 3);
+ }
+
+ public void testSequenceAcknowledgementSerialization1() throws Exception
+ {
+ SequenceAcknowledgement sequenceAcknowledgementMessage =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+ // construct message
+
sequenceAcknowledgementMessage.setIdentifier("http://Business456.com...;
+ sequenceAcknowledgementMessage.setFinal();
+ SequenceAcknowledgement.AcknowledgementRange firstRange =
sequenceAcknowledgementMessage.newAcknowledgementRange();
+ firstRange.setLower(1);
+ firstRange.setUpper(1);
+ sequenceAcknowledgementMessage.addAcknowledgementRange(firstRange);
+ SequenceAcknowledgement.AcknowledgementRange secondRange =
sequenceAcknowledgementMessage.newAcknowledgementRange();
+ secondRange.setLower(3);
+ secondRange.setUpper(3);
+ sequenceAcknowledgementMessage.addAcknowledgementRange(secondRange);
+ // perform assertion
+ assertEquals(sequenceAcknowledgementMessage, SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_1,
WSRM_200702_FACTORY);
+ }
+
+ public void testSequenceAcknowledgementDeserialization2() throws Exception
+ {
+ SequenceAcknowledgement sequenceAcknowledgement =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+
sequenceAcknowledgement.deserializeFrom(toSOAPMessage(SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_2));
+ // perform assertion
+ assertEquals(sequenceAcknowledgement.getIdentifier(),
"http://Business456.com/RM/ABC");
+ assertFalse(sequenceAcknowledgement.isFinal());
+ assertFalse(sequenceAcknowledgement.isNone());
+ assertEquals(sequenceAcknowledgement.getAcknowledgementRanges().size(), 0);
+ List<Long> nacks = sequenceAcknowledgement.getNacks();
+ assertEquals(nacks.size(), 1);
+ assertEquals(nacks.get(0).longValue(), 2);
+ }
+
+ public void testSequenceAcknowledgementSerialization2() throws Exception
+ {
+ SequenceAcknowledgement sequenceAcknowledgementMessage =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+ // construct message
+
sequenceAcknowledgementMessage.setIdentifier("http://Business456.com...;
+ sequenceAcknowledgementMessage.addNack(2);
+ // perform assertion
+ assertEquals(sequenceAcknowledgementMessage, SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_2,
WSRM_200702_FACTORY);
+ }
+
+ public void testSequenceAcknowledgementDeserialization3() throws Exception
+ {
+ SequenceAcknowledgement sequenceAcknowledgement =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+
sequenceAcknowledgement.deserializeFrom(toSOAPMessage(SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_3));
+ // perform assertion
+ assertEquals(sequenceAcknowledgement.getIdentifier(),
"http://Business456.com/RM/ABC");
+ assertFalse(sequenceAcknowledgement.isFinal());
+ assertTrue(sequenceAcknowledgement.isNone());
+ assertEquals(sequenceAcknowledgement.getAcknowledgementRanges().size(), 0);
+ assertEquals(sequenceAcknowledgement.getNacks().size(), 0);
+ }
+
+ public void testSequenceAcknowledgementSerialization3() throws Exception
+ {
+ SequenceAcknowledgement sequenceAcknowledgementMessage =
WSRM_200702_FACTORY.newSequenceAcknowledgement();
+ // construct message
+
sequenceAcknowledgementMessage.setIdentifier("http://Business456.com...;
+ sequenceAcknowledgementMessage.setNone();
+ // perform assertion
+ assertEquals(sequenceAcknowledgementMessage, SEQUENCE_ACKNOWLEDGEMENT_MESSAGE_3,
WSRM_200702_FACTORY);
+ }
+
+ public void testCreateSequenceMessageDeserialization() throws Exception
+ {
+ CreateSequence 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();
+ 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);
+ }
+
+ public void testCreateSequenceMessageSerialization() throws Exception
+ {
+ CreateSequence createSequenceMessage = WSRM_200702_FACTORY.newCreateSequence();
+ // construct message
+
createSequenceMessage.setAcksTo("http://Business456.com/serviceA/789...;
+ createSequenceMessage.setExpires("PT0S");
+ CreateSequence.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);
+ createSequenceMessage.setOffer(offer);
+ // perform assertion
+ assertEquals(createSequenceMessage, CREATE_SEQUENCE_MESSAGE, WSRM_200702_FACTORY);
+ }
+
+ public void testCreateSequenceResponseMessageDeserialization() throws Exception
+ {
+ CreateSequenceResponse 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(accept.getAcksTo(),
"http://Business456.com/serviceA/ASDF");
+ }
+
+ public void testCreateSequenceResponseMessageSerialization() throws Exception
+ {
+ CreateSequenceResponse 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();
+
accept.setAcksTo("http://Business456.com/serviceA/ASDF");
+ createSequenceResponse.setAccept(accept);
+ // perform assertion
+ assertEquals(createSequenceResponse, CREATE_SEQUENCE_RESPONSE_MESSAGE,
WSRM_200702_FACTORY);
+ }
+
+ public void testCloseSequenceMessageDeserialization() throws Exception
+ {
+ CloseSequence closeSequence = WSRM_200702_FACTORY.newCloseSequence();
+ closeSequence.deserializeFrom(toSOAPMessage(CLOSE_SEQUENCE_MESSAGE));
+ // perform assertion
+ assertEquals(closeSequence.getIdentifier(),
"http://Business456.com/RM/ABC");
+ assertEquals(closeSequence.getLastMsgNumber(), 3);
+ }
+
+ public void testCloseSequenceMessageSerialization() throws Exception
+ {
+ CloseSequence closeSequence = WSRM_200702_FACTORY.newCloseSequence();
+ // construct message
+
closeSequence.setIdentifier("http://Business456.com/RM/ABC");
+ closeSequence.setLastMsgNumber(3);
+ // perform assertion
+ assertEquals(closeSequence, CLOSE_SEQUENCE_MESSAGE, WSRM_200702_FACTORY);
+ }
+
+ public void testCloseSequenceResponseMessageDeserialization() throws Exception
+ {
+ CloseSequenceResponse closeSequenceResponse =
WSRM_200702_FACTORY.newCloseSequenceResponse();
+
closeSequenceResponse.deserializeFrom(toSOAPMessage(CLOSE_SEQUENCE_RESPONSE_MESSAGE));
+ // perform assertion
+ assertEquals(closeSequenceResponse.getIdentifier(),
"http://Business456.com/RM/ABC");
+ }
+
+ public void testCloseSequenceResponseMessageSerialization() throws Exception
+ {
+ CloseSequenceResponse closeSequenceResponse =
WSRM_200702_FACTORY.newCloseSequenceResponse();
+ // construct message
+
closeSequenceResponse.setIdentifier("http://Business456.com/RM/ABC&q...;
+ // perform assertion
+ assertEquals(closeSequenceResponse, CLOSE_SEQUENCE_RESPONSE_MESSAGE,
WSRM_200702_FACTORY);
+ }
+
+ public void testTerminateSequenceMessageDeserialization() throws Exception
+ {
+ TerminateSequence terminateSequence = WSRM_200702_FACTORY.newTerminateSequence();
+ terminateSequence.deserializeFrom(toSOAPMessage(TERMINATE_SEQUENCE_MESSAGE));
+ // perform assertion
+ assertEquals(terminateSequence.getIdentifier(),
"http://Business456.com/RM/ABC");
+ assertEquals(terminateSequence.getLastMsgNumber(), 3);
+ }
+
+ public void testTerminateSequenceMessageSerialization() throws Exception
+ {
+ TerminateSequence terminateSequence = WSRM_200702_FACTORY.newTerminateSequence();
+ // construct message
+
terminateSequence.setIdentifier("http://Business456.com/RM/ABC");
+ terminateSequence.setLastMsgNumber(3);
+ // perform assertion
+ assertEquals(terminateSequence, TERMINATE_SEQUENCE_MESSAGE, WSRM_200702_FACTORY);
+ }
+
+ public void testTerminateSequenceResponseMessageDeserialization() throws Exception
+ {
+ TerminateSequenceResponse terminateSequenceResponse =
WSRM_200702_FACTORY.newTerminateSequenceResponse();
+
terminateSequenceResponse.deserializeFrom(toSOAPMessage(TERMINATE_SEQUENCE_RESPONSE_MESSAGE));
+ // perform assertion
+ assertEquals(terminateSequenceResponse.getIdentifier(),
"http://Business456.com/RM/ABC");
+ }
+
+ public void testTerminateSequenceResponseMessageSerialization() throws Exception
+ {
+ TerminateSequenceResponse terminateSequenceResponse =
WSRM_200702_FACTORY.newTerminateSequenceResponse();
+ // construct message
+
terminateSequenceResponse.setIdentifier("http://Business456.com/RM/A...;
+ // perform assertion
+ assertEquals(terminateSequenceResponse, TERMINATE_SEQUENCE_RESPONSE_MESSAGE,
WSRM_200702_FACTORY);
+ }
+
+ public void testSequenceMessageSerialization() throws Exception
+ {
+ Sequence sequence = WSRM_200702_FACTORY.newSequence();
+ sequence.deserializeFrom(toSOAPMessage(SEQUENCE_PLUS_ACKREQUESTED_MESSAGE));
+ // perform assertion
+ assertEquals(sequence.getIdentifier(), "http://Business456.com/RM/ABC");
+ assertEquals(sequence.getMessageNumber(), 1);
+ }
+
+ public void testSequenceMessageDeserialization() throws Exception
+ {
+ Sequence sequence = WSRM_200702_FACTORY.newSequence();
+ // construct message
+
sequence.setIdentifier("http://Business456.com/RM/ABC");
+ sequence.setMessageNumber(1);
+ // perform assertion
+ assertEquals(sequence, SEQUENCE_PLUS_ACKREQUESTED_MESSAGE, WSRM_200702_FACTORY);
+ }
+
+ public void testAckRequestedMessageSerialization() throws Exception
+ {
+ AckRequested ackRequested = WSRM_200702_FACTORY.newAckRequested();
+ ackRequested.deserializeFrom(toSOAPMessage(SEQUENCE_PLUS_ACKREQUESTED_MESSAGE));
+ // perform assertion
+ assertEquals(ackRequested.getIdentifier(),
"http://Business456.com/RM/ABC");
+ }
+
+ public void testAckRequestedMessageDeserialization() throws Exception
+ {
+ AckRequested ackRequested = WSRM_200702_FACTORY.newAckRequested();
+ // construct message
+
ackRequested.setIdentifier("http://Business456.com/RM/ABC");
+ // perform assertion
+ assertEquals(ackRequested, SEQUENCE_PLUS_ACKREQUESTED_MESSAGE,
WSRM_200702_FACTORY);
+ }
+
+ // TODO: implement other de/serializations
+
+ private static void assertEquals(Serializable serializable, String exemplar,
MessageFactory factory) throws Exception
+ {
+ // serialize constructed message
+ SOAPMessage createdSOAPMessage = newEmptySOAPMessage();
+ serializable.serializeTo(createdSOAPMessage);
+ // deserialize from constructed message
+ Serializable serializable1 = newEmptySerializable(factory, serializable);
+ serializable1.deserializeFrom(createdSOAPMessage);
+ // deserialize from reference message
+ Serializable serializable2 = newEmptySerializable(factory, serializable);
+ serializable2.deserializeFrom(toSOAPMessage(exemplar));
+ // perform assertion
+ assertEquals(serializable1, serializable2);
+ }
+
+ private static Serializable newEmptySerializable(MessageFactory factory, Serializable
helper)
+ {
+ if (helper instanceof CreateSequence)
+ return factory.newCreateSequence();
+ if (helper instanceof CreateSequenceResponse)
+ return factory.newCreateSequenceResponse();
+ if (helper instanceof CloseSequence)
+ return factory.newCloseSequence();
+ if (helper instanceof CloseSequenceResponse)
+ return factory.newCloseSequenceResponse();
+ if (helper instanceof TerminateSequence)
+ return factory.newTerminateSequence();
+ if (helper instanceof TerminateSequenceResponse)
+ return factory.newTerminateSequenceResponse();
+ if (helper instanceof Sequence)
+ return factory.newSequence();
+ if (helper instanceof AckRequested)
+ return factory.newAckRequested();
+ if (helper instanceof SequenceAcknowledgement)
+ return factory.newSequenceAcknowledgement();
+
+ throw new IllegalArgumentException();
+ }
+
+ private static SOAPMessage toSOAPMessage(String data) throws Exception
+ {
+ javax.xml.soap.MessageFactory factory =
javax.xml.soap.MessageFactory.newInstance();
+ return factory.createMessage(null, new ByteArrayInputStream(data.getBytes()));
+ }
+
+ private static SOAPMessage newEmptySOAPMessage() throws Exception
+ {
+ javax.xml.soap.MessageFactory factory =
javax.xml.soap.MessageFactory.newInstance();
+ return factory.createMessage();
+ }
+
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/WSRMDeSerializationTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,224 @@
+/*
+ * 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.test.ws.jaxws.wsrm.emulator;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Random;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * Endpoint emulator
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 24, 2007
+ */
+public class EndpointEmulator extends HttpServlet
+{
+ private static final String ADDR_NS =
"http://www.w3.org/2005/08/addressing";
+ private static final String WSRM_NS =
"http://docs.oasis-open.org/ws-rx/wsrm/200702";
+ private static final Map<String, String> wsrmActions = new HashMap<String,
String>();
+ private static final String CREATE_SEQUENCE_ACTION = WSRM_NS +
"/CreateSequence";
+ private static final String CREATE_SEQUENCE_RESPONSE_ACTION = WSRM_NS +
"/CreateSequenceResponse";
+ private static final String CLOSE_SEQUENCE_ACTION = WSRM_NS +
"/CloseSequence";
+ private static final String CLOSE_SEQUENCE_RESPONSE_ACTION = WSRM_NS +
"/CloseSequenceResponse";
+ private static final String TERMINATE_SEQUENCE_ACTION = WSRM_NS +
"/TerminateSequence";
+ private static final String TERMINATE_SEQUENCE_RESPONSE_ACTION = WSRM_NS +
"/TerminateSequenceResponse";
+ private static final Random generator = new Random();
+
+ static
+ {
+ wsrmActions.put(CREATE_SEQUENCE_ACTION, CREATE_SEQUENCE_RESPONSE_ACTION);
+ wsrmActions.put(CLOSE_SEQUENCE_ACTION, CLOSE_SEQUENCE_RESPONSE_ACTION);
+ wsrmActions.put(TERMINATE_SEQUENCE_ACTION, TERMINATE_SEQUENCE_RESPONSE_ACTION);
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException
+ {
+ String pathInfo = req.getPathInfo();
+ System.out.println(pathInfo);
+ resp.setContentType("text/xml");
+ PrintWriter writer = resp.getWriter();
+ if (pathInfo.equals("/OneWayService"))
+ {
+ writer.print(getResource("WEB-INF/resources/OneWayService.wsdl"));
+ }
+ else
+ {
+ writer.print(getResource("WEB-INF/resources/ReqResService.wsdl"));
+ }
+ writer.flush();
+ writer.close();
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException
+ {
+ resp.setContentType("text/xml");
+ PrintWriter writer = resp.getWriter();
+ Properties properties = getProperties(getRequestMessage(req));
+ String response = getResource("WEB-INF/resources/echoResponse.xml");
+ if (properties.get("addressing.action").equals(CREATE_SEQUENCE_ACTION))
+ response =
getResource("WEB-INF/resources/createSequenceResponse.xml");
+ if
(properties.get("addressing.action").equals(TERMINATE_SEQUENCE_ACTION))
+ response =
getResource("WEB-INF/resources/terminateSequenceResponse.xml");
+ response = modifyResponse(response, properties);
+ writer.print(response);
+ writer.flush();
+ writer.close();
+ }
+
+ private String modifyResponse(String response, Properties props)
+ {
+ response = replace("${addressing.to}",
props.getProperty("addressing.replyto"), response);
+ response = replace("${addressing.relatesto}",
props.getProperty("addressing.messageid"), response);
+ String action = props.getProperty("addressing.action");
+ if (wsrmActions.containsKey(action))
+ {
+ if (action.equals(CREATE_SEQUENCE_ACTION))
+ {
+ String sequenceId =
"http://wsrm.emulator.jboss/sequence/generated/" +
generator.nextInt(Integer.MAX_VALUE);
+ response = replace("${messaging.identifier}", sequenceId,
response);
+ }
+ action = wsrmActions.get(action);
+ }
+ response = replace("${messaging.identifier}",
props.getProperty("messaging.identifier"), response);
+ response = replace("${messaging.upper}",
props.getProperty("messaging.messagenumber"), response);
+ response = replace("${messaging.lower}",
props.getProperty("messaging.messagenumber"), response);
+ response = replace("${addressing.action}", action, response);
+ return response;
+ }
+
+ private static String replace(String oldString, String newString, String data)
+ {
+ int fromIndex = 0;
+ int index = 0;
+ StringBuffer result = new StringBuffer();
+
+ while ((index = data.indexOf(oldString, fromIndex)) >= 0)
+ {
+ result.append(data.substring(fromIndex, index));
+ result.append(newString);
+ fromIndex = index + oldString.length();
+ }
+ result.append(data.substring(fromIndex));
+ return result.toString();
+ }
+
+ private Properties getProperties(String message) throws IOException
+ {
+ try
+ {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document document = builder.parse(new
ByteArrayInputStream(message.getBytes()));
+ Properties retVal = new Properties();
+ String to = document.getElementsByTagNameNS(ADDR_NS,
"To").item(0).getTextContent().trim();
+ retVal.put("addressing.to", to);
+ String messageId = document.getElementsByTagNameNS(ADDR_NS,
"MessageID").item(0).getTextContent().trim();
+ retVal.put("addressing.messageid", messageId);
+ String action = document.getElementsByTagNameNS(ADDR_NS,
"Action").item(0).getTextContent().trim();
+ retVal.put("addressing.action", action);
+ String replyTo = ((Element)document.getElementsByTagNameNS(ADDR_NS,
"ReplyTo").item(0))
+ .getElementsByTagNameNS(ADDR_NS,
"Address").item(0).getTextContent().trim();
+ retVal.put("addressing.replyto", replyTo);
+ NodeList sequence = document.getElementsByTagNameNS(WSRM_NS,
"Sequence");
+ if (sequence != null && sequence.getLength() != 0)
+ {
+ String sequenceId = ((Element)sequence.item(0))
+ .getElementsByTagNameNS(WSRM_NS,
"Identifier").item(0).getTextContent().trim();
+ retVal.put("messaging.identifier", replyTo);
+ String messageNumber = ((Element)sequence.item(0))
+ .getElementsByTagNameNS(WSRM_NS,
"MessageNumber").item(0).getTextContent().trim();
+ retVal.put("messaging.messagenumber", messageNumber);
+ }
+ NodeList terminateSequence = document.getElementsByTagNameNS(WSRM_NS,
"TerminateSequence");
+ if (terminateSequence != null && terminateSequence.getLength() != 0)
+ {
+ String sequenceId = ((Element)terminateSequence.item(0))
+ .getElementsByTagNameNS(WSRM_NS,
"Identifier").item(0).getTextContent().trim();
+ retVal.put("messaging.identifier", sequenceId);
+ }
+
+ System.out.println("Properties from message: " + retVal);
+ return retVal;
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new IOException(e.getMessage());
+ }
+ }
+
+ private String getResource(String resource) throws IOException
+ {
+ return toString(getServletContext().getResourceAsStream(resource));
+ }
+
+ private String getRequestMessage(HttpServletRequest req) throws IOException
+ {
+ BufferedReader reader = req.getReader();
+ String line = null;
+ StringBuilder sb = new StringBuilder();
+ while ((line = reader.readLine()) != null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+
+ private String toString(InputStream is) throws IOException
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ byte[] buffer = new byte[1024];
+ int offset = -1;
+ while ((offset = is.read(buffer, 0, buffer.length)) != -1)
+ {
+ baos.write(buffer, 0, offset);
+ }
+ return baos.toString();
+ }
+
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,115 @@
+/*
+ * 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.test.ws.jaxws.wsrm.oneway;
+
+import static org.jboss.test.ws.jaxws.wsrm.Helper.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+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.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.jboss.test.ws.jaxws.wsrm.OneWayServiceIface;
+
+/**
+ * Reliable JBoss WebService client invoking one way methods
+ *
+ * @author richard.opalka(a)jboss.com
+ * @since 22-Aug-2007
+ */
+public class OneWayTestCase extends JBossWSTest
+{
+ private static final Properties props = new Properties();
+ private String targetNS = "http://wsrm.jaxws.ws.test.jboss.org/";
+ private OneWayServiceIface proxy;
+ private final boolean emulatorOn =
Boolean.parseBoolean((String)props.get("emulator"));
+ private final String serviceURL = "http://" + getServerHost() +
":" + props.getProperty("port") +
props.getProperty("path");
+
+ static
+ {
+ // load test properties
+ File propertiesFile = new
File("resources/jaxws/wsrm/properties/OneWayTestCase.properties");
+ try
+ {
+ props.load(new FileInputStream(propertiesFile));
+ }
+ catch (IOException ignore)
+ {
+ ignore.printStackTrace();
+ }
+ }
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(OneWayTestCase.class,
props.getProperty("archives"));
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ QName serviceName = new QName(targetNS, "OneWayService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ proxy = (OneWayServiceIface)service.getPort(OneWayServiceIface.class);
+ }
+
+ public void testOneWayMethods() throws Exception
+ {
+ 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");
+ RMSequence sequence = null;
+ if (emulatorOn)
+ {
+ RMProvider wsrmProvider = (RMProvider)proxy;
+ sequence = wsrmProvider.createSequence();
+ System.out.println("Created sequence with id=" + sequence.getId());
+ }
+ setAddrProps(proxy, "http://useless/action1", serviceURL);
+ proxy.method1();
+ setAddrProps(proxy, "http://useless/action2", serviceURL);
+ proxy.method2("Hello World");
+ setAddrProps(proxy, "http://useless/action3", serviceURL);
+ proxy.method3(new String[] {"Hello","World"});
+ if (emulatorOn)
+ {
+ if (!sequence.isCompleted(1000, TimeUnit.MILLISECONDS)) {
+ fail("Sequence not completed within specified time amount");
+ } else {
+ sequence.terminate();
+ }
+ }
+ }
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java 2007-11-05
21:51:06 UTC (rev 4990)
@@ -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.test.ws.jaxws.wsrm.reqres;
+
+import static org.jboss.test.ws.jaxws.wsrm.Helper.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Properties;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Response;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+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;
+
+/**
+ * Reliable JBoss WebService client invoking req/res methods
+ *
+ * @author richard.opalka(a)jboss.com
+ * @since 22-Aug-2007
+ */
+public class ReqResTestCase extends JBossWSTest
+{
+ private static final Properties props = new Properties();
+ private static final String HELLO_WORLD_MSG = "Hello World";
+ private static final String TARGET_NS = "http://org.jboss.ws/jaxws/wsrm";
+ private final String serviceURL = "http://" + getServerHost() +
":" + props.getProperty("port") +
props.getProperty("path");
+ private Exception handlerException;
+ private boolean asyncHandlerCalled;
+ private ReqResServiceIface proxy;
+ private final boolean emulatorOn =
Boolean.parseBoolean((String)props.get("emulator"));
+
+ static
+ {
+ // load test properties
+ File propertiesFile = new
File("resources/jaxws/wsrm/properties/ReqResTestCase.properties");
+ try
+ {
+ props.load(new FileInputStream(propertiesFile));
+ }
+ catch (IOException ignore)
+ {
+ ignore.printStackTrace();
+ }
+ }
+
+ private enum InvocationType
+ {
+ SYNC, ASYNC, ASYNC_FUTURE
+ }
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(ReqResTestCase.class,
props.getProperty("archives"));
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ if (proxy == null)
+ {
+ QName serviceName = new QName(TARGET_NS, "ReqResService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ proxy = (ReqResServiceIface)service.getPort(ReqResServiceIface.class);
+ }
+ }
+
+ public void testSynchronousInvocation() throws Exception
+ {
+ doReliableMessageExchange(proxy, InvocationType.SYNC);
+ }
+
+ public void testAsynchronousInvocation() throws Exception
+ {
+ doReliableMessageExchange(proxy, InvocationType.ASYNC);
+ }
+
+ public void testAsynchronousInvocationUsingFuture() throws Exception
+ {
+ doReliableMessageExchange(proxy, InvocationType.ASYNC_FUTURE);
+ }
+
+ private void doSynchronousInvocation() throws Exception
+ {
+ assertEquals(proxy.echo(HELLO_WORLD_MSG), HELLO_WORLD_MSG);
+ }
+
+ private void doAsynchronousInvocation() throws Exception
+ {
+ Response<String> response = proxy.echoAsync(HELLO_WORLD_MSG);
+ assertEquals(response.get(), HELLO_WORLD_MSG); // hidden future pattern
+ }
+
+ private void doAsynchronousInvocationUsingFuture() throws Exception
+ {
+ AsyncHandler<String> handler = new AsyncHandler<String>()
+ {
+ public void handleResponse(Response<String> response)
+ {
+ try
+ {
+ String retStr = (String) response.get(1000, TimeUnit.MILLISECONDS);
+ assertEquals(HELLO_WORLD_MSG, retStr);
+ asyncHandlerCalled = true;
+ }
+ catch (Exception ex)
+ {
+ handlerException = ex;
+ }
+ }
+ };
+ Future<?> future = proxy.echoAsync(HELLO_WORLD_MSG, handler);
+ future.get(1000, TimeUnit.MILLISECONDS);
+ ensureAsyncStatus();
+ }
+
+ private void ensureAsyncStatus() throws Exception
+ {
+ if (handlerException != null) throw handlerException;
+ assertTrue("Async handler called", asyncHandlerCalled);
+ handlerException = null;
+ asyncHandlerCalled = false;
+ }
+
+ private void invokeWebServiceMethod(InvocationType invocationType) throws Exception
+ {
+ switch (invocationType) {
+ case SYNC: doSynchronousInvocation(); break;
+ case ASYNC: doAsynchronousInvocation(); break;
+ case ASYNC_FUTURE: doAsynchronousInvocationUsingFuture(); break;
+ default : fail("Unknown invocation type");
+ }
+ }
+
+ private void doReliableMessageExchange(Object proxyObject, InvocationType
invocationType) throws Exception
+ {
+ 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");
+ RMSequence sequence = null;
+ if (emulatorOn)
+ {
+ RMProvider wsrmProvider = (RMProvider)proxyObject;
+ sequence = wsrmProvider.createSequence();
+ System.out.println("Created sequence with id=" + sequence.getId());
+ }
+ setAddrProps(proxy, "http://useless/action", serviceURL);
+ invokeWebServiceMethod(invocationType);
+ setAddrProps(proxy, "http://useless/action", serviceURL);
+ invokeWebServiceMethod(invocationType);
+ setAddrProps(proxy, "http://useless/action", serviceURL);
+ invokeWebServiceMethod(invocationType);
+ if (emulatorOn)
+ {
+ if (!sequence.isCompleted(1000, TimeUnit.MILLISECONDS)) {
+ sequence.discard();
+ fail("Sequence not completed within specified time amount");
+ } else {
+ sequence.terminate();
+ }
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/src/test/resources/common/config/jaxws-endpoint-config.xml
===================================================================
---
stack/native/trunk/src/test/resources/common/config/jaxws-endpoint-config.xml 2007-11-05
18:33:05 UTC (rev 4989)
+++
stack/native/trunk/src/test/resources/common/config/jaxws-endpoint-config.xml 2007-11-05
21:51:06 UTC (rev 4990)
@@ -41,4 +41,26 @@
</endpoint-config>
+ <endpoint-config>
+
+ <config-name>Standard WSRM Endpoint</config-name>
+ <reliable-messaging>
+ <delivery-assurance inOrder="true"
quality="AtLeastOnce"/>
+ <provider
+
specVersion="http://docs.oasis-open.org/ws-rx/wsrm/200702"/>
+ <message-store
+ id="wsrmStoreId"
+ class="custom.MessageStoreImpl">
+ <config-file>META-INF/config.xml</config-file>
+ </message-store>
+ <port name="{http://custom/namespace/}Port1">
+ <delivery-assurance inOrder="false"
quality="AtMostOnce"/>
+ </port>
+ <port name="{http://custom/namespace/}Port2">
+ <delivery-assurance inOrder="true"
quality="ExactlyOnce"/>
+ </port>
+ </reliable-messaging>
+
+ </endpoint-config>
+
</jaxws-config>
\ No newline at end of file
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config
+ xmlns="urn:jboss:jaxws-config:2.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
+
+ <client-config>
+ <config-name>Standard WSRM Client</config-name>
+ <reliable-messaging>
+ <delivery-assurance inOrder="true"
quality="AtLeastOnce"/>
+ <provider
specVersion="http://docs.oasis-open.org/ws-rx/wsrm/200702"/>
+ <message-store id="wsrmStoreId"
class="custom.MessageStoreImpl">
+ <config-file>META-INF/config.xml</config-file>
+ </message-store>
+ </reliable-messaging>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>WSRM Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.ws.extensions.wsrm.RMClientHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+</jaxws-config>
Property changes on:
stack/native/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/web.xml
(rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/web.xml 2007-11-05 21:51:06
UTC (rev 4990)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>OneWayService</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.wsrm.OneWayServiceImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>OneWayService</servlet-name>
+ <url-pattern>/OneWayService</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>ReqResService</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.wsrm.ReqResServiceImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ReqResService</servlet-name>
+ <url-pattern>/ReqResService</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-exactly-once-in-order-policy.xml
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-exactly-once-in-order-policy.xml
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-exactly-once-in-order-policy.xml 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy
+ wsu:Id="exactly_one_in_order_rm_delivery"
+
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+
xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <wsrmp:DeliveryAssurance>
+ <wsp:Policy>
+ <wsrmp:ExactlyOnce/>
+ <wsrmp:InOrder/>
+ </wsp:Policy>
+ </wsrmp:DeliveryAssurance>
+</wsp:Policy>
Property changes on:
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-exactly-once-in-order-policy.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-jaxws-endpoint-config.xml
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-jaxws-endpoint-config.xml
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-jaxws-endpoint-config.xml 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config
+ xmlns="urn:jboss:jaxws-config:2.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
+
+ <endpoint-config>
+ <config-name>Standard WSRM Endpoint</config-name>
+ <reliable-messaging>
+ <delivery-assurance inOrder="true"
quality="AtLeastOnce"/>
+ <provider
specVersion="http://docs.oasis-open.org/ws-rx/wsrm/200702"/>
+ <message-store id="wsrmStoreId"
class="custom.MessageStoreImpl">
+ <config-file>META-INF/config.xml</config-file>
+ </message-store>
+ </reliable-messaging>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ <!--javaee:handler>
+ <javaee:handler-name>WSRM Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.ws.extensions.wsrm.RMServerHandler</javaee:handler-class>
+ </javaee:handler-->
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+
+</jaxws-config>
Property changes on:
stack/native/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-jaxws-endpoint-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml
(rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>EndpointEmulator</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.wsrm.emulator.EndpointEmulator</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>EndpointEmulator</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/OneWayService.wsdl
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/OneWayService.wsdl
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/OneWayService.wsdl 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="OneWayService"
targetNamespace="http://wsrm.jaxws.ws.test.jboss.org/"
xmlns:tns="http://wsrm.jaxws.ws.test.jboss.org/"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xs:schema
targetNamespace="http://wsrm.jaxws.ws.test.jboss.org/"
version="1.0"
xmlns:tns="http://wsrm.jaxws.ws.test.jboss.org/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="method1" type="tns:method1"/>
+ <xs:element name="method2" type="tns:method2"/>
+ <xs:element name="method3" type="tns:method3"/>
+ <xs:complexType name="method1">
+ <xs:sequence/>
+ </xs:complexType>
+ <xs:complexType name="method2">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0"
type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="method3">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0"
name="arg0" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name="OneWayServiceIface_method3">
+ <part name="method3" element="tns:method3">
+ </part>
+ </message>
+ <message name="OneWayServiceIface_method2">
+ <part name="method2" element="tns:method2">
+ </part>
+ </message>
+ <message name="OneWayServiceIface_method1">
+ <part name="method1" element="tns:method1">
+ </part>
+ </message>
+ <portType name="OneWayServiceIface">
+ <operation name="method1">
+ <input message="tns:OneWayServiceIface_method1">
+ </input>
+ </operation>
+ <operation name="method2">
+ <input message="tns:OneWayServiceIface_method2">
+ </input>
+ </operation>
+ <operation name="method3">
+ <input message="tns:OneWayServiceIface_method3">
+ </input>
+ </operation>
+ </portType>
+ <binding name="OneWayServiceIfaceBinding"
type="tns:OneWayServiceIface">
+ <wsp:PolicyReference URI="#exactly_one_in_order_rm_delivery"/>
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="method1">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+ <operation name="method2">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+ <operation name="method3">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+ </binding>
+ <service name="OneWayService">
+ <port name="OneWayPort"
binding="tns:OneWayServiceIfaceBinding">
+ <soap:address
location="http://127.0.0.1:8080/jaxws-wsrm-emulator/OneWayService"/>
+ </port>
+ </service>
+ <wsp:Policy wsu:Id="exactly_one_in_order_rm_delivery"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <wsp:All>
+ <wsrmp:DeliveryAssurance
xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702">
+ <wsp:Policy>
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsrmp:ExactlyOnce/>
+ <wsrmp:InOrder/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </wsrmp:DeliveryAssurance>
+ </wsp:All>
+ </wsp:Policy>
+</definitions>
\ No newline at end of file
Property changes on:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/OneWayService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/ReqResService.wsdl
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/ReqResService.wsdl
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/ReqResService.wsdl 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="ReqResService"
targetNamespace="http://org.jboss.ws/jaxws/wsrm"
xmlns:tns="http://org.jboss.ws/jaxws/wsrm"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ </types>
+ <message name="ReqRes_echo">
+ <part name="String_1" type="xsd:string">
+ </part>
+ </message>
+ <message name="ReqRes_echoResponse">
+ <part name="result" type="xsd:string">
+ </part>
+ </message>
+ <portType name="ReqRes">
+ <operation name="echo" parameterOrder="String_1">
+ <input message="tns:ReqRes_echo">
+ </input>
+ <output message="tns:ReqRes_echoResponse">
+ </output>
+ </operation>
+ </portType>
+ <binding name="ReqResBinding" type="tns:ReqRes">
+ <wsp:PolicyReference URI="#exactly_one_in_order_rm_delivery"/>
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echo">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"
namespace="http://org.jboss.ws/jaxws/wsrm"/>
+ </input>
+ <output>
+ <soap:body use="literal"
namespace="http://org.jboss.ws/jaxws/wsrm"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="ReqResService">
+ <port name="ReqResPort" binding="tns:ReqResBinding">
+ <soap:address
location="http://127.0.0.1:8080/jaxws-wsrm-emulator/ReqResService"/>
+ </port>
+ </service>
+ <wsp:Policy wsu:Id="exactly_one_in_order_rm_delivery"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <wsp:All>
+ <wsrmp:DeliveryAssurance
xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702">
+ <wsp:Policy>
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsrmp:ExactlyOnce/>
+ <wsrmp:InOrder/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </wsrmp:DeliveryAssurance>
+ </wsp:All>
+ </wsp:Policy>
+</definitions>
Property changes on:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/ReqResService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/createSequenceResponse.xml
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/createSequenceResponse.xml
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/createSequenceResponse.xml 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,15 @@
+<env:Envelope
+
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
+
xmlns:wsrm11='http://docs.oasis-open.org/ws-rx/wsrm/200702'
+
xmlns:wsa='http://www.w3.org/2005/08/addressing'>
+ <env:Header>
+ <wsa:To env:mustUnderstand="1">${addressing.to}</wsa:To>
+ <wsa:RelatesTo>${addressing.relatesto}</wsa:RelatesTo>
+ <wsa:Action
env:mustUnderstand="1">${addressing.action}</wsa:Action>
+ </env:Header>
+ <env:Body>
+ <wsrm11:CreateSequenceResponse>
+ <wsrm11:Identifier>${messaging.identifier}</wsrm11:Identifier>
+ </wsrm11:CreateSequenceResponse>
+ </env:Body>
+</env:Envelope>
Property changes on:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/createSequenceResponse.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/echoResponse.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/echoResponse.xml
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/echoResponse.xml 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,19 @@
+<env:Envelope
+
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
+
xmlns:wsrm='http://docs.oasis-open.org/ws-rx/wsrm/200702'
+
xmlns:wsa='http://www.w3.org/2005/08/addressing'>
+ <env:Header
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
+ <wsa:To env:mustUnderstand="1">${addressing.to}</wsa:To>
+ <wsa:RelatesTo>${addressing.relatesto}</wsa:RelatesTo>
+ <wsa:Action
env:mustUnderstand="1">${addressing.action}</wsa:Action>
+ <wsrm:SequenceAcknowledgement>
+ <wsrm:Identifier>${messaging.identifier}</wsrm:Identifier>
+ <wsrm:AcknowledgementRange Upper='${messaging.upper}'
Lower='${messaging.lower}'/>
+ </wsrm:SequenceAcknowledgement>
+ </env:Header>
+ <env:Body>
+ <ns1:echoResponse xmlns:ns1='http://org.jboss.ws/jaxws/wsrm'>
+ <result>Hello World</result>
+ </ns1:echoResponse>
+ </env:Body>
+</env:Envelope>
Property changes on:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/echoResponse.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/terminateSequenceResponse.xml
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/terminateSequenceResponse.xml
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/terminateSequenceResponse.xml 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,15 @@
+<env:Envelope
+
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
+
xmlns:wsrm11='http://docs.oasis-open.org/ws-rx/wsrm/200702'
+
xmlns:wsa='http://www.w3.org/2005/08/addressing'>
+ <env:Header>
+ <wsa:To env:mustUnderstand="1">${addressing.to}</wsa:To>
+ <wsa:RelatesTo>${addressing.relatesto}</wsa:RelatesTo>
+ <wsa:Action
env:mustUnderstand="1">${addressing.action}</wsa:Action>
+ </env:Header>
+ <env:Body>
+ <wsrm11:TerminateSequenceResponse>
+ <wsrm11:Identifier>${messaging.identifier}</wsrm11:Identifier>
+ </wsrm11:TerminateSequenceResponse>
+ </env:Body>
+</env:Envelope>
Property changes on:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/terminateSequenceResponse.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,6 @@
+port=8080
+#path=/jaxws-wsrm/OneWayService
+path=/jaxws-wsrm-emulator/OneWayService
+#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
+archives=jaxws-wsrm-emulator.war, jaxws-wsrm-client.jar
+emulator=true
\ No newline at end of file
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties 2007-11-05
21:51:06 UTC (rev 4990)
@@ -0,0 +1,6 @@
+port=8080
+#path=/jaxws-wsrm/ReqResService
+path=/jaxws-wsrm-emulator/ReqResService
+#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
+archives=jaxws-wsrm-emulator.war, jaxws-wsrm-client.jar
+emulator=true
\ No newline at end of file