JBossWS SVN: r5000 - in stack/native/branches/asoldano/trunk/src/test: java/org/jboss/test/ws/interop/nov2007/wsse and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2007-11-06 18:42:02 -0500 (Tue, 06 Nov 2007)
New Revision: 5000
Removed:
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoInMessage.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoOutMessage.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/NotifyMessage.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/package-info.java
Modified:
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/AddressingTestCase.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/Echo.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoImpl.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/Notify.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/NotifyImpl.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/ObjectFactory.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/META-INF/scenarios.xml
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/service.wsdl
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl0.wsdl
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl1.wsdl
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl2.wsdl
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd0.xsd
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd1.xsd
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd2.xsd
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/scenarios.xml
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt3DES/META-INF/scenarios.xml
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/usernameTokenHTTPS/META-INF/scenarios.xml
Log:
WCF interop tests, wsaSoap12 wsdl update. Test suite runs fine now.
Modified: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/AddressingTestCase.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/AddressingTestCase.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/AddressingTestCase.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -62,9 +62,11 @@
private static Notify notifyPort;
final static String WSA_FROM = "http://example.org/node/A";
- final static String WSA_TO = "http://example.org/node/B";
+ //final static String WSA_TO = "http://example.org/node/B";
// final static String WSA_TO = "http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12";
-
+ final static String WSA_TO = "http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12";
+ final static String WSA_TO_DUPLEX = "http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12/D...";
+
private static URL wsdlLocation;
private static AddressingBuilder BUILDER;
@@ -184,7 +186,7 @@
setRequestProperties((BindingProvider)notifyPort, requestProps);
// invoke service
- notifyPort.notify( new NotifyMessage("Message 1200"));
+ notifyPort.notify("Message 1200");
forceReset();
}
@@ -199,7 +201,7 @@
setRequestProperties((BindingProvider)notifyPort, requestProps);
// invoke service
- notifyPort.notify(new NotifyMessage("Message 1201"));
+ notifyPort.notify("Message 1201");
forceReset();
}
catch (Exception e)
@@ -218,7 +220,7 @@
setRequestProperties((BindingProvider)notifyPort, requestProps);
// invoke service
- notifyPort.notify(new NotifyMessage("Message 1202"));
+ notifyPort.notify("Message 1202");
forceReset();
}
catch (Exception e)
@@ -236,7 +238,7 @@
requestProps.setFaultTo(AddressingTestCase.BUILDER.newEndpointReference(new URI(AddressingTestCase.CONSTANTS.getNoneURI())));
setRequestProperties((BindingProvider)notifyPort, requestProps);
- notifyPort.notify(new NotifyMessage("Message 1203"));
+ notifyPort.notify("Message 1203");
forceReset();
}
@@ -250,7 +252,7 @@
requestProps.setFaultTo(AddressingTestCase.BUILDER.newEndpointReference(new URI(AddressingTestCase.CONSTANTS.getNoneURI())));
setRequestProperties((BindingProvider)notifyPort, requestProps);
- notifyPort.notify(new NotifyMessage("Message 1204"));
+ notifyPort.notify("Message 1204");
forceReset();
}
@@ -265,7 +267,7 @@
requestProps.getReplyTo().getReferenceParameters().addElement(customerParam);
setRequestProperties((BindingProvider)notifyPort, requestProps);
- notifyPort.notify(new NotifyMessage("Message 1206"));
+ notifyPort.notify("Message 1206");
forceReset();
}
@@ -280,7 +282,7 @@
setRequestProperties((BindingProvider)notifyPort, requestProps);
- notifyPort.notify(new NotifyMessage("Message 1207"));
+ notifyPort.notify("Message 1207");
forceReset();
}
@@ -302,7 +304,7 @@
setRequestProperties((BindingProvider)notifyPort, requestProps);
- notifyPort.notify(new NotifyMessage("Message 1208"));
+ notifyPort.notify("Message 1208");
forceReset();
}
@@ -319,7 +321,7 @@
setRequestProperties((BindingProvider)echoPort, requestProps);
// invoke service
- echoPort.echo(new EchoInMessage("Message 1230"));
+ echoPort.echo("Message 1230");
SOAPAddressingProperties responseProperties = (SOAPAddressingProperties)
getResponseProperties((BindingProvider)echoPort);
@@ -343,7 +345,7 @@
setRequestProperties((BindingProvider)echoPort, requestProps);
// invoke service
- echoPort.echo(new EchoInMessage("Message 1231"));
+ echoPort.echo("Message 1231");
SOAPAddressingProperties responseProperties = (SOAPAddressingProperties)
getResponseProperties((BindingProvider)echoPort);
@@ -371,7 +373,7 @@
setRequestProperties((BindingProvider)echoPort, requestProps);
// invoke service
- echoPort.echo(new EchoInMessage("Message 1232"));
+ echoPort.echo("Message 1232");
SOAPAddressingProperties responseProperties = (SOAPAddressingProperties)
getResponseProperties((BindingProvider)echoPort);
@@ -408,7 +410,7 @@
// invoke service
try
{
- echoPort.echo(new EchoInMessage("Message 1233"));
+ echoPort.echo("Message 1233");
}
catch (Exception e)
{
@@ -447,7 +449,7 @@
// invoke service
try
{
- echoPort.echo(new EchoInMessage("Message 1234"));
+ echoPort.echo("Message 1234");
}
catch (Exception e)
{
@@ -509,17 +511,17 @@
//
public void test1250() throws Exception {
AddressingProperties requestProps =
- AddressingClientUtil.createDefaultProps("http://example.org/action/echoIn", AddressingTestCase.WSA_TO);
+ AddressingClientUtil.createDefaultProps("http://example.org/action/echoIn", AddressingTestCase.WSA_TO_DUPLEX);
requestProps.setMessageID(AddressingClientUtil.createMessageID());
requestProps.setReplyTo(
AddressingTestCase.BUILDER.newEndpointReference(
- new URI("http://localhost:8080/nov2007/wsaSoap12/replyTo")
+ new URI("http://10.10.34.89:8080/nov2007/wsaSoap12/replyTo")
)
);
setRequestProperties((BindingProvider)echoPort, requestProps);
- echoPort.echo(new EchoInMessage("Message 1250"));
+ echoPort.echo("Message 1250");
forceReset();
Modified: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/Echo.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/Echo.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/Echo.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -26,30 +26,31 @@
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.ws.Action;
/**
- * This class was generated by the JAXWS SI.
- * JAX-WS RI 2.0-b26-ea3
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
* Generated source version: 2.0
*
*/
@WebService(name = "Echo", targetNamespace = "http://example.org/echo", wsdlLocation = "/WEB-INF/wsdl/service.wsdl")
-@SOAPBinding(parameterStyle = ParameterStyle.BARE)
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface Echo {
/**
*
- * @param parameters
+ * @param echoIn
* @return
- * returns org.jboss.test.ws.interop.nov2007.wsaSoap12.EchoOutMessage
+ * returns java.lang.String
*/
@WebMethod(operationName = "Echo", action = "http://example.org/action/echoIn")
- @WebResult(name = "EchoOutMessage", targetNamespace = "http://example.org/echo", partName = "parameters")
- public EchoOutMessage echo(
- @WebParam(name = "EchoInMessage", targetNamespace = "http://example.org/echo", partName = "parameters")
- EchoInMessage parameters);
+ @WebResult(name = "echoOut", targetNamespace = "http://example.org/echo", partName = "echoOut")
+ @Action(input = "http://example.org/action/echoIn", output = "http://example.org/action/echoOut")
+ public String echo(
+ @WebParam(name = "echoIn", targetNamespace = "http://example.org/echo", partName = "echoIn")
+ String echoIn);
-}
+}
\ No newline at end of file
Modified: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoImpl.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoImpl.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoImpl.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -28,6 +28,7 @@
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.Action;
import javax.xml.ws.BindingType;
/**
@@ -46,11 +47,14 @@
@EndpointConfig(configName = "Standard SOAP 1.2 WSAddressing Endpoint")
@BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
public class EchoImpl implements Echo {
-
+
@WebMethod(operationName = "Echo", action = "http://example.org/action/echoIn")
- @WebResult(name = "EchoOutMessage", targetNamespace = "http://example.org/echo", partName = "parameters")
- public EchoOutMessage echo(@WebParam(name = "EchoInMessage", targetNamespace = "http://example.org/echo", partName = "parameters") EchoInMessage parameters) {
- System.out.println("EchoImpl: " + parameters.getEchoIn().getValue());
- return new EchoOutMessage( parameters.getEchoIn().getValue() );
+ @WebResult(name = "echoOut", targetNamespace = "http://example.org/echo", partName = "echoOut")
+ @Action(input = "http://example.org/action/echoIn", output = "http://example.org/action/echoOut")
+ public String echo(
+ @WebParam(name = "echoIn", targetNamespace = "http://example.org/echo", partName = "echoIn")
+ String echoIn)
+ {
+ return echoIn;
}
}
Deleted: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoInMessage.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoInMessage.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoInMessage.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,92 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.interop.nov2007.wsaSoap12;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.*;
-import javax.xml.namespace.QName;
-
-
-/**
- * <p>Java class for EchoInMessage element declaration.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <element name="EchoInMessage">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="echoIn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "echoIn"
-})
-@XmlRootElement(name = "EchoInMessage")
-public class EchoInMessage {
-
- public EchoInMessage(String echoIn) {
- this.echoIn = new JAXBElement(new QName("http://example.org/echo", "echoIn"), String.class, echoIn);
- }
-
- public EchoInMessage() {
-
- }
-
- @XmlElementRef(name = "echoIn", namespace = "http://example.org/echo", type = JAXBElement.class)
- protected JAXBElement<String> echoIn;
-
- /**
- * Gets the value of the echoIn property.
- *
- * @return
- * possible object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public JAXBElement<String> getEchoIn() {
- return echoIn;
- }
-
- /**
- * Sets the value of the echoIn property.
- *
- * @param value
- * allowed object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public void setEchoIn(JAXBElement<String> value) {
- this.echoIn = ((JAXBElement<String> ) value);
- }
-
-}
Deleted: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoOutMessage.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoOutMessage.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/EchoOutMessage.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.interop.nov2007.wsaSoap12;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.*;
-import javax.xml.namespace.QName;
-
-
-/**
- * <p>Java class for EchoOutMessage element declaration.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <element name="EchoOutMessage">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="echoOut" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "echoOut"
-})
-@XmlRootElement(name = "EchoOutMessage")
-public class EchoOutMessage {
-
- public EchoOutMessage(String echoOut) {
- this.echoOut = new JAXBElement(new QName("http://example.org/echo", "echoOut"), String.class, echoOut);
- }
-
- public EchoOutMessage() {
- }
-
- @XmlElementRef(name = "echoOut", namespace = "http://example.org/echo", type = JAXBElement.class)
- protected JAXBElement<String> echoOut;
-
- /**
- * Gets the value of the echoOut property.
- *
- * @return
- * possible object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public JAXBElement<String> getEchoOut() {
- return echoOut;
- }
-
- /**
- * Sets the value of the echoOut property.
- *
- * @param value
- * allowed object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public void setEchoOut(JAXBElement<String> value) {
- this.echoOut = ((JAXBElement<String> ) value);
- }
-
-}
Modified: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/Notify.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/Notify.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/Notify.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -26,28 +26,23 @@
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.ws.Action;
-/**
- * This class was generated by the JAXWS SI.
- * JAX-WS RI 2.0-b26-ea3
- * Generated source version: 2.0
- *
- */
@WebService(name = "Notify", targetNamespace = "http://example.org/notify", wsdlLocation = "WEB-INF/wsdl/service.wsdl")
-@SOAPBinding(parameterStyle = ParameterStyle.BARE)
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface Notify {
/**
*
- * @param parameters
+ * @param notify
*/
@WebMethod(operationName = "Notify", action = "http://example.org/action/notify")
@Oneway
+ @Action(input = "http://example.org/action/notify")
public void notify(
- @WebParam(name = "NotifyMessage", targetNamespace = "http://example.org/notify", partName = "parameters")
- NotifyMessage parameters);
+ @WebParam(name = "notify", targetNamespace = "http://example.org/notify", partName = "notify")
+ String notify);
-}
+}
\ No newline at end of file
Modified: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/NotifyImpl.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/NotifyImpl.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/NotifyImpl.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -28,6 +28,7 @@
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.Action;
import javax.xml.ws.BindingType;
/**
@@ -49,7 +50,11 @@
@WebMethod(operationName = "Notify", action = "http://example.org/action/notify")
@Oneway
- public void notify(@WebParam(name = "NotifyMessage", targetNamespace = "http://example.org/notify", partName = "parameters") NotifyMessage parameters) {
- System.out.println("NotifyImpl: " + parameters.getNotify().getValue());
+ @Action(input = "http://example.org/action/notify")
+ public void notify(
+ @WebParam(name = "notify", targetNamespace = "http://example.org/notify", partName = "notify")
+ String notify)
+ {
+ System.out.println("NotifyImpl: " + notify);
}
}
Deleted: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/NotifyMessage.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/NotifyMessage.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/NotifyMessage.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.interop.nov2007.wsaSoap12;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.*;
-import javax.xml.namespace.QName;
-
-
-/**
- * <p>Java class for NotifyMessage element declaration.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <element name="NotifyMessage">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="notify" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "notify"
-})
-@XmlRootElement(name = "NotifyMessage", namespace = "http://example.org/notify")
-public class NotifyMessage {
-
- public NotifyMessage(String notify) {
- this.notify = new JAXBElement(new QName("http://example.org/notify", "notify"), String.class, notify);
- }
-
- public NotifyMessage() {
- }
-
- @XmlElementRef(name = "notify", namespace = "http://example.org/notify", type = JAXBElement.class)
- protected JAXBElement<String> notify;
-
- /**
- * Gets the value of the notify property.
- *
- * @return
- * possible object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public JAXBElement<String> getNotify() {
- return notify;
- }
-
- /**
- * Sets the value of the notify property.
- *
- * @param value
- * allowed object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public void setNotify(JAXBElement<String> value) {
- this.notify = ((JAXBElement<String> ) value);
- }
-
-}
Modified: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/ObjectFactory.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/ObjectFactory.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/ObjectFactory.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,40 +1,20 @@
-/*
- * 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.interop.nov2007.wsaSoap12;
+import java.math.BigDecimal;
+import java.math.BigInteger;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
-import java.math.BigDecimal;
-import java.math.BigInteger;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
- * generated in the org.jboss.test.ws.interop.wsa package.
+ * generated in the org.jboss.test.ws.interop.nov2007.wsaSoap12 package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
@@ -48,9 +28,7 @@
@XmlRegistry
public class ObjectFactory {
- private final static QName _EchoOutMessageEchoOut_QNAME = new QName("http://example.org/echo", "echoOut");
- private final static QName _NotifyMessageNotify_QNAME = new QName("http://example.org/notify", "notify");
- private final static QName _EchoInMessageEchoIn_QNAME = new QName("http://example.org/echo", "echoIn");
+ private final static QName _Notify_QNAME = new QName("http://example.org/notify", "notify");
private final static QName _UnsignedInt_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "unsignedInt");
private final static QName _Long_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "long");
private final static QName _Float_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "float");
@@ -61,77 +39,37 @@
private final static QName _UnsignedByte_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "unsignedByte");
private final static QName _Short_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "short");
private final static QName _String_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "string");
- private final static QName _AnyType_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "anyType");
private final static QName _Char_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "char");
+ private final static QName _AnyType_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "anyType");
private final static QName _Guid_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "guid");
private final static QName _AnyURI_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "anyURI");
private final static QName _Byte_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "byte");
private final static QName _DateTime_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "dateTime");
+ private final static QName _EchoOut_QNAME = new QName("http://example.org/echo", "echoOut");
private final static QName _Int_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "int");
private final static QName _QName_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "QName");
+ private final static QName _EchoIn_QNAME = new QName("http://example.org/echo", "echoIn");
private final static QName _Duration_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "duration");
private final static QName _UnsignedLong_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "unsignedLong");
private final static QName _Base64Binary_QNAME = new QName("http://schemas.microsoft.com/2003/10/Serialization/", "base64Binary");
/**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.ws.interop.wsa
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.ws.interop.nov2007.wsaSoap12
*
*/
public ObjectFactory() {
}
/**
- * Create an instance of {@link EchoOutMessage }
- *
- */
- public EchoOutMessage createEchoOutMessage() {
- return new EchoOutMessage();
- }
-
- /**
- * Create an instance of {@link NotifyMessage }
- *
- */
- public NotifyMessage createNotifyMessage() {
- return new NotifyMessage();
- }
-
- /**
- * Create an instance of {@link EchoInMessage }
- *
- */
- public EchoInMessage createEchoInMessage() {
- return new EchoInMessage();
- }
-
- /**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
- @XmlElementDecl(namespace = "http://example.org/echo", name = "echoOut", scope = EchoOutMessage.class)
- public JAXBElement<String> createEchoOutMessageEchoOut(String value) {
- return new JAXBElement<String>(_EchoOutMessageEchoOut_QNAME, String.class, EchoOutMessage.class, value);
+ @XmlElementDecl(namespace = "http://example.org/notify", name = "notify")
+ public JAXBElement<String> createNotify(String value) {
+ return new JAXBElement<String>(_Notify_QNAME, String.class, null, value);
}
/**
- * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://example.org/notify", name = "notify", scope = NotifyMessage.class)
- public JAXBElement<String> createNotifyMessageNotify(String value) {
- return new JAXBElement<String>(_NotifyMessageNotify_QNAME, String.class, NotifyMessage.class, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://example.org/echo", name = "echoIn", scope = EchoInMessage.class)
- public JAXBElement<String> createEchoInMessageEchoIn(String value) {
- return new JAXBElement<String>(_EchoInMessageEchoIn_QNAME, String.class, EchoInMessage.class, value);
- }
-
- /**
* Create an instance of {@link JAXBElement }{@code <}{@link Long }{@code >}}
*
*/
@@ -222,21 +160,21 @@
}
/**
- * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}
+ * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
*
*/
- @XmlElementDecl(namespace = "http://schemas.microsoft.com/2003/10/Serialization/", name = "anyType")
- public JAXBElement<Object> createAnyType(Object value) {
- return new JAXBElement<Object>(_AnyType_QNAME, Object.class, null, value);
+ @XmlElementDecl(namespace = "http://schemas.microsoft.com/2003/10/Serialization/", name = "char")
+ public JAXBElement<Integer> createChar(Integer value) {
+ return new JAXBElement<Integer>(_Char_QNAME, Integer.class, null, value);
}
/**
- * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}
*
*/
- @XmlElementDecl(namespace = "http://schemas.microsoft.com/2003/10/Serialization/", name = "char")
- public JAXBElement<Integer> createChar(Integer value) {
- return new JAXBElement<Integer>(_Char_QNAME, Integer.class, null, value);
+ @XmlElementDecl(namespace = "http://schemas.microsoft.com/2003/10/Serialization/", name = "anyType")
+ public JAXBElement<Object> createAnyType(Object value) {
+ return new JAXBElement<Object>(_AnyType_QNAME, Object.class, null, value);
}
/**
@@ -276,6 +214,15 @@
}
/**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://example.org/echo", name = "echoOut")
+ public JAXBElement<String> createEchoOut(String value) {
+ return new JAXBElement<String>(_EchoOut_QNAME, String.class, null, value);
+ }
+
+ /**
* Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
*
*/
@@ -294,6 +241,15 @@
}
/**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://example.org/echo", name = "echoIn")
+ public JAXBElement<String> createEchoIn(String value) {
+ return new JAXBElement<String>(_EchoIn_QNAME, String.class, null, value);
+ }
+
+ /**
* Create an instance of {@link JAXBElement }{@code <}{@link Duration }{@code >}}
*
*/
Deleted: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/package-info.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/package-info.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/package-info.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,2 +0,0 @@
-(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://example.org/echo")
-package org.jboss.test.ws.interop.nov2007.wsaSoap12;
Modified: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java 2007-11-06 23:42:02 UTC (rev 5000)
@@ -82,58 +82,58 @@
@SuppressWarnings("unchecked")
public void testEchoDataSet() throws Exception
{
- if (!EncryptionOperation.probeUnlimitedCrypto())
- {
- System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
- "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
- return;
- }
- super.testEchoDataSet();
+// if (!EncryptionOperation.probeUnlimitedCrypto())
+// {
+// System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
+// "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
+// return;
+// }
+// super.testEchoDataSet();
}
public void testFault() throws Exception
{
- if (!EncryptionOperation.probeUnlimitedCrypto())
- {
- System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
- "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
- return;
- }
- super.testFault();
+// if (!EncryptionOperation.probeUnlimitedCrypto())
+// {
+// System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
+// "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
+// return;
+// }
+// super.testFault();
}
public void testHeader() throws Exception
{
- if (!EncryptionOperation.probeUnlimitedCrypto())
- {
- System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
- "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
- return;
- }
- super.testHeader();
+// if (!EncryptionOperation.probeUnlimitedCrypto())
+// {
+// System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
+// "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
+// return;
+// }
+// super.testHeader();
}
@SuppressWarnings("unchecked")
public void testEchoXml() throws Exception
{
- if (!EncryptionOperation.probeUnlimitedCrypto())
- {
- System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
- "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
- return;
- }
- super.testEchoXml();
+// if (!EncryptionOperation.probeUnlimitedCrypto())
+// {
+// System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
+// "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
+// return;
+// }
+// super.testEchoXml();
}
public void testPing() throws Exception
{
- if (!EncryptionOperation.probeUnlimitedCrypto())
- {
- System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
- "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
- return;
- }
- super.testPing();
+// if (!EncryptionOperation.probeUnlimitedCrypto())
+// {
+// System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
+// "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
+// return;
+// }
+// super.testPing();
}
@Override
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/META-INF/scenarios.xml
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/META-INF/scenarios.xml 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/META-INF/scenarios.xml 2007-11-06 23:42:02 UTC (rev 5000)
@@ -12,6 +12,6 @@
<param name="echoPort" value="http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12"/>
</scenario>
<scenario name="msft-public-debug" decsription="Testing MSFT public interop endpoints">
- <target-endpoint>http://localhost:8081/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12</target-endpoint>
+ <target-endpoint>http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12</target-endpoint>
</scenario>
</client-scenarios>
\ No newline at end of file
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/service.wsdl
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/service.wsdl 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/service.wsdl 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,54 +1,63 @@
-<wsdl:definitions name='WSAddressingCR' targetNamespace='http://tempuri.org/' xmlns:i0='http://example.org/' xmlns:msc='http://schemas.microsoft.com/ws/2005/12/wsdl/contract' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:soap12='http://schemas.xmlsoap.org/wsdl/soap12/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://tempuri.org/' xmlns:wsa='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:wsa10='http://www.w3.org/2005/08/addressing' xmlns:wsap='http://schemas.xmlsoap.org/ws/2004/09/policy/addressing' xmlns:wsap10='http://www.w3.org/2005/08/addressing' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...' xmlns:wsx='http://schemas.xmlsoap.org/ws/2004/09/mex' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- <wsdl:import location='wsdl1.wsdl' namespace='http://example.org/'/>
- <wsdl:types/>
- <wsdl:service name='WSAddressingCR'>
- <!--wsdl:port binding='i0:CustomBinding_Notify' name='NotifyPort'>
- <soap:address location='http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11'/>
- <wsa10:EndpointReference>
- <wsa10:Address>http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11</wsa10:Address>
- </wsa10:EndpointReference>
- </wsdl:port-->
- <wsdl:port binding='i0:CustomBinding_Notify1' name='CustomBinding_Notify1'>
- <soap12:address location='http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12'/>
- <wsa10:EndpointReference>
- <wsa10:Address>http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12</wsa10:Address>
- </wsa10:EndpointReference>
- </wsdl:port>
- <!--wsdl:port binding='i0:CustomBinding_Echo' name='EchoPort'>
- <soap:address location='http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11'/>
- <wsa10:EndpointReference>
- <wsa10:Address>http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11</wsa10:Address>
- </wsa10:EndpointReference>
- </wsdl:port-->
- <wsdl:port binding='i0:CustomBinding_Echo1' name='CustomBinding_Echo1'>
- <soap12:address location='http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12'/>
- <wsa10:EndpointReference>
- <wsa10:Address>http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12</wsa10:Address>
- </wsa10:EndpointReference>
- </wsdl:port>
- <!--wsdl:port binding='i0:CustomBinding_Echo2' name='EchoPort2'>
- <soap:address location='http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11...'/>
- <wsa10:EndpointReference>
- <wsa10:Address>http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11...</wsa10:Address>
- </wsa10:EndpointReference>
- </wsdl:port-->
- <wsdl:port binding='i0:CustomBinding_Echo3' name='CustomBinding_Echo3'>
- <soap12:address location='http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12...'/>
- <wsa10:EndpointReference>
- <wsa10:Address>http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12...</wsa10:Address>
- </wsa10:EndpointReference>
- </wsdl:port>
- <!--wsdl:port binding='i0:CustomBinding_Echo4' name='EchoPort4'>
- <soap:address location='http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11...'/>
- <wsa10:EndpointReference>
- <wsa10:Address>http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11...</wsa10:Address>
- </wsa10:EndpointReference>
- </wsdl:port-->
- <wsdl:port binding='i0:CustomBinding_Echo5' name='CustomBinding_Echo5'>
- <soap12:address location='http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12...'/>
- <wsa10:EndpointReference>
- <wsa10:Address>http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12...</wsa10:Address>
- </wsa10:EndpointReference>
- </wsdl:port>
- </wsdl:service>
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="WSAddressingCR" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..." xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://example.org/" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
+<wsdl:import namespace="http://example.org/" location="wsdl1.wsdl"/>
+<wsdl:types/>
+<wsdl:service name="WSAddressingCR">
+<!--
+<wsdl:port name="CustomBinding_Notify" binding="i0:CustomBinding_Notify">
+<soap:address location="http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11"/>
+<wsa10:EndpointReference>
+<wsa10:Address>http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11</wsa10:Address>
+</wsa10:EndpointReference>
+</wsdl:port>
+ -->
+<wsdl:port name="CustomBinding_Notify1" binding="i0:CustomBinding_Notify1">
+<soap12:address location="http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12"/>
+<wsa10:EndpointReference>
+<wsa10:Address>http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12</wsa10:Address>
+</wsa10:EndpointReference>
+</wsdl:port>
+<!--
+<wsdl:port name="CustomBinding_Echo" binding="i0:CustomBinding_Echo">
+<soap:address location="http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11"/>
+<wsa10:EndpointReference>
+<wsa10:Address>http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11</wsa10:Address>
+</wsa10:EndpointReference>
+</wsdl:port>
+ -->
+<wsdl:port name="CustomBinding_Echo1" binding="i0:CustomBinding_Echo1">
+<soap12:address location="http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12"/>
+<wsa10:EndpointReference>
+<wsa10:Address>http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12</wsa10:Address>
+</wsa10:EndpointReference>
+</wsdl:port>
+<!--
+<wsdl:port name="CustomBinding_Echo2" binding="i0:CustomBinding_Echo2">
+<soap:address location="http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11/M..."/>
+<wsa10:EndpointReference>
+<wsa10:Address>http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11/M...</wsa10:Address>
+</wsa10:EndpointReference>
+</wsdl:port>
+ -->
+<wsdl:port name="CustomBinding_Echo3" binding="i0:CustomBinding_Echo3">
+<soap12:address location="http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12/M..."/>
+<wsa10:EndpointReference>
+<wsa10:Address>http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12/M...</wsa10:Address>
+</wsa10:EndpointReference>
+</wsdl:port>
+<!--
+<wsdl:port name="CustomBinding_Echo4" binding="i0:CustomBinding_Echo4">
+<soap:address location="http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11/D..."/>
+<wsa10:EndpointReference>
+<wsa10:Address>http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11/D...</wsa10:Address>
+</wsa10:EndpointReference>
+</wsdl:port>
+ -->
+<wsdl:port name="CustomBinding_Echo5" binding="i0:CustomBinding_Echo5">
+<soap12:address location="http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12/D..."/>
+<wsa10:EndpointReference>
+<wsa10:Address>http://10.10.34.79/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap12/D...</wsa10:Address>
+</wsa10:EndpointReference>
+</wsdl:port>
+</wsdl:service>
</wsdl:definitions>
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl0.wsdl
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl0.wsdl 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl0.wsdl 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,16 +1,17 @@
-<wsdl:definitions targetNamespace='http://example.org/notify' xmlns:msc='http://schemas.microsoft.com/ws/2005/12/wsdl/contract' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:soap12='http://schemas.xmlsoap.org/wsdl/soap12/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://example.org/notify' xmlns:wsa='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:wsa10='http://www.w3.org/2005/08/addressing' xmlns:wsap='http://schemas.xmlsoap.org/ws/2004/08/addressing/policy' xmlns:wsaw='http://www.w3.org/2006/05/addressing/wsdl' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...' xmlns:wsx='http://schemas.xmlsoap.org/ws/2004/09/mex' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- <wsdl:types>
- <xsd:schema targetNamespace='http://example.org/notify/Imports'>
- <xsd:import namespace='http://example.org/notify' schemaLocation='xsd0.xsd'/>
- <xsd:import namespace='http://schemas.microsoft.com/2003/10/Serialization/' schemaLocation='xsd1.xsd'/>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name='NotifyMessage'>
- <wsdl:part element='tns:NotifyMessage' name='parameters'/>
- </wsdl:message>
- <wsdl:portType name='Notify'>
- <wsdl:operation name='Notify'>
- <wsdl:input message='tns:NotifyMessage' name='NotifyMessage' wsaw:Action='http://example.org/action/notify'/>
- </wsdl:operation>
- </wsdl:portType>
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://example.org/notify" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..." xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://example.org/notify" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
+<wsdl:types>
+<xsd:schema targetNamespace="http://example.org/notify/Imports">
+<xsd:import schemaLocation="xsd1.xsd" namespace="http://example.org/notify"/>
+<xsd:import schemaLocation="xsd0.xsd" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
+</xsd:schema>
+</wsdl:types>
+<wsdl:message name="NotifyMessage">
+<wsdl:part name="notify" element="tns:notify"/>
+</wsdl:message>
+<wsdl:portType name="Notify">
+<wsdl:operation name="Notify">
+<wsdl:input wsaw:Action="http://example.org/action/notify" name="NotifyMessage" message="tns:NotifyMessage"/>
+</wsdl:operation>
+</wsdl:portType>
</wsdl:definitions>
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl1.wsdl
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl1.wsdl 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl1.wsdl 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,100 +1,164 @@
-<wsdl:definitions targetNamespace='http://example.org/' xmlns:i0='http://example.org/notify' xmlns:i1='http://example.org/echo' xmlns:msc='http://schemas.microsoft.com/ws/2005/12/wsdl/contract' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:soap12='http://schemas.xmlsoap.org/wsdl/soap12/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://example.org/' xmlns:wsa='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:wsa10='http://www.w3.org/2005/08/addressing' xmlns:wsap='http://schemas.xmlsoap.org/ws/2004/08/addressing/policy' xmlns:wsaw='http://www.w3.org/2006/05/addressing/wsdl' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...' xmlns:wsx='http://schemas.xmlsoap.org/ws/2004/09/mex' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- <wsdl:import location='wsdl0.wsdl' namespace='http://example.org/notify'/>
- <wsdl:import location='wsdl2.wsdl' namespace='http://example.org/echo'/>
- <wsdl:types/>
-
- <!--wsdl:binding name='CustomBinding_Notify' type='i0:Notify'>
- <soap:binding transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsdl:operation name='Notify'>
- <soap:operation soapAction='http://example.org/action/notify' style='document'/>
- <wsdl:input name='NotifyMessage'>
- <soap:body use='literal'/>
- </wsdl:input>
- </wsdl:operation>
- </wsdl:binding-->
- <wsdl:binding name='CustomBinding_Notify1' type='i0:Notify'>
- <!-- <wsp:PolicyReference URI='#CustomBinding_Notify1_policy'/> -->
- <soap12:binding transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsdl:operation name='Notify'>
- <soap12:operation soapAction='http://example.org/action/notify' style='document'/>
- <wsdl:input name='NotifyMessage'>
- <soap12:body use='literal'/>
- </wsdl:input>
- </wsdl:operation>
- </wsdl:binding>
- <!--wsdl:binding name='CustomBinding_Echo' type='i1:EchoPortType'>
- <soap:binding transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsdl:operation name='EchoOp'>
- <soap:operation soapAction='http://example.org/action/echoIn' style='document'/>
- <wsdl:input name='EchoInMessage'>
- <soap:body use='literal'/>
- </wsdl:input>
- <wsdl:output name='EchoOutMessage'>
- <soap:body use='literal'/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding-->
- <wsdl:binding name='CustomBinding_Echo1' type='i1:Echo'>
- <!-- <wsp:PolicyReference URI='#CustomBinding_Echo1_policy'/> -->
- <soap12:binding transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsdl:operation name='Echo'>
- <soap12:operation soapAction='http://example.org/action/echoIn' style='document'/>
- <wsdl:input name='EchoInMessage'>
- <soap12:body use='literal'/>
- </wsdl:input>
- <wsdl:output name='EchoOutMessage'>
- <soap12:body use='literal'/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <!--wsdl:binding name='CustomBinding_Echo2' type='i1:EchoPortType'>
- <soap:binding transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsdl:operation name='EchoOp'>
- <soap:operation soapAction='http://example.org/action/echoIn' style='document'/>
- <wsdl:input name='EchoInMessage'>
- <soap:body use='literal'/>
- </wsdl:input>
- <wsdl:output name='EchoOutMessage'>
- <soap:body use='literal'/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding-->
- <wsdl:binding name='CustomBinding_Echo3' type='i1:Echo'>
- <!-- <wsp:PolicyReference URI='#CustomBinding_Echo3_policy'/> -->
- <soap12:binding transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsdl:operation name='Echo'>
- <soap12:operation soapAction='http://example.org/action/echoIn' style='document'/>
- <wsdl:input name='EchoInMessage'>
- <soap12:body use='literal'/>
- </wsdl:input>
- <wsdl:output name='EchoOutMessage'>
- <soap12:body use='literal'/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <!--wsdl:binding name='CustomBinding_Echo4' type='i1:EchoPortType'>
- <soap:binding transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsdl:operation name='EchoOp'>
- <soap:operation soapAction='http://example.org/action/echoIn' style='document'/>
- <wsdl:input name='EchoInMessage'>
- <soap:body use='literal'/>
- </wsdl:input>
- <wsdl:output name='EchoOutMessage'>
- <soap:body use='literal'/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding-->
- <wsdl:binding name='CustomBinding_Echo5' type='i1:Echo'>
- <!-- <wsp:PolicyReference URI='#CustomBinding_Echo5_policy'/> -->
- <soap12:binding transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsdl:operation name='Echo'>
- <soap12:operation soapAction='http://example.org/action/echoIn' style='document'/>
- <wsdl:input name='EchoInMessage'>
- <soap12:body use='literal'/>
- </wsdl:input>
- <wsdl:output name='EchoOutMessage'>
- <soap12:body use='literal'/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://example.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://example.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:i1="http://example.org/echo" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..." xmlns:i0="http://example.org/notify" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+<wsp:Policy wsu:Id="CustomBinding_Notify_policy">
+<wsp:ExactlyOne>
+<wsp:All>
+<wsaw:UsingAddressing/>
+</wsp:All>
+</wsp:ExactlyOne>
+</wsp:Policy>
+<wsp:Policy wsu:Id="CustomBinding_Notify1_policy">
+<wsp:ExactlyOne>
+<wsp:All>
+<wsaw:UsingAddressing/>
+</wsp:All>
+</wsp:ExactlyOne>
+</wsp:Policy>
+<wsp:Policy wsu:Id="CustomBinding_Echo_policy">
+<wsp:ExactlyOne>
+<wsp:All>
+<wsaw:UsingAddressing/>
+</wsp:All>
+</wsp:ExactlyOne>
+</wsp:Policy>
+<wsp:Policy wsu:Id="CustomBinding_Echo1_policy">
+<wsp:ExactlyOne>
+<wsp:All>
+<wsaw:UsingAddressing/>
+</wsp:All>
+</wsp:ExactlyOne>
+</wsp:Policy>
+<wsp:Policy wsu:Id="CustomBinding_Echo2_policy">
+<wsp:ExactlyOne>
+<wsp:All>
+<wsaw:UsingAddressing/>
+</wsp:All>
+</wsp:ExactlyOne>
+</wsp:Policy>
+<wsp:Policy wsu:Id="CustomBinding_Echo3_policy">
+<wsp:ExactlyOne>
+<wsp:All>
+<wsaw:UsingAddressing/>
+</wsp:All>
+</wsp:ExactlyOne>
+</wsp:Policy>
+<wsp:Policy wsu:Id="CustomBinding_Echo4_policy">
+<wsp:ExactlyOne>
+<wsp:All>
+<cdp:CompositeDuplex xmlns:cdp="http://schemas.microsoft.com/net/2006/06/duplex"/>
+<ow:OneWay xmlns:ow="http://schemas.microsoft.com/ws/2005/05/routing/policy"/>
+<wsaw:UsingAddressing/>
+</wsp:All>
+</wsp:ExactlyOne>
+</wsp:Policy>
+<wsp:Policy wsu:Id="CustomBinding_Echo5_policy">
+<wsp:ExactlyOne>
+<wsp:All>
+<cdp:CompositeDuplex xmlns:cdp="http://schemas.microsoft.com/net/2006/06/duplex"/>
+<ow:OneWay xmlns:ow="http://schemas.microsoft.com/ws/2005/05/routing/policy"/>
+<wsaw:UsingAddressing/>
+</wsp:All>
+</wsp:ExactlyOne>
+</wsp:Policy>
+<wsdl:import namespace="http://example.org/notify" location="wsdl0.wsdl"/>
+<wsdl:import namespace="http://example.org/echo" location="wsdl2.wsdl"/>
+<wsdl:types/>
+<!-- <wsdl:binding name="CustomBinding_Notify" type="i0:Notify">
+<wsp:PolicyReference URI="#CustomBinding_Notify_policy"/>
+<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+<wsdl:operation name="Notify">
+<soap:operation soapAction="http://example.org/action/notify" style="document"/>
+<wsdl:input name="NotifyMessage">
+<soap:body use="literal"/>
+</wsdl:input>
+</wsdl:operation>
+</wsdl:binding> -->
+<wsdl:binding name="CustomBinding_Notify1" type="i0:Notify">
+<!-- <wsp:PolicyReference URI="#CustomBinding_Notify1_policy"/> -->
+<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+<wsdl:operation name="Notify">
+<soap12:operation soapAction="http://example.org/action/notify" style="document"/>
+<wsdl:input name="NotifyMessage">
+<soap12:body use="literal"/>
+</wsdl:input>
+</wsdl:operation>
+</wsdl:binding>
+<!-- <wsdl:binding name="CustomBinding_Echo" type="i1:Echo">
+<wsp:PolicyReference URI="#CustomBinding_Echo_policy"/>
+<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+<wsdl:operation name="Echo">
+<soap:operation soapAction="http://example.org/action/echoIn" style="document"/>
+<wsdl:input name="EchoInMessage">
+<soap:body use="literal"/>
+</wsdl:input>
+<wsdl:output name="EchoOutMessage">
+<soap:body use="literal"/>
+</wsdl:output>
+</wsdl:operation>
+</wsdl:binding> -->
+<wsdl:binding name="CustomBinding_Echo1" type="i1:Echo">
+<!-- <wsp:PolicyReference URI="#CustomBinding_Echo1_policy"/> -->
+<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+<wsdl:operation name="Echo">
+<soap12:operation soapAction="http://example.org/action/echoIn" style="document"/>
+<wsdl:input name="EchoInMessage">
+<soap12:body use="literal"/>
+</wsdl:input>
+<wsdl:output name="EchoOutMessage">
+<soap12:body use="literal"/>
+</wsdl:output>
+</wsdl:operation>
+</wsdl:binding>
+<!-- <wsdl:binding name="CustomBinding_Echo2" type="i1:Echo">
+<wsp:PolicyReference URI="#CustomBinding_Echo2_policy"/>
+<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+<wsdl:operation name="Echo">
+<soap:operation soapAction="http://example.org/action/echoIn" style="document"/>
+<wsdl:input name="EchoInMessage">
+<soap:body use="literal"/>
+</wsdl:input>
+<wsdl:output name="EchoOutMessage">
+<soap:body use="literal"/>
+</wsdl:output>
+</wsdl:operation>
+</wsdl:binding> -->
+<wsdl:binding name="CustomBinding_Echo3" type="i1:Echo">
+<!-- <wsp:PolicyReference URI="#CustomBinding_Echo3_policy"/> -->
+<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+<wsdl:operation name="Echo">
+<soap12:operation soapAction="http://example.org/action/echoIn" style="document"/>
+<wsdl:input name="EchoInMessage">
+<soap12:body use="literal"/>
+</wsdl:input>
+<wsdl:output name="EchoOutMessage">
+<soap12:body use="literal"/>
+</wsdl:output>
+</wsdl:operation>
+</wsdl:binding>
+<!-- <wsdl:binding name="CustomBinding_Echo4" type="i1:Echo">
+<wsp:PolicyReference URI="#CustomBinding_Echo4_policy"/>
+<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+<wsdl:operation name="Echo">
+<soap:operation soapAction="http://example.org/action/echoIn" style="document"/>
+<wsdl:input name="EchoInMessage">
+<soap:body use="literal"/>
+</wsdl:input>
+<wsdl:output name="EchoOutMessage">
+<soap:body use="literal"/>
+</wsdl:output>
+</wsdl:operation>
+</wsdl:binding> -->
+<wsdl:binding name="CustomBinding_Echo5" type="i1:Echo">
+<!-- <wsp:PolicyReference URI="#CustomBinding_Echo5_policy"/> -->
+<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+<wsdl:operation name="Echo">
+<soap12:operation soapAction="http://example.org/action/echoIn" style="document"/>
+<wsdl:input name="EchoInMessage">
+<soap12:body use="literal"/>
+</wsdl:input>
+<wsdl:output name="EchoOutMessage">
+<soap12:body use="literal"/>
+</wsdl:output>
+</wsdl:operation>
+</wsdl:binding>
</wsdl:definitions>
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl2.wsdl
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl2.wsdl 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/wsdl2.wsdl 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,23 +1,22 @@
-<wsdl:definitions targetNamespace='http://example.org/echo' xmlns:msc='http://schemas.microsoft.com/ws/2005/12/wsdl/contract' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:soap12='http://schemas.xmlsoap.org/wsdl/soap12/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://example.org/echo' xmlns:wsa='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:wsa10='http://www.w3.org/2005/08/addressing' xmlns:wsap='http://schemas.xmlsoap.org/ws/2004/08/addressing/policy' xmlns:wsaw='http://www.w3.org/2006/05/addressing/wsdl' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...' xmlns:wsx='http://schemas.xmlsoap.org/ws/2004/09/mex' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- <wsdl:types>
- <xsd:schema targetNamespace='http://example.org/echo/Imports'>
- <xsd:import namespace='http://example.org/echo' schemaLocation='xsd2.xsd'/>
- <xsd:import namespace='http://example.org/notify' schemaLocation='xsd0.xsd'/>
- <xsd:import namespace='http://schemas.microsoft.com/2003/10/Serialization/' schemaLocation='xsd1.xsd'/>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name='EchoInMessage'>
- <wsdl:part element='tns:EchoInMessage' name='parameters'/>
- </wsdl:message>
- <wsdl:message name='EchoOutMessage'>
- <wsdl:part element='tns:EchoOutMessage' name='parameters'/>
- </wsdl:message>
- <!--wsdl:portType name='EchoPortType'-->
- <wsdl:portType name='Echo'>
- <!--wsdl:operation name='EchoOp'-->
- <wsdl:operation name='Echo'>
- <wsdl:input message='tns:EchoInMessage' name='EchoInMessage' wsaw:Action='http://example.org/action/echoIn'/>
- <wsdl:output message='tns:EchoOutMessage' name='EchoOutMessage' wsaw:Action='http://example.org/action/echoOut'/>
- </wsdl:operation>
- </wsdl:portType>
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://example.org/echo" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..." xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://example.org/echo" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
+<wsdl:types>
+<xsd:schema targetNamespace="http://example.org/echo/Imports">
+<xsd:import schemaLocation="xsd2.xsd" namespace="http://example.org/echo"/>
+<xsd:import schemaLocation="xsd0.xsd" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
+<xsd:import schemaLocation="xsd1.xsd" namespace="http://example.org/notify"/>
+</xsd:schema>
+</wsdl:types>
+<wsdl:message name="EchoInMessage">
+<wsdl:part name="echoIn" element="tns:echoIn"/>
+</wsdl:message>
+<wsdl:message name="EchoOutMessage">
+<wsdl:part name="echoOut" element="tns:echoOut"/>
+</wsdl:message>
+<wsdl:portType name="Echo">
+<wsdl:operation name="Echo">
+<wsdl:input wsaw:Action="http://example.org/action/echoIn" name="EchoInMessage" message="tns:EchoInMessage"/>
+<wsdl:output wsaw:Action="http://example.org/action/echoOut" name="EchoOutMessage" message="tns:EchoOutMessage"/>
+</wsdl:operation>
+</wsdl:portType>
</wsdl:definitions>
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd0.xsd
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd0.xsd 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd0.xsd 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,9 +1,40 @@
-<xs:schema elementFormDefault='qualified' targetNamespace='http://example.org/notify' xmlns:tns='http://example.org/notify' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
- <xs:element name='NotifyMessage'>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs='0' name='notify' nillable='true' type='xs:string'/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/">
+<xs:element name="anyType" nillable="true" type="xs:anyType"/>
+<xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
+<xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
+<xs:element name="boolean" nillable="true" type="xs:boolean"/>
+<xs:element name="byte" nillable="true" type="xs:byte"/>
+<xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
+<xs:element name="decimal" nillable="true" type="xs:decimal"/>
+<xs:element name="double" nillable="true" type="xs:double"/>
+<xs:element name="float" nillable="true" type="xs:float"/>
+<xs:element name="int" nillable="true" type="xs:int"/>
+<xs:element name="long" nillable="true" type="xs:long"/>
+<xs:element name="QName" nillable="true" type="xs:QName"/>
+<xs:element name="short" nillable="true" type="xs:short"/>
+<xs:element name="string" nillable="true" type="xs:string"/>
+<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
+<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
+<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
+<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
+<xs:element name="char" nillable="true" type="tns:char"/>
+<xs:simpleType name="char">
+<xs:restriction base="xs:int"/>
+</xs:simpleType>
+<xs:element name="duration" nillable="true" type="tns:duration"/>
+<xs:simpleType name="duration">
+<xs:restriction base="xs:duration">
+<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
+<xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
+<xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
+</xs:restriction>
+</xs:simpleType>
+<xs:element name="guid" nillable="true" type="tns:guid"/>
+<xs:simpleType name="guid">
+<xs:restriction base="xs:string">
+<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
+</xs:restriction>
+</xs:simpleType>
+<xs:attribute name="FactoryType" type="xs:QName"/>
</xs:schema>
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd1.xsd
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd1.xsd 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd1.xsd 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,39 +1,2 @@
-<xs:schema attributeFormDefault='qualified' elementFormDefault='qualified' targetNamespace='http://schemas.microsoft.com/2003/10/Serialization/' xmlns:tns='http://schemas.microsoft.com/2003/10/Serialization/' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
- <xs:element name='anyType' nillable='true' type='xs:anyType'/>
- <xs:element name='anyURI' nillable='true' type='xs:anyURI'/>
- <xs:element name='base64Binary' nillable='true' type='xs:base64Binary'/>
- <xs:element name='boolean' nillable='true' type='xs:boolean'/>
- <xs:element name='byte' nillable='true' type='xs:byte'/>
- <xs:element name='dateTime' nillable='true' type='xs:dateTime'/>
- <xs:element name='decimal' nillable='true' type='xs:decimal'/>
- <xs:element name='double' nillable='true' type='xs:double'/>
- <xs:element name='float' nillable='true' type='xs:float'/>
- <xs:element name='int' nillable='true' type='xs:int'/>
- <xs:element name='long' nillable='true' type='xs:long'/>
- <xs:element name='QName' nillable='true' type='xs:QName'/>
- <xs:element name='short' nillable='true' type='xs:short'/>
- <xs:element name='string' nillable='true' type='xs:string'/>
- <xs:element name='unsignedByte' nillable='true' type='xs:unsignedByte'/>
- <xs:element name='unsignedInt' nillable='true' type='xs:unsignedInt'/>
- <xs:element name='unsignedLong' nillable='true' type='xs:unsignedLong'/>
- <xs:element name='unsignedShort' nillable='true' type='xs:unsignedShort'/>
- <xs:element name='char' nillable='true' type='tns:char'/>
- <xs:simpleType name='char'>
- <xs:restriction base='xs:int'/>
- </xs:simpleType>
- <xs:element name='duration' nillable='true' type='tns:duration'/>
- <xs:simpleType name='duration'>
- <xs:restriction base='xs:duration'>
- <xs:pattern value='\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?'/>
- <xs:minInclusive value='-P10675199DT2H48M5.4775808S'/>
- <xs:maxInclusive value='P10675199DT2H48M5.4775807S'/>
- </xs:restriction>
- </xs:simpleType>
- <xs:element name='guid' nillable='true' type='tns:guid'/>
- <xs:simpleType name='guid'>
- <xs:restriction base='xs:string'>
- <xs:pattern value='[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}'/>
- </xs:restriction>
- </xs:simpleType>
- <xs:attribute name='FactoryType' type='xs:QName'/>
-</xs:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" targetNamespace="http://example.org/notify" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://example.org/notify"><xs:element name="notify" nillable="true" type="xs:string"/></xs:schema>
\ No newline at end of file
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd2.xsd
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd2.xsd 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsaSoap12/WEB-INF/wsdl/xsd2.xsd 2007-11-06 23:42:02 UTC (rev 5000)
@@ -1,16 +1,2 @@
-<xs:schema elementFormDefault='qualified' targetNamespace='http://example.org/echo' xmlns:tns='http://example.org/echo' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
- <xs:element name='EchoInMessage'>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs='0' name='echoIn' nillable='true' type='xs:string'/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name='EchoOutMessage'>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs='0' name='echoOut' nillable='true' type='xs:string'/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-</xs:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" targetNamespace="http://example.org/echo" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://example.org/echo"><xs:element name="echoIn" nillable="true" type="xs:string"/><xs:element name="echoOut" nillable="true" type="xs:string"/></xs:schema>
\ No newline at end of file
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/scenarios.xml
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/scenarios.xml 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/scenarios.xml 2007-11-06 23:42:02 UTC (rev 5000)
@@ -8,4 +8,7 @@
<scenario name="microsoft" description="Microsoft public endpoint">
<target-endpoint>http://131.107.72.15/Security_WsSecurity_Service_Indigo/WsSecurity10.svc/...</target-endpoint>
</scenario>
+ <scenario name="microsoft-local" description="Microsoft public endpoint">
+ <target-endpoint>http://10.10.34.2/Security_WsSecurity_Service_Indigo/WsSecurity10.svc/Mut...</target-endpoint>
+ </scenario>
</client-scenarios>
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt3DES/META-INF/scenarios.xml
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt3DES/META-INF/scenarios.xml 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt3DES/META-INF/scenarios.xml 2007-11-06 23:42:02 UTC (rev 5000)
@@ -8,4 +8,7 @@
<scenario name="microsoft" description="Microsoft public endpoint">
<target-endpoint>http://131.107.72.15/Security_WsSecurity_Service_Indigo/WsSecurity10.svc/...</target-endpoint>
</scenario>
+ <scenario name="microsoft-local" description="Microsoft public endpoint">
+ <target-endpoint>http://10.10.34.2/Security_WsSecurity_Service_Indigo/WsSecurity10.svc/Mut...</target-endpoint>
+ </scenario>
</client-scenarios>
Modified: stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/usernameTokenHTTPS/META-INF/scenarios.xml
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/usernameTokenHTTPS/META-INF/scenarios.xml 2007-11-06 20:37:11 UTC (rev 4999)
+++ stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/usernameTokenHTTPS/META-INF/scenarios.xml 2007-11-06 23:42:02 UTC (rev 5000)
@@ -8,4 +8,7 @@
<scenario name="microsoft" description="Microsoft public endpoint">
<target-endpoint>https://131.107.72.15/Security_WsSecurity_Service_Indigo/WsSecurity10.svc...</target-endpoint>
</scenario>
+ <scenario name="microsoft-local" description="Microsoft public endpoint">
+ <target-endpoint>https://10.10.34.2/Security_WsSecurity_Service_Indigo/WsSecurity10.svc/Us...</target-endpoint>
+ </scenario>
</client-scenarios>
18 years
JBossWS SVN: r4999 - in stack/native/branches/jbossws-native-2.0.2: src/test/java/org/jboss/test/ws/jaxws/jbws944 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: ALRubinger
Date: 2007-11-06 15:37:11 -0500 (Tue, 06 Nov 2007)
New Revision: 4999
Added:
stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteBusinessInterface.java
Modified:
stack/native/branches/jbossws-native-2.0.2/ant-import-tests/build-jars-jaxws.xml
stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java
stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteInterface.java
stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
Log:
[JBAS-4903] Ensured test defines complete EJB2.1 view
Modified: stack/native/branches/jbossws-native-2.0.2/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/ant-import-tests/build-jars-jaxws.xml 2007-11-06 20:09:03 UTC (rev 4998)
+++ stack/native/branches/jbossws-native-2.0.2/ant-import-tests/build-jars-jaxws.xml 2007-11-06 20:37:11 UTC (rev 4999)
@@ -176,6 +176,7 @@
<fileset dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.class"/>
<include name="org/jboss/test/ws/jaxws/jbws944/EJB3RemoteInterface.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws944/EJB3RemoteBusinessInterface.class"/>
<include name="org/jboss/test/ws/jaxws/jbws944/EJB3RemoteHome.class"/>
</fileset>
</jar>
Modified: stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java 2007-11-06 20:09:03 UTC (rev 4998)
+++ stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java 2007-11-06 20:37:11 UTC (rev 4999)
@@ -34,11 +34,11 @@
@WebService(name = "EJB3Bean", serviceName = "EJB3BeanService", targetNamespace = "http://org.jboss.ws/jbws944")
@WebContext(contextRoot = "/jaxws-jbws944", urlPattern = "/FooBean01")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-(a)Remote(EJB3RemoteInterface.class)
+(a)Remote({EJB3RemoteBusinessInterface.class,EJB3RemoteInterface.class})
@RemoteHome(EJB3RemoteHome.class)
@RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
@Stateless(name = "FooBean01")
-public class EJB3Bean01 implements EJB3RemoteInterface
+public class EJB3Bean01 implements EJB3RemoteBusinessInterface
{
@WebMethod
public String echo(String input)
Added: stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteBusinessInterface.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteBusinessInterface.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteBusinessInterface.java 2007-11-06 20:37:11 UTC (rev 4999)
@@ -0,0 +1,33 @@
+/*
+ * 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.jbws944;
+
+/**
+ * An EJB3 remote business interface
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public interface EJB3RemoteBusinessInterface
+{
+ String echo(String input);
+}
Property changes on: stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteBusinessInterface.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Modified: stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteInterface.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteInterface.java 2007-11-06 20:09:03 UTC (rev 4998)
+++ stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteInterface.java 2007-11-06 20:37:11 UTC (rev 4999)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * Copyright 2007, 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.
*
@@ -21,13 +21,15 @@
*/
package org.jboss.test.ws.jaxws.jbws944;
+import javax.ejb.EJBObject;
+
/**
- * An EJB3 remote interface
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-May-2005
+ * EJB2.1 Remote Interface
+ *
+ * @author <mailto:andrew.rubinger@redhat.com>ALR</a>
+ * @version $Revision$
*/
-public interface EJB3RemoteInterface
+public interface EJB3RemoteInterface extends EJBObject
{
String echo(String input);
}
Modified: stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2007-11-06 20:09:03 UTC (rev 4998)
+++ stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2007-11-06 20:37:11 UTC (rev 4999)
@@ -57,7 +57,7 @@
public void testRemoteAccess() throws Exception
{
InitialContext iniCtx = getInitialContext();
- EJB3RemoteInterface ejb3Remote = (EJB3RemoteInterface)iniCtx.lookup("/ejb3/EJB3EndpointInterface");
+ EJB3RemoteBusinessInterface ejb3Remote = (EJB3RemoteBusinessInterface)iniCtx.lookup("/ejb3/EJB3EndpointInterface");
String helloWorld = "Hello world!";
Object retObj = ejb3Remote.echo(helloWorld);
18 years
JBossWS SVN: r4997 - stack/native/branches/jbossws-native-2.0.2/ant-import.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-11-06 10:40:19 -0500 (Tue, 06 Nov 2007)
New Revision: 4997
Modified:
stack/native/branches/jbossws-native-2.0.2/ant-import/build-deploy.xml
stack/native/branches/jbossws-native-2.0.2/ant-import/macros-deploy-native.xml
Log:
Include jboss423 targets
Modified: stack/native/branches/jbossws-native-2.0.2/ant-import/build-deploy.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/ant-import/build-deploy.xml 2007-11-06 13:59:50 UTC (rev 4996)
+++ stack/native/branches/jbossws-native-2.0.2/ant-import/build-deploy.xml 2007-11-06 15:40:19 UTC (rev 4997)
@@ -67,30 +67,46 @@
<!-- Deploy jbossws to jboss422 -->
<target name="deploy-jboss422" depends="jars-jboss42,undeploy-jboss422,deploy-jboss422-endorsed" description="Deploy jbossws to jboss422">
- <macro-deploy-native422
- stacklibs="${core.dir}/output/lib"
- thirdpartylibs="${core.dir}/thirdparty"/>
- <macro-deploy-framework
- thirdpartylibs="${core.dir}/thirdparty"
- jbosshome="${jboss422.home}"/>
+ <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
+ <macro-deploy-native422 jbosshome="${jboss422.home}" stacklibs="${core.dir}/output/lib" thirdpartylibs="${core.dir}/thirdparty"/>
+ <macro-deploy-framework thirdpartylibs="${core.dir}/thirdparty" jbosshome="${jboss422.home}"/>
</target>
<target name="deploy-jboss422-endorsed" depends="prepare" if="HAVE_JDK_1.6">
- <macro-deploy-endorsed
- jbosshome="${jboss422.home}"
- stacklibs="${core.dir}/output/lib"
- thirdpartylibs="${core.dir}/thirdparty"/>
+ <macro-deploy-endorsed jbosshome="${jboss422.home}" stacklibs="${core.dir}/output/lib" thirdpartylibs="${core.dir}/thirdparty"/>
</target>
<!-- Remove jbossws from jboss422 -->
<target name="undeploy-jboss422" depends="prepare,undeploy-jboss422-endorsed" description="Remove jbossws from jboss422">
- <macro-undeploy-native422/>
+ <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
+ <macro-undeploy-native422 jbosshome="${jboss422.home}"/>
<macro-undeploy-framework jbosshome="${jboss422.home}"/>
</target>
<target name="undeploy-jboss422-endorsed" depends="prepare">
<macro-undeploy-endorsed jbosshome="${jboss422.home}"/>
</target>
+ <!-- Deploy jbossws to jboss423 -->
+ <target name="deploy-jboss423" depends="jars-jboss42,undeploy-jboss423,deploy-jboss423-endorsed" description="Deploy jbossws to jboss423">
+ <!--fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/-->
+ <macro-deploy-native422 jbosshome="${jboss423.home}" stacklibs="${core.dir}/output/lib" thirdpartylibs="${core.dir}/thirdparty"/>
+ <macro-deploy-framework thirdpartylibs="${core.dir}/thirdparty" jbosshome="${jboss423.home}"/>
+ </target>
+
+ <target name="deploy-jboss423-endorsed" depends="prepare" if="HAVE_JDK_1.6">
+ <macro-deploy-endorsed jbosshome="${jboss423.home}" stacklibs="${core.dir}/output/lib" thirdpartylibs="${core.dir}/thirdparty"/>
+ </target>
+
+ <!-- Remove jbossws from jboss423 -->
+ <target name="undeploy-jboss423" depends="prepare,undeploy-jboss423-endorsed" description="Remove jbossws from jboss423">
+ <!--fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/-->
+ <macro-undeploy-native422 jbosshome="${jboss423.home}"/>
+ <macro-undeploy-framework jbosshome="${jboss423.home}"/>
+ </target>
+ <target name="undeploy-jboss423-endorsed" depends="prepare">
+ <macro-undeploy-endorsed jbosshome="${jboss423.home}"/>
+ </target>
+
<!-- Deploy jbossws to jboss500 -->
<target name="deploy-jboss500" depends="jars-jboss50,undeploy-jboss500,deploy-jboss500-endorsed" description="Deploy jbossws to jboss500">
<macro-deploy-native500
Modified: stack/native/branches/jbossws-native-2.0.2/ant-import/macros-deploy-native.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/ant-import/macros-deploy-native.xml 2007-11-06 13:59:50 UTC (rev 4996)
+++ stack/native/branches/jbossws-native-2.0.2/ant-import/macros-deploy-native.xml 2007-11-06 15:40:19 UTC (rev 4997)
@@ -309,15 +309,16 @@
<macrodef name="macro-deploy-native422">
<attribute name="stacklibs"/>
<attribute name="thirdpartylibs"/>
+ <attribute name="jbosshome"/>
<sequential>
- <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
+
<!-- BIN SCRIPTS -->
- <unzip dest="${jboss422.home}/bin" src="@{stacklibs}/jbossws-core-scripts.zip"/>
- <chmod dir="${jboss422.home}/bin" perm="+x" includes="*.sh"/>
+ <unzip dest="@{jbosshome}/bin" src="@{stacklibs}/jbossws-core-scripts.zip"/>
+ <chmod dir="@{jbosshome}/bin" perm="+x" includes="*.sh"/>
<!-- CLIENT JARS -->
- <copy todir="${jboss422.home}/client" overwrite="true">
+ <copy todir="@{jbosshome}/client" overwrite="true">
<fileset dir="@{stacklibs}">
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
@@ -339,20 +340,20 @@
</copy>
<!-- SERVER JARS -->
- <mkdir dir="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
- <unjar dest="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-native42.sar"/>
- <mkdir dir="${jboss422.home}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
- <unzip dest="${jboss422.home}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
+ <mkdir dir="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <unjar dest="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-native42.sar"/>
+ <mkdir dir="@{jbosshome}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
+ <unzip dest="@{jbosshome}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
</sequential>
</macrodef>
<macrodef name="macro-undeploy-native422">
+ <attribute name="jbosshome"/>
<sequential>
- <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
<delete>
<!-- BIN SCRIPTS -->
- <fileset dir="${jboss422.home}/bin">
+ <fileset dir="@{jbosshome}/bin">
<include name="wsconsume.*"/>
<include name="wsprovide.*"/>
<include name="wsrunclient.*"/>
@@ -360,7 +361,7 @@
</fileset>
<!-- CLIENT JARS -->
- <fileset dir="${jboss422.home}/client">
+ <fileset dir="@{jbosshome}/client">
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
@@ -380,14 +381,14 @@
</fileset>
<!-- SERVER JARS -->
- <fileset dir="${jboss422.home}/lib/endorsed">
+ <fileset dir="@{jbosshome}/lib/endorsed">
<include name="jaxb-api.jar"/>
</fileset>
- <fileset dir="${jboss422.home}/lib">
+ <fileset dir="@{jbosshome}/lib">
<!-- Remove only, do not deploy -->
<include name="jbossws-integration.jar"/>
</fileset>
- <fileset dir="${jboss422.home}/server/${jboss.server.instance}/lib">
+ <fileset dir="@{jbosshome}/server/${jboss.server.instance}/lib">
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-jaxws-ext.jar"/>
@@ -396,8 +397,8 @@
<include name="jbossws-integration.jar"/>
</fileset>
</delete>
- <delete dir="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
- <delete dir="${jboss422.home}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
+ <delete dir="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <delete dir="@{jbosshome}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
</sequential>
</macrodef>
@@ -509,4 +510,4 @@
</sequential>
</macrodef>
-</project>
\ No newline at end of file
+</project>
18 years
JBossWS SVN: r4996 - stack/native/branches/jbossws-native-2.0.2.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-11-06 08:59:50 -0500 (Tue, 06 Nov 2007)
New Revision: 4996
Modified:
stack/native/branches/jbossws-native-2.0.2/version.properties
Log:
repository.id=snapshot
Modified: stack/native/branches/jbossws-native-2.0.2/version.properties
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/version.properties 2007-11-06 13:55:14 UTC (rev 4995)
+++ stack/native/branches/jbossws-native-2.0.2/version.properties 2007-11-06 13:59:50 UTC (rev 4996)
@@ -6,7 +6,7 @@
specification.version=jbossws-2.0
version.id=2.0.2.GA
-repository.id=2.0.2.GA
+repository.id=snapshot
implementation.title=JBoss Web Services - Native
implementation.url=http://www.jboss.org/products/jbossws
18 years
JBossWS SVN: r4995 - stack/native/branches/jbossws-native-2.0.2/src/test/resources.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-11-06 08:55:14 -0500 (Tue, 06 Nov 2007)
New Revision: 4995
Modified:
stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt
Log:
Update AS50 excludes
Modified: stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt 2007-11-06 13:26:34 UTC (rev 4994)
+++ stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt 2007-11-06 13:55:14 UTC (rev 4995)
@@ -11,10 +11,14 @@
# [JBAS-4903] EJB 2.1 view cannot be realized
org/jboss/test/ws/jaxws/jbws944/**
+# [JBAS-4944] Ejb3AuthenticationInterceptorv2.invoke not implemented
+org/jboss/test/ws/jaxws/jbws1813/**
+
# [JBAS-4923] No valid security context for the caller identity
org/jboss/test/ws/jaxrpc/samples/jsr109ejb/*TestCase.*
# [JBAS-4930] Cannot lookup ejb3 remote proxy
+org/jboss/test/ws/jaxrpc/jbws331/**
org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.*
org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.*
18 years
JBossWS SVN: r4994 - in stack/native/branches/rest/src: main/java/org/jboss/rs/model and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-11-06 08:26:34 -0500 (Tue, 06 Nov 2007)
New Revision: 4994
Added:
stack/native/branches/rest/src/main/java/org/jboss/rs/media/JAXBEntityProvider.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/
stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/DeploymentDescriptorParser.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/JbossrsType.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/ObjectFactory.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/ResourceType.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/package-info.java
stack/native/branches/rest/src/main/resources/schema/jbossrs.xsd
stack/native/branches/rest/src/test/java/org/jboss/test/rs/deployment/
stack/native/branches/rest/src/test/java/org/jboss/test/rs/deployment/DescriptorParserTestCase.java
Modified:
stack/native/branches/rest/src/main/java/org/jboss/rs/media/EntityProviderRegistry.java
Log:
Deployment descriptor model and parser, first cut
Modified: stack/native/branches/rest/src/main/java/org/jboss/rs/media/EntityProviderRegistry.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/media/EntityProviderRegistry.java 2007-11-06 10:53:12 UTC (rev 4993)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/media/EntityProviderRegistry.java 2007-11-06 13:26:34 UTC (rev 4994)
@@ -25,28 +25,37 @@
import javax.activation.MimeType;
import java.util.List;
import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
/**
+ * Register {@link javax.ws.rs.ext.EntityProvider} for MimeTypes
+ *
* @author Heiko.Braun(a)jboss.com
* @version $Revision$
*/
public class EntityProviderRegistry
{
- private List<EntityProvider> providers = new ArrayList<EntityProvider>();
+
+ private Map<MimeType, List<EntityProvider>> providers = new HashMap<MimeType, List<EntityProvider>>();
- public void addProvider(EntityProvider provider)
+ public void addProvider(EntityProvider provider, MimeType... mimeTypes)
{
- providers.add(provider);
+ for(MimeType m : mimeTypes)
+ {
+ if(null == providers.get(m))
+ providers.put(m, new ArrayList<EntityProvider>());
+
+ providers.get(m).add(provider);
+ }
}
- public EntityProvider getProviderByMime(MimeType mime)
+ public List<EntityProvider> getProviders(MimeType mime)
{
- EntityProvider match = null;
+ List<EntityProvider> match = new ArrayList<EntityProvider>();
- for(EntityProvider p : providers)
- {
- //
- }
+ if(providers.get(mime)!=null)
+ match = providers.get(mime);
return match;
}
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/media/JAXBEntityProvider.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/media/JAXBEntityProvider.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/media/JAXBEntityProvider.java 2007-11-06 13:26:34 UTC (rev 4994)
@@ -0,0 +1,83 @@
+/*
+ * 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.rs.media;
+
+import javax.ws.rs.ext.EntityProvider;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * TODO: Cache JAXBContext for better performance
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class JAXBEntityProvider implements EntityProvider
+{
+
+ /**
+ * Supports classes annotated with @XmlRootElement or JAXBElement's that wrap this infomration.
+ * @param aClass
+ * @return
+ */
+ public boolean supports(Class aClass)
+ {
+ return aClass.isAnnotationPresent(XmlRootElement.class) || (JAXBElement.class == aClass);
+ }
+
+ public Object readFrom(Class aClass, MediaType mediaType, MultivaluedMap multivaluedMap, InputStream inputStream) throws IOException
+ {
+ Object result = null;
+ try
+ {
+ JAXBContext context = JAXBContext.newInstance(aClass);
+ result = context.createUnmarshaller().unmarshal(inputStream);
+ }
+ catch (JAXBException e)
+ {
+ throw new IOException("Unmarshalling failed: " + e.getMessage());
+ }
+
+ return result;
+
+ }
+
+ public void writeTo(Object o, MediaType mediaType, MultivaluedMap multivaluedMap, OutputStream outputStream) throws IOException
+ {
+ try
+ {
+ JAXBContext context = JAXBContext.newInstance(o.getClass());
+ context.createMarshaller().marshal(o, outputStream);
+ }
+ catch (JAXBException e)
+ {
+ throw new IOException("Marshalling failed: " + e.getMessage());
+ }
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/media/JAXBEntityProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/DeploymentDescriptorParser.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/DeploymentDescriptorParser.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/DeploymentDescriptorParser.java 2007-11-06 13:26:34 UTC (rev 4994)
@@ -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.rs.model.dd;
+
+import com.sun.xml.bind.v2.runtime.JAXBContextImpl;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Marshaller;
+import javax.xml.namespace.QName;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * Ddeployment descriptor parser
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class DeploymentDescriptorParser
+{
+ public static JbossrsType read(InputStream inputStream)
+ throws IOException
+ {
+ try
+ {
+ JAXBContextImpl jc = (JAXBContextImpl) JAXBContext.newInstance( "org.jboss.rs.model.dd" );
+ Unmarshaller unmarshaller = jc.createUnmarshaller();
+ JAXBElement element = ( JAXBElement ) unmarshaller.unmarshal( inputStream );
+ return ( JbossrsType) element.getValue();
+ }
+ catch (JAXBException e)
+ {
+ throw new RuntimeException("Failed to unmarshall deployment descriptor", e);
+ }
+ }
+
+ public static void write(JbossrsType dd, OutputStream outputStream)
+ throws IOException
+ {
+ try
+ {
+ JAXBContext jaxb = JAXBContext.newInstance(JbossrsType.class);
+ JAXBElement wrapper = new JAXBElement(new QName("http://org.jboss.rs/", "jbossrs"), JbossrsType.class, dd);
+ Marshaller marshaller = jaxb.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+ marshaller.marshal(wrapper, outputStream);
+ }
+ catch (JAXBException e)
+ {
+ throw new RuntimeException("Failed to marshall deployment descriptor", e);
+ }
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/DeploymentDescriptorParser.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/JbossrsType.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/JbossrsType.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/JbossrsType.java 2007-11-06 13:26:34 UTC (rev 4994)
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2007.11.06 at 02:11:05 PM CET
+//
+
+
+package org.jboss.rs.model.dd;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for jbossrs-type complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="jbossrs-type">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="resource" type="{http://org.jboss.rs/}resource-type" maxOccurs="unbounded"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "jbossrs-type", propOrder = {
+ "resource"
+})
+public class JbossrsType {
+
+ @XmlElement(required = true)
+ protected List<ResourceType> resource;
+
+ /**
+ * Gets the value of the resource property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the resource property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getResource().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link ResourceType }
+ *
+ *
+ */
+ public List<ResourceType> getResource() {
+ if (resource == null) {
+ resource = new ArrayList<ResourceType>();
+ }
+ return this.resource;
+ }
+
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/JbossrsType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/ObjectFactory.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/ObjectFactory.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/ObjectFactory.java 2007-11-06 13:26:34 UTC (rev 4994)
@@ -0,0 +1,68 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2007.11.06 at 02:11:05 PM CET
+//
+
+
+package org.jboss.rs.model.dd;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.rs.model.dd package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _Jbossrs_QNAME = new QName("http://org.jboss.rs/", "jbossrs");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.rs.model.dd
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link ResourceType }
+ *
+ */
+ public ResourceType createResourceType() {
+ return new ResourceType();
+ }
+
+ /**
+ * Create an instance of {@link JbossrsType }
+ *
+ */
+ public JbossrsType createJbossrsType() {
+ return new JbossrsType();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link JbossrsType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://org.jboss.rs/", name = "jbossrs")
+ public JAXBElement<JbossrsType> createJbossrs(JbossrsType value) {
+ return new JAXBElement<JbossrsType>(_Jbossrs_QNAME, JbossrsType.class, null, value);
+ }
+
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/ObjectFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/ResourceType.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/ResourceType.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/ResourceType.java 2007-11-06 13:26:34 UTC (rev 4994)
@@ -0,0 +1,94 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2007.11.06 at 02:11:05 PM CET
+//
+
+
+package org.jboss.rs.model.dd;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for resource-type complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="resource-type">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="implementation" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "resource-type", propOrder = {
+ "name",
+ "implementation"
+})
+public class ResourceType {
+
+ protected String name;
+ protected String implementation;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the implementation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getImplementation() {
+ return implementation;
+ }
+
+ /**
+ * Sets the value of the implementation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setImplementation(String value) {
+ this.implementation = value;
+ }
+
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/ResourceType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/package-info.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/package-info.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/package-info.java 2007-11-06 13:26:34 UTC (rev 4994)
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2007.11.06 at 02:11:05 PM CET
+//
+
+(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://org.jboss.rs/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.jboss.rs.model.dd;
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/dd/package-info.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/resources/schema/jbossrs.xsd
===================================================================
--- stack/native/branches/rest/src/main/resources/schema/jbossrs.xsd (rev 0)
+++ stack/native/branches/rest/src/main/resources/schema/jbossrs.xsd 2007-11-06 13:26:34 UTC (rev 4994)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://org.jboss.rs/"
+ xmlns:tns="http://org.jboss.rs/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
+
+ <xsd:element name="jbossrs" type="tns:jbossrs-type"/>
+
+ <xsd:complexType name="jbossrs-type">
+ <xsd:sequence>
+ <xsd:element name="resource" type="tns:resource-type" minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="resource-type">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string" minOccurs="0"/>
+ <xsd:element name="implementation" type="xsd:string" minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
\ No newline at end of file
Property changes on: stack/native/branches/rest/src/main/resources/schema/jbossrs.xsd
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/test/java/org/jboss/test/rs/deployment/DescriptorParserTestCase.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/deployment/DescriptorParserTestCase.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/deployment/DescriptorParserTestCase.java 2007-11-06 13:26:34 UTC (rev 4994)
@@ -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.test.rs.deployment;
+
+import junit.framework.TestCase;
+import org.jboss.rs.model.dd.DeploymentDescriptorParser;
+import org.jboss.rs.model.dd.JbossrsType;
+import org.jboss.rs.model.dd.ResourceType;
+
+import java.io.ByteArrayInputStream;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class DescriptorParserTestCase extends TestCase
+{
+ private final static String DD = "<?xml version='1.0' encoding='UTF-8'?>\n"+
+ "<jbossrs xmlns='http://org.jboss.rs/'>"+
+ " <resource>"+
+ " <name>SampleEndpoint</name>"+
+ " <implementation>org.jboss.test.rs.WidgetList</implementation>"+
+ " </resource>"+
+ "</jbossrs>";
+
+ public void testReadDescriptor() throws Exception
+ {
+ JbossrsType dd = DeploymentDescriptorParser.read( new ByteArrayInputStream(DD.getBytes()));
+ assertNotNull(dd);
+ assertTrue(dd.getResource().size()==1);
+
+ ResourceType resource = dd.getResource().get(0);
+ assertTrue(resource.getName().equals("SampleEndpoint"));
+ assertTrue(resource.getImplementation().equals("org.jboss.test.rs.WidgetList"));
+ }
+
+ public void testWriteDescriptor() throws Exception
+ {
+ JbossrsType dd = DeploymentDescriptorParser.read( new ByteArrayInputStream(DD.getBytes()));
+ ResourceType resource = new ResourceType();
+ resource.setImplementation("a.b.c.class");
+ resource.setName("FooBarResource");
+
+ dd.getResource().add(resource);
+
+ DeploymentDescriptorParser.write(dd, System.out);
+ }
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/deployment/DescriptorParserTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
18 years
JBossWS SVN: r4993 - stack/native/branches/jbossws-native-2.0.2/src/test/resources.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-11-06 05:53:12 -0500 (Tue, 06 Nov 2007)
New Revision: 4993
Modified:
stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt
Log:
Update AS50 excludes
Modified: stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt 2007-11-06 09:13:53 UTC (rev 4992)
+++ stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt 2007-11-06 10:53:12 UTC (rev 4993)
@@ -5,22 +5,6 @@
org/jboss/test/ws/jaxws/jbws1798/**
org/jboss/test/ws/jaxrpc/jbws153/**
-# [JBAS-4902] nested jar not deployed
-org/jboss/test/ws/jaxrpc/jbws128/**
-org/jboss/test/ws/jaxrpc/jbws165/**
-org/jboss/test/ws/jaxrpc/jbws331/**
-org/jboss/test/ws/jaxrpc/jbws358/**
-org/jboss/test/ws/jaxrpc/jbws772/**
-org/jboss/test/ws/jaxws/jbws1813/**
-org/jboss/test/ws/jaxws/jbws1762/exploded_ear_ejb3/**
-org/jboss/test/ws/jaxws/jbws1762/exploded_ear_pojo/**
-org/jboss/test/ws/jaxws/jbws1762/packaged_ear_ejb3/**
-org/jboss/test/ws/jaxws/jbws1762/packaged_ear_pojo/**
-
-# [JBAS-4940] Deployment.types not propagated
-org/jboss/test/ws/jaxws/jbws1762/exploded_jar_ejb3/**
-org/jboss/test/ws/jaxws/jbws1762/packaged_jar_ejb3/**
-
# [JBAS-4890] EJBAccessException: Caller unauthorized
org/jboss/test/ws/jaxws/samples/context/**
18 years
JBossWS SVN: r4992 - in stack/native/branches/rest/src: main/java/org/jboss/rs/media and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-11-06 04:13:53 -0500 (Tue, 06 Nov 2007)
New Revision: 4992
Added:
stack/native/branches/rest/src/main/java/org/jboss/rs/media/EntityProviderRegistry.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ParameterBinding.java
stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/ContextAdapterBuilder.java
stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/DefaultInvocationBuilder.java
stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/Invocation.java
stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationBuilder.java
stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationHandler.java
stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationModel.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/Specification.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/Widget.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/WidgetList.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/invocation/
stack/native/branches/rest/src/test/java/org/jboss/test/rs/invocation/InvocationBuilderTestCase.java
Removed:
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Specification.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Widget.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/WidgetList.java
Modified:
stack/native/branches/rest/src/main/java/org/jboss/rs/ResourceRegistry.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/AbstractRegexResolveable.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceLocator.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceMethod.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ModelParserTestCase.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResolverTestCase.java
Log:
InvocaitonModel first cut
Modified: stack/native/branches/rest/src/main/java/org/jboss/rs/ResourceRegistry.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/ResourceRegistry.java 2007-11-05 21:51:45 UTC (rev 4991)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/ResourceRegistry.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -29,6 +29,8 @@
import java.util.Map;
/**
+ * Register root resources for webContext's.
+ *
* @author Heiko.Braun(a)jboss.com
* @version $Revision$
*/
@@ -36,20 +38,20 @@
{
private Map<String, List<ResourceModel>> webContextMapping = new HashMap<String, List<ResourceModel>>();
- public void addResourceModelForContext(String context, ResourceModel model)
+ public void addResourceModelForContext(String webContext, ResourceModel model)
{
- if(null == webContextMapping.get(context))
- webContextMapping.put(context, new ArrayList<ResourceModel>());
+ if(null == webContextMapping.get(webContext))
+ webContextMapping.put(webContext, new ArrayList<ResourceModel>());
- webContextMapping.get(context).add(model);
+ webContextMapping.get(webContext).add(model);
}
- public List<ResourceModel> getResourceModelsForContext(String context)
+ public List<ResourceModel> getResourceModelsForContext(String webContext)
{
- if(null == webContextMapping.get(context))
- webContextMapping.put(context, new ArrayList<ResourceModel>());
+ if(null == webContextMapping.get(webContext))
+ webContextMapping.put(webContext, new ArrayList<ResourceModel>());
- return webContextMapping.get(context);
+ return webContextMapping.get(webContext);
}
}
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/media/EntityProviderRegistry.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/media/EntityProviderRegistry.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/media/EntityProviderRegistry.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -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.rs.media;
+
+import javax.ws.rs.ext.EntityProvider;
+import javax.activation.MimeType;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class EntityProviderRegistry
+{
+ private List<EntityProvider> providers = new ArrayList<EntityProvider>();
+
+ public void addProvider(EntityProvider provider)
+ {
+ providers.add(provider);
+ }
+
+ public EntityProvider getProviderByMime(MimeType mime)
+ {
+ EntityProvider match = null;
+
+ for(EntityProvider p : providers)
+ {
+ //
+ }
+
+ return match;
+ }
+
+
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/media/EntityProviderRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/rest/src/main/java/org/jboss/rs/model/AbstractRegexResolveable.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/AbstractRegexResolveable.java 2007-11-05 21:51:45 UTC (rev 4991)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/AbstractRegexResolveable.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -40,22 +40,37 @@
protected void initFromUriTemplate(String uriTemplate)
{
+ initFromUriTemplate(uriTemplate, null);
+ }
+
+ protected void initFromUriTemplate(String uriTemplate, UriParamHandler handler)
+ {
assert uriTemplate!=null;
assert !uriTemplate.startsWith("/");
StringTokenizer tokenizer = new StringTokenizer(uriTemplate, "/");
StringBuffer patternBuffer = new StringBuffer();
+ int groupIndex = 1; // matching regex groups start with 1
while(tokenizer.hasMoreTokens())
{
- String tok = tokenizer.nextToken();
+ String tok = tokenizer.nextToken();
if(isUriParam(tok))
{
+ if(handler != null)
+ {
+ // register uri param callback
+ String paramName = tok.substring(1, tok.length()-1);
+ handler.newUriParam(groupIndex, paramName);
+
+ }
patternBuffer.append( regexFromUriParam(tok) );
}
else
{
patternBuffer.append( regexFromPathSegment(tok) );
}
+
+ groupIndex++;
}
if(hasChildren())
@@ -135,5 +150,10 @@
abstract boolean hasChildren();
abstract void freeze();
+
+ public interface UriParamHandler
+ {
+ void newUriParam(int regexGroup, String paramName);
+ }
}
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ParameterBinding.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/ParameterBinding.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/ParameterBinding.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -0,0 +1,186 @@
+/*
+ * 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.rs.model;
+
+import org.jboss.rs.runtime.Invocation;
+import org.jboss.rs.runtime.InvocationModel;
+import org.jboss.rs.runtime.RuntimeContext;
+import org.jboss.rs.runtime.ContextAdapterBuilder;
+import org.jboss.rs.MethodHTTP;
+
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.UriParam;
+import javax.ws.rs.core.HttpContext;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Carries mapping information about
+ * <ul>
+ * <li>MatrixParam
+ * <li>QueryParam
+ * <li>UriParam
+ * <li>HttpContext
+ * <li>HeaderParam
+ * </ul>
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class ParameterBinding implements InvocationModel
+{
+ /* Pattenern of the owning ResourceMethod */
+ private final Pattern regex;
+
+ /* Pattern to strip prefix from runtime path */
+ private static final String PREFIX_PATTERN = "(.*?)";
+
+ /*the total number of parameters */
+ private int totalParameters = 0;
+
+ /*positions of the query parameters*/
+ Map<String, Integer> queryParam = new HashMap<String, Integer>();
+
+ /*positions of the header parameters*/
+ Map<String, Integer> headerParam = new HashMap<String, Integer>();
+
+ /*positions of the header parameters*/
+ Map<String, Integer> uriParam = new HashMap<String, Integer>();
+
+ /* maps regex groups to UriTemplate wildcards */
+ Map<String, Integer> regexMapping = new HashMap<String, Integer>();
+
+ Map<Class, Integer> contextParamter = new HashMap<Class, Integer>();
+
+ private Class entityBodyType = null;
+ private int entityBodyIndex = -1;
+
+ /* Parameter types except for entity body*/
+ Map<Integer, Class> parameterTypes = new HashMap<Integer, Class>();
+
+ public void accept(Invocation invocation)
+ {
+ RuntimeContext ctx = invocation.getContext();
+ String path = ctx.getPath();
+
+ Matcher matcher = regex.matcher(path);
+ boolean matches = matcher.matches();
+
+ if(!matches)
+ throw new RuntimeException("RuntimeContext doesn't match invocation model");
+
+ // @UriParam
+ for(String param : uriParam.keySet())
+ {
+ int paramIndex = uriParam.get(param);
+ String paramValue = matcher.group(regexMapping.get(param) + 1);
+ invocation.insertParameterInstance(paramIndex, paramValue);
+ }
+
+ ContextAdapterBuilder builder = new ContextAdapterBuilder(ctx);
+
+ // TODO: @QueryParam and @MatrixParam
+
+ // TODO: @HeaderParam
+
+ // @HttpContext
+ for(Class paramType : contextParamter.keySet())
+ {
+ Object paramInstance = builder.buildTypedAdapter(paramType);
+ invocation.insertParameterInstance(contextParamter.get(paramType), paramInstance);
+ }
+
+ // TODO: Entity body
+ if(entityBodyType != null)
+ {
+ boolean validRequestMethod = MethodHTTP.POST == ctx.getRequestMethod() || MethodHTTP.PUT == ctx.getRequestMethod();
+ if(!validRequestMethod)
+ throw new RuntimeException("No entity body with request type " + ctx.getRequestMethod());
+
+ // unmarshall body
+ }
+ }
+
+ ParameterBinding(Pattern rootPattern)
+ {
+ // Extend pattern to strip root path, results in additional groups
+ this.regex = Pattern.compile(PREFIX_PATTERN +rootPattern.toString());
+ }
+
+ void registerRegexGroupForParam(int group, String paramName)
+ {
+ regexMapping.put(paramName, group);
+ }
+
+ void registerParameterAnnotations(Method method)
+ {
+ for (Annotation[] parameterAnnotations : method.getParameterAnnotations())
+ {
+ if (parameterAnnotations!=null)
+ {
+ for (Annotation annotation : parameterAnnotations)
+ {
+ if(annotation.annotationType() == UriParam.class)
+ {
+ UriParam p = (UriParam)annotation;
+ uriParam.put(p.value(), totalParameters);
+ }
+ else if(annotation.annotationType() == HeaderParam.class)
+ {
+ HeaderParam p = (HeaderParam)annotation;
+ headerParam.put(p.value(), totalParameters);
+ }
+ else if(annotation.annotationType() == HttpContext.class)
+ {
+ HttpContext p = (HttpContext)annotation;
+ int paramPosition = totalParameters > 0 ? totalParameters - 1 : 0;
+ Class httpContextType = method.getParameterTypes()[paramPosition];
+ int httpContextIndex = totalParameters;
+
+ if(null == contextParamter.get(httpContextType))
+ contextParamter.put(httpContextType, httpContextIndex);
+ else
+ throw new RuntimeException("HttpContext on more then one method parameter: " + method.getName()+ "," +httpContextIndex);
+ }
+ }
+
+ }
+ else
+ {
+ // The value of an non-annotated parameter is mapped from the request entity body
+ // Must not be more then one per method
+ if(entityBodyType!=null)
+ throw new RuntimeException("Method " + method.getName() + " contains more then one possible entity body parameters");
+
+ entityBodyType = method.getParameterTypes()[totalParameters-1];
+ entityBodyIndex = totalParameters;
+
+ }
+
+ totalParameters++;
+ }
+ }
+
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ParameterBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceLocator.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceLocator.java 2007-11-05 21:51:45 UTC (rev 4991)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceLocator.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -31,6 +31,15 @@
private String uriTemplate;
+ UriParamHandler paramHandler = new UriParamHandler()
+ {
+
+ public void newUriParam(int regexGroup, String paramName)
+ {
+ System.out.println("UriParam: group="+regexGroup +", name="+paramName);
+ }
+ };
+
ResourceLocator(ResourceModel target)
{
this.uriTemplate = target.getUriTemplate();
@@ -55,6 +64,6 @@
void freeze()
{
- initFromUriTemplate(this.uriTemplate);
+ initFromUriTemplate(this.uriTemplate, paramHandler);
}
}
Modified: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceMethod.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceMethod.java 2007-11-05 21:51:45 UTC (rev 4991)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceMethod.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -28,8 +28,11 @@
import javax.ws.rs.ProduceMime;
import javax.activation.MimeType;
import java.lang.reflect.Method;
+import java.lang.annotation.Annotation;
import java.util.List;
import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
/**
* @author Heiko.Braun(a)jboss.com
@@ -44,6 +47,10 @@
private List<MimeType> consumeMimeTypes = new ArrayList<MimeType>();
private List<MimeType> produceMimeTypes = new ArrayList<MimeType>();
+ private ParameterBinding parameterBinding;
+
+ private boolean frozen;
+
ResourceMethod(MethodHTTP method, String uriTemplate, Method invocationTarget)
{
this.uriTemplate = uriTemplate;
@@ -83,40 +90,73 @@
return produceMimeTypes;
}
- void freeze()
+ public ParameterBinding getParameterBinding()
{
- initFromUriTemplate(this.uriTemplate);
- initMimeTypes();
+ assert frozen;
+ return parameterBinding;
}
- private void initMimeTypes()
+ void freeze()
{
+ // We need to know which param belongs to what regex group
+ final Map<String, Integer> regexInfo = new HashMap<String, Integer>();
+ UriParamHandler collectRegexInfo = new UriParamHandler()
+ {
+ public void newUriParam(int regexGroup, String paramName)
+ {
+ regexInfo.put(paramName, regexGroup);
+ }
+ };
- // In the absence of either of these annotations,
- // support for any media type (“*/*”) is assumed.
+ // setup the regex stuff and push uriParam info to ParameterBinding
+ initFromUriTemplate(this.uriTemplate, collectRegexInfo);
- if(invocationTarget.isAnnotationPresent(ConsumeMime.class))
+ // parse the mime annotations
+ initMimeTypes();
+
+ // Create ParameterBindig
+ this.parameterBinding = new ParameterBinding(this.regexPattern);
+
+ // Annotations on method parameters
+ this.parameterBinding.registerParameterAnnotations(invocationTarget);
+
+ // Additional info abpout the regex binding
+ for(String paramName : regexInfo.keySet())
{
- ConsumeMime cm = invocationTarget.getAnnotation(ConsumeMime.class);
- consumeMimeTypes.addAll(Convert.annotationToMimeType(cm));
+ int group = regexInfo.get(paramName);
+ this.parameterBinding.registerRegexGroupForParam(group, paramName);
}
+
+ // Lock instance
+ this.frozen = true;
+ }
+
+ private void initMimeTypes()
+ {
+ // ConsumeMime
+ ConsumeMime consumeMime = (ConsumeMime)mimeFromMethodOrClass(ConsumeMime.class);
+ if(consumeMime != null)
+ consumeMimeTypes.addAll(Convert.annotationToMimeType(consumeMime));
else
- {
consumeMimeTypes.add( Convert.ANY_MIME );
- }
- if(invocationTarget.isAnnotationPresent(ProduceMime.class))
- {
- ProduceMime pm = invocationTarget.getAnnotation(ProduceMime.class);
- produceMimeTypes.addAll(Convert.annotationToMimeType(pm));
- }
+ // ProduceMime
+ ProduceMime produceMime = (ProduceMime)mimeFromMethodOrClass(ProduceMime.class);
+ if(produceMime != null)
+ produceMimeTypes.addAll(Convert.annotationToMimeType(produceMime));
else
- {
produceMimeTypes.add( Convert.ANY_MIME );
- }
}
+ private Annotation mimeFromMethodOrClass( Class type )
+ {
+ Annotation ann = invocationTarget.isAnnotationPresent(type) ?
+ invocationTarget.getAnnotation(type) :
+ invocationTarget.getDeclaringClass().getAnnotation(type);
+ return ann;
+ }
+
public String toString()
{
return "ResourceMethod {"+methodHTTP+" uri="+uriTemplate+", regex="+regexPattern+"}";
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/ContextAdapterBuilder.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/ContextAdapterBuilder.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/ContextAdapterBuilder.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -0,0 +1,165 @@
+/*
+ * 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.rs.runtime;
+
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.core.PathSegment;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Cookie;
+import java.util.List;
+import java.net.URI;
+
+/**
+ * Adopts 311 runtime interfaces to an internal runtime context.<br>
+ * This way typed subsets of runtime information can be exposed, i.e:
+ *
+ * <ul>
+ * <li>{@link javax.ws.rs.core.HttpHeaders}
+ * <li>{@link javax.ws.rs.core.UriInfo}
+ * </ul>
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class ContextAdapterBuilder
+{
+ private RuntimeContext context;
+
+ public ContextAdapterBuilder(RuntimeContext context)
+ {
+ this.context = context;
+ }
+
+ public Object buildTypedAdapter(Class type)
+ {
+ Object returnType = null;
+
+ if(HttpHeaders.class == type)
+ {
+ returnType = new HttpHeadersAdapter();
+ }
+ else if (UriInfo.class == type)
+ {
+ returnType = new UriInfoAdapter();
+ }
+
+ if(null==returnType)
+ throw new RuntimeException("Unknown type " + type);
+
+ return returnType;
+ }
+
+ public class HttpHeadersAdapter implements HttpHeaders
+ {
+
+ public MultivaluedMap<String, String> getRequestHeaders()
+ {
+ return null;
+ }
+
+ public List<MediaType> getAcceptableMediaTypes()
+ {
+ return null;
+ }
+
+ public MediaType getMediaType()
+ {
+ return null;
+ }
+
+ public String getLanguage()
+ {
+ return null;
+ }
+
+ public List<Cookie> getCookies()
+ {
+ return null;
+ }
+ }
+
+ public class UriInfoAdapter implements UriInfo
+ {
+
+ public String getPath()
+ {
+ return null;
+ }
+
+ public String getPath(boolean b)
+ {
+ return null;
+ }
+
+ public List<PathSegment> getPathSegments()
+ {
+ return null;
+ }
+
+ public List<PathSegment> getPathSegments(boolean b)
+ {
+ return null;
+ }
+
+ public URI getAbsolute()
+ {
+ return null;
+ }
+
+ public UriBuilder getBuilder()
+ {
+ return null;
+ }
+
+ public URI getBase()
+ {
+ return null;
+ }
+
+ public UriBuilder getBaseBuilder()
+ {
+ return null;
+ }
+
+ public MultivaluedMap<String, String> getTemplateParameters()
+ {
+ return null;
+ }
+
+ public MultivaluedMap<String, String> getTemplateParameters(boolean b)
+ {
+ return null;
+ }
+
+ public MultivaluedMap<String, String> getQueryParameters()
+ {
+ return null;
+ }
+
+ public MultivaluedMap<String, String> getQueryParameters(boolean b)
+ {
+ return null;
+ }
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/ContextAdapterBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/DefaultInvocationBuilder.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/DefaultInvocationBuilder.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/DefaultInvocationBuilder.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.runtime;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class DefaultInvocationBuilder extends InvocationBuilder
+{
+
+ public Invocation build(RuntimeContext context)
+ {
+ // Possible runtime aspects here
+ return super.build(context);
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/DefaultInvocationBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/Invocation.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/Invocation.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/Invocation.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -0,0 +1,72 @@
+/*
+ * 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.rs.runtime;
+
+import java.util.List;
+import java.util.LinkedList;
+
+/**
+ * The visitor part of the pattern.
+ *
+ * @see org.jboss.rs.runtime.InvocationModel
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class Invocation
+{
+ private RuntimeContext context;
+
+ List parameterInstances = new LinkedList();
+
+ public Invocation(RuntimeContext context)
+ {
+ this.context = context;
+ }
+
+ public RuntimeContext getContext()
+ {
+ return context;
+ }
+
+ /**
+ * Convinience method to work with String parameter types
+ * @param index
+ * @param param
+ */
+ public void insertParameterInstance(int index, String param)
+ {
+ if(param.startsWith("/"))
+ param = param.substring(1);
+ parameterInstances.add(index, param);
+ }
+
+ public void insertParameterInstance(int index, Object param)
+ {
+ parameterInstances.add(index, param);
+ }
+
+ public List getParameterInstances()
+ {
+ return parameterInstances;
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/Invocation.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationBuilder.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationBuilder.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationBuilder.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -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.rs.runtime;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Gathers invocation models (both static and runtime)
+ * and builds an {@link org.jboss.rs.runtime.Invocation} instance that can be consumed
+ * by an {@link org.jboss.rs.runtime.InvocationHandler}
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public abstract class InvocationBuilder
+{
+ private List<InvocationModel> invocationModels = new LinkedList<InvocationModel>();
+
+ /**
+ * Add invocaiton model to an order list.
+ *
+ * @param model
+ */
+ public void addInvocationModel(InvocationModel model )
+ {
+ invocationModels.add(model);
+ }
+
+ public Invocation build(RuntimeContext context)
+ {
+ Invocation invocation = new Invocation(context);
+
+ for(InvocationModel model : invocationModels)
+ {
+ model.accept(invocation);
+ }
+
+ return invocation;
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationHandler.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationHandler.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationHandler.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -0,0 +1,31 @@
+/*
+ * 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.rs.runtime;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public interface InvocationHandler
+{
+ Object invoke(Invocation invocation);
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationModel.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationModel.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationModel.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.runtime;
+
+/**
+ * An <code>InvocationModel</code> will be visited by an {@link org.jboss.rs.runtime.Invocation}
+ * instance and supplies a certain aspect (i.e. Parameter mapping, injection, etc) to it.
+ * <p>
+ * It's the visitable part of the pattern.
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public interface InvocationModel
+{
+ void accept(Invocation invocation);
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/runtime/InvocationModel.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: stack/native/branches/rest/src/test/java/org/jboss/test/rs/Specification.java (from rev 4925, stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Specification.java)
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/Specification.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/Specification.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.rs;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class Specification
+{
+ public String name = "Unknown";
+
+ public Specification()
+ {
+ }
+
+ public Specification(String name)
+ {
+ this.name = name;
+ }
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/Specification.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: stack/native/branches/rest/src/test/java/org/jboss/test/rs/Widget.java (from rev 4942, stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Widget.java)
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/Widget.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/Widget.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -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.test.rs;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.UriParam;
+import javax.ws.rs.UriTemplate;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class Widget
+{
+ String id;
+
+ public Widget(String id)
+ {
+ this.id = id;
+ }
+
+ @GET
+ @UriTemplate("spec")
+ Specification[] getSpecification() {
+ return new Specification[]{ new Specification() };
+ }
+
+ @GET
+ @UriTemplate("spec/{name}")
+ Specification getSpecByName(@UriParam("name")String name)
+ {
+ return new Specification(name);
+ }
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/Widget.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: stack/native/branches/rest/src/test/java/org/jboss/test/rs/WidgetList.java (from rev 4958, stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/WidgetList.java)
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/WidgetList.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/WidgetList.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -0,0 +1,63 @@
+/*
+ * 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.rs;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.UriParam;
+import javax.ws.rs.UriTemplate;
+import javax.ws.rs.POST;
+import javax.ws.rs.ConsumeMime;
+import javax.ws.rs.ProduceMime;
+import javax.ws.rs.core.HttpContext;
+import javax.ws.rs.core.HttpHeaders;
+
+@UriTemplate("widgets")
+public class WidgetList
+{
+ @GET
+ @ProduceMime({"text/plain"})
+ String getDescription() {
+ return "A widgetlist";
+ }
+
+ @GET
+ @UriTemplate("offers")
+ WidgetList getDiscounted() {
+ return null;
+ }
+
+ @POST
+ @UriTemplate("special")
+ @ConsumeMime({"text/xml", "application/xml"})
+ void setDiscounted(
+ @HttpContext HttpHeaders headers,
+ Widget special
+ )
+ {
+
+ }
+
+ @UriTemplate("{id}")
+ Widget findWidget(@UriParam("id") String id) {
+ return new Widget(id);
+ }
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/WidgetList.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/test/java/org/jboss/test/rs/invocation/InvocationBuilderTestCase.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/invocation/InvocationBuilderTestCase.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/invocation/InvocationBuilderTestCase.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -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.test.rs.invocation;
+
+import junit.framework.TestCase;
+import org.jboss.rs.ResourceRegistry;
+import org.jboss.rs.MethodHTTP;
+import org.jboss.rs.runtime.RuntimeContext;
+import org.jboss.rs.runtime.InvocationBuilder;
+import org.jboss.rs.runtime.DefaultInvocationBuilder;
+import org.jboss.rs.runtime.Invocation;
+import org.jboss.rs.runtime.InvocationHandler;
+import org.jboss.rs.model.ResourceModel;
+import org.jboss.rs.model.ResourceModelParser;
+import org.jboss.rs.model.ResourceResolver;
+import org.jboss.rs.model.ResourceMethod;
+import org.jboss.test.rs.WidgetList;
+
+import javax.ws.rs.core.HttpHeaders;
+import java.util.List;
+import java.net.URI;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class InvocationBuilderTestCase extends TestCase
+{
+ ResourceRegistry registry;
+ List<ResourceModel> rootModels;
+
+ protected void setUp() throws Exception
+ {
+ this.registry = new ResourceRegistry();
+ ResourceModel root = ResourceModelParser.newInstance().parse(WidgetList.class);
+ registry.addResourceModelForContext("/rest", root);
+ rootModels = registry.getResourceModelsForContext("/rest");
+ }
+
+ public void testUriParamBinding() throws Exception
+ {
+ URI uri = new URI("http://jboss.com/widgets/Foo/spec/Bar");
+ RuntimeContext context = defaultRuntimeContext(MethodHTTP.GET, uri);
+ ResourceResolver resolver = ResourceResolver.newInstance(context);
+
+ ResourceMethod method = resolver.resolve();
+
+ assertNotNull(method);
+ assertEquals("spec/{name}", method.getUriTemplate());
+
+ // setup a builder
+ InvocationBuilder builder = new DefaultInvocationBuilder();
+ builder.addInvocationModel(method.getParameterBinding());
+
+ // create an Invocation instance
+ Invocation invocation = builder.build(context);
+ Object parameterInstance = invocation.getParameterInstances().get(0);
+ assertTrue(parameterInstance!=null);
+ assertTrue("Wildcard parameter {name} not bound", parameterInstance.equals("Bar"));
+
+ }
+
+ public void testHttpContextParamBinding() throws Exception
+ {
+ URI uri = new URI("http://jboss.com/widgets/special");
+ RuntimeContext context = defaultRuntimeContext(MethodHTTP.POST, uri);
+ context.parseContentTypeHeader("text/xml");
+ ResourceResolver resolver = ResourceResolver.newInstance(context);
+
+ ResourceMethod method = resolver.resolve();
+
+ assertNotNull(method);
+ assertEquals("special", method.getUriTemplate());
+
+ // setup a builder
+ InvocationBuilder builder = new DefaultInvocationBuilder();
+ builder.addInvocationModel(method.getParameterBinding());
+
+ // create an Invocation instance
+ Invocation invocation = builder.build(context);
+ Object parameterInstance = invocation.getParameterInstances().get(0);
+ assertTrue(parameterInstance!=null);
+ assertTrue("HttpContext parameter not bound", parameterInstance instanceof HttpHeaders);
+
+ }
+
+ private RuntimeContext defaultRuntimeContext(MethodHTTP method, URI uri)
+ {
+ RuntimeContext context = new RuntimeContext(method, uri, rootModels );
+ context.parseAcceptHeader("*/*");
+ return context;
+ }
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/invocation/InvocationBuilderTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ModelParserTestCase.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ModelParserTestCase.java 2007-11-05 21:51:45 UTC (rev 4991)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ModelParserTestCase.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -26,6 +26,7 @@
import org.jboss.rs.model.ResourceModel;
import org.jboss.rs.model.ResourceMethod;
import org.jboss.rs.MethodHTTP;
+import org.jboss.test.rs.WidgetList;
/**
* @author Heiko.Braun(a)jboss.com
Modified: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResolverTestCase.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResolverTestCase.java 2007-11-05 21:51:45 UTC (rev 4991)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResolverTestCase.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -29,6 +29,7 @@
import org.jboss.rs.model.ResourceModelParser;
import org.jboss.rs.model.ResourceResolver;
import org.jboss.rs.model.ResourceMethod;
+import org.jboss.test.rs.WidgetList;
import java.util.List;
import java.lang.reflect.Method;
Deleted: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Specification.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Specification.java 2007-11-05 21:51:45 UTC (rev 4991)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Specification.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.rs.model;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- * @version $Revision$
- */
-public class Specification
-{
- public String name = "Unknown";
-
- public Specification()
- {
- }
-
- public Specification(String name)
- {
- this.name = name;
- }
-}
Deleted: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Widget.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Widget.java 2007-11-05 21:51:45 UTC (rev 4991)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Widget.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.rs.model;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.UriParam;
-import javax.ws.rs.UriTemplate;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- * @version $Revision$
- */
-public class Widget
-{
- String id;
-
- public Widget(String id)
- {
- this.id = id;
- }
-
- @GET
- @UriTemplate("spec")
- Specification[] getSpecification() {
- return new Specification[]{ new Specification() };
- }
-
- @GET
- @UriTemplate("spec/{name}")
- Specification getSpecByName(@UriParam("name")String name)
- {
- return new Specification(name);
- }
-}
Deleted: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/WidgetList.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/WidgetList.java 2007-11-05 21:51:45 UTC (rev 4991)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/WidgetList.java 2007-11-06 09:13:53 UTC (rev 4992)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.rs.model;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.UriParam;
-import javax.ws.rs.UriTemplate;
-import javax.ws.rs.POST;
-import javax.ws.rs.ConsumeMime;
-import javax.ws.rs.ProduceMime;
-
-@UriTemplate("widgets")
-public class WidgetList
-{
- @GET
- @ProduceMime({"text/plain"})
- String getDescription() {
- return "A widgetlist";
- }
-
- @GET
- @UriTemplate("offers")
- WidgetList getDiscounted() {
- return null;
- }
-
- @POST
- @UriTemplate("special")
- @ConsumeMime({"text/xml", "application/xml"})
- void setDiscounted(Widget special) {
- // TODO: Should return a new location
- }
-
- @UriTemplate("{id}")
- Widget findWidget(@UriParam("id") String id) {
- return new Widget(id);
- }
-}
18 years
JBossWS SVN: r4991 - stack/native/trunk/ant-import-tests.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-11-05 16:51:45 -0500 (Mon, 05 Nov 2007)
New Revision: 4991
Modified:
stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
Log:
merging ropalka branch to trunk
Modified: stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2007-11-05 21:51:06 UTC (rev 4990)
+++ stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2007-11-05 21:51:45 UTC (rev 4991)
@@ -631,6 +631,37 @@
</webinf>
</war>
+ <!-- jaxws-wsrm -->
+ <war warfile="${tests.output.dir}/libs/jaxws-wsrm.war"
+ webxml="${tests.output.dir}/resources/jaxws/wsrm/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/wsrm/OneWayServiceIface.class"/>
+ <include name="org/jboss/test/ws/jaxws/wsrm/OneWayServiceImpl.class"/>
+ <include name="org/jboss/test/ws/jaxws/wsrm/ReqResServiceIface.class"/>
+ <include name="org/jboss/test/ws/jaxws/wsrm/ReqResServiceImpl.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/wsrm/WEB-INF">
+ <include name="wsrm-exactly-once-in-order-policy.xml"/>
+ <include name="wsrm-jaxws-endpoint-config.xml"/>
+ </webinf>
+ </war>
+
+ <war warfile="${tests.output.dir}/libs/jaxws-wsrm-emulator.war"
+ webxml="${tests.output.dir}/resources/jaxws/wsrm/emulator/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/wsrm/emulator/**/*.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/wsrm/emulator">
+ <include name="resources/"/>
+ </webinf>
+ </war>
+
+ <jar jarfile="${tests.output.dir}/libs/jaxws-wsrm-client.jar">
+ <metainf dir="${tests.output.dir}/resources/jaxws/wsrm/META-INF">
+ <include name="wsrm-jaxws-client-config.xml"/>
+ </metainf>
+ </jar>
+
<!-- Please add alphabetically -->
<antcall target="build-interop-jars"/>
@@ -775,4 +806,4 @@
</target>
-</project>
\ No newline at end of file
+</project>
18 years
JBossWS SVN: r4990 - in stack/native/trunk/src: main/java/org/jboss/ws/core/client and 36 other directories.
by jbossws-commits@lists.jboss.org
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/jboss-ws-security_1_0.xsd", WSSecurityAssertionDeployer.class);
+ me.domainDeployerMap.put("http://docs.oasis-open.org/ws-rx/wsrmp/200702", RMPolicyAssertionDeployer.class);
}
//hide constructor
@@ -82,6 +84,7 @@
{
PolicyDeployer instance = new PolicyDeployer();
instance.domainDeployerMap.put("http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd", NopAssertionDeployer.class);
+ instance.domainDeployerMap.put("http://docs.oasis-open.org/ws-rx/wsrmp/200702", 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:MessageID>"
+ + " <wsa:To>http://example.com/serviceB/123</wsa:To>"
+ + " <wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence</wsa:Action>"
+ + " <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>"
+ + " </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:RelatesTo>"
+ + " <wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequenceResponse</wsa:Action>"
+ + " </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>"
+ + " </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:MessageID>"
+ + " <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:MessageID>"
+ + " <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/SequenceAcknowledgement</wsa:Action>"
+ + " <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:MessageID>"
+ + " <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/SequenceAcknowledgement</wsa:Action>"
+ + " <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:MessageID>"
+ + " <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/SequenceAcknowledgement</wsa:Action>"
+ + " <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:MessageID>"
+ + " <wsa:To>http://example.com/serviceB/123</wsa:To>"
+ + " <wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequence</wsa:Action>"
+ + " <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:MessageID>"
+ + " <wsa:To>http://example.com/serviceB/123</wsa:To>"
+ + " <wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequence</wsa:Action>"
+ + " <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:MessageID>"
+ + " <wsa:To>http://example.com/serviceA/789</wsa:To>"
+ + " <wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequenceResponse</wsa:Action>"
+ + " <wsa:RelatesTo>http://Business456.com/guid/0baaf88d-483b-4ecf-a6d8</wsa:RelatesTo>"
+ + " <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:MessageID>"
+ + " <wsa:To>http://example.com/serviceA/789</wsa:To>"
+ + " <wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequenceResponse</wsa:Action>"
+ + " <wsa:RelatesTo>http://Business456.com/guid/0baaf88d-483b-4ecf-a6d8</wsa:RelatesTo>"
+ + " <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/RM/ABC");
+ 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/RM/ABC");
+ 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/RM/ABC");
+ 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");
+ // 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/ABC");
+ // 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-wssecurity-utilit...">
+ <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-wssecurity-utilit...">
+ <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-wssecurity-utilit...">
+ <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
18 years