JBossWS SVN: r5914 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP: src/main/java/org/jboss/ws/metadata/config/binding and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-03-11 06:52:40 -0400 (Tue, 11 Mar 2008)
New Revision: 5914
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/JBWS1792TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestHandler.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/application-client.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/jboss-client.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/custom-endpoint-config.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/jaxrpc-mapping.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/webservices.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/TestService.wsdl
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/wstools-config.xml
Removed:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/JBWS1792TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestHandler.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/application-client.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/jboss-client.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/custom-endpoint-config.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/jaxrpc-mapping.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/webservices.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/TestService.wsdl
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/wstools-config.xml
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxrpc.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java
Log:
[JBPAPP-680] init-param for handler defined in jaxrpc-config not processed.
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxrpc.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxrpc.xml 2008-03-11 09:47:51 UTC (rev 5913)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxrpc.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -2548,6 +2548,34 @@
</metainf>
</jar>
+ <!-- jaxrpc-jbws1792 -->
+ <war warfile="${tests.output.dir}/libs/jaxrpc-jbws1792.war" webxml="${tests.output.dir}/resources/jaxrpc/jbws1792/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxrpc/jbws1792/TestEndpoint.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1792/TestEndpointImpl.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1792/TestHandler.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxrpc/jbws1792/WEB-INF">
+ <include name="webservices.xml"/>
+ <include name="jaxrpc-mapping.xml"/>
+ <include name="custom-endpoint-config.xml"/>
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
+ <jar destfile="${tests.output.dir}/libs/jaxrpc-jbws1792-client.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jbws1792/TestEndpoint.class"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/resources/jaxrpc/jbws1792/META-INF">
+ <include name="application-client.xml"/>
+ <include name="jboss-client.xml"/>
+ </metainf>
+ <metainf dir="${tests.output.dir}/resources/jaxrpc/jbws1792/WEB-INF">
+ <include name="jaxrpc-mapping.xml"/>
+ <include name="wsdl/**"/>
+ </metainf>
+ </jar>
+
<!-- jaxrpc-marshall-doclit.war -->
<war warfile="${tests.output.dir}/libs/jaxrpc-marshall-doclit.war" webxml="${tests.output.dir}/resources/jaxrpc/marshall-doclit/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java 2008-03-11 09:47:51 UTC (rev 5913)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java 2008-03-11 10:52:40 UTC (rev 5914)
@@ -145,6 +145,24 @@
}
/**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("init-param".equals(localName))
+ return new UnifiedInitParamMetaData();
+ else return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(UnifiedHandlerMetaData handler, UnifiedInitParamMetaData param, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ handler.addInitParam(param);
+ }
+
+ /**
* Called when a new simple child element with text value was read from the XML content.
*/
public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792 (from rev 4491, stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/JBWS1792TestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/JBWS1792TestCase.java 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/JBWS1792TestCase.java 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software 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.jaxrpc.jbws1792;
-
-import javax.naming.InitialContext;
-import javax.xml.rpc.Service;
-
-import junit.framework.Test;
-
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-
-/**
- * @see http://jira.jboss.com/jira/browse/JBWS-1792
- *
- * init-param for handler defined in jaxrpc-config not processed
- *
- * @author darran.lofthouse(a)jboss.com
- * @since Aug 22, 2007
- */
-public class JBWS1792TestCase extends JBossWSTest
-{
- private static TestEndpoint port;
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS1792TestCase.class, "jaxrpc-jbws1792.war, jaxrpc-jbws1792-client.jar");
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- if (port == null)
- {
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
- port = (TestEndpoint)service.getPort(TestEndpoint.class);
- }
- }
-
- public void testCall() throws Exception
- {
- final String message = "Hello!!";
-
- String response = port.echoMessage(message);
-
- assertEquals(message, response);
- }
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/JBWS1792TestCase.java (from rev 4491, stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/JBWS1792TestCase.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/JBWS1792TestCase.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/JBWS1792TestCase.java 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.jaxrpc.jbws1792;
+
+import javax.naming.InitialContext;
+import javax.xml.rpc.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * @see http://jira.jboss.com/jira/browse/JBWS-1792
+ *
+ * init-param for handler defined in jaxrpc-config not processed
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since Aug 22, 2007
+ */
+public class JBWS1792TestCase extends JBossWSTest
+{
+ private static TestEndpoint port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS1792TestCase.class, "jaxrpc-jbws1792.war, jaxrpc-jbws1792-client.jar");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ if (port == null)
+ {
+ InitialContext iniCtx = getInitialContext();
+ Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
+ port = (TestEndpoint)service.getPort(TestEndpoint.class);
+ }
+ }
+
+ public void testCall() throws Exception
+ {
+ final String message = "Hello!!";
+
+ String response = port.echoMessage(message);
+
+ assertEquals(message, response);
+ }
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpoint.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpoint.java 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpoint.java 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software 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.jaxrpc.jbws1792;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-/**
- * @author darran.lofthouse(a)jboss.com
- * @since Aug 22, 2007
- */
-public interface TestEndpoint extends Remote
-{
-
- public String echoMessage(final String message) throws RemoteException;
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpoint.java (from rev 4491, stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpoint.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpoint.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpoint.java 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.jaxrpc.jbws1792;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * @author darran.lofthouse(a)jboss.com
+ * @since Aug 22, 2007
+ */
+public interface TestEndpoint extends Remote
+{
+
+ public String echoMessage(final String message) throws RemoteException;
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpointImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpointImpl.java 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpointImpl.java 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software 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.jaxrpc.jbws1792;
-
-/**
- * @author darran.lofthouse(a)jboss.com
- * @since Aug 22, 2007
- */
-public class TestEndpointImpl implements TestEndpoint
-{
-
- /**
- * @see org.jboss.test.ws.jaxrpc.jbws1792.TestEndpoint#echoMessage(java.lang.String)
- */
- public String echoMessage(final String message)
- {
- return message;
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpointImpl.java (from rev 4491, stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpointImpl.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpointImpl.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestEndpointImpl.java 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.jaxrpc.jbws1792;
+
+/**
+ * @author darran.lofthouse(a)jboss.com
+ * @since Aug 22, 2007
+ */
+public class TestEndpointImpl implements TestEndpoint
+{
+
+ /**
+ * @see org.jboss.test.ws.jaxrpc.jbws1792.TestEndpoint#echoMessage(java.lang.String)
+ */
+ public String echoMessage(final String message)
+ {
+ return message;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestHandler.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestHandler.java 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestHandler.java 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software 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.jaxrpc.jbws1792;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.handler.GenericHandler;
-import javax.xml.rpc.handler.HandlerInfo;
-
-/**
- * @author darran.lofthouse(a)jboss.com
- * @since Aug 22, 2007
- */
-public class TestHandler extends GenericHandler
-{
-
- public void init(final HandlerInfo config)
- {
- super.init(config);
-
- Object value = config.getHandlerConfig().get("TestParameter");
-
- if ("TestValue".equals(value) == false)
- {
- throw new RuntimeException("Expected parameter not set expected-[TestParameter=TestValue] actual-[TestParameter=" + value + "].");
- }
- }
-
- /**
- * @see javax.xml.rpc.handler.GenericHandler#getHeaders()
- */
- public QName[] getHeaders()
- {
- return null;
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestHandler.java (from rev 4491, stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestHandler.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestHandler.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1792/TestHandler.java 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.jaxrpc.jbws1792;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.GenericHandler;
+import javax.xml.rpc.handler.HandlerInfo;
+
+/**
+ * @author darran.lofthouse(a)jboss.com
+ * @since Aug 22, 2007
+ */
+public class TestHandler extends GenericHandler
+{
+
+ public void init(final HandlerInfo config)
+ {
+ super.init(config);
+
+ Object value = config.getHandlerConfig().get("TestParameter");
+
+ if ("TestValue".equals(value) == false)
+ {
+ throw new RuntimeException("Expected parameter not set expected-[TestParameter=TestValue] actual-[TestParameter=" + value + "].");
+ }
+ }
+
+ /**
+ * @see javax.xml.rpc.handler.GenericHandler#getHeaders()
+ */
+ public QName[] getHeaders()
+ {
+ return null;
+ }
+
+}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792 (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792)
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/META-INF)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/application-client.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxrpc/jbws1792/META-INF/application-client.xml 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/application-client.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<application-client 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/application-client_1_4.xsd"
- version="1.4">
-
- <display-name>TestService</display-name>
-
- <service-ref>
- <service-ref-name>service/TestService</service-ref-name>
- <service-interface>javax.xml.rpc.Service</service-interface>
- <wsdl-file>META-INF/wsdl/TestService.wsdl</wsdl-file>
- <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
- <port-component-ref>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1792.TestEndpoint</service-endpoint-interface>
- </port-component-ref>
- </service-ref>
-
-</application-client>
-
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/application-client.xml (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/META-INF/application-client.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/application-client.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/application-client.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<application-client 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/application-client_1_4.xsd"
+ version="1.4">
+
+ <display-name>TestService</display-name>
+
+ <service-ref>
+ <service-ref-name>service/TestService</service-ref-name>
+ <service-interface>javax.xml.rpc.Service</service-interface>
+ <wsdl-file>META-INF/wsdl/TestService.wsdl</wsdl-file>
+ <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
+ <port-component-ref>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1792.TestEndpoint</service-endpoint-interface>
+ </port-component-ref>
+ </service-ref>
+
+</application-client>
+
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/jboss-client.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxrpc/jbws1792/META-INF/jboss-client.xml 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/jboss-client.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,15 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-
-<!DOCTYPE jboss-client PUBLIC
- "-//JBoss//DTD Application Client 4.0//EN"
- "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
-
-<jboss-client>
- <jndi-name>jbossws-client</jndi-name>
-
- <service-ref>
- <service-ref-name>service/TestService</service-ref-name>
- <wsdl-override>http://@jboss.bind.address@:8080/jaxrpc-jbws1792/TestEndpoint?wsdl</wsdl-override>
- </service-ref>
-
-</jboss-client>
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/jboss-client.xml (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/META-INF/jboss-client.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/jboss-client.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/META-INF/jboss-client.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!DOCTYPE jboss-client PUBLIC
+ "-//JBoss//DTD Application Client 4.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
+
+<jboss-client>
+ <jndi-name>jbossws-client</jndi-name>
+
+ <service-ref>
+ <service-ref-name>service/TestService</service-ref-name>
+ <wsdl-override>http://@jboss.bind.address@:8080/jaxrpc-jbws1792/TestEndpoint?wsdl</wsdl-override>
+ </service-ref>
+
+</jboss-client>
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/custom-endpoint-config.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/custom-endpoint-config.xml 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/custom-endpoint-config.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id$ -->
-
-<jaxrpc-config xmlns="urn:jboss:jaxrpc-config:2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xsi:schemaLocation="urn:jboss:jaxrpc-config:2.0 jaxrpc-config_2_0.xsd">
-
- <endpoint-config>
- <config-name>Custom Endpoint Config</config-name>
- <pre-handler-chain>
- <handler-chain-name>Custom Handlers</handler-chain-name>
- <handler>
- <j2ee:handler-name>Custom Handler</j2ee:handler-name>
- <j2ee:handler-class>org.jboss.test.ws.jaxrpc.jbws1792.TestHandler</j2ee:handler-class>
- <j2ee:init-param>
- <j2ee:param-name>TestParameter</j2ee:param-name>
- <j2ee:param-value>TestValue</j2ee:param-value>
- </j2ee:init-param>
- </handler>
- </pre-handler-chain>
- </endpoint-config>
-
-</jaxrpc-config>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/custom-endpoint-config.xml (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/custom-endpoint-config.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/custom-endpoint-config.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/custom-endpoint-config.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+
+<jaxrpc-config xmlns="urn:jboss:jaxrpc-config:2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+ xsi:schemaLocation="urn:jboss:jaxrpc-config:2.0 jaxrpc-config_2_0.xsd">
+
+ <endpoint-config>
+ <config-name>Custom Endpoint Config</config-name>
+ <pre-handler-chain>
+ <handler-chain-name>Custom Handlers</handler-chain-name>
+ <handler>
+ <j2ee:handler-name>Custom Handler</j2ee:handler-name>
+ <j2ee:handler-class>org.jboss.test.ws.jaxrpc.jbws1792.TestHandler</j2ee:handler-class>
+ <j2ee:init-param>
+ <j2ee:param-name>TestParameter</j2ee:param-name>
+ <j2ee:param-value>TestValue</j2ee:param-value>
+ </j2ee:init-param>
+ </handler>
+ </pre-handler-chain>
+ </endpoint-config>
+
+</jaxrpc-config>
\ No newline at end of file
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/jaxrpc-mapping.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/jaxrpc-mapping.xml 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/jaxrpc-mapping.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,37 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
- <package-mapping>
- <package-type>org.jboss.test.ws.jaxrpc.jbws1792</package-type>
- <namespaceURI>http://org.jboss.test.ws/jbws1792/types</namespaceURI>
- </package-mapping>
- <service-interface-mapping>
- <service-interface>org.jboss.test.ws.jaxrpc.jbws1792.TestService</service-interface>
- <wsdl-service-name xmlns:serviceNS='http://org.jboss.test.ws/jbws1792'>serviceNS:TestService</wsdl-service-name>
- <port-mapping>
- <port-name>TestEndpointPort</port-name>
- <java-port-name>TestEndpointPort</java-port-name>
- </port-mapping>
- </service-interface-mapping>
- <service-endpoint-interface-mapping>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1792.TestEndpoint</service-endpoint-interface>
- <wsdl-port-type xmlns:portTypeNS='http://org.jboss.test.ws/jbws1792'>portTypeNS:TestEndpoint</wsdl-port-type>
- <wsdl-binding xmlns:bindingNS='http://org.jboss.test.ws/jbws1792'>bindingNS:TestEndpointBinding</wsdl-binding>
- <service-endpoint-method-mapping>
- <java-method-name>echoMessage</java-method-name>
- <wsdl-operation>echoMessage</wsdl-operation>
- <method-param-parts-mapping>
- <param-position>0</param-position>
- <param-type>java.lang.String</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1792'>wsdlMsgNS:TestEndpoint_echoMessage</wsdl-message>
- <wsdl-message-part-name>String_1</wsdl-message-part-name>
- <parameter-mode>IN</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
- <wsdl-return-value-mapping>
- <method-return-value>java.lang.String</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1792'>wsdlMsgNS:TestEndpoint_echoMessageResponse</wsdl-message>
- <wsdl-message-part-name>result</wsdl-message-part-name>
- </wsdl-return-value-mapping>
- </service-endpoint-method-mapping>
- </service-endpoint-interface-mapping>
-</java-wsdl-mapping>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/jaxrpc-mapping.xml (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/jaxrpc-mapping.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/jaxrpc-mapping.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/jaxrpc-mapping.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,37 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jaxrpc.jbws1792</package-type>
+ <namespaceURI>http://org.jboss.test.ws/jbws1792/types</namespaceURI>
+ </package-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jaxrpc.jbws1792.TestService</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://org.jboss.test.ws/jbws1792'>serviceNS:TestService</wsdl-service-name>
+ <port-mapping>
+ <port-name>TestEndpointPort</port-name>
+ <java-port-name>TestEndpointPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1792.TestEndpoint</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://org.jboss.test.ws/jbws1792'>portTypeNS:TestEndpoint</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://org.jboss.test.ws/jbws1792'>bindingNS:TestEndpointBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>echoMessage</java-method-name>
+ <wsdl-operation>echoMessage</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1792'>wsdlMsgNS:TestEndpoint_echoMessage</wsdl-message>
+ <wsdl-message-part-name>String_1</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>java.lang.String</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1792'>wsdlMsgNS:TestEndpoint_echoMessageResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,28 +0,0 @@
-<?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">
-
- <context-param>
- <param-name>jbossws-config-name</param-name>>
- <param-value>Custom Endpoint Config</param-value>
- </context-param>
- <context-param>
- <param-name>jbossws-config-file</param-name>>
- <param-value>WEB-INF/custom-endpoint-config.xml</param-value>
- </context-param>
-
- <servlet>
- <servlet-name>TestEndpoint</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxrpc.jbws1792.TestEndpointImpl</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>TestEndpoint</servlet-name>
- <url-pattern>/TestEndpoint</url-pattern>
- </servlet-mapping>
-
-</web-app>
-
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -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">
+
+ <context-param>
+ <param-name>jbossws-config-name</param-name>>
+ <param-value>Custom Endpoint Config</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jbossws-config-file</param-name>>
+ <param-value>WEB-INF/custom-endpoint-config.xml</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxrpc.jbws1792.TestEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/TestEndpoint</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/webservices.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/webservices.xml 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/webservices.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,15 +0,0 @@
-<webservices version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
- <webservice-description>
- <webservice-description-name>TestService</webservice-description-name>
- <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
- <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
- <port-component>
- <port-component-name>TestEndpointPort</port-component-name>
- <wsdl-port xmlns:portNS='http://org.jboss.test.ws/jbws1792'>portNS:TestEndpointPort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1792.TestEndpoint</service-endpoint-interface>
- <service-impl-bean>
- <servlet-link>TestEndpoint</servlet-link>
- </service-impl-bean>
- </port-component>
- </webservice-description>
-</webservices>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/webservices.xml (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/webservices.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/webservices.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/webservices.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,15 @@
+<webservices version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
+ <webservice-description>
+ <webservice-description-name>TestService</webservice-description-name>
+ <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
+ <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
+ <port-component>
+ <port-component-name>TestEndpointPort</port-component-name>
+ <wsdl-port xmlns:portNS='http://org.jboss.test.ws/jbws1792'>portNS:TestEndpointPort</wsdl-port>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1792.TestEndpoint</service-endpoint-interface>
+ <service-impl-bean>
+ <servlet-link>TestEndpoint</servlet-link>
+ </service-impl-bean>
+ </port-component>
+ </webservice-description>
+</webservices>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/TestService.wsdl 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/TestService.wsdl 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions name='TestService' targetNamespace='http://org.jboss.test.ws/jbws1792' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.test.ws/jbws1792' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- <types/>
- <message name='TestEndpoint_echoMessage'>
- <part name='String_1' type='xsd:string'/>
- </message>
- <message name='TestEndpoint_echoMessageResponse'>
- <part name='result' type='xsd:string'/>
- </message>
- <portType name='TestEndpoint'>
- <operation name='echoMessage' parameterOrder='String_1'>
- <input message='tns:TestEndpoint_echoMessage'/>
- <output message='tns:TestEndpoint_echoMessageResponse'/>
- </operation>
- </portType>
- <binding name='TestEndpointBinding' type='tns:TestEndpoint'>
- <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
- <operation name='echoMessage'>
- <soap:operation soapAction=''/>
- <input>
- <soap:body namespace='http://org.jboss.test.ws/jbws1792' use='literal'/>
- </input>
- <output>
- <soap:body namespace='http://org.jboss.test.ws/jbws1792' use='literal'/>
- </output>
- </operation>
- </binding>
- <service name='TestService'>
- <port binding='tns:TestEndpointBinding' name='TestEndpointPort'>
- <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
- </port>
- </service>
-</definitions>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/TestService.wsdl (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/TestService.wsdl)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/TestService.wsdl (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/WEB-INF/wsdl/TestService.wsdl 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='TestService' targetNamespace='http://org.jboss.test.ws/jbws1792' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.test.ws/jbws1792' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types/>
+ <message name='TestEndpoint_echoMessage'>
+ <part name='String_1' type='xsd:string'/>
+ </message>
+ <message name='TestEndpoint_echoMessageResponse'>
+ <part name='result' type='xsd:string'/>
+ </message>
+ <portType name='TestEndpoint'>
+ <operation name='echoMessage' parameterOrder='String_1'>
+ <input message='tns:TestEndpoint_echoMessage'/>
+ <output message='tns:TestEndpoint_echoMessageResponse'/>
+ </operation>
+ </portType>
+ <binding name='TestEndpointBinding' type='tns:TestEndpoint'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echoMessage'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1792' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1792' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:TestEndpointBinding' name='TestEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/wstools-config.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxrpc/jbws1792/wstools-config.xml 2007-08-23 14:08:49 UTC (rev 4491)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/wstools-config.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- wstools.sh -cp ../../../../../output/tests/classes -config wstools-config.xml
--->
-
-<configuration xmlns="http://www.jboss.org/jbossws-tools"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
-
- <java-wsdl>
- <service name="TestService" endpoint="org.jboss.test.ws.jaxrpc.jbws1792.TestEndpoint" style="rpc">
- </service>
- <namespaces target-namespace="http://org.jboss.test.ws/jbws1792" type-namespace="http://org.jboss.test.ws/jbws1792/types"/>
- <mapping file="jaxrpc-mapping.xml"/>
- <webservices servlet-link="TestEndpoint"/>
- </java-wsdl>
-
-</configuration>
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/wstools-config.xml (from rev 4491, stack/native/trunk/src/test/resources/jaxrpc/jbws1792/wstools-config.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/wstools-config.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxrpc/jbws1792/wstools-config.xml 2008-03-11 10:52:40 UTC (rev 5914)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ wstools.sh -cp ../../../../../output/tests/classes -config wstools-config.xml
+-->
+
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+
+ <java-wsdl>
+ <service name="TestService" endpoint="org.jboss.test.ws.jaxrpc.jbws1792.TestEndpoint" style="rpc">
+ </service>
+ <namespaces target-namespace="http://org.jboss.test.ws/jbws1792" type-namespace="http://org.jboss.test.ws/jbws1792/types"/>
+ <mapping file="jaxrpc-mapping.xml"/>
+ <webservices servlet-link="TestEndpoint"/>
+ </java-wsdl>
+
+</configuration>
16 years, 3 months
JBossWS SVN: r5913 - framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-03-11 05:47:51 -0400 (Tue, 11 Mar 2008)
New Revision: 5913
Added:
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/FakeInputStream.java
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/GeneratorDataSource.java
Modified:
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBase.java
Log:
[JBPAPP-650] Additional classes needed for testsuite.
Copied: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/FakeInputStream.java (from rev 4766, framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/FakeInputStream.java)
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/FakeInputStream.java (rev 0)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/FakeInputStream.java 2008-03-11 09:47:51 UTC (rev 5913)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.samples.xop.doclit;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.Arrays;
+
+public class FakeInputStream extends InputStream
+{
+ private long size;
+
+ public FakeInputStream(long size)
+ {
+ this.size = size;
+ }
+
+ public int read(byte[] b, int off, int len) throws IOException
+ {
+ if (len < 1)
+ return 0;
+
+ if (size == 0)
+ return -1;
+
+ int ret = (int)Math.min(size, len);
+ Arrays.fill(b, off, off + ret, (byte)1);
+ size -= ret;
+
+ return ret;
+ }
+
+ public int read() throws IOException
+ {
+ if (size > 0)
+ {
+ size--;
+ return 1;
+ }
+
+ return -1;
+ }
+}
Copied: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/GeneratorDataSource.java (from rev 4766, framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/GeneratorDataSource.java)
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/GeneratorDataSource.java (rev 0)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/GeneratorDataSource.java 2008-03-11 09:47:51 UTC (rev 5913)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.samples.xop.doclit;
+
+import javax.activation.DataSource;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Arrays;
+
+public class GeneratorDataSource implements DataSource
+{
+ private long size;
+
+ public GeneratorDataSource(long size)
+ {
+ this.size = size;
+ }
+
+ public String getContentType()
+ {
+ return "application/octet-stream";
+ }
+
+ public InputStream getInputStream() throws IOException
+ {
+ return new FakeInputStream(size);
+ }
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public OutputStream getOutputStream() throws IOException
+ {
+ return null;
+ }
+}
\ No newline at end of file
Modified: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBase.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBase.java 2008-03-11 09:46:26 UTC (rev 5912)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBase.java 2008-03-11 09:47:51 UTC (rev 5913)
@@ -133,6 +133,24 @@
assertTrue(response.getData() instanceof Source);
}
+ public void testAttachmentpartSwap() throws Exception
+ {
+ getBinding().setMTOMEnabled(true);
+
+ DataHandler dh = new DataHandler( new GeneratorDataSource(1024*128) );
+ DHResponse response = getPort().echoDataHandler(new DHRequest(dh));
+ assertNotNull(response);
+ assertNotNull(response.getDataHandler().getContent());
+
+ File tmpDir = new File(System.getProperty("jboss.home")+"/server/default/tmp/jbossws");
+ assertTrue("Temp dir doesn't exist", tmpDir.exists());
+
+ for(String fileName : tmpDir.list())
+ {
+ assertTrue("Attachment part swap file does still exist: "+fileName, fileName.indexOf("JBossWSattachment") == -1);
+ }
+ }
+
protected Object getContent(DataHandler dh) throws IOException
{
Object content = dh.getContent();
16 years, 3 months
JBossWS SVN: r5911 - framework/branches.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-03-11 05:42:57 -0400 (Tue, 11 Mar 2008)
New Revision: 5911
Added:
framework/branches/jbossws-framework-2.0.1.GA_CP/
Log:
[JBPAPP-650] Branch for testsuite changes.
Copied: framework/branches/jbossws-framework-2.0.1.GA_CP (from rev 5910, framework/tags/jbossws-framework-2.0.1.GA)
16 years, 3 months
JBossWS SVN: r5910 - stack/native/trunk/src/main/java/org/jboss/ws/extensions/security.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-03-11 03:15:35 -0400 (Tue, 11 Mar 2008)
New Revision: 5910
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
Log:
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2008-03-10 18:01:14 UTC (rev 5909)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2008-03-11 07:15:35 UTC (rev 5910)
@@ -21,7 +21,6 @@
*/
package org.jboss.ws.extensions.security;
-import java.lang.reflect.Constructor;
import java.util.Calendar;
import java.util.Collection;
import java.util.HashSet;
@@ -36,7 +35,6 @@
import org.jboss.ws.extensions.security.element.UsernameToken;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.jboss.ws.extensions.security.operation.DecryptionOperation;
-import org.jboss.ws.extensions.security.operation.OperationDescription;
import org.jboss.ws.extensions.security.operation.ReceiveUsernameOperation;
import org.jboss.ws.extensions.security.operation.RequireEncryptionOperation;
import org.jboss.ws.extensions.security.operation.RequireOperation;
16 years, 3 months
JBossWS SVN: r5909 - stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-03-10 14:01:14 -0400 (Mon, 10 Mar 2008)
New Revision: 5909
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/OperationDescription.java
Log:
Removing class no longer used
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/OperationDescription.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/OperationDescription.java 2008-03-10 17:50:55 UTC (rev 5908)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/OperationDescription.java 2008-03-10 18:01:14 UTC (rev 5909)
@@ -1,133 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security.operation;
-
-import java.util.List;
-
-import org.jboss.ws.extensions.security.Target;
-
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class OperationDescription<T extends Operation>
-{
- private Class<? extends T> operation;
-
- private List<Target> targets;
-
- private String certificateAlias;
-
- private String credential;
-
- private String algorithm;
-
- private String keyWrapAlgorithm;
-
- private String tokenRefType;
-
- public OperationDescription(Class<? extends T> operation, List<Target> targets, String certicateAlias, String credential, String algorithm, String keyWrapAlgorithm, String tokenRefType)
- {
- this.operation = operation;
- this.targets = targets;
- this.certificateAlias = certicateAlias;
- this.credential = credential;
- this.algorithm = algorithm;
- this.keyWrapAlgorithm = keyWrapAlgorithm;
- this.tokenRefType = tokenRefType;
- }
-
- public Class<? extends T> getOperation()
- {
- return operation;
- }
-
- public void setOperation(Class<? extends T> operation)
- {
- this.operation = operation;
- }
-
- public List<Target> getTargets()
- {
- return targets;
- }
-
- public void setTargets(List<Target> targets)
- {
- this.targets = targets;
- }
-
-
- public String getCertificateAlias()
- {
- return certificateAlias;
- }
-
-
- public void setCertificateAlias(String certificateAlias)
- {
- this.certificateAlias = certificateAlias;
- }
-
-
- public String getCredential()
- {
- return credential;
- }
-
- public void setCredential(String credential)
- {
- this.credential = credential;
- }
-
- public String getAlgorithm()
- {
- return algorithm;
- }
-
- public void setAlgorithm(String algorithm)
- {
- this.algorithm = algorithm;
- }
-
- public String getKeyWrapAlgorithm()
- {
- return keyWrapAlgorithm;
- }
-
- public void setKeyWrapAlgorithm(String keyWrapAlgorithm)
- {
- this.keyWrapAlgorithm = keyWrapAlgorithm;
- }
-
- public String getTokenRefType()
- {
- return tokenRefType;
- }
-
- public void setTokenRefType(String tokenRefType)
- {
- this.tokenRefType = tokenRefType;
- }
-
-}
16 years, 3 months
JBossWS SVN: r5908 - in stack/native/trunk: src/main/java/org/jboss/ws/extensions/security and 11 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-03-10 13:50:55 -0400 (Mon, 10 Mar 2008)
New Revision: 5908
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/DecodingOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/DecryptionOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/EncodingOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/EncryptionOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/Operation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/OperationDescription.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireEncryptionOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireSignatureOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireTargetableOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireTimestampOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SendUsernameOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SignatureOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SignatureVerificationOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TimestampOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TimestampVerificationOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TokenOperation.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernamePwdDigestTestCase.java
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/jboss-wsse-client.xml
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/wsdl/
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/wsdl/UsernameService.wsdl
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/jboss-web.xml
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/jboss-wsse-server.xml
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/web.xml
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java
Modified:
stack/native/trunk/ant-import-tests/build-samples-jaxws.xml
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
stack/native/trunk/src/main/resources/schema/jboss-ws-security_1_0.xsd
stack/native/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
Log:
- Refactoring security operation model to support future extensibility
- [JBWS-1988] Preparing test (still WIP)
Modified: stack/native/trunk/ant-import-tests/build-samples-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-samples-jaxws.xml 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/ant-import-tests/build-samples-jaxws.xml 2008-03-10 17:50:55 UTC (rev 5908)
@@ -271,6 +271,19 @@
<include name="jboss-wsse-server.xml"/>
</webinf>
</war>
+
+ <!-- jaxws-samples-wssecurity-username-digest -->
+ <war warfile="${tests.output.dir}/libs/jaxws-samples-wssecurity-username-digest.war"
+ webxml="${tests.output.dir}/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/samples/wssecurity/username-digest/WEB-INF">
+ <include name="jboss-web.xml"/>
+ <include name="jboss-wsse-server.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-samples-wssecurityAnnotatedpolicy-encrypt -->
<war warfile="${tests.output.dir}/libs/jaxws-samples-wssecurityAnnotatedpolicy-encrypt.war"
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.util.Collection;
-
-import org.jboss.ws.extensions.security.element.SecurityProcess;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-
-/**
- * <code>DecodingOperation</code> represents an operation that is applied to a
- * WS-Security encoded message to both convert and verify the contents of the
- * message.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public interface DecodingOperation extends Operation
-{
- public Collection<String> process(Document message, SecurityProcess process) throws WSSecurityException;
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,148 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import javax.crypto.SecretKey;
-
-import org.apache.xml.security.encryption.XMLCipher;
-import org.apache.xml.security.encryption.XMLEncryptionException;
-import org.jboss.ws.extensions.security.element.EncryptedKey;
-import org.jboss.ws.extensions.security.element.ReferenceList;
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.SecurityProcess;
-import org.jboss.ws.extensions.security.exception.FailedCheckException;
-import org.jboss.ws.extensions.security.exception.InvalidSecurityHeaderException;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class DecryptionOperation implements DecodingOperation
-{
-
- private SecurityHeader header;
-
- private SecurityStore store;
-
- public DecryptionOperation(SecurityHeader header, SecurityStore store) throws WSSecurityException
- {
- this.header = header;
- this.store = store;
- }
-
- private boolean isContent(Element element)
- {
- return Constants.XENC_CONTENT_TYPE.equals(element.getAttribute("Type"));
- }
-
- private String getEncryptionAlgorithm(Element element) throws WSSecurityException
- {
- element = Util.findElement(element, "EncryptionMethod", Constants.XML_ENCRYPTION_NS);
- if (element == null)
- throw new InvalidSecurityHeaderException("Encrypted element corrupted, no encryption method");
-
- String alg = element.getAttribute("Algorithm");
- if (alg == null || alg.length() == 0)
- throw new InvalidSecurityHeaderException("Encrypted element corrupted, no algorithm specified");
-
- return alg;
- }
-
- private String decryptElement(Element element, SecretKey key) throws WSSecurityException
- {
- Element previous;
- boolean parent;
- boolean isContent;
-
- // We find the decrypted element by traversing to the element before the
- // encrypted data. If there is no sibling before the encrypted data, then
- // we traverse to the parent.
- // "Now take a step back . . . and then a step forward . . . and then a
- // step back . . . and then we're cha-chaing." -Chris Knight
- parent = isContent = isContent(element);
- if (parent)
- {
- previous = (Element) element.getParentNode();
- }
- else
- {
- previous = Util.getPreviousSiblingElement(element);
- if (previous == null)
- {
- parent = true;
- previous = (Element) element.getParentNode();
- }
- }
-
- String alg = getEncryptionAlgorithm(element);
- try
- {
- XMLCipher cipher = XMLCipher.getInstance(alg);
- cipher.init(XMLCipher.DECRYPT_MODE, key);
- cipher.doFinal(element.getOwnerDocument(), element);
- }
- catch (XMLEncryptionException e)
- {
- throw new FailedCheckException("Decryption was invalid.");
- }
- catch (Exception e)
- {
- throw new WSSecurityException("Could not decrypt element: " + e.getMessage(), e);
- }
-
- if (isContent)
- return Util.getWsuId(previous);
-
- Element decrypted = (parent) ? Util.getFirstChildElement(previous) : Util.getNextSiblingElement(previous);
- if (decrypted == null)
- return null;
-
- return Util.getWsuId(decrypted);
- }
-
- private boolean isEncryptedData(Element element)
- {
- return "EncryptedData".equals(element.getLocalName()) && Constants.XML_ENCRYPTION_NS.equals(element.getNamespaceURI());
- }
-
- public Collection<String> process(Document message, SecurityProcess process) throws WSSecurityException
- {
- Collection<String> ids = new HashSet<String>();
- EncryptedKey key = (EncryptedKey) process;
- ReferenceList list = key.getReferenceList();
- for (String uri : list.getAllReferences())
- {
- Element element = Util.findElementByWsuId(message.getDocumentElement(), uri);
- if (element == null)
- throw new WSSecurityException("A reference list refered to an element that was not found: " + uri);
-
- if (!isEncryptedData(element))
- throw new WSSecurityException("Malformed reference list, a non encrypted data element was referenced: " + uri);
-
- ids.add(decryptElement(element, key.getSecretKey()));
- }
-
- return ids;
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -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.ws.extensions.security;
-
-import java.util.List;
-
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-
-/**
- * <code>EncodingOperation</code> represents an encoding operation that is
- * applied to a standard SOAP message, transforming it into a WS-Security
- * encoded message.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public interface EncodingOperation extends Operation
-{
- public void process(Document message, List<Target> targets, String alias, String credential, String algorithm, String wrap, String tokenRefType) throws WSSecurityException;
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,231 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PublicKey;
-import java.security.cert.X509Certificate;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.crypto.Cipher;
-import javax.crypto.KeyGenerator;
-import javax.crypto.SecretKey;
-import javax.xml.namespace.QName;
-
-import org.apache.xml.security.encryption.EncryptedData;
-import org.apache.xml.security.encryption.XMLCipher;
-import org.apache.xml.security.exceptions.XMLSecurityException;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.extensions.security.element.EncryptedKey;
-import org.jboss.ws.extensions.security.element.Reference;
-import org.jboss.ws.extensions.security.element.ReferenceList;
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.X509Token;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class EncryptionOperation implements EncodingOperation
-{
- private SecurityHeader header;
-
- private SecurityStore store;
-
- private static class Algorithm
- {
- Algorithm(String jceName, String xmlName, int size)
- {
- this.jceName = jceName;
- this.xmlName = xmlName;
- this.size = size;
- }
-
- public String jceName;
- public String xmlName;
- public int size;
- }
-
- private static HashMap<String, Algorithm> algorithms;
-
- private static final String DEFAULT_ALGORITHM = "aes-128";
-
- static
- {
- algorithms = new HashMap<String, Algorithm>(4);
- algorithms.put("aes-128", new Algorithm("AES", XMLCipher.AES_128, 128));
- algorithms.put("aes-192", new Algorithm("AES", XMLCipher.AES_192, 192));
- algorithms.put("aes-256", new Algorithm("AES", XMLCipher.AES_256, 256));
- algorithms.put("tripledes", new Algorithm("TripleDes", XMLCipher.TRIPLEDES, 168));
- }
-
- public EncryptionOperation(SecurityHeader header, SecurityStore store) throws WSSecurityException
- {
- this.header = header;
- this.store = store;
- }
-
- private void processTarget(XMLCipher cipher, Document message, Target target, ReferenceList list, SecretKey key) throws WSSecurityException
- {
- if (!(target instanceof QNameTarget))
- throw new NotImplementedException();
-
- QName name = ((QNameTarget)target).getName();
-
- Element element = Util.findElement(message.getDocumentElement(), name);
- if (element == null)
- throw new RuntimeException("Could not find element");
-
- // Ensure that the element has an id, so that encryption verification can be performed
- Util.assignWsuId(element);
-
- try
- {
- cipher.init(XMLCipher.ENCRYPT_MODE, key);
- EncryptedData encrypted = cipher.getEncryptedData();
- String id = Util.generateId("encrypted");
- encrypted.setId(id);
- list.add(id);
- cipher.doFinal(message, element, target.isContent());
- }
- catch (Exception e)
- {
- throw new WSSecurityException("Error encrypting target: " + name, e);
- }
- }
-
- public SecretKey getSecretKey(String algorithm) throws WSSecurityException
- {
- Algorithm alg = algorithms.get(algorithm);
-
- try
- {
- KeyGenerator kgen = KeyGenerator.getInstance(alg.jceName);
- kgen.init(alg.size);
- return kgen.generateKey();
- }
- catch (NoSuchAlgorithmException e)
- {
- throw new WSSecurityException(e.getMessage());
- }
- }
-
- public void process(Document message, List<Target> targets, String alias, String credential, String algorithm, String wrap, String tokenRefType) throws WSSecurityException
- {
- if (! algorithms.containsKey(algorithm))
- algorithm = DEFAULT_ALGORITHM;
-
- SecretKey secretKey = getSecretKey(algorithm);
- XMLCipher cipher;
- try
- {
- cipher = XMLCipher.getInstance(algorithms.get(algorithm).xmlName);
- cipher.init(XMLCipher.ENCRYPT_MODE, secretKey);
- }
- catch (XMLSecurityException e)
- {
- throw new WSSecurityException("Error initializing xml cipher" + e.getMessage(), e);
- }
-
- ReferenceList list = new ReferenceList();
-
- if (targets == null || targets.size() == 0)
- {
- // By default we encrypt the content of the body element
- String namespace = message.getDocumentElement().getNamespaceURI();
- processTarget(cipher, message, new QNameTarget(new QName(namespace, "Body"), true), list, secretKey);
- }
- else
- {
- for (Target target : targets)
- processTarget(cipher, message, target, list, secretKey);
- }
-
- X509Certificate cert = getCertificate(alias);
- X509Token token = (X509Token) header.getSharedToken(cert);
-
- // Can we reuse an existing token?
- if (token == null)
- {
- token = new X509Token(cert, message);
- if (tokenRefType == null || Reference.DIRECT_REFERENCE.equals(tokenRefType))
- header.addToken(token);
- }
-
- EncryptedKey eKey = new EncryptedKey(message, secretKey, token, list, wrap, tokenRefType);
- header.addSecurityProcess(eKey);
- }
-
- @SuppressWarnings("unchecked")
- private X509Certificate getCertificate(String alias) throws WSSecurityException
- {
- X509Certificate cert = null;
- if (alias != null)
- {
- cert = store.getCertificate(alias);
- if (cert == null)
- throw new WSSecurityException("Cannot load certificate from keystore; alias = " + alias);
- }
- else
- {
- List<PublicKey> publicKeys = SignatureKeysAssociation.getPublicKeys();
- if (publicKeys != null && publicKeys.size() == 1)
- cert = store.getCertificateByPublicKey(publicKeys.iterator().next());
- if (cert == null)
- throw new WSSecurityException("Cannot get the certificate for message encryption! Verify the keystore contents, " +
- "considering the certificate is obtained through the alias specified in the encrypt configuration element " +
- "or (server side only) through a single key used to sign the incoming message.");
- }
- return cert;
- }
-
-
- public static boolean probeUnlimitedCrypto() throws WSSecurityException
- {
- try
- {
- //Check AES-256
- KeyGenerator kgen = KeyGenerator.getInstance("AES");
- kgen.init(256);
- SecretKey key = kgen.generateKey();
- Cipher c = Cipher.getInstance("AES");
- c.init(Cipher.ENCRYPT_MODE, key);
-
- //Check Blowfish
- kgen = KeyGenerator.getInstance("Blowfish");
- key = kgen.generateKey();
- c = Cipher.getInstance("Blowfish");
- c.init(Cipher.ENCRYPT_MODE, key);
-
- return true;
- }
- catch (InvalidKeyException e)
- {
- return false;
- }
- catch (Exception e)
- {
- throw new WSSecurityException("Error probing cryptographic permissions", e);
- }
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,33 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-/**
- * Marker interface for all WS-Security operations
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public interface Operation
-{
-
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,131 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.util.List;
-
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class OperationDescription<T extends Operation>
-{
- private Class<? extends T> operation;
-
- private List<Target> targets;
-
- private String certificateAlias;
-
- private String credential;
-
- private String algorithm;
-
- private String keyWrapAlgorithm;
-
- private String tokenRefType;
-
- public OperationDescription(Class<? extends T> operation, List<Target> targets, String certicateAlias, String credential, String algorithm, String keyWrapAlgorithm, String tokenRefType)
- {
- this.operation = operation;
- this.targets = targets;
- this.certificateAlias = certicateAlias;
- this.credential = credential;
- this.algorithm = algorithm;
- this.keyWrapAlgorithm = keyWrapAlgorithm;
- this.tokenRefType = tokenRefType;
- }
-
- public Class<? extends T> getOperation()
- {
- return operation;
- }
-
- public void setOperation(Class<? extends T> operation)
- {
- this.operation = operation;
- }
-
- public List<Target> getTargets()
- {
- return targets;
- }
-
- public void setTargets(List<Target> targets)
- {
- this.targets = targets;
- }
-
-
- public String getCertificateAlias()
- {
- return certificateAlias;
- }
-
-
- public void setCertificateAlias(String certificateAlias)
- {
- this.certificateAlias = certificateAlias;
- }
-
-
- public String getCredential()
- {
- return credential;
- }
-
- public void setCredential(String credential)
- {
- this.credential = credential;
- }
-
- public String getAlgorithm()
- {
- return algorithm;
- }
-
- public void setAlgorithm(String algorithm)
- {
- this.algorithm = algorithm;
- }
-
- public String getKeyWrapAlgorithm()
- {
- return keyWrapAlgorithm;
- }
-
- public void setKeyWrapAlgorithm(String keyWrapAlgorithm)
- {
- this.keyWrapAlgorithm = keyWrapAlgorithm;
- }
-
- public String getTokenRefType()
- {
- return tokenRefType;
- }
-
- public void setTokenRefType(String tokenRefType)
- {
- this.tokenRefType = tokenRefType;
- }
-
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.extensions.security;
-
-// $Id$
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.Token;
-import org.jboss.ws.extensions.security.element.UsernameToken;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.invocation.SecurityAdaptor;
-import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
-import org.w3c.dom.Document;
-
-public class ReceiveUsernameOperation implements TokenOperation
-{
- private SecurityHeader header;
- private SecurityStore store;
-
- private SecurityAdaptorFactory secAdapterfactory;
-
- public ReceiveUsernameOperation(SecurityHeader header, SecurityStore store)
- {
- this.header = header;
- this.store = store;
-
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- secAdapterfactory = spiProvider.getSPI(SecurityAdaptorFactory.class);
- }
-
- public void process(Document message, Token token) throws WSSecurityException
- {
- UsernameToken user = (UsernameToken)token;
- SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();
- securityAdaptor.setPrincipal(new SimplePrincipal(user.getUsername()));
- securityAdaptor.setCredential(user.getPassword());
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,34 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-
-
-public class RequireEncryptionOperation extends RequireTargetableOperation
-{
- public RequireEncryptionOperation(SecurityHeader header, SecurityStore store) throws WSSecurityException
- {
- super(header, store);
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,39 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-
-/**
- * Marker interface for all requirement based WS-Security operations.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public interface RequireOperation extends Operation
-{
- public void process(Document message, List<Target> targets, String alias, String credential, Collection<String> processedIds) throws WSSecurityException;
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,34 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-
-
-public class RequireSignatureOperation extends RequireTargetableOperation
-{
- public RequireSignatureOperation(SecurityHeader header, SecurityStore store) throws WSSecurityException
- {
- super(header, store);
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -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.ws.extensions.security;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.exception.FailedCheckException;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class RequireTargetableOperation implements RequireOperation
-{
- public RequireTargetableOperation(SecurityHeader header, SecurityStore store) throws WSSecurityException
- {
- }
-
- private Collection<String> resolveTarget(Document message, Target target) throws WSSecurityException
- {
- if (target instanceof QNameTarget)
- return resolveQNameTarget(message, (QNameTarget) target);
- else if (target instanceof WsuIdTarget)
- {
- Collection<String> result = new ArrayList<String>(1);
- result.add(((WsuIdTarget)target).getId());
- return result;
- }
-
- throw new WSSecurityException("Unknown target");
- }
-
- private Collection<String> resolveQNameTarget(Document message, QNameTarget target) throws WSSecurityException
- {
- QName name = target.getName();
-
- Element element = Util.findElement(message.getDocumentElement(), name);
- if (element == null)
- throw new FailedCheckException("Required QName was not present: " + name);
-
- String id = Util.getWsuId(element);
-
- if (id == null)
- throw new FailedCheckException("Required element did not contain a wsu:id.");
-
- Collection<String> result = new ArrayList<String>(1);
- result.add(id);
-
- return result;
- }
-
- public void process(Document message, List<Target> targets, String alias, String credential, Collection<String> processedIds) throws WSSecurityException
- {
- if (targets == null || targets.size() == 0)
- {
- // By default we require just the body element
- String namespace = message.getDocumentElement().getNamespaceURI();
- targets = new ArrayList<Target>(1);
- targets.add(new QNameTarget(new QName(namespace, "Body"), true));
- }
-
- for (Target target : targets)
- {
- Collection<String> ids = resolveTarget(message, target);
- if (! processedIds.containsAll(ids))
- throw new FailedCheckException("Required elements for encryption and or signing are not all present.");
- }
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,62 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.List;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.Timestamp;
-import org.jboss.ws.extensions.security.exception.FailedCheckException;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-
-
-public class RequireTimestampOperation implements RequireOperation
-{
- private SecurityHeader header;
-
- public RequireTimestampOperation(SecurityHeader header, SecurityStore store) throws WSSecurityException
- {
- this.header = header;
- }
-
- public void process(Document message, List<Target> targets, String maxAge, String credential, Collection<String> processedIds) throws WSSecurityException
- {
- Timestamp stamp = header.getTimestamp();
- if (stamp == null)
- throw new FailedCheckException("Required timestamp not present.");
-
- // If there is no maxAge specified then we are done
- if (maxAge == null)
- return;
-
- int max = Integer.parseInt(maxAge);
-
- Calendar expired = (Calendar)stamp.getCreated().clone();
- expired.add(Calendar.SECOND, max);
-
- if (! Calendar.getInstance().before(expired))
- throw new FailedCheckException("Timestamp of message is too old.");
- }
-}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -35,6 +35,14 @@
import org.jboss.ws.extensions.security.element.Token;
import org.jboss.ws.extensions.security.element.UsernameToken;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.ws.extensions.security.operation.DecryptionOperation;
+import org.jboss.ws.extensions.security.operation.OperationDescription;
+import org.jboss.ws.extensions.security.operation.ReceiveUsernameOperation;
+import org.jboss.ws.extensions.security.operation.RequireEncryptionOperation;
+import org.jboss.ws.extensions.security.operation.RequireOperation;
+import org.jboss.ws.extensions.security.operation.RequireSignatureOperation;
+import org.jboss.ws.extensions.security.operation.SignatureVerificationOperation;
+import org.jboss.ws.extensions.security.operation.TimestampVerificationOperation;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -134,41 +142,23 @@
}
}
- public void verify(List<OperationDescription<RequireOperation>> requireOperations) throws WSSecurityException
+ public void verify(List<RequireOperation> requireOperations) throws WSSecurityException
{
if (requireOperations == null)
return;
- for (OperationDescription<RequireOperation> o : requireOperations)
+ for (RequireOperation op : requireOperations)
{
- Class<? extends RequireOperation> operation = o.getOperation();
- RequireOperation op;
Collection<String> processedIds = null;
-
- if (operation.equals(RequireSignatureOperation.class))
+ if (op instanceof RequireSignatureOperation)
{
- op = new RequireSignatureOperation(header, store);
processedIds = signedIds;
}
- else if (operation.equals(RequireEncryptionOperation.class))
+ else if (op instanceof RequireEncryptionOperation)
{
- op = new RequireEncryptionOperation(header, store);
processedIds = encryptedIds;
}
- else
- {
- try
- {
- Constructor<? extends RequireOperation> c = operation.getConstructor(SecurityHeader.class, SecurityStore.class);
- op = c.newInstance(header, store);
- }
- catch (Exception e)
- {
- throw new WSSecurityException("Error constructing operation: " + operation);
- }
- }
-
- op.process(message, o.getTargets(), o.getCertificateAlias(), o.getCredential(), processedIds);
+ op.process(message, header, processedIds);
}
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -21,11 +21,13 @@
*/
package org.jboss.ws.extensions.security;
-import java.lang.reflect.Constructor;
+//$Id$
+
import java.util.List;
import org.jboss.ws.extensions.security.element.SecurityHeader;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.ws.extensions.security.operation.EncodingOperation;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -39,11 +41,11 @@
*/
public class SecurityEncoder
{
- private List<OperationDescription<EncodingOperation>> operations;
+ private List<EncodingOperation> operations;
private SecurityStore store;
- public SecurityEncoder(List<OperationDescription<EncodingOperation>> operations, SecurityStore store)
+ public SecurityEncoder(List<EncodingOperation> operations, SecurityStore store)
{
org.apache.xml.security.Init.init();
this.operations = operations;
@@ -69,21 +71,9 @@
public void encode(Document message) throws WSSecurityException
{
SecurityHeader header = new SecurityHeader(message);
- for (OperationDescription<EncodingOperation> op : operations)
+ for (EncodingOperation operation : operations)
{
- EncodingOperation operation;
-
- try
- {
- Constructor<? extends EncodingOperation> constructor = op.getOperation().getConstructor(SecurityHeader.class, SecurityStore.class);
- operation = constructor.newInstance(header, store);
- }
- catch (Exception e)
- {
- throw new WSSecurityException("Error constructing operation: " + op.getOperation());
- }
-
- operation.process(message, op.getTargets(), op.getCertificateAlias(), op.getCredential(), op.getAlgorithm(), op.getKeyWrapAlgorithm(), op.getTokenRefType());
+ operation.process(message, header, store);
}
attachHeader(header, message);
}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,47 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.util.List;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.UsernameToken;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-
-public class SendUsernameOperation implements EncodingOperation
-{
- private SecurityHeader header;
-
- private SecurityStore store;
-
- public SendUsernameOperation(SecurityHeader header, SecurityStore store)
- {
- this.header = header;
- this.store = store;
- }
-
- public void process(Document message, List<Target> targets, String username, String credential, String algorithm, String keyWrapAlgorithm, String tokenRefType) throws WSSecurityException
- {
- header.addToken(new UsernameToken(username, credential, message));
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,180 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xml.security.c14n.Canonicalizer;
-import org.apache.xml.security.exceptions.XMLSecurityException;
-import org.apache.xml.security.signature.XMLSignature;
-import org.apache.xml.security.signature.XMLSignatureException;
-import org.apache.xml.security.transforms.TransformationException;
-import org.apache.xml.security.transforms.Transforms;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.extensions.security.element.Reference;
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.SecurityTokenReference;
-import org.jboss.ws.extensions.security.element.Signature;
-import org.jboss.ws.extensions.security.element.X509Token;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-public class SignatureOperation implements EncodingOperation
-{
- private SecurityHeader header;
-
- private SecurityStore store;
-
- public SignatureOperation(SecurityHeader header, SecurityStore store) throws WSSecurityException
- {
- this.header = header;
- this.store = store;
- }
-
- private void processTarget(XMLSignature sig, Document message, Target target)
- {
- if (target instanceof QNameTarget)
- processQNameTarget(sig, message, (QNameTarget) target);
- else if (target instanceof WsuIdTarget)
- processWsuIdTarget(sig, message, (WsuIdTarget) target);
- else
- throw new NotImplementedException();
- }
-
- private void processQNameTarget(XMLSignature sig, Document message, QNameTarget target)
- {
- QName name = target.getName();
-
- Transforms transforms = new Transforms(message);
- try
- {
- transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
- }
- catch (TransformationException e)
- {
- throw new RuntimeException(e);
- }
-
- Element element = Util.findElement(message.getDocumentElement(), name);
- if (element == null)
- throw new RuntimeException("Could not find element");
-
- String id = Util.assignWsuId(element);
-
- try
- {
- sig.addDocument("#" + id, transforms);
- }
- catch (XMLSignatureException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- private void processWsuIdTarget(XMLSignature sig, Document message, WsuIdTarget target)
- {
- String id = target.getId();
-
- Transforms transforms = new Transforms(message);
- try
- {
- transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
- }
- catch (TransformationException e)
- {
- throw new RuntimeException(e);
- }
-
- try
- {
- sig.addDocument("#" + id, transforms);
- }
- catch (XMLSignatureException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public void process(Document message, List<Target> targets, String alias, String credential, String algorithm, String keyWrapAlgorithm, String tokenRefType) throws WSSecurityException
- {
- Element envelope = message.getDocumentElement();
- XMLSignature sig;
- try
- {
- sig = new XMLSignature(message, null, XMLSignature.ALGO_ID_SIGNATURE_RSA, Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
- }
- catch (XMLSecurityException e)
- {
- throw new WSSecurityException("Error building signature", e);
- }
-
- // For now we pass our resolver the root document because the signature element isn't attached
- // to the evelope yet (no wsse header). Perhaps we should do this differently
- sig.addResourceResolver(new WsuIdResolver(message, header.getElement()));
- PrivateKey key = store.getPrivateKey(alias);
-
- if (targets == null || targets.size() == 0)
- {
- // By default we sign the body element, and a timestamp if it is available
- String namespace = envelope.getNamespaceURI();
- processTarget(sig, message, new QNameTarget(new QName(namespace, "Body")));
- if (header.getTimestamp() != null)
- processTarget(sig, message, new WsuIdTarget("timestamp"));
- }
- else
- {
- for (Target target : targets)
- processTarget(sig, message, target);
- }
-
- try
- {
- sig.sign(key);
- }
- catch (XMLSignatureException e)
- {
- throw new WSSecurityException("Error signing message: " + e.getMessage(), e);
- }
-
- X509Certificate cert = store.getCertificate(alias);
- X509Token token = (X509Token) header.getSharedToken(cert);
-
- // Can we reuse an existing token?
- if (token == null)
- {
- token = new X509Token(cert, message);
- if (tokenRefType == null || Reference.DIRECT_REFERENCE.equals(tokenRefType))
- header.addToken(token);
- }
-
- SecurityTokenReference reference = new SecurityTokenReference(Reference.getReference(tokenRefType, message, token));
- sig.getKeyInfo().addUnknownElement(reference.getElement());
-
- header.addSecurityProcess(new Signature(sig));
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,93 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.xml.security.exceptions.XMLSecurityException;
-import org.apache.xml.security.signature.SignedInfo;
-import org.apache.xml.security.signature.XMLSignature;
-import org.apache.xml.security.signature.XMLSignatureException;
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.SecurityProcess;
-import org.jboss.ws.extensions.security.element.Signature;
-import org.jboss.ws.extensions.security.exception.FailedCheckException;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-
-public class SignatureVerificationOperation implements DecodingOperation
-{
- private SecurityHeader header;
-
- private SecurityStore store;
-
- public SignatureVerificationOperation(SecurityHeader header, SecurityStore store) throws WSSecurityException
- {
- this.header = header;
- this.store = store;
- }
-
- public Collection<String> process(Document message, SecurityProcess process) throws WSSecurityException
- {
- Signature signature = (Signature) process;
- XMLSignature xmlSig = signature.getSignature();
-
- xmlSig.addResourceResolver(new WsuIdResolver(message));
- STRTransform.setSecurityStore(store);
-
- try
- {
- if (! xmlSig.checkSignatureValue(signature.getPublicKey()))
- throw new FailedCheckException("Signature is invalid.");
-
- SignatureKeysAssociation.saveKey(signature.getPublicKey());
- }
- catch (XMLSignatureException e)
- {
- throw new WSSecurityException("An unexpected error occured while verifying signature", e);
- }
- finally
- {
- STRTransform.setSecurityStore(null);
- }
-
- SignedInfo info = xmlSig.getSignedInfo();
- int length = info.getLength();
- Collection<String> processed = new ArrayList<String>(length);
- try
- {
- for (int i = 0; i < length; i++)
- {
- String uri = info.item(i).getURI();
- if (uri != null && uri.length() > 1 && uri.charAt(0)=='#')
- processed.add(uri.substring(1));
- }
- }
- catch (XMLSecurityException e)
- {
- throw new WSSecurityException("Could not extract references", e);
- }
-
- return processed;
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,59 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.util.List;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.Timestamp;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-
-public class TimestampOperation implements EncodingOperation
-{
- private SecurityHeader header;
-
- private SecurityStore store;
-
- public TimestampOperation(SecurityHeader header, SecurityStore store)
- {
- this.header = header;
- this.store = store;
- }
-
- public void process(Document message, List<Target> targets, String alias, String credential, String algorithm, String keyWrapAlgorithm, String tokenRefType) throws WSSecurityException
- {
- Integer ttl = null;
-
- try
- {
- // Time to live is stuffed in the credential field
- ttl = Integer.valueOf(credential);
- }
- catch (NumberFormatException e)
- {
- // Eat
- }
-
- header.setTimestamp(new Timestamp(ttl, message));
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,63 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import java.util.Calendar;
-
-import org.jboss.ws.extensions.security.element.Timestamp;
-import org.jboss.ws.extensions.security.exception.FailedCheckException;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-
-
-public class TimestampVerificationOperation
-{
- private Calendar now = null;
-
- public TimestampVerificationOperation()
- {
- }
-
- /**
- * A special constructor that allows you to use a different value when validating the message.
- * DO NOT USE THIS UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!.
- *
- * @param now The timestamp to use as the current time when validating a message expiration
- */
- public TimestampVerificationOperation(Calendar now)
- {
- this.now = now;
- }
-
- public void process(Document message, Timestamp timestamp) throws WSSecurityException
- {
- Calendar expired = timestamp.getExpires();
- Calendar created = timestamp.getCreated();
- Calendar now = (this.now == null) ? Calendar.getInstance() : this.now;
-
- if (created.after(now))
- throw new WSSecurityException("Invalid timestamp, message claimed to be created after now");
-
- if (expired != null && ! now.before(expired))
- throw new FailedCheckException("Expired message.");
- }
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -1,39 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import org.jboss.ws.extensions.security.element.Token;
-import org.jboss.ws.extensions.security.exception.WSSecurityException;
-import org.w3c.dom.Document;
-
-/**
- * <code>DecodingOperation</code> represents an operation that is applied to a
- * WS-Security encoded message to both convert and verify the contents of the
- * message.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public interface TokenOperation
-{
- public void process(Document message, Token token) throws WSSecurityException;
-}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -35,6 +35,16 @@
import org.jboss.ws.core.CommonSOAPFaultException;
import org.jboss.ws.extensions.security.exception.InvalidSecurityHeaderException;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.ws.extensions.security.operation.EncodingOperation;
+import org.jboss.ws.extensions.security.operation.EncryptionOperation;
+//import org.jboss.ws.extensions.security.operation.OperationDescription;
+import org.jboss.ws.extensions.security.operation.RequireEncryptionOperation;
+import org.jboss.ws.extensions.security.operation.RequireOperation;
+import org.jboss.ws.extensions.security.operation.RequireSignatureOperation;
+import org.jboss.ws.extensions.security.operation.RequireTimestampOperation;
+import org.jboss.ws.extensions.security.operation.SendUsernameOperation;
+import org.jboss.ws.extensions.security.operation.SignatureOperation;
+import org.jboss.ws.extensions.security.operation.TimestampOperation;
import org.jboss.ws.metadata.wsse.Config;
import org.jboss.ws.metadata.wsse.Encrypt;
import org.jboss.ws.metadata.wsse.RequireEncryption;
@@ -80,7 +90,7 @@
return new CommonSOAPFaultException(e.getFaultCode(), e.getFaultString());
}
- private static List<OperationDescription<RequireOperation>> buildRequireOperations(Config operationConfig)
+ private static List<RequireOperation> buildRequireOperations(Config operationConfig)
{
if (operationConfig == null)
return null;
@@ -89,23 +99,23 @@
if (requires == null)
return null;
- ArrayList<OperationDescription<RequireOperation>> operations = new ArrayList<OperationDescription<RequireOperation>>();
+ ArrayList<RequireOperation> operations = new ArrayList<RequireOperation>();
RequireTimestamp requireTimestamp = requires.getRequireTimestamp();
if (requireTimestamp != null)
- operations.add(new OperationDescription<RequireOperation>(RequireTimestampOperation.class, null, requireTimestamp.getMaxAge(), null, null, null, null));
+ operations.add(new RequireTimestampOperation(requireTimestamp.getMaxAge()));
RequireSignature requireSignature = requires.getRequireSignature();
if (requireSignature != null)
{
List<Target> targets = convertTargets(requireSignature.getTargets());
- operations.add(new OperationDescription<RequireOperation>(RequireSignatureOperation.class, targets, null, null, null, null, null));
+ operations.add(new RequireSignatureOperation(targets));
}
RequireEncryption requireEncryption = requires.getRequireEncryption();
if (requireEncryption != null)
{
List<Target> targets = convertTargets(requireEncryption.getTargets());
- operations.add(new OperationDescription<RequireOperation>(RequireEncryptionOperation.class, targets, null, null, null, null, null));
+ operations.add(new RequireEncryptionOperation(targets));
}
return operations;
@@ -152,7 +162,7 @@
if (log.isTraceEnabled())
log.trace("Decoded Message:\n" + DOMWriter.printNode(message.getSOAPPart(), true));
- List<OperationDescription<RequireOperation>> operations = buildRequireOperations(config);
+ List<RequireOperation> operations = buildRequireOperations(config);
decoder.verify(operations);
if(log.isDebugEnabled()) log.debug("Verification is successful");
@@ -179,16 +189,16 @@
if (config == null)
return;
- ArrayList<OperationDescription<EncodingOperation>> operations = new ArrayList<OperationDescription<EncodingOperation>>();
+ ArrayList<EncodingOperation> operations = new ArrayList<EncodingOperation>();
Timestamp timestamp = config.getTimestamp();
if (timestamp != null)
{
- operations.add(new OperationDescription<EncodingOperation>(TimestampOperation.class, null, null, timestamp.getTtl(), null, null, null));
+ operations.add(new TimestampOperation(timestamp.getTtl()));
}
if (config.getUsername() != null && user != null && password != null)
{
- operations.add(new OperationDescription<EncodingOperation>(SendUsernameOperation.class, null, user, password, null, null, null));
+ operations.add(new SendUsernameOperation(user, password));
}
Sign sign = config.getSign();
@@ -198,20 +208,20 @@
if (sign.isIncludeTimestamp())
{
if (timestamp == null)
- operations.add(new OperationDescription<EncodingOperation>(TimestampOperation.class, null, null, null, null, null, null));
+ operations.add(new TimestampOperation(null)); //TODO!! check this null
if (targets != null && targets.size() > 0)
targets.add(new WsuIdTarget("timestamp"));
}
- operations.add(new OperationDescription<EncodingOperation>(SignatureOperation.class, targets, sign.getAlias(), null, null, null, sign.getTokenRefType()));
+ operations.add(new SignatureOperation(targets, sign.getAlias(), sign.getTokenRefType()));
}
Encrypt encrypt = config.getEncrypt();
if (encrypt != null)
{
List<Target> targets = convertTargets(encrypt.getTargets());
- operations.add(new OperationDescription<EncodingOperation>(EncryptionOperation.class, targets, encrypt.getAlias(), null, encrypt.getAlgorithm(), encrypt.getWrap(), encrypt.getTokenRefType()));
+ operations.add(new EncryptionOperation(targets, encrypt.getAlias(), encrypt.getAlgorithm(), encrypt.getWrap(), encrypt.getTokenRefType()));
}
if (operations.size() == 0)
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/DecodingOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/DecodingOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/DecodingOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.util.Collection;
+
+import org.jboss.ws.extensions.security.element.SecurityProcess;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+
+/**
+ * <code>DecodingOperation</code> represents an operation that is applied to a
+ * WS-Security encoded message to both convert and verify the contents of the
+ * message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public interface DecodingOperation extends Operation
+{
+ public Collection<String> process(Document message, SecurityProcess process) throws WSSecurityException;
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/DecryptionOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/DecryptionOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/DecryptionOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,151 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.util.Collection;
+import java.util.HashSet;
+
+import javax.crypto.SecretKey;
+
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.encryption.XMLEncryptionException;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.element.EncryptedKey;
+import org.jboss.ws.extensions.security.element.ReferenceList;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.SecurityProcess;
+import org.jboss.ws.extensions.security.exception.FailedCheckException;
+import org.jboss.ws.extensions.security.exception.InvalidSecurityHeaderException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class DecryptionOperation implements DecodingOperation
+{
+
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public DecryptionOperation(SecurityHeader header, SecurityStore store) throws WSSecurityException
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ private boolean isContent(Element element)
+ {
+ return Constants.XENC_CONTENT_TYPE.equals(element.getAttribute("Type"));
+ }
+
+ private String getEncryptionAlgorithm(Element element) throws WSSecurityException
+ {
+ element = Util.findElement(element, "EncryptionMethod", Constants.XML_ENCRYPTION_NS);
+ if (element == null)
+ throw new InvalidSecurityHeaderException("Encrypted element corrupted, no encryption method");
+
+ String alg = element.getAttribute("Algorithm");
+ if (alg == null || alg.length() == 0)
+ throw new InvalidSecurityHeaderException("Encrypted element corrupted, no algorithm specified");
+
+ return alg;
+ }
+
+ private String decryptElement(Element element, SecretKey key) throws WSSecurityException
+ {
+ Element previous;
+ boolean parent;
+ boolean isContent;
+
+ // We find the decrypted element by traversing to the element before the
+ // encrypted data. If there is no sibling before the encrypted data, then
+ // we traverse to the parent.
+ // "Now take a step back . . . and then a step forward . . . and then a
+ // step back . . . and then we're cha-chaing." -Chris Knight
+ parent = isContent = isContent(element);
+ if (parent)
+ {
+ previous = (Element) element.getParentNode();
+ }
+ else
+ {
+ previous = Util.getPreviousSiblingElement(element);
+ if (previous == null)
+ {
+ parent = true;
+ previous = (Element) element.getParentNode();
+ }
+ }
+
+ String alg = getEncryptionAlgorithm(element);
+ try
+ {
+ XMLCipher cipher = XMLCipher.getInstance(alg);
+ cipher.init(XMLCipher.DECRYPT_MODE, key);
+ cipher.doFinal(element.getOwnerDocument(), element);
+ }
+ catch (XMLEncryptionException e)
+ {
+ throw new FailedCheckException("Decryption was invalid.");
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Could not decrypt element: " + e.getMessage(), e);
+ }
+
+ if (isContent)
+ return Util.getWsuId(previous);
+
+ Element decrypted = (parent) ? Util.getFirstChildElement(previous) : Util.getNextSiblingElement(previous);
+ if (decrypted == null)
+ return null;
+
+ return Util.getWsuId(decrypted);
+ }
+
+ private boolean isEncryptedData(Element element)
+ {
+ return "EncryptedData".equals(element.getLocalName()) && Constants.XML_ENCRYPTION_NS.equals(element.getNamespaceURI());
+ }
+
+ public Collection<String> process(Document message, SecurityProcess process) throws WSSecurityException
+ {
+ Collection<String> ids = new HashSet<String>();
+ EncryptedKey key = (EncryptedKey) process;
+ ReferenceList list = key.getReferenceList();
+ for (String uri : list.getAllReferences())
+ {
+ Element element = Util.findElementByWsuId(message.getDocumentElement(), uri);
+ if (element == null)
+ throw new WSSecurityException("A reference list refered to an element that was not found: " + uri);
+
+ if (!isEncryptedData(element))
+ throw new WSSecurityException("Malformed reference list, a non encrypted data element was referenced: " + uri);
+
+ ids.add(decryptElement(element, key.getSecretKey()));
+ }
+
+ return ids;
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/EncodingOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/EncodingOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/EncodingOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+
+/**
+ * <code>EncodingOperation</code> represents an encoding operation that is
+ * applied to a standard SOAP message, transforming it into a WS-Security
+ * encoded message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public interface EncodingOperation extends Operation
+{
+ public void process(Document message, SecurityHeader header, SecurityStore store) throws WSSecurityException;
+
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/EncryptionOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/EncryptionOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/EncryptionOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,242 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PublicKey;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.crypto.Cipher;
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+import javax.xml.namespace.QName;
+
+import org.apache.xml.security.encryption.EncryptedData;
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.security.QNameTarget;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.SignatureKeysAssociation;
+import org.jboss.ws.extensions.security.Target;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.element.EncryptedKey;
+import org.jboss.ws.extensions.security.element.Reference;
+import org.jboss.ws.extensions.security.element.ReferenceList;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.X509Token;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class EncryptionOperation implements EncodingOperation
+{
+ private List<Target> targets;
+ private String alias;
+ private String algorithm;
+ private String wrap;
+ private String tokenRefType;
+
+ private static class Algorithm
+ {
+ Algorithm(String jceName, String xmlName, int size)
+ {
+ this.jceName = jceName;
+ this.xmlName = xmlName;
+ this.size = size;
+ }
+
+ public String jceName;
+ public String xmlName;
+ public int size;
+ }
+
+ private static HashMap<String, Algorithm> algorithms;
+
+ private static final String DEFAULT_ALGORITHM = "aes-128";
+
+ static
+ {
+ algorithms = new HashMap<String, Algorithm>(4);
+ algorithms.put("aes-128", new Algorithm("AES", XMLCipher.AES_128, 128));
+ algorithms.put("aes-192", new Algorithm("AES", XMLCipher.AES_192, 192));
+ algorithms.put("aes-256", new Algorithm("AES", XMLCipher.AES_256, 256));
+ algorithms.put("tripledes", new Algorithm("TripleDes", XMLCipher.TRIPLEDES, 168));
+ }
+
+ public EncryptionOperation(List<Target> targets, String alias, String algorithm, String wrap, String tokenRefType)
+ {
+ super();
+ this.targets = targets;
+ this.alias = alias;
+ this.algorithm = algorithm;
+ this.wrap = wrap;
+ this.tokenRefType = tokenRefType;
+ }
+
+ private void processTarget(XMLCipher cipher, Document message, Target target, ReferenceList list, SecretKey key) throws WSSecurityException
+ {
+ if (!(target instanceof QNameTarget))
+ throw new NotImplementedException();
+
+ QName name = ((QNameTarget)target).getName();
+
+ Element element = Util.findElement(message.getDocumentElement(), name);
+ if (element == null)
+ throw new RuntimeException("Could not find element");
+
+ // Ensure that the element has an id, so that encryption verification can be performed
+ Util.assignWsuId(element);
+
+ try
+ {
+ cipher.init(XMLCipher.ENCRYPT_MODE, key);
+ EncryptedData encrypted = cipher.getEncryptedData();
+ String id = Util.generateId("encrypted");
+ encrypted.setId(id);
+ list.add(id);
+ cipher.doFinal(message, element, target.isContent());
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Error encrypting target: " + name, e);
+ }
+ }
+
+ public SecretKey getSecretKey(String algorithm) throws WSSecurityException
+ {
+ Algorithm alg = algorithms.get(algorithm);
+
+ try
+ {
+ KeyGenerator kgen = KeyGenerator.getInstance(alg.jceName);
+ kgen.init(alg.size);
+ return kgen.generateKey();
+ }
+ catch (NoSuchAlgorithmException e)
+ {
+ throw new WSSecurityException(e.getMessage());
+ }
+ }
+
+ public void process(Document message, SecurityHeader header, SecurityStore store) throws WSSecurityException
+ {
+ if (! algorithms.containsKey(algorithm))
+ algorithm = DEFAULT_ALGORITHM;
+
+ SecretKey secretKey = getSecretKey(algorithm);
+ XMLCipher cipher;
+ try
+ {
+ cipher = XMLCipher.getInstance(algorithms.get(algorithm).xmlName);
+ cipher.init(XMLCipher.ENCRYPT_MODE, secretKey);
+ }
+ catch (XMLSecurityException e)
+ {
+ throw new WSSecurityException("Error initializing xml cipher" + e.getMessage(), e);
+ }
+
+ ReferenceList list = new ReferenceList();
+
+ if (targets == null || targets.size() == 0)
+ {
+ // By default we encrypt the content of the body element
+ String namespace = message.getDocumentElement().getNamespaceURI();
+ processTarget(cipher, message, new QNameTarget(new QName(namespace, "Body"), true), list, secretKey);
+ }
+ else
+ {
+ for (Target target : targets)
+ processTarget(cipher, message, target, list, secretKey);
+ }
+
+ X509Certificate cert = getCertificate(store, alias);
+ X509Token token = (X509Token) header.getSharedToken(cert);
+
+ // Can we reuse an existing token?
+ if (token == null)
+ {
+ token = new X509Token(cert, message);
+ if (tokenRefType == null || Reference.DIRECT_REFERENCE.equals(tokenRefType))
+ header.addToken(token);
+ }
+
+ EncryptedKey eKey = new EncryptedKey(message, secretKey, token, list, wrap, tokenRefType);
+ header.addSecurityProcess(eKey);
+ }
+
+ @SuppressWarnings("unchecked")
+ private X509Certificate getCertificate(SecurityStore store, String alias) throws WSSecurityException
+ {
+ X509Certificate cert = null;
+ if (alias != null)
+ {
+ cert = store.getCertificate(alias);
+ if (cert == null)
+ throw new WSSecurityException("Cannot load certificate from keystore; alias = " + alias);
+ }
+ else
+ {
+ List<PublicKey> publicKeys = SignatureKeysAssociation.getPublicKeys();
+ if (publicKeys != null && publicKeys.size() == 1)
+ cert = store.getCertificateByPublicKey(publicKeys.iterator().next());
+ if (cert == null)
+ throw new WSSecurityException("Cannot get the certificate for message encryption! Verify the keystore contents, " +
+ "considering the certificate is obtained through the alias specified in the encrypt configuration element " +
+ "or (server side only) through a single key used to sign the incoming message.");
+ }
+ return cert;
+ }
+
+
+ public static boolean probeUnlimitedCrypto() throws WSSecurityException
+ {
+ try
+ {
+ //Check AES-256
+ KeyGenerator kgen = KeyGenerator.getInstance("AES");
+ kgen.init(256);
+ SecretKey key = kgen.generateKey();
+ Cipher c = Cipher.getInstance("AES");
+ c.init(Cipher.ENCRYPT_MODE, key);
+
+ //Check Blowfish
+ kgen = KeyGenerator.getInstance("Blowfish");
+ key = kgen.generateKey();
+ c = Cipher.getInstance("Blowfish");
+ c.init(Cipher.ENCRYPT_MODE, key);
+
+ return true;
+ }
+ catch (InvalidKeyException e)
+ {
+ return false;
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Error probing cryptographic permissions", e);
+ }
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/Operation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/Operation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/Operation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -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.ws.extensions.security.operation;
+
+/**
+ * Marker interface for all WS-Security operations
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public interface Operation
+{
+
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/OperationDescription.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/OperationDescription.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/OperationDescription.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,133 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.util.List;
+
+import org.jboss.ws.extensions.security.Target;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class OperationDescription<T extends Operation>
+{
+ private Class<? extends T> operation;
+
+ private List<Target> targets;
+
+ private String certificateAlias;
+
+ private String credential;
+
+ private String algorithm;
+
+ private String keyWrapAlgorithm;
+
+ private String tokenRefType;
+
+ public OperationDescription(Class<? extends T> operation, List<Target> targets, String certicateAlias, String credential, String algorithm, String keyWrapAlgorithm, String tokenRefType)
+ {
+ this.operation = operation;
+ this.targets = targets;
+ this.certificateAlias = certicateAlias;
+ this.credential = credential;
+ this.algorithm = algorithm;
+ this.keyWrapAlgorithm = keyWrapAlgorithm;
+ this.tokenRefType = tokenRefType;
+ }
+
+ public Class<? extends T> getOperation()
+ {
+ return operation;
+ }
+
+ public void setOperation(Class<? extends T> operation)
+ {
+ this.operation = operation;
+ }
+
+ public List<Target> getTargets()
+ {
+ return targets;
+ }
+
+ public void setTargets(List<Target> targets)
+ {
+ this.targets = targets;
+ }
+
+
+ public String getCertificateAlias()
+ {
+ return certificateAlias;
+ }
+
+
+ public void setCertificateAlias(String certificateAlias)
+ {
+ this.certificateAlias = certificateAlias;
+ }
+
+
+ public String getCredential()
+ {
+ return credential;
+ }
+
+ public void setCredential(String credential)
+ {
+ this.credential = credential;
+ }
+
+ public String getAlgorithm()
+ {
+ return algorithm;
+ }
+
+ public void setAlgorithm(String algorithm)
+ {
+ this.algorithm = algorithm;
+ }
+
+ public String getKeyWrapAlgorithm()
+ {
+ return keyWrapAlgorithm;
+ }
+
+ public void setKeyWrapAlgorithm(String keyWrapAlgorithm)
+ {
+ this.keyWrapAlgorithm = keyWrapAlgorithm;
+ }
+
+ public String getTokenRefType()
+ {
+ return tokenRefType;
+ }
+
+ public void setTokenRefType(String tokenRefType)
+ {
+ this.tokenRefType = tokenRefType;
+ }
+
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -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.security.operation;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.SimplePrincipal;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.Token;
+import org.jboss.ws.extensions.security.element.UsernameToken;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+import org.w3c.dom.Document;
+
+public class ReceiveUsernameOperation implements TokenOperation
+{
+ private SecurityHeader header;
+ private SecurityStore store;
+
+ private SecurityAdaptorFactory secAdapterfactory;
+
+ public ReceiveUsernameOperation(SecurityHeader header, SecurityStore store)
+ {
+ this.header = header;
+ this.store = store;
+
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ secAdapterfactory = spiProvider.getSPI(SecurityAdaptorFactory.class);
+ }
+
+ public void process(Document message, Token token) throws WSSecurityException
+ {
+ UsernameToken user = (UsernameToken)token;
+ SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();
+ Logger.getLogger(this.getClass()).info("Username: " + user.getUsername());
+ Logger.getLogger(this.getClass()).info("Password: " + user.getPassword());
+ securityAdaptor.setPrincipal(new SimplePrincipal(user.getUsername()));
+ securityAdaptor.setCredential(user.getPassword());
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireEncryptionOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireEncryptionOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireEncryptionOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.util.List;
+
+import org.jboss.ws.extensions.security.Target;
+
+
+public class RequireEncryptionOperation extends RequireTargetableOperation
+{
+
+ public RequireEncryptionOperation(List<Target> targets)
+ {
+ super(targets);
+ }
+
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.util.Collection;
+
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+
+/**
+ * Marker interface for all requirement based WS-Security operations.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public interface RequireOperation extends Operation
+{
+ public void process(Document message, SecurityHeader header, Collection<String> processedIds) throws WSSecurityException;
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireSignatureOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireSignatureOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireSignatureOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.util.List;
+
+import org.jboss.ws.extensions.security.Target;
+
+
+public class RequireSignatureOperation extends RequireTargetableOperation
+{
+
+ public RequireSignatureOperation(List<Target> targets)
+ {
+ super(targets);
+ }
+
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireTargetableOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireTargetableOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireTargetableOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,99 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.security.QNameTarget;
+import org.jboss.ws.extensions.security.Target;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WsuIdTarget;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.exception.FailedCheckException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class RequireTargetableOperation implements RequireOperation
+{
+ private List<Target> targets;
+
+ public RequireTargetableOperation(List<Target> targets)
+ {
+ this.targets = targets;
+ }
+
+ private Collection<String> resolveTarget(Document message, Target target) throws WSSecurityException
+ {
+ if (target instanceof QNameTarget)
+ return resolveQNameTarget(message, (QNameTarget) target);
+ else if (target instanceof WsuIdTarget)
+ {
+ Collection<String> result = new ArrayList<String>(1);
+ result.add(((WsuIdTarget)target).getId());
+ return result;
+ }
+
+ throw new WSSecurityException("Unknown target");
+ }
+
+ private Collection<String> resolveQNameTarget(Document message, QNameTarget target) throws WSSecurityException
+ {
+ QName name = target.getName();
+
+ Element element = Util.findElement(message.getDocumentElement(), name);
+ if (element == null)
+ throw new FailedCheckException("Required QName was not present: " + name);
+
+ String id = Util.getWsuId(element);
+
+ if (id == null)
+ throw new FailedCheckException("Required element did not contain a wsu:id.");
+
+ Collection<String> result = new ArrayList<String>(1);
+ result.add(id);
+
+ return result;
+ }
+
+ public void process(Document message, SecurityHeader header, Collection<String> processedIds) throws WSSecurityException
+ {
+ if (targets == null || targets.size() == 0)
+ {
+ // By default we require just the body element
+ String namespace = message.getDocumentElement().getNamespaceURI();
+ targets = new ArrayList<Target>(1);
+ targets.add(new QNameTarget(new QName(namespace, "Body"), true));
+ }
+
+ for (Target target : targets)
+ {
+ Collection<String> ids = resolveTarget(message, target);
+ if (! processedIds.containsAll(ids))
+ throw new FailedCheckException("Required elements for encryption and or signing are not all present.");
+ }
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireTimestampOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireTimestampOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/RequireTimestampOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.util.Calendar;
+import java.util.Collection;
+
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.Timestamp;
+import org.jboss.ws.extensions.security.exception.FailedCheckException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+
+
+public class RequireTimestampOperation implements RequireOperation
+{
+ private String maxAge;
+
+ public RequireTimestampOperation(String maxAge)
+ {
+ this.maxAge = maxAge;
+ }
+
+ public void process(Document message, SecurityHeader header, Collection<String> processedIds) throws WSSecurityException
+ {
+ Timestamp stamp = header.getTimestamp();
+ if (stamp == null)
+ throw new FailedCheckException("Required timestamp not present.");
+
+ // If there is no maxAge specified then we are done
+ if (maxAge == null)
+ return;
+
+ int max = Integer.parseInt(maxAge);
+
+ Calendar expired = (Calendar)stamp.getCreated().clone();
+ expired.add(Calendar.SECOND, max);
+
+ if (! Calendar.getInstance().before(expired))
+ throw new FailedCheckException("Timestamp of message is too old.");
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SendUsernameOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SendUsernameOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SendUsernameOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -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.security.operation;
+
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.UsernameToken;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+
+public class SendUsernameOperation implements EncodingOperation
+{
+ private String username;
+ private String credential;
+
+ public SendUsernameOperation(String username, String credential)
+ {
+ this.username = username;
+ this.credential = credential;
+ }
+
+ public void process(Document message, SecurityHeader header, SecurityStore store) throws WSSecurityException
+ {
+ header.addToken(new UsernameToken(username, credential, message));
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SignatureOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SignatureOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SignatureOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,188 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xml.security.c14n.Canonicalizer;
+import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.signature.XMLSignatureException;
+import org.apache.xml.security.transforms.TransformationException;
+import org.apache.xml.security.transforms.Transforms;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.security.QNameTarget;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.Target;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WsuIdResolver;
+import org.jboss.ws.extensions.security.WsuIdTarget;
+import org.jboss.ws.extensions.security.element.Reference;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.SecurityTokenReference;
+import org.jboss.ws.extensions.security.element.Signature;
+import org.jboss.ws.extensions.security.element.X509Token;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+public class SignatureOperation implements EncodingOperation
+{
+ private List<Target> targets;
+ private String alias;
+ private String tokenRefType;
+
+ public SignatureOperation(List<Target> targets, String alias, String tokenRefType)
+ {
+ super();
+ this.targets = targets;
+ this.alias = alias;
+ this.tokenRefType = tokenRefType;
+ }
+
+ private void processTarget(XMLSignature sig, Document message, Target target)
+ {
+ if (target instanceof QNameTarget)
+ processQNameTarget(sig, message, (QNameTarget) target);
+ else if (target instanceof WsuIdTarget)
+ processWsuIdTarget(sig, message, (WsuIdTarget) target);
+ else
+ throw new NotImplementedException();
+ }
+
+ private void processQNameTarget(XMLSignature sig, Document message, QNameTarget target)
+ {
+ QName name = target.getName();
+
+ Transforms transforms = new Transforms(message);
+ try
+ {
+ transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
+ }
+ catch (TransformationException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ Element element = Util.findElement(message.getDocumentElement(), name);
+ if (element == null)
+ throw new RuntimeException("Could not find element");
+
+ String id = Util.assignWsuId(element);
+
+ try
+ {
+ sig.addDocument("#" + id, transforms);
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void processWsuIdTarget(XMLSignature sig, Document message, WsuIdTarget target)
+ {
+ String id = target.getId();
+
+ Transforms transforms = new Transforms(message);
+ try
+ {
+ transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
+ }
+ catch (TransformationException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ try
+ {
+ sig.addDocument("#" + id, transforms);
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void process(Document message, SecurityHeader header, SecurityStore store) throws WSSecurityException
+ {
+ Element envelope = message.getDocumentElement();
+ XMLSignature sig;
+ try
+ {
+ sig = new XMLSignature(message, null, XMLSignature.ALGO_ID_SIGNATURE_RSA, Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+ }
+ catch (XMLSecurityException e)
+ {
+ throw new WSSecurityException("Error building signature", e);
+ }
+
+ // For now we pass our resolver the root document because the signature element isn't attached
+ // to the evelope yet (no wsse header). Perhaps we should do this differently
+ sig.addResourceResolver(new WsuIdResolver(message, header.getElement()));
+ PrivateKey key = store.getPrivateKey(alias);
+
+ if (targets == null || targets.size() == 0)
+ {
+ // By default we sign the body element, and a timestamp if it is available
+ String namespace = envelope.getNamespaceURI();
+ processTarget(sig, message, new QNameTarget(new QName(namespace, "Body")));
+ if (header.getTimestamp() != null)
+ processTarget(sig, message, new WsuIdTarget("timestamp"));
+ }
+ else
+ {
+ for (Target target : targets)
+ processTarget(sig, message, target);
+ }
+
+ try
+ {
+ sig.sign(key);
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new WSSecurityException("Error signing message: " + e.getMessage(), e);
+ }
+
+ X509Certificate cert = store.getCertificate(alias);
+ X509Token token = (X509Token) header.getSharedToken(cert);
+
+ // Can we reuse an existing token?
+ if (token == null)
+ {
+ token = new X509Token(cert, message);
+ if (tokenRefType == null || Reference.DIRECT_REFERENCE.equals(tokenRefType))
+ header.addToken(token);
+ }
+
+ SecurityTokenReference reference = new SecurityTokenReference(Reference.getReference(tokenRefType, message, token));
+ sig.getKeyInfo().addUnknownElement(reference.getElement());
+
+ header.addSecurityProcess(new Signature(sig));
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SignatureVerificationOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SignatureVerificationOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SignatureVerificationOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,97 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.apache.xml.security.signature.SignedInfo;
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.signature.XMLSignatureException;
+import org.jboss.ws.extensions.security.STRTransform;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.SignatureKeysAssociation;
+import org.jboss.ws.extensions.security.WsuIdResolver;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.SecurityProcess;
+import org.jboss.ws.extensions.security.element.Signature;
+import org.jboss.ws.extensions.security.exception.FailedCheckException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+
+public class SignatureVerificationOperation implements DecodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public SignatureVerificationOperation(SecurityHeader header, SecurityStore store) throws WSSecurityException
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ public Collection<String> process(Document message, SecurityProcess process) throws WSSecurityException
+ {
+ Signature signature = (Signature) process;
+ XMLSignature xmlSig = signature.getSignature();
+
+ xmlSig.addResourceResolver(new WsuIdResolver(message));
+ STRTransform.setSecurityStore(store);
+
+ try
+ {
+ if (! xmlSig.checkSignatureValue(signature.getPublicKey()))
+ throw new FailedCheckException("Signature is invalid.");
+
+ SignatureKeysAssociation.saveKey(signature.getPublicKey());
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new WSSecurityException("An unexpected error occured while verifying signature", e);
+ }
+ finally
+ {
+ STRTransform.setSecurityStore(null);
+ }
+
+ SignedInfo info = xmlSig.getSignedInfo();
+ int length = info.getLength();
+ Collection<String> processed = new ArrayList<String>(length);
+ try
+ {
+ for (int i = 0; i < length; i++)
+ {
+ String uri = info.item(i).getURI();
+ if (uri != null && uri.length() > 1 && uri.charAt(0)=='#')
+ processed.add(uri.substring(1));
+ }
+ }
+ catch (XMLSecurityException e)
+ {
+ throw new WSSecurityException("Could not extract references", e);
+ }
+
+ return processed;
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TimestampOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TimestampOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TimestampOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.Timestamp;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+
+public class TimestampOperation implements EncodingOperation
+{
+ private Integer ttl;
+
+ public TimestampOperation(String timeToLive)
+ {
+ try
+ {
+ this.ttl = Integer.valueOf(timeToLive);
+ }
+ catch (NumberFormatException e)
+ {
+ // Eat
+ }
+ }
+
+ public void process(Document message, SecurityHeader header, SecurityStore store) throws WSSecurityException
+ {
+ header.setTimestamp(new Timestamp(ttl, message));
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TimestampVerificationOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TimestampVerificationOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TimestampVerificationOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -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.ws.extensions.security.operation;
+
+import java.util.Calendar;
+
+import org.jboss.ws.extensions.security.element.Timestamp;
+import org.jboss.ws.extensions.security.exception.FailedCheckException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+
+
+public class TimestampVerificationOperation
+{
+ private Calendar now = null;
+
+ public TimestampVerificationOperation()
+ {
+ }
+
+ /**
+ * A special constructor that allows you to use a different value when validating the message.
+ * DO NOT USE THIS UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!.
+ *
+ * @param now The timestamp to use as the current time when validating a message expiration
+ */
+ public TimestampVerificationOperation(Calendar now)
+ {
+ this.now = now;
+ }
+
+ public void process(Document message, Timestamp timestamp) throws WSSecurityException
+ {
+ Calendar expired = timestamp.getExpires();
+ Calendar created = timestamp.getCreated();
+ Calendar now = (this.now == null) ? Calendar.getInstance() : this.now;
+
+ if (created.after(now))
+ throw new WSSecurityException("Invalid timestamp, message claimed to be created after now");
+
+ if (expired != null && ! now.before(expired))
+ throw new FailedCheckException("Expired message.");
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TokenOperation.java (from rev 5882, stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TokenOperation.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/TokenOperation.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import org.jboss.ws.extensions.security.element.Token;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.w3c.dom.Document;
+
+/**
+ * <code>DecodingOperation</code> represents an operation that is applied to a
+ * WS-Security encoded message to both convert and verify the contents of the
+ * message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public interface TokenOperation
+{
+ public void process(Document message, Token token) throws WSSecurityException;
+}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -27,4 +27,32 @@
public class Username implements Serializable
{
private static final long serialVersionUID = 8273360977250180943L;
+
+ private boolean digestPassword;
+
+ private boolean useNonce;
+
+ private boolean useCreated;
+
+ public Username(boolean digestPassword, boolean useNonce, boolean useCreated)
+ {
+ this.digestPassword = digestPassword;
+ this.useNonce = useNonce;
+ this.useCreated = useCreated;
+ }
+
+ public boolean isDigestPassword()
+ {
+ return digestPassword;
+ }
+
+ public boolean isUseNonce()
+ {
+ return useNonce;
+ }
+
+ public boolean isUseCreated()
+ {
+ return useCreated;
+ }
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -244,7 +244,25 @@
}
else if ("username".equals(localName))
{
- return new Username();
+ //By default, we do not use password digest
+ Boolean digestPassword = new Boolean(false);
+ String digestPasswordAttr = attrs.getValue("", "digestPassword");
+ if (digestPasswordAttr != null)
+ digestPassword = (Boolean)SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, digestPasswordAttr, null);
+
+ //if password digest is enabled, we use nonces by default
+ Boolean useNonce = new Boolean(true);
+ String useNonceAttr = attrs.getValue("", "useNonce");
+ if (useNonceAttr != null)
+ useNonce = (Boolean)SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, useNonceAttr, null);
+
+ //if password digest is enabled, we use the created element by default
+ Boolean useCreated = new Boolean(true);
+ String useCreatedAttr = attrs.getValue("", "useCreated");
+ if (useCreatedAttr != null)
+ useCreated = (Boolean)SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, useCreatedAttr, null);
+
+ return new Username(digestPassword, useNonce, useCreated);
}
return null;
Modified: stack/native/trunk/src/main/resources/schema/jboss-ws-security_1_0.xsd
===================================================================
--- stack/native/trunk/src/main/resources/schema/jboss-ws-security_1_0.xsd 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/main/resources/schema/jboss-ws-security_1_0.xsd 2008-03-10 17:50:55 UTC (rev 5908)
@@ -145,7 +145,21 @@
</xs:attribute>
</xs:complexType>
<xs:complexType name="usernameType">
- <xs:sequence/>
+ <xs:attribute name="digestPassword" type="xs:boolean" use="optional">
+ <xs:annotation>
+ <xs:documentation>If true a password digest will be used as password element. The default is false.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="useNonce" type="xs:boolean" use="optional">
+ <xs:annotation>
+ <xs:documentation>Enables/disables nonce usage in the password digest. The default is true.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="useCreated" type="xs:boolean" use="optional">
+ <xs:annotation>
+ <xs:documentation>Enables/disables usage of the Created element in the password digest. The default is true.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
</xs:complexType>
<xs:complexType name="encryptType">
<xs:sequence>
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -26,7 +26,7 @@
import junit.framework.Test;
import org.jboss.ws.core.StubExt;
-import org.jboss.ws.extensions.security.EncryptionOperation;
+import org.jboss.ws.extensions.security.operation.EncryptionOperation;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2008-03-10 13:27:04 UTC (rev 5907)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -35,22 +35,21 @@
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.EncryptionOperation;
-import org.jboss.ws.extensions.security.OperationDescription;
import org.jboss.ws.extensions.security.QNameTarget;
-import org.jboss.ws.extensions.security.RequireEncryptionOperation;
-import org.jboss.ws.extensions.security.RequireSignatureOperation;
import org.jboss.ws.extensions.security.SecurityDecoder;
import org.jboss.ws.extensions.security.SecurityEncoder;
import org.jboss.ws.extensions.security.SecurityStore;
-import org.jboss.ws.extensions.security.SendUsernameOperation;
-import org.jboss.ws.extensions.security.SignatureOperation;
import org.jboss.ws.extensions.security.Target;
-import org.jboss.ws.extensions.security.TimestampOperation;
import org.jboss.ws.extensions.security.Util;
import org.jboss.ws.extensions.security.WSSecurityAPI;
import org.jboss.ws.extensions.security.WSSecurityDispatcher;
import org.jboss.ws.extensions.security.WsuIdTarget;
+import org.jboss.ws.extensions.security.operation.EncryptionOperation;
+import org.jboss.ws.extensions.security.operation.RequireEncryptionOperation;
+import org.jboss.ws.extensions.security.operation.RequireSignatureOperation;
+import org.jboss.ws.extensions.security.operation.SendUsernameOperation;
+import org.jboss.ws.extensions.security.operation.SignatureOperation;
+import org.jboss.ws.extensions.security.operation.TimestampOperation;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
import org.jboss.wsf.common.DOMWriter;
@@ -180,8 +179,8 @@
targets.add(new WsuIdTarget("timestamp"));
LinkedList operations = new LinkedList();
- operations.add(new OperationDescription(TimestampOperation.class, null, null, "300", null, null, null));
- operations.add(new OperationDescription(SignatureOperation.class, targets, "wsse", null, null, null, null));
+ operations.add(new TimestampOperation("300"));
+ operations.add(new SignatureOperation(targets, "wsse", null));
name = new QName("http://org.jboss.ws/2004", "someHeader");
target = new QNameTarget(name);
@@ -192,8 +191,8 @@
target = new QNameTarget(name, true);
targets.add(target);
- operations.add(new OperationDescription(EncryptionOperation.class, targets, "wsse", null, null, null, null));
- operations.add(new OperationDescription(SendUsernameOperation.class, null, "hi", "there", null, null, null));
+ operations.add(new EncryptionOperation(targets, "wsse", null, null, null));
+ operations.add(new SendUsernameOperation("hi", "there"));
return operations;
}
@@ -209,8 +208,8 @@
targets.add(target);
//targets.add(new WsuIdTarget("timestamp"));
LinkedList operations = new LinkedList();
- operations.add(new OperationDescription(RequireSignatureOperation.class, targets, null, null, null, null, null));
- operations.add(new OperationDescription(RequireEncryptionOperation.class, targets, null, null, null, null, null));
+ operations.add(new RequireSignatureOperation(targets));
+ operations.add(new RequireEncryptionOperation(targets));
return operations;
}
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernamePwdDigestTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernamePwdDigestTestCase.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernamePwdDigestTestCase.java 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.samples.wssecurity;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test WS-Security for Username Token with password digest
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 10-Mar-2008
+ */
+public class UsernamePwdDigestTestCase extends JBossWSTest
+{
+ private static UsernameEndpoint port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(UsernamePwdDigestTestCase.class, "jaxws-samples-wssecurity-username-digest.war");
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ if (port == null)
+ {
+ URL wsdlURL = new File("resources/jaxws/samples/wssecurity/username-digest/META-INF/wsdl/UsernameService.wsdl").toURL();
+ URL securityURL = new File("resources/jaxws/samples/wssecurity/username-digest/META-INF/jboss-wsse-client.xml").toURL();
+ QName serviceName = new QName("http://org.jboss.ws/samples/wssecurity", "UsernameService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+
+ port = (UsernameEndpoint)service.getPort(UsernameEndpoint.class);
+ ((StubExt)port).setSecurityConfig(securityURL.toExternalForm());
+ ((StubExt)port).setConfigName("Standard WSSecurity Client");
+ }
+ }
+
+ public void testUsernameTokenNegative() throws Exception
+ {
+ try
+ {
+ port.getUsernameToken();
+ fail("Server should respond with [401] - Unauthorized");
+ }
+ catch (Exception ex)
+ {
+ // this should be ok
+ }
+ }
+
+ public void testUsernameToken() throws Exception
+ {
+ Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
+ reqContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ reqContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+
+ String retObj = port.getUsernameToken();
+ assertEquals("kermit", retObj);
+ }
+}
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernamePwdDigestTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/jboss-wsse-client.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/jboss-wsse-client.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/jboss-wsse-client.xml 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <config>
+ <username digestPassword="true"/>
+ </config>
+</jboss-ws-security>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/jboss-wsse-client.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/wsdl/UsernameService.wsdl
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/wsdl/UsernameService.wsdl (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/wsdl/UsernameService.wsdl 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,30 @@
+<definitions name='UsernameService' targetNamespace='http://org.jboss.ws/samples/wssecurity' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/samples/wssecurity' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types/>
+ <message name='UsernameEndpoint_getUsernameToken'></message>
+ <message name='UsernameEndpoint_getUsernameTokenResponse'>
+ <part name='return' type='xsd:string'/>
+ </message>
+ <portType name='UsernameEndpoint'>
+ <operation name='getUsernameToken'>
+ <input message='tns:UsernameEndpoint_getUsernameToken'/>
+ <output message='tns:UsernameEndpoint_getUsernameTokenResponse'/>
+ </operation>
+ </portType>
+ <binding name='UsernameEndpointBinding' type='tns:UsernameEndpoint'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='getUsernameToken'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/samples/wssecurity' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/samples/wssecurity' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='UsernameService'>
+ <port binding='tns:UsernameEndpointBinding' name='UsernameEndpointPort'>
+ <soap:address location='http://@jboss.bind.address@:8080/jaxws-samples-wssecurity-username-digest'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/META-INF/wsdl/UsernameService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/jboss-web.xml 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <security-domain>java:/jaas/JBossWS</security-domain>
+</jboss-web>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/jboss-wsse-server.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/jboss-wsse-server.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/jboss-wsse-server.xml 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+</jboss-ws-security>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/jboss-wsse-server.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/web.xml 2008-03-10 17:50:55 UTC (rev 5908)
@@ -0,0 +1,39 @@
+<?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>UsernameService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wssecurity.UsernameBean</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>UsernameService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>UsernameService</web-resource-name>
+ <url-pattern>/*</url-pattern>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>friend</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>JBossWS</realm-name>
+ </login-config>
+
+ <security-role>
+ <role-name>friend</role-name>
+ </security-role>
+
+</web-app>
+
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/username-digest/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 3 months
JBossWS SVN: r5907 - in stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm: protocol and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-03-10 09:27:04 -0400 (Mon, 10 Mar 2008)
New Revision: 5907
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMConstants.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMMessageFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMProvider.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMAckRequestedImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMCreateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMCreateSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMMessageFactoryImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMProviderImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceAcknowledgementImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceFaultImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMTerminateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMAckRequestedImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCloseSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCloseSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCreateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCreateSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMMessageFactoryImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMProviderImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceAcknowledgementImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceFaultImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMTerminateSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMTerminateSequenceResponseImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMAckRequested.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCloseSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCloseSequenceResponse.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCreateSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCreateSequenceResponse.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMIncompleteSequenceBehavior.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceAcknowledgement.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceFault.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceFaultCode.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSerializable.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMTerminateSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMTerminateSequenceResponse.java
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/
Log:
refactoring WS-RM protocol
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMConstants.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMConstants.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMConstants.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -0,0 +1,226 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.protocol;
+
+import javax.xml.namespace.QName;
+
+/**
+ * WS-RM protocol elements SPI facade. Each WS-RM provider must implement this interface.
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMConstants
+{
+
+ /**
+ * getter
+ * @return wsrm <b>prefix</b>
+ */
+ String getPrefix();
+
+ /**
+ * getter
+ * @return wsrm <b>namespace</b>
+ */
+ String getNamespaceURI();
+
+ /**
+ * getter
+ * @return <b>LastMessage</b> QName
+ */
+ QName getLastMessageQName();
+
+ /**
+ * getter
+ * @return <b>CreateSequence</b> QName
+ */
+ QName getCreateSequenceQName();
+
+ /**
+ * getter
+ * @return <b>AcksTo</b> QName
+ */
+ QName getAcksToQName();
+
+ /**
+ * getter
+ * @return <b>Expires</b> QName
+ */
+ QName getExpiresQName();
+
+ /**
+ * getter
+ * @return <b>Offer</b> QName
+ */
+ QName getOfferQName();
+
+ /**
+ * getter
+ * @return <b>Identifier</b> QName
+ */
+ QName getIdentifierQName();
+
+ /**
+ * getter
+ * @return <b>Endpoint</b> QName
+ */
+ QName getEndpointQName();
+
+ /**
+ * getter
+ * @return <b>IncompleteSequenceBehavior</b> QName
+ */
+ QName getIncompleteSequenceBehaviorQName();
+
+ /**
+ * getter
+ * @return <b>CreateSequenceResponse</b> QName
+ */
+ QName getCreateSequenceResponseQName();
+
+ /**
+ * getter
+ * @return <b>Accept</b> QName
+ */
+ QName getAcceptQName();
+
+ /**
+ * getter
+ * @return <b>CloseSequence</b> QName
+ */
+ QName getCloseSequenceQName();
+
+ /**
+ * getter
+ * @return <b>LastMessageNumber</b> QName
+ */
+ QName getLastMessageNumberQName();
+
+ /**
+ * getter
+ * @return <b>CloseSequenceResponse</b> QName
+ */
+ QName getCloseSequenceResponseQName();
+
+ /**
+ * getter
+ * @return <b>TerminateSequence</b> QName
+ */
+ QName getTerminateSequenceQName();
+
+ /**
+ * getter
+ * @return <b>LastMsgNumber</b> QName
+ */
+ QName getLastMsgNumberQName();
+
+ /**
+ * getter
+ * @return <b>TerminateSequenceResponse</b> QName
+ */
+ QName getTerminateSequenceResponseQName();
+
+ /**
+ * getter
+ * @return <b>Sequence</b> QName
+ */
+ QName getSequenceQName();
+
+ /**
+ * getter
+ * @return <b>MessageNumber</b> QName
+ */
+ QName getMessageNumberQName();
+
+ /**
+ * getter
+ * @return <b>MaxMessageNumber</b> QName
+ */
+ QName getMaxMessageNumberQName();
+
+ /**
+ * 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/protocol/RMConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMMessageFactory.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMMessageFactory.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMMessageFactory.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol;
+
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequenceResponse;
+
+/**
+ * WS-RM protocol elements SPI facade. Each WS-RM provider must implement this interface.
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMMessageFactory
+{
+ /**
+ * Factory method
+ * @return new CreateSequence instance
+ */
+ RMCreateSequence newCreateSequence();
+
+ /**
+ * Factory method
+ * @return new CreateSequenceResponse instance
+ */
+ RMCreateSequenceResponse newCreateSequenceResponse();
+
+ /**
+ * Factory method
+ * @return new CloseSequence instance or null if this message is not supported by underlying WS-RM provider
+ */
+ RMCloseSequence newCloseSequence();
+
+ /**
+ * Factory method
+ * @return new CloseSequenceResponse instance or null if this message is not supported by underlying WS-RM provider
+ */
+ RMCloseSequenceResponse newCloseSequenceResponse();
+
+ /**
+ * Factory method
+ * @return new TerminateSequence instance
+ */
+ RMTerminateSequence newTerminateSequence();
+
+ /**
+ * Factory method
+ * @return new TerminateSequenceResponse instance or null if this message is not supported by underlying WS-RM provider
+ */
+ RMTerminateSequenceResponse newTerminateSequenceResponse();
+
+ /**
+ * Factory method
+ * @return new Sequence instance
+ */
+ RMSequence newSequence();
+
+ /**
+ * Factory method
+ * @return new AckRequested instance
+ */
+ RMAckRequested newAckRequested();
+
+ /**
+ * Factory method
+ * @return new SequenceAcknowledgement instance
+ */
+ RMSequenceAcknowledgement newSequenceAcknowledgement();
+
+ /**
+ * Factory method
+ * @return new SequenceFault instance
+ */
+ RMSequenceFault newSequenceFault();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMMessageFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMProvider.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMProvider.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMProvider.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol;
+
+import org.jboss.wsf.spi.util.ServiceLoader;
+
+/**
+ * WS-RM Provider SPI facade. Each WS-RM provider must override this class.
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public abstract class RMProvider
+{
+
+ private static final RMProvider rmProviderImpl = (RMProvider) ServiceLoader.loadService(
+ RMProvider.class.getName(),
+ org.jboss.ws.extensions.wsrm.protocol.spec200702.RMProviderImpl.class.getName());
+
+ /**
+ * Must be overriden in subclasses
+ * @param targetNamespace
+ */
+ protected RMProvider()
+ {
+ }
+
+ /**
+ * Returns the namespace associated with current WS-RM provider implementation
+ * @return
+ */
+ public abstract String getNamespaceURI();
+
+ /**
+ * Returns WS-RM provider specific message factory
+ * @return message factory
+ */
+ public abstract RMMessageFactory getMessageFactory();
+
+ /**
+ * Returns WS-RM provider specific constants
+ * @return constants
+ */
+ public abstract RMConstants getConstants();
+
+ public static final RMProvider get()
+ {
+ return rmProviderImpl;
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/RMProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMAckRequestedImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMAckRequestedImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMAckRequestedImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200502;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested
+ */
+final class RMAckRequestedImpl extends RMAbstractSerializable implements RMAckRequested
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private long lastMessageNumber;
+
+ RMAckRequestedImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getMessage()
+ */
+ public long getMessageNumber()
+ {
+ return this.lastMessageNumber;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setMessage(long)
+ */
+ public void setMessageNumber(long lastMessageNumber)
+ {
+ if (lastMessageNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.lastMessageNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.lastMessageNumber = lastMessageNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (int)(lastMessageNumber ^ (lastMessageNumber >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMAckRequestedImpl))
+ return false;
+ final RMAckRequestedImpl other = (RMAckRequestedImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (lastMessageNumber != other.lastMessageNumber)
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMAckRequestedImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMCreateSequenceImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMCreateSequenceImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMCreateSequenceImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -0,0 +1,322 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.protocol.spec200502;
+
+import javax.xml.datatype.Duration;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMIncompleteSequenceBehavior;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence
+ */
+final class RMCreateSequenceImpl extends RMAbstractSerializable implements RMCreateSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String acksTo;
+ private Duration expires;
+ private RMOffer offer;
+
+ RMCreateSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getAcksTo()
+ */
+ public String getAcksTo()
+ {
+ return this.acksTo;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getExpires()
+ */
+ public Duration getExpires()
+ {
+ return this.expires;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getOffer()
+ */
+ public RMOffer getOffer()
+ {
+ return this.offer;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#newOffer()
+ */
+ public RMOffer 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(Duration duration)
+ {
+ if ((duration == null) || (duration.toString().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(RMOffer offer)
+ {
+ if (offer == null)
+ throw new IllegalArgumentException("Offer cannot be null");
+ if (!(offer instanceof OfferImpl))
+ throw new IllegalArgumentException();
+ if (offer.getIdentifier() == null)
+ throw new IllegalArgumentException("Offer identifier must be specified");
+ if (offer.getEndpoint() == null)
+ throw new IllegalArgumentException("Offer endpoint address must be specified");
+ if (this.offer != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.offer = offer;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
+ result = prime * result + ((expires == null) ? 0 : expires.hashCode());
+ result = prime * result + ((offer == null) ? 0 : offer.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCreateSequenceImpl))
+ return false;
+ final RMCreateSequenceImpl other = (RMCreateSequenceImpl)obj;
+ if (acksTo == null)
+ {
+ if (other.acksTo != null)
+ return false;
+ }
+ else if (!acksTo.equals(other.acksTo))
+ return false;
+ if (expires == null)
+ {
+ if (other.expires != null)
+ return false;
+ }
+ else if (!expires.equals(other.expires))
+ return false;
+ if (offer == null)
+ {
+ if (other.offer != null)
+ return false;
+ }
+ else if (!offer.equals(other.offer))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.acksTo == null)
+ throw new RMException("AcksTo must be set");
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer
+ */
+ private static class OfferImpl implements RMCreateSequence.RMOffer
+ {
+
+ private String duration;
+ private String identifier;
+
+ private OfferImpl()
+ {
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getEndpoint()
+ */
+ public String getEndpoint()
+ {
+ return null; // always return null for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getExpires()
+ */
+ public String getExpires()
+ {
+ return this.duration;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIncompleteSequenceBehavior()
+ */
+ public RMIncompleteSequenceBehavior getIncompleteSequenceBehavior()
+ {
+ return null; // always return null for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setEndpoint(java.lang.String)
+ */
+ public void setEndpoint(String address)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty string");
+ if (this.duration != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.duration = duration;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
+ */
+ public void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior incompleteSequenceBehavior)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((duration == null) ? 0 : duration.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof OfferImpl))
+ return false;
+ final OfferImpl other = (OfferImpl)obj;
+ if (duration == null)
+ {
+ if (other.duration != null)
+ return false;
+ }
+ else if (!duration.equals(other.duration))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMCreateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMCreateSequenceResponseImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMCreateSequenceResponseImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMCreateSequenceResponseImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -0,0 +1,270 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.protocol.spec200502;
+
+import javax.xml.datatype.Duration;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMIncompleteSequenceBehavior;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse
+ */
+final class RMCreateSequenceResponseImpl extends RMAbstractSerializable implements RMCreateSequenceResponse
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private Duration expires;
+ private RMAccept accept;
+
+ RMCreateSequenceResponseImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getAccept()
+ */
+ public RMAccept getAccept()
+ {
+ return this.accept;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getDuration()
+ */
+ public Duration getExpires()
+ {
+ return this.expires;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIncompleteSequenceBehavior()
+ */
+ public RMIncompleteSequenceBehavior getIncompleteSequenceBehavior()
+ {
+ return null; // always return null for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#newAccept()
+ */
+ public RMAccept 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(RMAccept 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(Duration duration)
+ {
+ if ((duration == null) || (duration.toString().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty string");
+ if (this.expires != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.expires = duration;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
+ */
+ public void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior incompleteSequenceBehavior)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((accept == null) ? 0 : accept.hashCode());
+ result = prime * result + ((expires == null) ? 0 : expires.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCreateSequenceResponseImpl))
+ return false;
+ final RMCreateSequenceResponseImpl other = (RMCreateSequenceResponseImpl)obj;
+ if (accept == null)
+ {
+ if (other.accept != null)
+ return false;
+ }
+ else if (!accept.equals(other.accept))
+ return false;
+ if (expires == null)
+ {
+ if (other.expires != null)
+ return false;
+ }
+ else if (!expires.equals(other.expires))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier must be set");
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept
+ */
+ private static class AcceptImpl implements RMCreateSequenceResponse.RMAccept
+ {
+
+ 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/protocol/spec200502/RMCreateSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMMessageFactoryImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMMessageFactoryImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMMessageFactoryImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200502;
+
+import org.jboss.ws.extensions.wsrm.protocol.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequenceResponse;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory
+ */
+final class RMMessageFactoryImpl implements RMMessageFactory
+{
+
+ private static final RMMessageFactory INSTANCE = new RMMessageFactoryImpl();
+
+ private RMMessageFactoryImpl()
+ {
+ // forbidden inheritance
+ }
+
+ public static RMMessageFactory getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newAckRequested()
+ */
+ public RMAckRequested newAckRequested()
+ {
+ return new RMAckRequestedImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequence()
+ */
+ public RMCloseSequence newCloseSequence()
+ {
+ return null; // not supported by this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequenceResponse()
+ */
+ public RMCloseSequenceResponse newCloseSequenceResponse()
+ {
+ return null; // not supported by this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequence()
+ */
+ public RMCreateSequence newCreateSequence()
+ {
+ return new RMCreateSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequenceResponse()
+ */
+ public RMCreateSequenceResponse newCreateSequenceResponse()
+ {
+ return new RMCreateSequenceResponseImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequence()
+ */
+ public RMSequence newSequence()
+ {
+ return new RMSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceAcknowledgement()
+ */
+ public RMSequenceAcknowledgement newSequenceAcknowledgement()
+ {
+ return new RMSequenceAcknowledgementImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceFault()
+ */
+ public RMSequenceFault newSequenceFault()
+ {
+ return new RMSequenceFaultImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequence()
+ */
+ public RMTerminateSequence newTerminateSequence()
+ {
+ return new RMTerminateSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequenceResponse()
+ */
+ public RMTerminateSequenceResponse newTerminateSequenceResponse()
+ {
+ return null; // not supported by this version of the RM protocol
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMMessageFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMProviderImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMProviderImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMProviderImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200502;
+
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.common.RMConstantsImpl;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider
+ */
+public final class RMProviderImpl extends RMProvider
+{
+
+ public static final String IMPLEMENTATION_VERSION = "http://schemas.xmlsoap.org/ws/2005/02/rm";
+ private static final RMConstants CONSTANTS = new RMConstantsImpl("wsrm10", IMPLEMENTATION_VERSION);
+ private static final RMProvider INSTANCE = new RMProviderImpl();
+
+ public RMProviderImpl()
+ {
+ // forbidden inheritance
+ }
+
+ public static RMProvider getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getMessageFactory()
+ */
+ @Override
+ public RMMessageFactory getMessageFactory()
+ {
+ return RMMessageFactoryImpl.getInstance();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getConstants()
+ */
+ @Override
+ public RMConstants getConstants()
+ {
+ return CONSTANTS;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getNamespaceURI()
+ */
+ @Override
+ public String getNamespaceURI()
+ {
+ return IMPLEMENTATION_VERSION;
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMProviderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceAcknowledgementImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceAcknowledgementImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceAcknowledgementImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200502;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Collections;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement
+ */
+final class RMSequenceAcknowledgementImpl extends RMAbstractSerializable implements RMSequenceAcknowledgement
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private final List<Long> nacks = new LinkedList<Long>();
+ private final List<RMAcknowledgementRange> acknowledgementRanges = new LinkedList<RMAcknowledgementRange>();
+ private String identifier;
+
+ RMSequenceAcknowledgementImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addAcknowledgementRange(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange)
+ */
+ public void addAcknowledgementRange(RMAcknowledgementRange 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 (RMAcknowledgementRange 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<RMAcknowledgementRange> 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 RMAcknowledgementRange newAcknowledgementRange()
+ {
+ return new AcknowledgementRangeImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setFinal(boolean)
+ */
+ public void setFinal()
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setNone(boolean)
+ */
+ public void setNone()
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + ((nacks == null) ? 0 : nacks.hashCode());
+ result = prime * result + ((acknowledgementRanges == null) ? 0 : acknowledgementRanges.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceAcknowledgementImpl))
+ return false;
+ final RMSequenceAcknowledgementImpl other = (RMSequenceAcknowledgementImpl)obj;
+ if (acknowledgementRanges == null)
+ {
+ if (other.acknowledgementRanges != null)
+ return false;
+ }
+ else if (!acknowledgementRanges.equals(other.acknowledgementRanges))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (nacks == null)
+ {
+ if (other.nacks != null)
+ return false;
+ }
+ else if (!nacks.equals(other.nacks))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ if ((this.acknowledgementRanges.size() == 0) && (this.nacks.size() == 0))
+ throw new RMException("AcknowledgementRange or Nack must be set");
+ }
+
+ private static void checkOverlap(RMAcknowledgementRange currentRange, RMAcknowledgementRange newRange)
+ {
+ if ((currentRange.getLower() <= newRange.getLower()) && (newRange.getLower() <= currentRange.getUpper()))
+ throw new IllegalArgumentException(
+ "Overlap detected: " + currentRange + " vs. " + newRange);
+ if ((currentRange.getLower() <= newRange.getUpper()) && (newRange.getUpper() <= currentRange.getUpper()))
+ throw new IllegalArgumentException(
+ "Overlap detected: " + currentRange + " vs. " + newRange);
+ }
+
+ private static class AcknowledgementRangeImpl implements RMSequenceAcknowledgement.RMAcknowledgementRange
+ {
+
+ 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/protocol/spec200502/RMSequenceAcknowledgementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceFaultImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceFaultImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceFaultImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200502;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFaultCode;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault
+ */
+final class RMSequenceFaultImpl extends RMAbstractSerializable implements RMSequenceFault
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private RMSequenceFaultCode faultCode;
+ private Exception detail;
+
+ RMSequenceFaultImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getDetail()
+ */
+ public Exception getDetail()
+ {
+ return this.detail;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getFaultCode()
+ */
+ public RMSequenceFaultCode getFaultCode()
+ {
+ return this.faultCode;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setDetail(java.lang.Exception)
+ */
+ public void setDetail(Exception detail)
+ {
+ if (detail == null)
+ throw new IllegalArgumentException("Detail cannot be null");
+ if (this.detail != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.detail = detail;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setFaultCode(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFaultCode)
+ */
+ public void setFaultCode(RMSequenceFaultCode faultCode)
+ {
+ if (faultCode == null)
+ throw new IllegalArgumentException("Fault code cannot be null");
+ if (this.faultCode != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.faultCode = faultCode;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((detail == null) ? 0 : detail.getMessage().hashCode());
+ result = prime * result + ((faultCode == null) ? 0 : faultCode.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceFaultImpl))
+ return false;
+ final RMSequenceFaultImpl other = (RMSequenceFaultImpl)obj;
+ if (detail == null)
+ {
+ if (other.detail != null)
+ return false;
+ }
+ else if (!detail.getMessage().equals(other.detail.getMessage()))
+ return false;
+ if (faultCode == null)
+ {
+ if (other.faultCode != null)
+ return false;
+ }
+ else if (!faultCode.equals(other.faultCode))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.faultCode == null)
+ throw new RMException("FaultCode must be set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceFaultImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200502;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence
+ */
+final class RMSequenceImpl extends RMAbstractSerializable implements RMSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private long messageNumber;
+ private boolean isLastMessage;
+
+ RMSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getMessageNumber()
+ */
+ public long getMessageNumber()
+ {
+ return messageNumber;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#isLastMessage()
+ */
+ public boolean isLastMessage()
+ {
+ return this.isLastMessage;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setLastMessage(boolean)
+ */
+ public void setLastMessage()
+ {
+ this.isLastMessage = true;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setMessageNumber(long)
+ */
+ public void setMessageNumber(long messageNumber)
+ {
+ if (messageNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.messageNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.messageNumber = messageNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (isLastMessage ? 1231 : 1237);
+ result = prime * result + (int)(messageNumber ^ (messageNumber >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceImpl))
+ return false;
+ final RMSequenceImpl other = (RMSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (isLastMessage != other.isLastMessage)
+ return false;
+ if (messageNumber != other.messageNumber)
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier must be set");
+ if (this.messageNumber == 0)
+ throw new RMException("MessageNumber must be set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMTerminateSequenceImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMTerminateSequenceImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMTerminateSequenceImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200502;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequence;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence
+ */
+final class RMTerminateSequenceImpl extends RMAbstractSerializable implements RMTerminateSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+
+ RMTerminateSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getLastMsgNumber()
+ */
+ public long getLastMsgNumber()
+ {
+ return 0; // always return zero for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setLastMsgNumber(long)
+ */
+ public void setLastMsgNumber(long lastMsgNumber)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMTerminateSequenceImpl))
+ return false;
+ final RMTerminateSequenceImpl other = (RMTerminateSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200502/RMTerminateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMAckRequestedImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMAckRequestedImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMAckRequestedImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested
+ */
+final class RMAckRequestedImpl extends RMAbstractSerializable implements RMAckRequested
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+
+ RMAckRequestedImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getMessage()
+ */
+ public long getMessageNumber()
+ {
+ return 0; // always return zero for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setMessage(long)
+ */
+ public void setMessageNumber(long lastMessageNumber)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMAckRequestedImpl))
+ return false;
+ final RMAckRequestedImpl other = (RMAckRequestedImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMAckRequestedImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCloseSequenceImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCloseSequenceImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCloseSequenceImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequence;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence
+ */
+final class RMCloseSequenceImpl extends RMAbstractSerializable implements RMCloseSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private long lastMsgNumber;
+
+ RMCloseSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#getLastMsgNumber()
+ */
+ public long getLastMsgNumber()
+ {
+ return this.lastMsgNumber;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence#setLastMsgNumber(long)
+ */
+ public void setLastMsgNumber(long lastMsgNumber)
+ {
+ if (lastMsgNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.lastMsgNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.lastMsgNumber = lastMsgNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (int)(lastMsgNumber ^ (lastMsgNumber >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCloseSequenceImpl))
+ return false;
+ final RMCloseSequenceImpl other = (RMCloseSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (lastMsgNumber != other.lastMsgNumber)
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCloseSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCloseSequenceResponseImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCloseSequenceResponseImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCloseSequenceResponseImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequenceResponse;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse
+ */
+final class RMCloseSequenceResponseImpl extends RMAbstractSerializable implements RMCloseSequenceResponse
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+
+ RMCloseSequenceResponseImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCloseSequenceResponseImpl))
+ return false;
+ final RMCloseSequenceResponseImpl other = (RMCloseSequenceResponseImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCloseSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCreateSequenceImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCreateSequenceImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCreateSequenceImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -0,0 +1,350 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.protocol.spec200702;
+
+import javax.xml.datatype.Duration;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMIncompleteSequenceBehavior;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence
+ */
+final class RMCreateSequenceImpl extends RMAbstractSerializable implements RMCreateSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String acksTo;
+ private Duration expires;
+ private RMOffer offer;
+
+ RMCreateSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getAcksTo()
+ */
+ public String getAcksTo()
+ {
+ return this.acksTo;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getExpires()
+ */
+ public Duration getExpires()
+ {
+ return this.expires;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getOffer()
+ */
+ public RMOffer getOffer()
+ {
+ return this.offer;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#newOffer()
+ */
+ public RMOffer 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(Duration duration)
+ {
+ if ((duration == null) || (duration.toString().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(RMOffer offer)
+ {
+ if (offer == null)
+ throw new IllegalArgumentException("Offer cannot be null");
+ if (!(offer instanceof OfferImpl))
+ throw new IllegalArgumentException();
+ if (offer.getIdentifier() == null)
+ throw new IllegalArgumentException("Offer identifier must be specified");
+ if (offer.getEndpoint() == null)
+ throw new IllegalArgumentException("Offer endpoint address must be specified");
+ if (this.offer != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.offer = offer;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
+ result = prime * result + ((expires == null) ? 0 : expires.hashCode());
+ result = prime * result + ((offer == null) ? 0 : offer.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCreateSequenceImpl))
+ return false;
+ final RMCreateSequenceImpl other = (RMCreateSequenceImpl)obj;
+ if (acksTo == null)
+ {
+ if (other.acksTo != null)
+ return false;
+ }
+ else if (!acksTo.equals(other.acksTo))
+ return false;
+ if (expires == null)
+ {
+ if (other.expires != null)
+ return false;
+ }
+ else if (!expires.equals(other.expires))
+ return false;
+ if (offer == null)
+ {
+ if (other.offer != null)
+ return false;
+ }
+ else if (!offer.equals(other.offer))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.acksTo == null)
+ throw new RMException("AcksTo must be set");
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer
+ */
+ private static class OfferImpl implements RMCreateSequence.RMOffer
+ {
+
+ private String endpoint;
+ private String duration;
+ private String identifier;
+ private RMIncompleteSequenceBehavior incompleteSequenceBehavior;
+
+ private OfferImpl()
+ {
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getEndpoint()
+ */
+ public String getEndpoint()
+ {
+ return this.endpoint;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getExpires()
+ */
+ public String getExpires()
+ {
+ return this.duration;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIncompleteSequenceBehavior()
+ */
+ public RMIncompleteSequenceBehavior getIncompleteSequenceBehavior()
+ {
+ return this.incompleteSequenceBehavior;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setEndpoint(java.lang.String)
+ */
+ public void setEndpoint(String address)
+ {
+ if ((address == null) || (address.trim().equals("")))
+ throw new IllegalArgumentException("Address cannot be null nor empty string");
+ if (this.endpoint != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.endpoint = address;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty string");
+ if (this.duration != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.duration = duration;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
+ */
+ public void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior incompleteSequenceBehavior)
+ {
+ if (incompleteSequenceBehavior == null)
+ throw new IllegalArgumentException("Sequence behavior type cannot be null");
+ if (this.incompleteSequenceBehavior != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.incompleteSequenceBehavior = incompleteSequenceBehavior;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((duration == null) ? 0 : duration.hashCode());
+ result = prime * result + ((endpoint == null) ? 0 : endpoint.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + ((incompleteSequenceBehavior == null) ? 0 : incompleteSequenceBehavior.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof OfferImpl))
+ return false;
+ final OfferImpl other = (OfferImpl)obj;
+ if (duration == null)
+ {
+ if (other.duration != null)
+ return false;
+ }
+ else if (!duration.equals(other.duration))
+ return false;
+ if (endpoint == null)
+ {
+ if (other.endpoint != null)
+ return false;
+ }
+ else if (!endpoint.equals(other.endpoint))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (incompleteSequenceBehavior == null)
+ {
+ if (other.incompleteSequenceBehavior != null)
+ return false;
+ }
+ else if (!incompleteSequenceBehavior.equals(other.incompleteSequenceBehavior))
+ return false;
+ return true;
+ }
+
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCreateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCreateSequenceResponseImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCreateSequenceResponseImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMCreateSequenceResponseImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -0,0 +1,284 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.protocol.spec200702;
+
+import javax.xml.datatype.Duration;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMIncompleteSequenceBehavior;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse
+ */
+final class RMCreateSequenceResponseImpl extends RMAbstractSerializable implements RMCreateSequenceResponse
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private Duration expires;
+ private RMAccept accept;
+ private RMIncompleteSequenceBehavior incompleteSequenceBehavior;
+
+ RMCreateSequenceResponseImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getAccept()
+ */
+ public RMAccept getAccept()
+ {
+ return this.accept;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getDuration()
+ */
+ public Duration getExpires()
+ {
+ return this.expires;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIncompleteSequenceBehavior()
+ */
+ public RMIncompleteSequenceBehavior getIncompleteSequenceBehavior()
+ {
+ return this.incompleteSequenceBehavior;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#newAccept()
+ */
+ public RMAccept 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(RMAccept 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(Duration duration)
+ {
+ if ((duration == null) || (duration.toString().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty string");
+ if (this.expires != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.expires = duration;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
+ */
+ public void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior incompleteSequenceBehavior)
+ {
+ if (incompleteSequenceBehavior == null)
+ throw new IllegalArgumentException("Sequence behavior type cannot be null");
+ if (this.incompleteSequenceBehavior != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.incompleteSequenceBehavior = incompleteSequenceBehavior;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((accept == null) ? 0 : accept.hashCode());
+ result = prime * result + ((expires == null) ? 0 : expires.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + ((incompleteSequenceBehavior == null) ? 0 : incompleteSequenceBehavior.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMCreateSequenceResponseImpl))
+ return false;
+ final RMCreateSequenceResponseImpl other = (RMCreateSequenceResponseImpl)obj;
+ if (accept == null)
+ {
+ if (other.accept != null)
+ return false;
+ }
+ else if (!accept.equals(other.accept))
+ return false;
+ if (expires == null)
+ {
+ if (other.expires != null)
+ return false;
+ }
+ else if (!expires.equals(other.expires))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (incompleteSequenceBehavior == null)
+ {
+ if (other.incompleteSequenceBehavior != null)
+ return false;
+ }
+ else if (!incompleteSequenceBehavior.equals(other.incompleteSequenceBehavior))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier must be set");
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept
+ */
+ private static class AcceptImpl implements RMCreateSequenceResponse.RMAccept
+ {
+
+ 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/protocol/spec200702/RMCreateSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMMessageFactoryImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMMessageFactoryImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMMessageFactoryImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200702;
+
+import org.jboss.ws.extensions.wsrm.protocol.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequenceResponse;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory
+ */
+final class RMMessageFactoryImpl implements RMMessageFactory
+{
+
+ private static final RMMessageFactory INSTANCE = new RMMessageFactoryImpl();
+
+ private RMMessageFactoryImpl()
+ {
+ // forbidden inheritance
+ }
+
+ public static RMMessageFactory getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newAckRequested()
+ */
+ public RMAckRequested newAckRequested()
+ {
+ return new RMAckRequestedImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequence()
+ */
+ public RMCloseSequence newCloseSequence()
+ {
+ return new RMCloseSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequenceResponse()
+ */
+ public RMCloseSequenceResponse newCloseSequenceResponse()
+ {
+ return new RMCloseSequenceResponseImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequence()
+ */
+ public RMCreateSequence newCreateSequence()
+ {
+ return new RMCreateSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequenceResponse()
+ */
+ public RMCreateSequenceResponse newCreateSequenceResponse()
+ {
+ return new RMCreateSequenceResponseImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequence()
+ */
+ public RMSequence newSequence()
+ {
+ return new RMSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceAcknowledgement()
+ */
+ public RMSequenceAcknowledgement newSequenceAcknowledgement()
+ {
+ return new RMSequenceAcknowledgementImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceFault()
+ */
+ public RMSequenceFault newSequenceFault()
+ {
+ return new RMSequenceFaultImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequence()
+ */
+ public RMTerminateSequence newTerminateSequence()
+ {
+ return new RMTerminateSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequenceResponse()
+ */
+ public RMTerminateSequenceResponse newTerminateSequenceResponse()
+ {
+ return new RMTerminateSequenceResponseImpl();
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMMessageFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMProviderImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMProviderImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMProviderImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200702;
+
+import org.jboss.ws.extensions.wsrm.common.RMConstantsImpl;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider
+ */
+public final class RMProviderImpl extends RMProvider
+{
+
+ public static final String IMPLEMENTATION_VERSION = "http://docs.oasis-open.org/ws-rx/wsrm/200702";
+ private static final RMConstants CONSTANTS = new RMConstantsImpl("wsrm11",IMPLEMENTATION_VERSION);
+ private static final RMProvider INSTANCE = new RMProviderImpl();
+
+ public RMProviderImpl()
+ {
+ // forbidden inheritance
+ }
+
+ public static RMProvider getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getMessageFactory()
+ */
+ @Override
+ public RMMessageFactory getMessageFactory()
+ {
+ return RMMessageFactoryImpl.getInstance();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getConstants()
+ */
+ @Override
+ public RMConstants getConstants()
+ {
+ return CONSTANTS;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getNamespaceURI()
+ */
+ @Override
+ public String getNamespaceURI()
+ {
+ return IMPLEMENTATION_VERSION;
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMProviderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceAcknowledgementImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceAcknowledgementImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceAcknowledgementImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200702;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Collections;
+
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement
+ */
+final class RMSequenceAcknowledgementImpl extends RMAbstractSerializable implements RMSequenceAcknowledgement
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private final List<Long> nacks = new LinkedList<Long>();
+ private final List<RMAcknowledgementRange> acknowledgementRanges = new LinkedList<RMAcknowledgementRange>();
+ private String identifier;
+ private boolean isFinal;
+ private boolean isNone;
+
+ RMSequenceAcknowledgementImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addAcknowledgementRange(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange)
+ */
+ public void addAcknowledgementRange(RMAcknowledgementRange 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 (RMAcknowledgementRange 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<RMAcknowledgementRange> 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 RMAcknowledgementRange newAcknowledgementRange()
+ {
+ return new AcknowledgementRangeImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setFinal(boolean)
+ */
+ public void setFinal()
+ {
+ if (this.nacks.size() != 0)
+ throw new IllegalStateException("There are already some nacks specified");
+
+ this.isFinal = true;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setNone(boolean)
+ */
+ public void setNone()
+ {
+ if (this.acknowledgementRanges.size() != 0)
+ throw new IllegalStateException("There are already some acknowledgement ranges specified");
+ if (this.nacks.size() != 0)
+ throw new IllegalStateException("There are already some nacks specified");
+
+ this.isNone = true;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (isFinal ? 1231 : 1237);
+ result = prime * result + (isNone ? 1231 : 1237);
+ result = prime * result + ((nacks == null) ? 0 : nacks.hashCode());
+ result = prime * result + ((acknowledgementRanges == null) ? 0 : acknowledgementRanges.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceAcknowledgementImpl))
+ return false;
+ final RMSequenceAcknowledgementImpl other = (RMSequenceAcknowledgementImpl)obj;
+ if (acknowledgementRanges == null)
+ {
+ if (other.acknowledgementRanges != null)
+ return false;
+ }
+ else if (!acknowledgementRanges.equals(other.acknowledgementRanges))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (isFinal != other.isFinal)
+ return false;
+ if (isNone != other.isNone)
+ return false;
+ if (nacks == null)
+ {
+ if (other.nacks != null)
+ return false;
+ }
+ else if (!nacks.equals(other.nacks))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ if ((this.acknowledgementRanges.size() == 0) && (this.nacks.size() == 0) && (!this.isNone))
+ throw new RMException("AcknowledgementRange or Nack or None must be set");
+ }
+
+ private static void checkOverlap(RMAcknowledgementRange currentRange, RMAcknowledgementRange newRange)
+ {
+ if ((currentRange.getLower() <= newRange.getLower()) && (newRange.getLower() <= currentRange.getUpper()))
+ throw new IllegalArgumentException(
+ "Overlap detected: " + currentRange + " vs. " + newRange);
+ if ((currentRange.getLower() <= newRange.getUpper()) && (newRange.getUpper() <= currentRange.getUpper()))
+ throw new IllegalArgumentException(
+ "Overlap detected: " + currentRange + " vs. " + newRange);
+ }
+
+ private static class AcknowledgementRangeImpl implements RMSequenceAcknowledgement.RMAcknowledgementRange
+ {
+
+ 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/protocol/spec200702/RMSequenceAcknowledgementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceFaultImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceFaultImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceFaultImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFaultCode;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault
+ */
+final class RMSequenceFaultImpl extends RMAbstractSerializable implements RMSequenceFault
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private RMSequenceFaultCode faultCode;
+ private Exception detail;
+
+ RMSequenceFaultImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getDetail()
+ */
+ public Exception getDetail()
+ {
+ return this.detail;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getFaultCode()
+ */
+ public RMSequenceFaultCode getFaultCode()
+ {
+ return this.faultCode;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setDetail(java.lang.Exception)
+ */
+ public void setDetail(Exception detail)
+ {
+ if (detail == null)
+ throw new IllegalArgumentException("Detail cannot be null");
+ if (this.detail != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.detail = detail;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setFaultCode(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFaultCode)
+ */
+ public void setFaultCode(RMSequenceFaultCode faultCode)
+ {
+ if (faultCode == null)
+ throw new IllegalArgumentException("Fault code cannot be null");
+ if (this.faultCode != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.faultCode = faultCode;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((detail == null) ? 0 : detail.getMessage().hashCode());
+ result = prime * result + ((faultCode == null) ? 0 : faultCode.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceFaultImpl))
+ return false;
+ final RMSequenceFaultImpl other = (RMSequenceFaultImpl)obj;
+ if (detail == null)
+ {
+ if (other.detail != null)
+ return false;
+ }
+ else if (!detail.getMessage().equals(other.detail.getMessage()))
+ return false;
+ if (faultCode == null)
+ {
+ if (other.faultCode != null)
+ return false;
+ }
+ else if (!faultCode.equals(other.faultCode))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.faultCode == null)
+ throw new RMException("FaultCode must be set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceFaultImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence
+ */
+final class RMSequenceImpl extends RMAbstractSerializable implements RMSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private long messageNumber;
+
+ RMSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getMessageNumber()
+ */
+ public long getMessageNumber()
+ {
+ return messageNumber;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#isLastMessage()
+ */
+ public boolean isLastMessage()
+ {
+ return false; // always return false for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setLastMessage(boolean)
+ */
+ public void setLastMessage()
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setMessageNumber(long)
+ */
+ public void setMessageNumber(long messageNumber)
+ {
+ if (messageNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.messageNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.messageNumber = messageNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (int)(messageNumber ^ (messageNumber >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMSequenceImpl))
+ return false;
+ final RMSequenceImpl other = (RMSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (messageNumber != other.messageNumber)
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier must be set");
+ if (this.messageNumber == 0)
+ throw new RMException("MessageNumber must be set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMTerminateSequenceImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMTerminateSequenceImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMTerminateSequenceImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequence;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence
+ */
+final class RMTerminateSequenceImpl extends RMAbstractSerializable implements RMTerminateSequence
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+ private long lastMsgNumber;
+
+ RMTerminateSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getLastMsgNumber()
+ */
+ public long getLastMsgNumber()
+ {
+ return this.lastMsgNumber;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setLastMsgNumber(long)
+ */
+ public void setLastMsgNumber(long lastMsgNumber)
+ {
+ if (lastMsgNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.lastMsgNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.lastMsgNumber = lastMsgNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (int)(lastMsgNumber ^ (lastMsgNumber >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMTerminateSequenceImpl))
+ return false;
+ final RMTerminateSequenceImpl other = (RMTerminateSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (lastMsgNumber != other.lastMsgNumber)
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMTerminateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMTerminateSequenceResponseImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMTerminateSequenceResponseImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMTerminateSequenceResponseImpl.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spec200702;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.common.serialization.RMAbstractSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequenceResponse;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse
+ */
+final class RMTerminateSequenceResponseImpl extends RMAbstractSerializable implements RMTerminateSequenceResponse
+{
+
+ // provider used by de/serialization framework
+ private static final RMProvider PROVIDER = RMProviderImpl.getInstance();
+ // internal fields
+ private String identifier;
+
+ RMTerminateSequenceResponseImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof RMTerminateSequenceResponseImpl))
+ return false;
+ final RMTerminateSequenceResponseImpl other = (RMTerminateSequenceResponseImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ public RMProvider getProvider()
+ {
+ return PROVIDER;
+ }
+
+ public void validate()
+ {
+ if (this.identifier == null)
+ throw new RMException("Identifier not set");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spec200702/RMTerminateSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMAckRequested.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMAckRequested.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMAckRequested.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+/**
+ * <p><b>AckRequested</b> element requests an Acknowledgement for the identified Sequence.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:AckRequested ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:MessageNumber> xs:unsignedLong </wsrm:MessageNumber> ?
+ * ...
+ * </wsrm:AckRequested>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMAckRequested extends RMSerializable
+{
+ /**
+ * An RM Source that includes an <b>AckRequested</b> header block in a SOAP envelope MUST include
+ * this element in that header block. The RM Source MUST set the value of this element to the
+ * absolute URI, (conformant with RFC3986), that uniquely identifies the Sequence to which the
+ * request applies.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * This optional element, if present, MUST contain an <b>xs:unsignedLong</b> representing the highest
+ * <b>MessageNumber</b> sent by the RM Source within a Sequence. If present, it MAY be treated
+ * as a hint to the RM Destination as an optimization to the process of preparing to transmit a
+ * <b>SequenceAcknowledgement</b>.
+ * @param lastMessageNumber
+ */
+ void setMessageNumber(long lastMessageNumber);
+
+ /**
+ * Getter
+ * @return last message number in the sequence
+ */
+ long getMessageNumber();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMAckRequested.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCloseSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCloseSequence.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCloseSequence.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+/**
+ * <p><b>CloseSequence</b> element MAY be sent by an RM Source to indicate that the RM Destination MUST NOT
+ * accept any new messages for this Sequence This element MAY also be sent by an RM
+ * Destination to indicate that it will not accept any new messages for this Sequence.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:CloseSequence ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:LastMsgNumber> wsrm:MessageNumberType </wsrm:LastMsgNumber> ?
+ * ...
+ * </wsrm:CloseSequence>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMCloseSequence extends RMSerializable
+{
+ /**
+ * The RM Source or RM Destination MUST include this element in any <b>CloseSequence</b> messages it
+ * sends. The RM Source or RM Destination MUST set the value of this element to the absolute URI
+ * (conformant with RFC3986) of the closing Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * The RM Source SHOULD include this element in any <b>CloseSequence</b> message it sends. The
+ * <b>LastMsgNumber</b> element specifies the highest assigned message number of all the Sequence
+ * Traffic Messages for the closing Sequence.
+ * @param lastMsgNumber
+ */
+ void setLastMsgNumber(long lastMsgNumber);
+
+ /**
+ * Getter
+ * @return last message number
+ */
+ long getLastMsgNumber();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCloseSequence.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCloseSequenceResponse.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCloseSequenceResponse.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCloseSequenceResponse.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+/**
+ * <p><b>CloseSequenceResponse</b> element is sent in the body of a message in response to receipt of a <b>CloseSequence</b>
+ * request message. It indicates that the responder has closed the Sequence.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:CloseSequenceResponse ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * ...
+ * </wsrm:CloseSequenceResponse>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMCloseSequenceResponse extends RMSerializable
+{
+ /**
+ * The responder (RM Source or RM Destination) MUST include this element in any
+ * <b>CloseSequenceResponse</b> message it sends. The responder MUST set the value of this
+ * element to the absolute URI (conformant with RFC3986) of the closing Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCloseSequenceResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCreateSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCreateSequence.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCreateSequence.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+import javax.xml.datatype.Duration;
+
+/**
+ * <p><b>CreateSequence</b> element requests creation of a new Sequence between the RM Source that sends it, and the
+ * RM Destination to which it is sent. The RM Source MUST NOT send this element as a header
+ * block. The RM Destination MUST respond either with a <b>CreateSequenceResponse</b> response
+ * message or a <b>CreateSequenceRefused</b> fault.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:CreateSequence ...>
+ * <wsrm:AcksTo> wsa:EndpointReferenceType </wsrm:AcksTo>
+ * <wsrm:Expires ...> xs:duration </wsrm:Expires> ?
+ * <wsrm:Offer ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:Endpoint> wsa:EndpointReferenceType </wsrm:Endpoint>
+ * <wsrm:Expires ...> xs:duration </wsrm:Expires> ?
+ * <wsrm:IncompleteSequenceBehavior>
+ * wsrm:IncompleteSequenceBehaviorType
+ * </wsrm:IncompleteSequenceBehavior> ?
+ * ...
+ * </wsrm:Offer> ?
+ * ...
+ * </wsrm:CreateSequence>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMCreateSequence extends RMSerializable
+{
+ /**
+ * <p>The RM Source MUST include this element in any CreateSequence message it sends. This
+ * element is of type wsa:EndpointReferenceType (as specified by WS-Addressing). It specifies
+ * the endpoint reference to which messages containing SequenceAcknowledgement header
+ * blocks and faults related to the created Sequence are to be sent, unless otherwise noted in this
+ * specification.</p>
+ * <p>Implementations MUST NOT use an endpoint reference in the AcksTo element that would prevent
+ * the sending of Sequence Acknowledgements back to the RM Source. For example, using the WS-Addressing
+ * "http://www.w3.org/2005/08/addressing/none" URI would make it impossible for the RM
+ * Destination to ever send Sequence Acknowledgements.</p>
+ * @param address
+ */
+ void setAcksTo(String address);
+
+ /**
+ * Getter
+ * @return address
+ */
+ String getAcksTo();
+
+ /**
+ * This element, if present, of type <b>xs:duration</b> specifies the RM Source's requested duration for
+ * the Sequence. The RM Destination MAY either accept the requested duration or assign a lesser
+ * value of its choosing. A value of <b>"PT0S"</b> indicates that the Sequence will never expire. Absence of
+ * the element indicates an implied value of <b>"PT0S"</b>.
+ * @param duration
+ */
+ void setExpires(Duration duration);
+
+ /**
+ * Getter
+ * @return duration
+ */
+ Duration getExpires();
+
+ /**
+ * Factory method
+ * @return new instance of Offer
+ */
+ RMOffer newOffer();
+
+ /**
+ * Setter
+ * @param offer
+ */
+ void setOffer(RMOffer offer);
+
+ /**
+ * Getter
+ * @return offer
+ */
+ RMOffer getOffer();
+
+ /**
+ * This element, if present, enables an RM Source to offer a corresponding Sequence for the reliable
+ * exchange of messages Transmitted from RM Destination to RM Source.
+ */
+ interface RMOffer
+ {
+ /**
+ * The RM Source MUST set the value of this element to an absolute URI (conformant with
+ * RFC3986 [URI]) that uniquely identifies the offered Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return offered sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * <p>An RM Source MUST include this element, of type <b>wsa:EndpointReferenceType</b> (as
+ * specified by WS-Addressing). This element specifies the endpoint reference to which Sequence
+ * Lifecycle Messages, Acknowledgement Requests, and fault messages related to the offered
+ * Sequence are to be sent.</p>
+ *
+ * <p>Implementations MUST NOT use an endpoint reference in the Endpoint element that would
+ * prevent the sending of Sequence Lifecycle Message, etc. For example, using the WS-Addressing
+ * "http://www.w3.org/2005/08/addressing/none" URI would make it impossible for the RM Destination
+ * to ever send Sequence Lifecycle Messages (e.g. <b>TerminateSequence</b>) to the RM Source for
+ * the Offered Sequence.</p>
+ *
+ * <p>The Offer of an Endpoint containing the "http://www.w3.org/2005/08/addressing/anonymous" URI
+ * as its address is problematic due to the inability of a source to connect to this address and retry
+ * unacknowledged messages. Note that this specification does not
+ * define any mechanisms for providing this assurance. In the absence of an extension that
+ * addresses this issue, an RM Destination MUST NOT accept (via the
+ * <b>/wsrm:CreateSequenceResponse/wsrm:Accept</b>) an Offer that
+ * contains the "http://www.w3.org/2005/08/addressing/anonymous" URI as its address.</p>
+ * @param address
+ */
+ void setEndpoint(String address);
+
+ /**
+ * Getter
+ * @return offered endpoint address
+ */
+ String getEndpoint();
+
+ /**
+ * This element, if present, of type <b>xs:duration</b> specifies the duration for the offered Sequence. A
+ * value of <b>"PT0S"</b> indicates that the offered Sequence will never expire. Absence of the element
+ * indicates an implied value of <b>"PT0S"</b>.
+ * @param duration
+ */
+ void setExpires(String duration);
+
+ /**
+ * Getter
+ * @return offered sequence duration
+ */
+ String getExpires();
+
+ /**
+ * This element, if present, specifies the behavior that the destination will exhibit upon the closure or
+ * termination of an incomplete Sequence.
+ * @param incompleteSequenceBehavior
+ */
+ void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior incompleteSequenceBehavior);
+
+ /**
+ * Getter
+ * @return offered incomplete sequence behavior
+ */
+ RMIncompleteSequenceBehavior getIncompleteSequenceBehavior();
+ }
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCreateSequence.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCreateSequenceResponse.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCreateSequenceResponse.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMCreateSequenceResponse.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+import javax.xml.datatype.Duration;
+
+/**
+ * <p><b>CreateSequenceResponse</b> element is sent in the body of the response message in response to a <b>CreateSequence</b>
+ * request message. It indicates that the RM Destination has created a new Sequence at the
+ * request of the RM Source. The RM Destination MUST NOT send this element as a header block.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <CreateSequenceResponse ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:Expires ...> xs:duration </wsrm:Expires> ?
+ * <wsrm:IncompleteSequenceBehavior>
+ * wsrm:IncompleteSequenceBehaviorType
+ * </wsrm:IncompleteSequenceBehavior> ?
+ * <wsrm:Accept ...>
+ * <wsrm:AcksTo> wsa:EndpointReferenceType </wsrm:AcksTo>
+ * ...
+ * </wsrm:Accept> ?
+ * ...
+ * </CreateSequenceResponse>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMCreateSequenceResponse extends RMSerializable
+{
+ /**
+ * The RM Destination MUST include this element within any CreateSequenceResponse message it
+ * sends. The RM Destination MUST set the value of this element to the absolute URI (conformant
+ * with RFC3986) that uniquely identifies the Sequence that has been created by the RM Destination.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * This element, if present, of type <b>xs:duration</b> accepts or refines the RM Source's requested
+ * duration for the Sequence. It specifies the amount of time after which any resources associated
+ * with the Sequence SHOULD be reclaimed thus causing the Sequence to be silently terminated. At
+ * the RM Destination this duration is measured from a point proximate to Sequence creation and at
+ * the RM Source this duration is measured from a point approximate to the successful processing of
+ * the <b>CreateSequenceResponse</b>. A value of "PT0S" indicates that the Sequence will never
+ * expire. Absence of the element indicates an implied value of "PT0S". The RM Destination MUST
+ * set the value of this element to be equal to or less than the value requested by the RM Source in
+ * the corresponding <b>CreateSequence</b> message.
+ * @param duration
+ */
+ void setExpires(Duration duration);
+
+ /**
+ * Getter
+ * @return sequence duration
+ */
+ Duration getExpires();
+
+ /**
+ * This element, if present, specifies the behavior that the destination will exhibit upon the closure or
+ * termination of an incomplete Sequence.
+ * @param incompleteSequenceBehavior
+ */
+ void setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior incompleteSequenceBehavior);
+
+ /**
+ * Getter
+ * @return used incomplete sequence behavior type
+ */
+ RMIncompleteSequenceBehavior getIncompleteSequenceBehavior();
+
+ /**
+ * Factory method
+ * @return new instance of accept
+ */
+ RMAccept newAccept();
+
+ /**
+ * Setter
+ * @param accept
+ */
+ void setAccept(RMAccept accept);
+
+ /**
+ * Getter
+ * @return accept
+ */
+ RMAccept 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 RMAccept
+ {
+ /**
+ * <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/protocol/spi/RMCreateSequenceResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMIncompleteSequenceBehavior.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMIncompleteSequenceBehavior.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMIncompleteSequenceBehavior.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+/**
+ * <p>This element, if present, specifies the behavior that the destination will exhibit upon the closure or
+ * termination of an incomplete Sequence. For the purposes of defining the values used, the term
+ * "discard" refers to behavior equivalent to the Application Destination never processing a particular message.</p>
+ *
+ * The following schema snippet defines allowed values:
+ * <p><blockquote><pre>
+ * <xs:simpleType name="IncompleteSequenceBehaviorType">
+ * <xs:restriction base="xs:string">
+ * <xs:enumeration value="DiscardEntireSequence"/>
+ * <xs:enumeration value="DiscardFollowingFirstGap"/>
+ * <xs:enumeration value="NoDiscard"/>
+ * </xs:restriction>
+ * </xs:simpleType>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public enum RMIncompleteSequenceBehavior
+{
+ /**
+ * A value of <b>"DiscardEntireSequence"</b> indicates that the entire Sequence MUST be discarded if the
+ * Sequence is closed, or terminated, when there are one or more gaps in the final <b>SequenceAcknowledgement</b>.
+ */
+ DISCARD_ENTIRE_SEQUENCE("DiscardEntireSequence"),
+
+ /**
+ * A value of <b>"DiscardFollowingFirstGap"</b> indicates that messages in the Sequence beyond the first
+ * gap MUST be discarded when there are one or more gaps in the final <b>SequenceAcknowledgement</b>.
+ */
+ DISCARD_FOLLOWING_FIRST_GAP("DiscardFollowingFirstGap"),
+
+ /**
+ * The default value of <b>"NoDiscard"</b> indicates that no acknowledged messages in the Sequence will
+ * be discarded.
+ */
+ NO_DISCARD("NoDiscard");
+
+ private final String value;
+
+ RMIncompleteSequenceBehavior(String value)
+ {
+ this.value = value;
+ }
+
+ public String toString()
+ {
+ return value;
+ }
+
+ /**
+ * Returns this enum instance if value string matches, <b>null</b> otherwise
+ * @param stringValue value in the form of string
+ * @return enum or null if string not recognized
+ */
+ public static RMIncompleteSequenceBehavior getValue(String stringValue)
+ {
+ if (DISCARD_ENTIRE_SEQUENCE.toString().equals(stringValue)) return DISCARD_ENTIRE_SEQUENCE;
+ if (DISCARD_FOLLOWING_FIRST_GAP.toString().equals(stringValue)) return DISCARD_FOLLOWING_FIRST_GAP;
+ if (NO_DISCARD.toString().equals(stringValue)) return NO_DISCARD;
+ return null;
+ }
+
+}
\ No newline at end of file
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMIncompleteSequenceBehavior.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequence.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequence.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+/**
+ * <p><b>Sequence</b> protocol element associates the message in which it is contained with a previously
+ * established RM Sequence. It contains the Sequence's unique identifier and the containing
+ * message's ordinal position within that Sequence. The RM Destination MUST understand the
+ * <b>Sequence</b> header block. The RM Source MUST assign a <b>mustUnderstand</b> attribute with a
+ * value 1/true (from the namespace corresponding to the version of SOAP to which the <b>Sequence</b>
+ * SOAP header block is bound) to the <b>Sequence</b> header block element.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:Sequence ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:MessageNumber> wsrm:MessageNumberType </wsrm:MessageNumber>
+ * <wsrm:LastMessage/> ?
+ * ...
+ * </wsrm:Sequence>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSequence extends RMSerializable
+{
+ /**
+ * An RM Source that includes a <b>Sequence</b> header block in a SOAP envelope MUST include this
+ * element in that header block. The RM Source MUST set the value of this element to the absolute
+ * URI (conformant with RFC3986) that uniquely identifies the Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * The RM Source MUST include this element within any Sequence headers it creates. This element
+ * is of type <b>MessageNumberType</b>. It represents the ordinal position of the message within a
+ * Sequence. Sequence message numbers start at 1 and monotonically increase by 1 throughout
+ * the Sequence.
+ * @param messageNumber
+ */
+ void setMessageNumber(long messageNumber);
+
+ /**
+ * Getter
+ * @return message number within specified sequence
+ */
+ long getMessageNumber();
+
+ /**
+ * This element MAY be included by the RM Source endpoint. The <b>LastMessage</b> element has no content.
+ * @param lastMessage
+ */
+ void setLastMessage();
+
+ /**
+ * Getter
+ * @return last message indicator
+ */
+ boolean isLastMessage();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequence.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceAcknowledgement.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceAcknowledgement.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceAcknowledgement.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+import java.util.List;
+
+/**
+ *
+ * <p><b>wsrm:SequenceAcknowledgement</b> element contains the sequence acknowledgement information</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:SequenceAcknowledgement ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * [ [ [ <wsrm:AcknowledgementRange ...
+ * Upper="wsrm:MessageNumberType"
+ * Lower="wsrm:MessageNumberType"/> +
+ * | <wsrm:None/> ]
+ * <wsrm:Final/> ? ]
+ * | <wsrm:Nack> wsrm:MessageNumberType </wsrm:Nack> + ]
+ *
+ * ...
+ * </wsrm:SequenceAcknowledgement>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSequenceAcknowledgement extends RMSerializable
+{
+ /**
+ * An RM Destination that includes a <b>SequenceAcknowledgement</b> header block in a SOAP
+ * envelope MUST include this element in that header block. The RM Destination MUST set the
+ * value of this element to the absolute URI (conformant with RFC3986) that uniquely identifies the
+ * Sequence. The RM Destination MUST NOT include multiple <b>SequenceAcknowledgement</b>
+ * header blocks that share the same value for <b>Identifier</b> within the same SOAP envelope.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * The RM Destination MAY include this element within a <b>SequenceAcknowledgement</b> header
+ * block. This element indicates that the RM Destination is not receiving new messages for the
+ * specified Sequence. The RM Source can be assured that the ranges of messages acknowledged
+ * by this SequenceAcknowledgement header block will not change in the future. The RM
+ * Destination MUST include this element when the Sequence is closed. The RM Destination MUST
+ * NOT include this element when sending a <b>Nack</b>; it can only be used when sending
+ * <b>AcknowledgementRange</b> elements or a <b>None</b>.
+ */
+ void setFinal();
+
+ /**
+ * Getter
+ * @return true if <b>SequenceAcknowledgement</b> is <b>Final</b>, false otherwise
+ */
+ boolean isFinal();
+
+ /**
+ * The RM Destination MUST include this element within a <b>SequenceAcknowledgement</b> header
+ * block if the RM Destination has not accepted any messages for the specified Sequence. The RM
+ * Destination MUST NOT include this element if a sibling <b>AcknowledgementRange</b> or <b>Nack</b>
+ * element is also present as a child of the <b>SequenceAcknowledgement</b>.
+ */
+ void setNone();
+
+ /**
+ * Getter
+ * @return true if <b>SequenceAcknowledgement</b> is <b>None</b>, false otherwise
+ */
+ boolean isNone();
+
+ /**
+ * The RM Destination MAY include this element within a <b>SequenceAcknowledgement</b> header
+ * block. If used, the RM Destination MUST set the value of this element to a <b>MessageNumberType</b>
+ * representing the <b>MessageNumber</b> of an unreceived message in a Sequence. The RM Destination
+ * MUST NOT include a <b>Nack</b> element if a sibling <b>AcknowledgementRange</b> or <b>None</b> element is
+ * also present as a child of <b>SequenceAcknowledgement</b>. Upon the receipt of a <b>Nack</b>, an RM
+ * Source SHOULD retransmit the message identified by the <b>Nack</b>. The RM Destination MUST NOT
+ * issue a <b>SequenceAcknowledgement</b> containing a <b>Nack</b> for a message that it has previously
+ * acknowledged within an <b>AcknowledgementRange</b>. The RM Source SHOULD ignore a
+ * <b>SequenceAcknowledgement</b> containing a <b>Nack</b> for a message that has previously been
+ * acknowledged within an <b>AcknowledgementRange</b>.
+ * @param messageNumber
+ */
+ void addNack(long messageNumber);
+
+ /**
+ * Getter
+ * @return list of not ackonwledged message numbers
+ */
+ List<Long> getNacks();
+
+ /**
+ * Factory method
+ * @return new instance of AcknowledgementRange
+ */
+ RMAcknowledgementRange newAcknowledgementRange();
+
+ /**
+ * Setter
+ * @param acknowledgementRange
+ */
+ void addAcknowledgementRange(RMAcknowledgementRange acknowledgementRange);
+
+ /**
+ * Getter
+ * @return list of acknowledged ranges
+ */
+ List<RMAcknowledgementRange> 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 RMAcknowledgementRange
+ {
+ /**
+ * 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/protocol/spi/RMSequenceAcknowledgement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceFault.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceFault.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceFault.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+/**
+ * <p><b>SequenceFault</b> element purpose is to carry the specific details of a fault generated during the
+ * reliable messaging specific processing of a message belonging to a Sequence. WS-ReliableMessaging
+ * nodes MUST use the <b>SequenceFault</b> container only in conjunction with the SOAP 1.1 fault mechanism.
+ * WS-ReliableMessaging nodes MUST NOT use the <b>SequenceFault</b> container in conjunction with the
+ * SOAP 1.2 binding.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <SequenceFault ...>
+ * <wsrm:FaultCode> wsrm:FaultCode </wsrm:FaultCode>
+ * <wsrm:Detail> ... </wsrm:Detail> ?
+ * ...
+ * </SequenceFault>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSequenceFault extends RMSerializable
+{
+ /**
+ * WS-ReliableMessaging nodes that generate a <b>SequenceFault</b> MUST set the value of this
+ * element to a qualified name from the set of faults [Subcodes] defined below.
+ * @param faultCode
+ */
+ void setFaultCode(RMSequenceFaultCode faultCode);
+
+ /**
+ * Getter
+ * @return sequence fault code
+ */
+ RMSequenceFaultCode getFaultCode();
+
+ /**
+ * This element, if present, carries application specific error information
+ * related to the fault being described.
+ * @param detail
+ */
+ void setDetail(Exception detail);
+
+ /**
+ * Getter
+ * @return application specific fault detail
+ */
+ Exception getDetail();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceFault.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceFaultCode.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceFaultCode.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceFaultCode.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.protocol.spi;
+
+/**
+ * WS-ReliableMessaging nodes that generate a <b>SequenceFault</b> MUST set the value of this
+ * element to a qualified name from the set of faults [Subcodes] defined below.
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public enum RMSequenceFaultCode
+{
+
+ /**
+ * Sequence terminated
+ */
+ SEQUENCE_TERMINATED("SequenceTerminated"),
+
+ /**
+ * Unknown sequence
+ */
+ UNKNOWN_SEQUENCE("UnknownSequence"),
+
+ /**
+ * Invalid acknowledgement
+ */
+ INVALID_ACKNOWLEDGEMENT("InvalidAcknowledgement"),
+
+ /**
+ * Message number rollover
+ */
+ MESSAGE_NUMBER_ROLLOVER("MessageNumberRollover"),
+
+ /**
+ * Create sequence refused
+ */
+ CREATE_SEQUENCE_REFUSED("CreateSequenceRefused"),
+
+ /**
+ * Sequence closed
+ */
+ SEQUENCE_CLOSED("SequenceClosed"),
+
+ /**
+ * WSRM required
+ */
+ WSRM_REQUIRED("WSRMRequired"),
+
+ /**
+ * Last message number exceeded
+ */
+ LAST_MESSAGE_NUMBER_EXCEEDED("LastMessageNumberExceeded");
+
+ private final String value;
+
+ RMSequenceFaultCode(String value)
+ {
+ this.value = value;
+ }
+
+ public final String getValue()
+ {
+ return this.value;
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSequenceFaultCode.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSerializable.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSerializable.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSerializable.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.extensions.wsrm.api.RMException;
+
+/**
+ * This interface identifies classes that are de/serializable from/to SOAP messages
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSerializable
+{
+
+ /**
+ * Serialize object instance to SOAP message
+ * @param soapMessage
+ * @throws RMException is something went wrong
+ */
+ void serializeTo(SOAPMessage soapMessage) throws RMException;
+
+ /**
+ * Deserialize object instance from SOAP message
+ * @param soapMessage ReliableMessagingException is something went wrong
+ */
+ void deserializeFrom(SOAPMessage soapMessage) throws RMException;
+
+ /**
+ * Validate object state if everything is all right
+ * @throws RMException if object is in incorrect state
+ */
+ void validate() throws RMException;
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMSerializable.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMTerminateSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMTerminateSequence.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMTerminateSequence.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+/**
+ * <p><b>TerminateSequence</b> MAY be sent by an RM Source to indicate it has completed its use of the Sequence.
+ * It indicates that the RM Destination can safely reclaim any resources related to the identified
+ * Sequence. The RM Source MUST NOT send this element as a header block. The RM Source
+ * MAY retransmit this element. Once this element is sent, other than this element, the RM Source
+ * MUST NOT send any additional message to the RM Destination referencing this Sequence.</p>
+ *
+ * <p>This element MAY also be sent by the RM Destination to indicate that it has unilaterally
+ * terminated the Sequence. Upon sending this message the RM Destination MUST NOT accept
+ * any additional messages (with the exception of the corresponding
+ * <b>TerminateSequenceResponse</b>) for this Sequence. Upon receipt of a <b>TerminateSequence</b>
+ * the RM Source MUST NOT send any additional messages (with the exception of the
+ * corresponding <b>TerminateSequenceResponse</b>) for this Sequence.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:TerminateSequence ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * <wsrm:LastMsgNumber> wsrm:MessageNumberType </wsrm:LastMsgNumber> ?
+ * ...
+ * </wsrm:TerminateSequence>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMTerminateSequence extends RMSerializable
+{
+ /**
+ * The RM Source or RM Destination MUST include this element in any TerminateSequence
+ * message it sends. The RM Source or RM Destination MUST set the value of this element to the
+ * absolute URI (conformant with RFC3986) of the terminating Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+
+ /**
+ * The RM Source SHOULD include this element in any TerminateSequence message it sends. The
+ * <b>LastMsgNumber</b> element specifies the highest assigned message number of all the Sequence
+ * Traffic Messages for the terminating Sequence.
+ * @param lastMsgNumber
+ */
+ void setLastMsgNumber(long lastMsgNumber);
+
+ /**
+ * Getter
+ * @return last message number
+ */
+ long getLastMsgNumber();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMTerminateSequence.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMTerminateSequenceResponse.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMTerminateSequenceResponse.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMTerminateSequenceResponse.java 2008-03-10 13:27:04 UTC (rev 5907)
@@ -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.protocol.spi;
+
+/**
+ * <p><b>TerminateSequenceResponse</b> is sent in the body of a message in response to receipt of a <b>TerminateSequence</b>
+ * request message. It indicates that the responder has terminated the Sequence. The responder
+ * MUST NOT send this element as a header block.</p>
+ *
+ * The following infoset defines its syntax:
+ * <p><blockquote><pre>
+ * <wsrm:TerminateSequenceResponse ...>
+ * <wsrm:Identifier ...> xs:anyURI </wsrm:Identifier>
+ * ...
+ * </wsrm:TerminateSequenceResponse>
+ * </pre></blockquote></p>
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMTerminateSequenceResponse extends RMSerializable
+{
+ /**
+ * The responder (RM Source or RM Destination) MUST include this element in any
+ * <b>TerminateSequenceResponse</b> message it sends. The responder MUST set the value of this
+ * element to the absolute URI (conformant with RFC3986) of the terminating Sequence.
+ * @param identifier
+ */
+ void setIdentifier(String identifier);
+
+ /**
+ * Getter
+ * @return sequence identifier
+ */
+ String getIdentifier();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/protocol/spi/RMTerminateSequenceResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 3 months
JBossWS SVN: r5906 - in stack/native/trunk/src: main/java/org/jboss/ws/extensions/wsrm and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-03-10 09:25:02 -0400 (Mon, 10 Mar 2008)
New Revision: 5906
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMAddressingConstants.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.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/RMFaultCode.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMConstantsImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAbstractSerializable.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAckRequestedSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceResponseSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceResponseSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceAcknowledgementSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceFaultSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationRepository.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceResponseSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM10PolicyAssertionDeployer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM11PolicyAssertionDeployer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/RMDeSerializationTestCase.java
Log:
refactoring WS-RM protocol
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 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -72,13 +72,13 @@
import org.jboss.ws.extensions.wsrm.RMClientSequence;
import org.jboss.ws.extensions.wsrm.api.RMException;
import org.jboss.ws.extensions.wsrm.common.RMHelper;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
import org.jboss.ws.metadata.config.Configurable;
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMAddressingConstants.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMAddressingConstants.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMAddressingConstants.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -23,7 +23,7 @@
import javax.xml.ws.addressing.AddressingBuilder;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
/**
* Addressing constants related to WS-RM protocol
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -47,9 +47,9 @@
import org.jboss.ws.extensions.addressing.AddressingClientUtil;
import org.jboss.ws.extensions.wsrm.config.RMConfig;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMIncompleteSequenceBehavior;
import org.jboss.ws.extensions.wsrm.transport.RMUnassignedMessageListener;
/**
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -6,8 +6,8 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
public final class RMConstant
{
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMFaultCode.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMFaultCode.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMFaultCode.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceFaultCode;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFaultCode;
/**
* RM fault constants
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMConstantsImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMConstantsImpl.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMConstantsImpl.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -23,12 +23,12 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
/**
* Utility class which should be used by all WS-RM protocol providers.
* @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants
*/
public final class RMConstantsImpl implements RMConstants
{
@@ -103,7 +103,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getPrefix()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getPrefix()
*/
public final String getPrefix()
{
@@ -111,7 +111,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getNamespaceURI()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getNamespaceURI()
*/
public final String getNamespaceURI()
{
@@ -119,7 +119,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getAcceptQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getAcceptQName()
*/
public final QName getAcceptQName()
{
@@ -127,7 +127,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getAckRequestedQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getAckRequestedQName()
*/
public final QName getAckRequestedQName()
{
@@ -135,7 +135,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getAcknowledgementRangeQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getAcknowledgementRangeQName()
*/
public final QName getAcknowledgementRangeQName()
{
@@ -143,7 +143,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getAcksToQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getAcksToQName()
*/
public final QName getAcksToQName()
{
@@ -151,7 +151,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getCloseSequenceQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getCloseSequenceQName()
*/
public final QName getCloseSequenceQName()
{
@@ -159,7 +159,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getCloseSequenceResponseQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getCloseSequenceResponseQName()
*/
public final QName getCloseSequenceResponseQName()
{
@@ -167,7 +167,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getCreateSequenceQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getCreateSequenceQName()
*/
public final QName getCreateSequenceQName()
{
@@ -175,7 +175,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getCreateSequenceResponseQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getCreateSequenceResponseQName()
*/
public final QName getCreateSequenceResponseQName()
{
@@ -183,7 +183,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getDetailQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getDetailQName()
*/
public final QName getDetailQName()
{
@@ -191,7 +191,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getEndpointQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getEndpointQName()
*/
public final QName getEndpointQName()
{
@@ -199,7 +199,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getExpiresQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getExpiresQName()
*/
public final QName getExpiresQName()
{
@@ -207,7 +207,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getFaultCodeQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getFaultCodeQName()
*/
public final QName getFaultCodeQName()
{
@@ -215,7 +215,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getFinalQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getFinalQName()
*/
public final QName getFinalQName()
{
@@ -223,7 +223,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getIdentifierQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getIdentifierQName()
*/
public final QName getIdentifierQName()
{
@@ -231,7 +231,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getIncompleteSequenceBehaviorQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getIncompleteSequenceBehaviorQName()
*/
public final QName getIncompleteSequenceBehaviorQName()
{
@@ -239,7 +239,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getLastMessageNumberQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getLastMessageNumberQName()
*/
public final QName getLastMessageNumberQName()
{
@@ -247,7 +247,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getLastMessageQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getLastMessageQName()
*/
public final QName getLastMessageQName()
{
@@ -255,7 +255,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getLastMsgNumberQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getLastMsgNumberQName()
*/
public final QName getLastMsgNumberQName()
{
@@ -263,7 +263,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getLowerQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getLowerQName()
*/
public final QName getLowerQName()
{
@@ -271,7 +271,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getMessageNumberQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getMessageNumberQName()
*/
public final QName getMessageNumberQName()
{
@@ -279,7 +279,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getMaxMessageNumberQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getMaxMessageNumberQName()
*/
public final QName getMaxMessageNumberQName()
{
@@ -287,7 +287,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getNackQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getNackQName()
*/
public final QName getNackQName()
{
@@ -295,7 +295,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getNoneQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getNoneQName()
*/
public final QName getNoneQName()
{
@@ -303,7 +303,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getOfferQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getOfferQName()
*/
public final QName getOfferQName()
{
@@ -311,7 +311,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getSequenceAcknowledgementQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getSequenceAcknowledgementQName()
*/
public final QName getSequenceAcknowledgementQName()
{
@@ -319,7 +319,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getSequenceFaultQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getSequenceFaultQName()
*/
public final QName getSequenceFaultQName()
{
@@ -327,7 +327,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getSequenceQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getSequenceQName()
*/
public final QName getSequenceQName()
{
@@ -335,7 +335,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getTerminateSequenceQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getTerminateSequenceQName()
*/
public final QName getTerminateSequenceQName()
{
@@ -343,7 +343,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getTerminateSequenceResponseQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getTerminateSequenceResponseQName()
*/
public final QName getTerminateSequenceResponseQName()
{
@@ -351,7 +351,7 @@
}
/**
- * @see org.jboss.ws.extensions.wsrm.spi.RMConstants#getUpperQName()
+ * @see org.jboss.ws.extensions.wsrm.protocol.RMConstants#getUpperQName()
*/
public final QName getUpperQName()
{
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -37,11 +37,11 @@
import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.wsrm.RMClientSequence;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAbstractSerializable.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAbstractSerializable.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAbstractSerializable.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -24,13 +24,13 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* Utility class which should be subclassed by all WS-RM protocol providers.
* @author richard.opalka(a)jboss.com
- * @see org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable
+ * @see org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable
*/
public abstract class RMAbstractSerializable implements RMSerializable
{
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAckRequestedSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAckRequestedSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMAckRequestedSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -34,10 +34,10 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* <b>AckRequested</b> object de/serializer
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceResponseSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceResponseSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceResponseSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -32,10 +32,10 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* <b>CloseSequenceResponse</b> object de/serializer
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCloseSequenceSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -34,10 +34,10 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* <b>CloseSequence</b> object de/serializer
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceResponseSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceResponseSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceResponseSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -36,11 +36,11 @@
import org.jboss.ws.extensions.wsrm.api.RMException;
import org.jboss.ws.extensions.wsrm.common.RMHelper;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMIncompleteSequenceBehavior;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* <b>CreateSequenceResponse</b> object de/serializer
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMCreateSequenceSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -38,11 +38,11 @@
import org.jboss.ws.extensions.wsrm.api.RMException;
import org.jboss.ws.extensions.wsrm.common.RMHelper;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMIncompleteSequenceBehavior;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* <b>CreateSequence</b> object de/serializer
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceAcknowledgementSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceAcknowledgementSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceAcknowledgementSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -35,10 +35,10 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
import java.util.List;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceFaultSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceFaultSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceFaultSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -35,11 +35,11 @@
import org.jboss.ws.extensions.wsrm.RMFault;
import org.jboss.ws.extensions.wsrm.RMFaultConstant;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceFault;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* <b>SequenceFault</b> object de/serializer
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSequenceSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -34,10 +34,10 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* <b>Sequence</b> object de/serializer
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationRepository.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationRepository.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializationRepository.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -22,17 +22,17 @@
package org.jboss.ws.extensions.wsrm.common.serialization;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceFault;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequenceResponse;
import javax.xml.soap.SOAPMessage;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -23,8 +23,8 @@
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* Each WS-RM message de/serializer must implement this interface
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceResponseSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceResponseSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceResponseSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -32,10 +32,10 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequenceResponse;
/**
* <b>TerminateSequenceResponse</b> object de/serializer
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceSerializer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/RMTerminateSequenceSerializer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -34,10 +34,10 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequence;
/**
* <b>TerminateSequence</b> object de/serializer
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -38,9 +38,9 @@
import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.wsrm.RMSequence;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* Client WS-RM JAX-WS handler
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -34,7 +34,7 @@
import org.jboss.ws.extensions.wsrm.RMFault;
import org.jboss.ws.extensions.wsrm.RMSequence;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* RM generic JAX-WS handler
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -29,19 +29,19 @@
import org.jboss.ws.extensions.wsrm.RMFault;
import org.jboss.ws.extensions.wsrm.RMSequence;
import org.jboss.ws.extensions.wsrm.common.RMHelper;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceFault;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceFault;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequenceResponse;
/**
* Handler helper
@@ -260,7 +260,7 @@
private static RMSerializable newSequence(RMSequence seq)
{
// construct Sequence object
- org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence sequence = rmFactory.newSequence();
+ org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence sequence = rmFactory.newSequence();
sequence.setIdentifier(seq.getOutboundId());
sequence.setMessageNumber(seq.getLastMessageNumber());
return sequence;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -38,9 +38,9 @@
import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.wsrm.RMFault;
import org.jboss.ws.extensions.wsrm.RMSequence;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
/**
* Server WS-RM JAX-WS handler
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM10PolicyAssertionDeployer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM10PolicyAssertionDeployer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM10PolicyAssertionDeployer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -27,7 +27,7 @@
import org.jboss.ws.extensions.wsrm.config.RMConfig;
import org.jboss.ws.extensions.wsrm.config.RMDeliveryAssuranceConfig;
import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM11PolicyAssertionDeployer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM11PolicyAssertionDeployer.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM11PolicyAssertionDeployer.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -35,7 +35,7 @@
import org.jboss.ws.extensions.wsrm.config.RMDeliveryAssuranceConfig;
import org.jboss.ws.extensions.wsrm.config.RMConfig;
import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -43,13 +43,13 @@
import org.jboss.ws.extensions.wsrm.RMFaultCode;
import org.jboss.ws.extensions.wsrm.RMFaultConstant;
import org.jboss.ws.extensions.wsrm.common.RMHelper;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.RMConstants;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequence;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -38,7 +38,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.soap.Style;
import org.jboss.ws.core.soap.Use;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
import org.jboss.wsf.common.JavaUtils;
import org.w3c.dom.Element;
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/RMDeSerializationTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/RMDeSerializationTestCase.java 2008-03-10 12:48:13 UTC (rev 5905)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/deserialization/RMDeSerializationTestCase.java 2008-03-10 13:25:02 UTC (rev 5906)
@@ -27,19 +27,19 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.extensions.wsrm.common.RMHelper;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMIncompleteSequenceBehavior;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.protocol.RMProvider;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMIncompleteSequenceBehavior;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMSerializable;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.protocol.spi.RMTerminateSequenceResponse;
import org.jboss.wsf.test.JBossWSTest;
/**
16 years, 3 months
JBossWS SVN: r5905 - in stack/native/trunk/src/test: java/org/jboss/test/ws/tools/jbws2018 and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2008-03-10 08:48:13 -0400 (Mon, 10 Mar 2008)
New Revision: 5905
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/
stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java
stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java
stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java
stack/native/trunk/src/test/resources/tools/jbws-2018/
stack/native/trunk/src/test/resources/tools/jbws-2018/TestService.wsdl
stack/native/trunk/src/test/resources/tools/jbws-2018/jaxrpc-mapping.xml
stack/native/trunk/src/test/resources/tools/jbws-2018/wstools-config.xml
Log:
[JBWS-2018] Added testcase
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java 2008-03-10 12:48:13 UTC (rev 5905)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.jbws2018.base;
+
+/**
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public class BaseException extends Exception
+{
+ public BaseException()
+ {
+ }
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java 2008-03-10 12:48:13 UTC (rev 5905)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.tools.jbws2018;
+
+import java.io.File;
+
+import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.tools.WSTools;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * JBWS-2018 - Test the support of multiple namespace to multiple
+ * package generation of tools JavaToWSDL.
+ *
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public class JBWS2018TestCase extends WSToolsTest
+{
+ public final void testMultiplePackageNameSpace() throws Exception
+ {
+ String resourceDir = "resources/tools/jbws-2018";
+ String toolsDir = "tools/jbws-2018";
+ String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+
+ semanticallyValidateWSDL(resourceDir + "/TestService.wsdl", toolsDir + "/wsdl/TestService.wsdl");
+
+ JaxrpcMappingValidator mappingValidator = new JaxrpcMappingValidator();
+ mappingValidator.validate(resourceDir + "/jaxrpc-mapping.xml", toolsDir + "/jaxrpc-mapping.xml");
+ }
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java 2008-03-10 12:48:13 UTC (rev 5905)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.jbws2018;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import org.jboss.test.ws.jbws2018.exception.TestException;
+
+/**
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public interface Test extends Remote
+{
+
+ public void testException() throws TestException, RemoteException;
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java 2008-03-10 12:48:13 UTC (rev 5905)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software 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.jbws2018.exception;
+
+import org.jboss.test.ws.jbws2018.base.BaseException;
+
+/**
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public class TestException extends BaseException
+{
+ public TestException()
+ {
+ }
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/tools/jbws-2018/TestService.wsdl
===================================================================
--- stack/native/trunk/src/test/resources/tools/jbws-2018/TestService.wsdl (rev 0)
+++ stack/native/trunk/src/test/resources/tools/jbws-2018/TestService.wsdl 2008-03-10 12:48:13 UTC (rev 5905)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='TestService' targetNamespace='http://org.jboss.test.ws.jbws2018' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://com.other.base' xmlns:ns2='http://com.other.exception' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.test.ws.jbws2018' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://com.other.exception' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://com.other.base' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://com.other.exception' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <import namespace='http://com.other.base'/>
+ <complexType name='TestException'>
+ <complexContent>
+ <extension base='ns2:BaseException'>
+ <sequence/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name='TestException' type='tns:TestException'/>
+ </schema>
+ <schema targetNamespace='http://com.other.base' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://com.other.exception' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://com.other.base' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <import namespace='http://com.other.exception'/>
+ <complexType name='BaseException'>
+ <sequence/>
+ </complexType>
+ <element name='BaseException' type='tns:BaseException'/>
+ </schema>
+ </types>
+ <message name='Test_testException' xmlns='http://schemas.xmlsoap.org/wsdl/'/>
+ <message name='Test_testExceptionResponse'/>
+ <message name='TestException'>
+ <part element='ns2:TestException' name='TestException'/>
+ </message>
+ <portType name='Test'>
+ <operation name='testException'>
+ <input message='tns:Test_testException'/>
+ <output message='tns:Test_testExceptionResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ </portType>
+ <binding name='TestBinding' type='tns:Test'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='testException'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:TestBinding' name='TestPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/tools/jbws-2018/TestService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/tools/jbws-2018/jaxrpc-mapping.xml
===================================================================
--- stack/native/trunk/src/test/resources/tools/jbws-2018/jaxrpc-mapping.xml (rev 0)
+++ stack/native/trunk/src/test/resources/tools/jbws-2018/jaxrpc-mapping.xml 2008-03-10 12:48:13 UTC (rev 5905)
@@ -0,0 +1,45 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws2018.exception</package-type>
+ <namespaceURI>http://com.other.exception</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws2018.base</package-type>
+ <namespaceURI>http://com.other.base</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws2018</package-type>
+ <namespaceURI>http://org.jboss.test.ws.jbws2018</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws2018.exception.TestException</java-type>
+ <root-type-qname xmlns:typeNS='http://com.other.exception'>typeNS:TestException</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws2018.base.BaseException</java-type>
+ <root-type-qname xmlns:typeNS='http://com.other.base'>typeNS:BaseException</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ </java-xml-type-mapping>
+ <exception-mapping>
+ <exception-type>org.jboss.test.ws.jbws2018.exception.TestException</exception-type>
+ <wsdl-message xmlns:exMsgNS='http://org.jboss.test.ws.jbws2018'>exMsgNS:TestException</wsdl-message>
+ </exception-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jbws2018.TestService</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://org.jboss.test.ws.jbws2018'>serviceNS:TestService</wsdl-service-name>
+ <port-mapping>
+ <port-name>TestPort</port-name>
+ <java-port-name>TestPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jbws2018.Test</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://org.jboss.test.ws.jbws2018'>portTypeNS:Test</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://org.jboss.test.ws.jbws2018'>bindingNS:TestBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>testException</java-method-name>
+ <wsdl-operation>testException</wsdl-operation>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/tools/jbws-2018/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/tools/jbws-2018/wstools-config.xml
===================================================================
--- stack/native/trunk/src/test/resources/tools/jbws-2018/wstools-config.xml (rev 0)
+++ stack/native/trunk/src/test/resources/tools/jbws-2018/wstools-config.xml 2008-03-10 12:48:13 UTC (rev 5905)
@@ -0,0 +1,16 @@
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+ <global>
+ <package-namespace package="org.jboss.test.ws.jbws2018.base" namespace="http://com.other.base"/>
+ <package-namespace package="org.jboss.test.ws.jbws2018.exception" namespace="http://com.other.exception"/>
+ </global>
+
+ <java-wsdl>
+ <service name="TestService" style="rpc" endpoint="org.jboss.test.ws.jbws2018.Test"/>
+ <namespaces target-namespace="http://org.jboss.test.ws.jbws2018" type-namespace="http://org.jboss.test.ws.jbws2018"/>
+ <mapping file="jaxrpc-mapping.xml" />
+ <webservices ejb-link="TestEJB"/>
+ </java-wsdl>
+
+</configuration>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/tools/jbws-2018/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 3 months