JBossWS SVN: r4918 - in stack/native/branches/asoldano/trunk/src: test/java/org/jboss/test/ws/interop/nov2007/wsse and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2007-10-29 10:15:56 -0400 (Mon, 29 Oct 2007)
New Revision: 4918
Modified:
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
Log:
Unlimited Strength Cryptography Extension check
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2007-10-29 14:13:24 UTC (rev 4917)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2007-10-29 14:15:56 UTC (rev 4918)
@@ -21,11 +21,13 @@
*/
package org.jboss.ws.extensions.security;
+import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
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;
@@ -170,4 +172,34 @@
EncryptedKey eKey = new EncryptedKey(message, secretKey, token, list);
header.addSecurityProcess(eKey);
}
+
+
+ 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);
+ }
+ }
}
Modified: stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java 2007-10-29 14:13:24 UTC (rev 4917)
+++ stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java 2007-10-29 14:15:56 UTC (rev 4918)
@@ -26,6 +26,7 @@
import junit.framework.Test;
import org.jboss.ws.core.StubExt;
+import org.jboss.ws.extensions.security.EncryptionOperation;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
@@ -69,6 +70,12 @@
public void testScenario() throws Exception
{
+ if (!EncryptionOperation.probeUnlimitedCrypto())
+ {
+ System.out.println("Please install the Unlimited Strength Java(TM) Cryptography Extension to run this test; " +
+ "please note that your country might have limits on allowed crypto strength.\n Test skipped.");
+ return;
+ }
String text = "Hello!";
String result = port.ping(text);
assertNotNull(result);
17 years, 2 months
JBossWS SVN: r4917 - stack/native/branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-10-29 10:13:24 -0400 (Mon, 29 Oct 2007)
New Revision: 4917
Added:
stack/native/branches/dlofthouse/JBWS-1873/
Log:
Branch for working area.
Copied: stack/native/branches/dlofthouse/JBWS-1873 (from rev 4916, stack/native/trunk)
17 years, 2 months
JBossWS SVN: r4916 - stack/native/branches/dlofthouse/JBWS-1862/src/test/java/org/jboss/test/ws/jaxrpc/jbws1862.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-10-29 09:58:55 -0400 (Mon, 29 Oct 2007)
New Revision: 4916
Modified:
stack/native/branches/dlofthouse/JBWS-1862/src/test/java/org/jboss/test/ws/jaxrpc/jbws1862/JBWS1862TestCase.java
Log:
Remove comments.
Modified: stack/native/branches/dlofthouse/JBWS-1862/src/test/java/org/jboss/test/ws/jaxrpc/jbws1862/JBWS1862TestCase.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1862/src/test/java/org/jboss/test/ws/jaxrpc/jbws1862/JBWS1862TestCase.java 2007-10-29 13:44:41 UTC (rev 4915)
+++ stack/native/branches/dlofthouse/JBWS-1862/src/test/java/org/jboss/test/ws/jaxrpc/jbws1862/JBWS1862TestCase.java 2007-10-29 13:58:55 UTC (rev 4916)
@@ -106,7 +106,6 @@
Call call = (Call)service.createCall();
call.setOperationName(operationName);
- //call.addParameter("String_1", Constants.TYPE_LITERAL_STRING, ParameterMode.IN);
call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);
call.setReturnType(Constants.TYPE_LITERAL_STRING, String.class);
@@ -127,7 +126,6 @@
Call call = (Call)service.createCall();
call.setOperationName(operationName);
- //call.addParameter("String_1", Constants.TYPE_LITERAL_STRING, ParameterMode.IN);
call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);
call.setReturnType(Constants.TYPE_LITERAL_STRING, String.class);
17 years, 2 months
JBossWS SVN: r4915 - stack/native/branches/rest/src/main/java/javax/xml/ws.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-10-29 09:44:41 -0400 (Mon, 29 Oct 2007)
New Revision: 4915
Modified:
stack/native/branches/rest/src/main/java/javax/xml/ws/WebServiceContext.java
Log:
Fix API Docs
Modified: stack/native/branches/rest/src/main/java/javax/xml/ws/WebServiceContext.java
===================================================================
--- stack/native/branches/rest/src/main/java/javax/xml/ws/WebServiceContext.java 2007-10-29 13:14:58 UTC (rev 4914)
+++ stack/native/branches/rest/src/main/java/javax/xml/ws/WebServiceContext.java 2007-10-29 13:44:41 UTC (rev 4915)
@@ -34,7 +34,7 @@
*
* Typically a <code>WebServiceContext</code> is injected
* into an endpoint implementation class using the
- * <code>ResourceModel</code> annotation.
+ * <code>Resource</code> annotation.
*
* @since JAX-WS 2.0
*
17 years, 2 months
JBossWS SVN: r4914 - in stack/native/branches/rest: ant-import and 9 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-10-29 09:14:58 -0400 (Mon, 29 Oct 2007)
New Revision: 4914
Added:
stack/native/branches/rest/src/main/java/org/jboss/rs/
stack/native/branches/rest/src/main/java/org/jboss/rs/MethodHTTP.java
stack/native/branches/rest/src/main/java/org/jboss/rs/ResourceRegistry.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/
stack/native/branches/rest/src/main/java/org/jboss/rs/model/AbstractRegexResolveable.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/EntityModel.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/EntityResolver.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/NoMethodException.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/NoResourceException.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/RegexQualifier.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceLocator.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceMethod.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceModel.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceModelFactory.java
stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceResolver.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResolverTestCase.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResourceFactoryTestCase.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/RunRegex.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Specification.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Widget.java
stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/WidgetList.java
stack/native/branches/rest/src/test/resources/test-excludes-jboss423.txt
Modified:
stack/native/branches/rest/ant-import-tests/build-testsuite.xml
stack/native/branches/rest/ant-import/build-deploy.xml
stack/native/branches/rest/ant-import/build-setup.xml
stack/native/branches/rest/ant-import/build-thirdparty.xml
stack/native/branches/rest/ant-import/macros-deploy-native.xml
stack/native/branches/rest/ant.properties.example
stack/native/branches/rest/build.xml
stack/native/branches/rest/src/main/java/javax/xml/ws/WebServiceContext.java
Log:
runtime model and resource resolver, first cut
Modified: stack/native/branches/rest/ant-import/build-deploy.xml
===================================================================
--- stack/native/branches/rest/ant-import/build-deploy.xml 2007-10-29 13:12:16 UTC (rev 4913)
+++ stack/native/branches/rest/ant-import/build-deploy.xml 2007-10-29 13:14:58 UTC (rev 4914)
@@ -56,7 +56,8 @@
<!-- Deploy jbossws to jboss422 -->
<target name="deploy-jboss422" depends="jars-jboss42,undeploy-jboss422,deploy-jboss422-endorsed" description="Deploy jbossws to jboss422">
- <macro-deploy-native422 stacklibs="${core.dir}/output/lib" thirdpartylibs="${core.dir}/thirdparty"/>
+ <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
+ <macro-deploy-native422 jbosshome="${jboss422.home}" stacklibs="${core.dir}/output/lib" thirdpartylibs="${core.dir}/thirdparty"/>
<macro-deploy-framework thirdpartylibs="${core.dir}/thirdparty" jbosshome="${jboss422.home}"/>
</target>
@@ -66,12 +67,34 @@
<!-- Remove jbossws from jboss422 -->
<target name="undeploy-jboss422" depends="prepare,undeploy-jboss422-endorsed" description="Remove jbossws from jboss422">
- <macro-undeploy-native422/>
+ <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
+ <macro-undeploy-native422 jbosshome="${jboss422.home}"/>
<macro-undeploy-framework jbosshome="${jboss422.home}"/>
</target>
<target name="undeploy-jboss422-endorsed" depends="prepare">
<macro-undeploy-endorsed jbosshome="${jboss422.home}"/>
</target>
+
+ <!-- Deploy jbossws to jboss423 -->
+ <target name="deploy-jboss423" depends="jars-jboss42,undeploy-jboss423,deploy-jboss423-endorsed" description="Deploy jbossws to jboss423">
+ <!--fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/-->
+ <macro-deploy-native422 jbosshome="${jboss423.home}" stacklibs="${core.dir}/output/lib" thirdpartylibs="${core.dir}/thirdparty"/>
+ <macro-deploy-framework thirdpartylibs="${core.dir}/thirdparty" jbosshome="${jboss423.home}"/>
+ </target>
+
+ <target name="deploy-jboss423-endorsed" depends="prepare" if="HAVE_JDK_1.6">
+ <macro-deploy-endorsed jbosshome="${jboss423.home}" stacklibs="${core.dir}/output/lib" thirdpartylibs="${core.dir}/thirdparty"/>
+ </target>
+
+ <!-- Remove jbossws from jboss423 -->
+ <target name="undeploy-jboss423" depends="prepare,undeploy-jboss423-endorsed" description="Remove jbossws from jboss423">
+ <!--fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/-->
+ <macro-undeploy-native422 jbosshome="${jboss423.home}"/>
+ <macro-undeploy-framework jbosshome="${jboss423.home}"/>
+ </target>
+ <target name="undeploy-jboss423-endorsed" depends="prepare">
+ <macro-undeploy-endorsed jbosshome="${jboss423.home}"/>
+ </target>
<!-- Deploy jbossws to jboss500 -->
<target name="deploy-jboss500" depends="jars-jboss50,undeploy-jboss500,deploy-jboss500-endorsed" description="Deploy jbossws to jboss500">
Modified: stack/native/branches/rest/ant-import/build-setup.xml
===================================================================
--- stack/native/branches/rest/ant-import/build-setup.xml 2007-10-29 13:12:16 UTC (rev 4913)
+++ stack/native/branches/rest/ant-import/build-setup.xml 2007-10-29 13:14:58 UTC (rev 4914)
@@ -72,6 +72,7 @@
<or>
<equals arg1="${jbossws.integration.target}" arg2="jboss421"/>
<equals arg1="${jbossws.integration.target}" arg2="jboss422"/>
+ <equals arg1="${jbossws.integration.target}" arg2="jboss423"/>
</or>
</condition>
<condition property="jbossws.integration.jboss50" value="true">
Modified: stack/native/branches/rest/ant-import/build-thirdparty.xml
===================================================================
--- stack/native/branches/rest/ant-import/build-thirdparty.xml 2007-10-29 13:12:16 UTC (rev 4913)
+++ stack/native/branches/rest/ant-import/build-thirdparty.xml 2007-10-29 13:14:58 UTC (rev 4914)
@@ -164,6 +164,7 @@
<pathelement location="${thirdparty.dir}/xmlsec.jar"/>
<pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
<pathelement location="${thirdparty.dir}/jboss-jaxb-intros.jar"/>
+ <pathelement location="${thirdparty.dir}/jsr311-api.jar"/>
</path>
</target>
Modified: stack/native/branches/rest/ant-import/macros-deploy-native.xml
===================================================================
--- stack/native/branches/rest/ant-import/macros-deploy-native.xml 2007-10-29 13:12:16 UTC (rev 4913)
+++ stack/native/branches/rest/ant-import/macros-deploy-native.xml 2007-10-29 13:14:58 UTC (rev 4914)
@@ -309,15 +309,16 @@
<macrodef name="macro-deploy-native422">
<attribute name="stacklibs"/>
<attribute name="thirdpartylibs"/>
+ <attribute name="jbosshome"/>
<sequential>
- <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
+
<!-- BIN SCRIPTS -->
- <unzip dest="${jboss422.home}/bin" src="@{stacklibs}/jbossws-core-scripts.zip"/>
- <chmod dir="${jboss422.home}/bin" perm="+x" includes="*.sh"/>
+ <unzip dest="@{jbosshome}/bin" src="@{stacklibs}/jbossws-core-scripts.zip"/>
+ <chmod dir="@{jbosshome}/bin" perm="+x" includes="*.sh"/>
<!-- CLIENT JARS -->
- <copy todir="${jboss422.home}/client" overwrite="true">
+ <copy todir="@{jbosshome}/client" overwrite="true">
<fileset dir="@{stacklibs}">
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
@@ -339,20 +340,21 @@
</copy>
<!-- SERVER JARS -->
- <mkdir dir="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
- <unjar dest="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-native42.sar"/>
- <mkdir dir="${jboss422.home}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
- <unzip dest="${jboss422.home}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
+ <mkdir dir="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <unjar dest="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-native42.sar"/>
+ <mkdir dir="@{jbosshome}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
+ <unzip dest="@{jbosshome}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
</sequential>
</macrodef>
<macrodef name="macro-undeploy-native422">
+ <attribute name="jbosshome"/>
<sequential>
- <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
+
<delete>
<!-- BIN SCRIPTS -->
- <fileset dir="${jboss422.home}/bin">
+ <fileset dir="@{jbosshome}/bin">
<include name="wsconsume.*"/>
<include name="wsprovide.*"/>
<include name="wsrunclient.*"/>
@@ -360,7 +362,7 @@
</fileset>
<!-- CLIENT JARS -->
- <fileset dir="${jboss422.home}/client">
+ <fileset dir="@{jbosshome}/client">
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
@@ -380,14 +382,14 @@
</fileset>
<!-- SERVER JARS -->
- <fileset dir="${jboss422.home}/lib/endorsed">
+ <fileset dir="@{jbosshome}/lib/endorsed">
<include name="jaxb-api.jar"/>
</fileset>
- <fileset dir="${jboss422.home}/lib">
+ <fileset dir="@{jbosshome}/lib">
<!-- Remove only, do not deploy -->
<include name="jbossws-integration.jar"/>
</fileset>
- <fileset dir="${jboss422.home}/server/${jboss.server.instance}/lib">
+ <fileset dir="@{jbosshome}/server/${jboss.server.instance}/lib">
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-jaxws-ext.jar"/>
@@ -396,8 +398,8 @@
<include name="jbossws-integration.jar"/>
</fileset>
</delete>
- <delete dir="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
- <delete dir="${jboss422.home}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
+ <delete dir="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <delete dir="@{jbosshome}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
</sequential>
</macrodef>
Modified: stack/native/branches/rest/ant-import-tests/build-testsuite.xml
===================================================================
--- stack/native/branches/rest/ant-import-tests/build-testsuite.xml 2007-10-29 13:12:16 UTC (rev 4913)
+++ stack/native/branches/rest/ant-import-tests/build-testsuite.xml 2007-10-29 13:14:58 UTC (rev 4914)
@@ -48,6 +48,7 @@
<pathelement location="${core.dir}/thirdparty/wstx.jar"/>
<pathelement location="${core.dir}/thirdparty/xmlunit.jar"/>
<pathelement location="${core.dir}/thirdparty/jboss-jaxb-intros.jar"/>
+ <pathelement location="${thirdparty.dir}/jsr311-api.jar"/>
</path>
<!-- The jBPM BPEL classpath -->
Modified: stack/native/branches/rest/ant.properties.example
===================================================================
--- stack/native/branches/rest/ant.properties.example 2007-10-29 13:12:16 UTC (rev 4913)
+++ stack/native/branches/rest/ant.properties.example 2007-10-29 13:14:58 UTC (rev 4914)
@@ -8,6 +8,7 @@
#jboss405.home=/home/tdiesler/svn/jbossas/tags/JBoss_4_0_5_GA/build/output/jboss-4.0.5.GA
#jboss421.home=/home/tdiesler/svn/jbossas/tags/JBoss_4_2_1_GA/build/output/jboss-4.2.1.GA
#jboss422.home=/home/tdiesler/svn/jbossas/tags/JBoss_4_2_2_GA/build/output/jboss-4.2.2.GA
+#jboss423.home=/home/hbraun/dev/prj/jbossas/branches/Branch_4_2/build/output/jboss-4.2.3.GA/
#jboss500.home=/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3
# The JBoss server under test. This can be [jboss405|jboss405.no.ejb3|jboss421|jboss422|jboss500]
Modified: stack/native/branches/rest/build.xml
===================================================================
--- stack/native/branches/rest/build.xml 2007-10-29 13:12:16 UTC (rev 4913)
+++ stack/native/branches/rest/build.xml 2007-10-29 13:14:58 UTC (rev 4914)
@@ -74,6 +74,7 @@
<include name="org/jboss/annotation/**"/>
<include name="org/jboss/ws/**"/>
<include name="org/jboss/wsf/stack/jbws/**"/>
+ <include name="org/jboss/rs/**"/>
<classpath path="${core.output.classes14.dir}"/>
<classpath refid="thirdparty.classpath"/>
</javac>
@@ -181,6 +182,7 @@
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/annotation/**"/>
<include name="org/jboss/ws/**"/>
+ <include name="org/jboss/rs/**"/>
</fileset>
<fileset dir="${core.resources.dir}">
<include name="schema/**"/>
Modified: stack/native/branches/rest/src/main/java/javax/xml/ws/WebServiceContext.java
===================================================================
--- stack/native/branches/rest/src/main/java/javax/xml/ws/WebServiceContext.java 2007-10-29 13:12:16 UTC (rev 4913)
+++ stack/native/branches/rest/src/main/java/javax/xml/ws/WebServiceContext.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -34,7 +34,7 @@
*
* Typically a <code>WebServiceContext</code> is injected
* into an endpoint implementation class using the
- * <code>Resource</code> annotation.
+ * <code>ResourceModel</code> annotation.
*
* @since JAX-WS 2.0
*
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/MethodHTTP.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/MethodHTTP.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/MethodHTTP.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public enum MethodHTTP
+{
+ GET, POST, PUT, DELETE, HEAD;
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/MethodHTTP.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/ResourceRegistry.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/ResourceRegistry.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/ResourceRegistry.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs;
+
+import org.jboss.rs.model.ResourceModel;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class ResourceRegistry
+{
+ private Map<String, List<ResourceModel>> webContextMapping = new HashMap<String, List<ResourceModel>>();
+
+ public void addResourceModelForContext(String context, ResourceModel model)
+ {
+ if(null == webContextMapping.get(context))
+ webContextMapping.put(context, new ArrayList<ResourceModel>());
+
+ webContextMapping.get(context).add(model);
+ }
+
+ public List<ResourceModel> getResourceModelsForContext(String context)
+ {
+ if(null == webContextMapping.get(context))
+ webContextMapping.put(context, new ArrayList<ResourceModel>());
+
+ return webContextMapping.get(context);
+ }
+
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/ResourceRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/AbstractRegexResolveable.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/AbstractRegexResolveable.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/AbstractRegexResolveable.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.model;
+
+import java.util.StringTokenizer;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public abstract class AbstractRegexResolveable
+{
+ public final String URI_PARAM_PATTERN = "(.*?)";
+ public final String CHILD_SUFFIX_PATTERN = "(/.*)?";
+ public final String CHILDLESS_SUFFIX_PATTERN = "(/)?";
+
+ protected Pattern regexPattern;
+ private boolean isCompiled;
+
+ protected void initFromUriTemplate(String uriTemplate)
+ {
+ assert uriTemplate!=null;
+ assert !uriTemplate.startsWith("/");
+
+ StringTokenizer tokenizer = new StringTokenizer(uriTemplate, "/");
+ StringBuffer patternBuffer = new StringBuffer();
+ while(tokenizer.hasMoreTokens())
+ {
+ String tok = tokenizer.nextToken();
+ if(isUriParam(tok))
+ {
+ patternBuffer.append( regexFromUriParam(tok) );
+ }
+ else
+ {
+ patternBuffer.append( regexFromPathSegment(tok) );
+ }
+ }
+
+ if(hasChildren())
+ patternBuffer.append(CHILD_SUFFIX_PATTERN);
+ else
+ patternBuffer.append(CHILDLESS_SUFFIX_PATTERN);
+
+
+ String patternString = patternBuffer.toString();
+
+ this.regexPattern = Pattern.compile(patternString);
+ this.isCompiled = true;
+ }
+
+ /**
+ *
+ * @param input a URI string
+ * @return a comparable or <code>null</code> if no match
+ */
+ public RegexQualifier resolve(String input)
+ {
+ assert isCompiled;
+ assert input != null;
+ assert !input.startsWith("/");
+
+ RegexQualifier qualifier = null;
+
+ Matcher matcher = regexPattern.matcher(input);
+ if(! matcher.find() )
+ return qualifier;
+
+ String lastGroup = matcher.group( matcher.groupCount() );
+ if(null == lastGroup)
+ {
+ lastGroup = "";
+ }
+ else if(lastGroup.startsWith("/"))
+ {
+ lastGroup = lastGroup.substring(1);
+ }
+
+ qualifier = new RegexQualifier(
+ matcher.groupCount(),
+ regexPattern.pattern().length(),
+ lastGroup
+ );
+
+ return qualifier;
+ }
+
+ private String regexFromPathSegment(String tok)
+ {
+ return "(\\b"+tok+"\\b)";
+ }
+
+ private String regexFromUriParam(String tok)
+ {
+ return URI_PARAM_PATTERN;
+ }
+
+ private boolean isUriParam(String token)
+ {
+ return token.startsWith("{") && token.endsWith("}");
+ }
+
+ abstract boolean hasChildren();
+
+ abstract void freeze();
+
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/AbstractRegexResolveable.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/EntityModel.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/EntityModel.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/EntityModel.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.model;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class EntityModel
+{
+ Class implementation;
+
+ public EntityModel(Class implementation)
+ {
+ this.implementation = implementation;
+ }
+
+ public Class getImplementation()
+ {
+ return implementation;
+ }
+
+
+ public String toString()
+ {
+ return "EntityModel {impl="+implementation+"}";
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/EntityModel.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/EntityResolver.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/EntityResolver.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/EntityResolver.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.model;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class EntityResolver
+{
+ List<ResourceModel> resourceModels;
+
+ public EntityResolver(List<ResourceModel> resourceModels)
+ {
+ this.resourceModels = resourceModels;
+ }
+
+ public EntityModel resolveEntityModel(String uri)
+ {
+ assert !uri.startsWith("/");
+
+
+ return null;
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/EntityResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/NoMethodException.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/NoMethodException.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/NoMethodException.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.model;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class NoMethodException extends Exception
+{
+
+ public NoMethodException(String message)
+ {
+ super(message);
+ }
+
+ public NoMethodException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/NoMethodException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/NoResourceException.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/NoResourceException.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/NoResourceException.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.model;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class NoResourceException extends Exception
+{
+
+ public NoResourceException(String message)
+ {
+ super(message);
+ }
+
+ public NoResourceException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/NoResourceException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/RegexQualifier.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/RegexQualifier.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/RegexQualifier.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.model;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class RegexQualifier implements Comparable
+{
+ public final int numGroups;
+ public final int patternLength;
+ public final String nextUriToken;
+
+ public RegexQualifier(int matchingGroups, int patternLenght, String uriToken)
+ {
+ this.numGroups = matchingGroups;
+ this.patternLength = patternLenght;
+
+ if(null == uriToken)
+ throw new IllegalArgumentException("Null UriToken");
+
+ this.nextUriToken = uriToken;
+ }
+
+ public int compareTo(Object o)
+ {
+ if(! (o instanceof RegexQualifier) )
+ throw new IllegalArgumentException("Cannot compare RegexQualifier.class to " + o.getClass());
+
+ RegexQualifier to = (RegexQualifier)o;
+ if(to.numGroups <this.numGroups)
+ return -1;
+ else if(to.numGroups >this.numGroups)
+ return 1;
+ else
+ return 0;
+
+ // todo: compare by second key
+ }
+
+ public String toString()
+ {
+ return "RegexQualifier{groups="+ numGroups +", patternLength="+patternLength+"}";
+ }
+}
\ No newline at end of file
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/RegexQualifier.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceLocator.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceLocator.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceLocator.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.model;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class ResourceLocator extends AbstractRegexResolveable
+{
+ ResourceModel target;
+
+ private String uriTemplate;
+
+ public ResourceLocator(ResourceModel target)
+ {
+ this.uriTemplate = target.getUriTemplate();
+ this.target = target;
+ }
+
+ public String getUriTemplate()
+ {
+ return uriTemplate;
+ }
+
+ public ResourceModel field()
+ {
+ return target;
+ }
+
+ boolean hasChildren()
+ {
+ // always append '(/.*)?' to the regex
+ return true;
+ }
+
+ void freeze()
+ {
+ initFromUriTemplate(this.uriTemplate);
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceLocator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceMethod.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceMethod.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceMethod.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.model;
+
+import org.jboss.rs.MethodHTTP;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class ResourceMethod extends AbstractRegexResolveable
+{
+ private EntityModel entityModel;
+ private MethodHTTP methodHTTP;
+ private String uriTemplate;
+
+ public ResourceMethod(MethodHTTP method, String uriTemplate, EntityModel entityModel)
+ {
+ this.uriTemplate = uriTemplate;
+ this.methodHTTP = method;
+ this.entityModel = entityModel;
+
+ }
+
+ public MethodHTTP getMethodHTTP()
+ {
+ return methodHTTP;
+ }
+
+
+ public EntityModel getEntityModel()
+ {
+ return entityModel;
+ }
+
+ public String getUriTemplate()
+ {
+ return this.uriTemplate;
+ }
+
+ boolean hasChildren()
+ {
+ // always append '(/)?' to the regex
+ return false;
+ }
+
+ void freeze()
+ {
+ initFromUriTemplate(this.uriTemplate);
+ }
+
+
+ public String toString()
+ {
+ return "ResourceMethod {"+methodHTTP+" uri="+uriTemplate+", regex="+regexPattern+", entity="+entityModel+"}";
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceMethod.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceModel.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceModel.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceModel.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -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.rs.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class ResourceModel extends AbstractRegexResolveable
+{
+ private ResourceModel parent = null;
+
+ private String uriTemplate;
+ private Class implementation;
+
+ /*TODO : parse resource methods = no UriTemplatem but HttpMethod annotation */
+ private List<ResourceMethod> resourceMethods = new ArrayList<ResourceMethod>();
+ private List<ResourceMethod> subResourceMethods = new ArrayList<ResourceMethod>();
+ private List<ResourceLocator> resourceLocators = new ArrayList<ResourceLocator>();
+
+ public ResourceModel(String uriTemplate, Class implementation)
+ {
+ this(null, uriTemplate, implementation);
+ }
+
+ public ResourceModel(ResourceModel parent, String uriTemplate, Class implementation)
+ {
+ this.parent = parent;
+ this.uriTemplate = uriTemplate;
+ this.implementation = implementation;
+ }
+
+ /**
+ * Locks the resource model for further modifications
+ */
+ void freeze()
+ {
+ initFromUriTemplate(this.uriTemplate);
+ }
+
+ public void addSubResourceMethod(ResourceMethod srm)
+ {
+ subResourceMethods.add(srm);
+ }
+
+ public void addSubResourceLocator(ResourceLocator srl)
+ {
+ resourceLocators.add(srl);
+ }
+
+ public boolean hasSubResources()
+ {
+ return !subResourceMethods.isEmpty() || !resourceLocators.isEmpty();
+ }
+
+ ResourceModel getParent()
+ {
+ return parent;
+ }
+
+ public Class getImplementation()
+ {
+ return implementation;
+ }
+
+ public String getUriTemplate()
+ {
+ return uriTemplate;
+ }
+
+
+ List<ResourceMethod> getSubResourceMethods()
+ {
+ return subResourceMethods;
+ }
+
+ List<ResourceLocator> getResourceLocator()
+ {
+ return resourceLocators;
+ }
+
+ boolean hasChildren()
+ {
+ return hasSubResources();
+ }
+
+ public String toString()
+ {
+ return "ResourceModel {uri=" + uriTemplate + ", regex=" + regexPattern + ", impl=" + implementation + "}";
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceModel.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceModelFactory.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceModelFactory.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceModelFactory.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.model;
+
+import org.jboss.rs.MethodHTTP;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.UriTemplate;
+import java.lang.reflect.Method;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class ResourceModelFactory
+{
+ public static ResourceModel createModel(Class bean)
+ {
+ assert bean.isAnnotationPresent(UriTemplate.class);
+
+ // the root resource
+ UriTemplate rootUri = (UriTemplate)bean.getAnnotation(UriTemplate.class);
+ ResourceModel rootResource = new ResourceModel(rootUri.value(), bean);
+
+ System.out.println("Creating resource model from bean: " + bean);
+
+ parseMetaData(rootResource);
+
+ return rootResource;
+ }
+
+ private static void parseMetaData(ResourceModel resource)
+ {
+ String parent = resource.getParent()!=null ? resource.getParent().getImplementation().getName() : "";
+
+ for( Method m : resource.getImplementation().getDeclaredMethods() )
+ {
+ // handle subresources
+ if(m.isAnnotationPresent(UriTemplate.class))
+ {
+ UriTemplate uri = m.getAnnotation(UriTemplate.class);
+ Class<?> returnType = m.getReturnType();
+
+ // TODO: extend to other http methods
+ if(m.isAnnotationPresent(GET.class))
+ {
+ // sub resource method
+ GET http = (GET)m.getAnnotation(GET.class);
+ ResourceMethod resourceMethod = new ResourceMethod(
+ MethodHTTP.valueOf("GET"), uri.value(), new EntityModel(returnType)
+ );
+ resource.addSubResourceMethod(resourceMethod);
+ }
+ else
+ {
+ // locator
+ ResourceModel subResource = new ResourceModel(resource, uri.value(), returnType);
+ ResourceLocator locator = new ResourceLocator(subResource);
+ locator.freeze();
+ resource.addSubResourceLocator(locator);
+
+ // recursive
+ parseMetaData(subResource);
+ }
+ }
+
+ }
+
+ // freeze resource
+ resource.freeze();
+
+ System.out.println("---");
+ System.out.println(resource);
+
+ // freeze sub resource methods
+ for(ResourceMethod srm : resource.getSubResourceMethods())
+ {
+ srm.freeze();
+ System.out.println(srm);
+ }
+
+ System.out.println("---");
+ }
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceModelFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceResolver.java
===================================================================
--- stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceResolver.java (rev 0)
+++ stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceResolver.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.rs.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class ResourceResolver
+{
+ public ResourceMethod resolve(List<ResourceModel> rootResources, String uri)
+ throws NoResourceException, NoMethodException
+ {
+ ResourceMethod resourceMethod = null;
+
+ // Filter the set of resource classes by rejecting those whose
+ // regular expression does not match uri
+ List<ResourceMatch> includedResources = new ArrayList<ResourceMatch>();
+ Iterator<ResourceModel> it1 = rootResources.iterator();
+ while(it1.hasNext())
+ {
+ ResourceModel model = it1.next();
+ RegexQualifier qualifier = model.resolve(uri);
+ if(qualifier!=null)
+ includedResources.add( new ResourceMatch(model, qualifier) );
+ }
+
+ if(includedResources.isEmpty())
+ throw new NoResourceException("No resource matches URI '"+uri+"'");
+
+ Collections.sort(includedResources);
+
+ // DFS by locator, should result in a resource match
+ Iterator<ResourceMatch> it2 = includedResources.iterator();
+ while(it2.hasNext() && null==resourceMethod)
+ {
+ ResourceMatch rootResource = it2.next();
+
+ // a root resource may be a final resource match already
+ resourceMethod = resolveResourceMethod(rootResource, rootResource.qualifier.nextUriToken);
+
+ // root didn't match, so recurse locators to find a resource
+ if(null == resourceMethod)
+ {
+ ResourceMatch subResource = resolveByLocator(rootResource);
+ if(subResource!=null)
+ resourceMethod = resolveResourceMethod(subResource, rootResource.qualifier.nextUriToken);
+ }
+ }
+
+ if(null == resourceMethod)
+ throw new NoMethodException("No method for URI '"+uri);
+
+ // gotcha
+ return resourceMethod;
+ }
+
+ private ResourceMatch resolveByLocator(ResourceMatch<ResourceModel> resourceMatch)
+ {
+ ResourceMatch match = null;
+
+ List<ResourceMatch> weightedResults = new ArrayList<ResourceMatch>();
+ Iterator<ResourceLocator> locators = resourceMatch.model.getResourceLocator().iterator();
+ while(locators.hasNext())
+ {
+ ResourceLocator bridge = locators.next();
+ RegexQualifier qualifier = bridge.resolve(resourceMatch.qualifier.nextUriToken);
+ if(qualifier!=null)
+ weightedResults.add( new ResourceMatch( bridge.field(), qualifier) );
+ }
+
+ Collections.sort(weightedResults);
+ ResourceMatch next = weightedResults.get(0);
+ String nextUriToken = next.qualifier.nextUriToken;
+
+ if("".equals(nextUriToken) || "/".equals(nextUriToken))
+ match = next;
+ else
+ match = resolveByLocator(next);
+
+ return match;
+ }
+
+ private ResourceMethod resolveResourceMethod(ResourceMatch<ResourceModel> methodTarget, String uriToken)
+ {
+ ResourceMethod match = null;
+
+ List<ResourceMatch<ResourceMethod>> matches = new ArrayList<ResourceMatch<ResourceMethod>>();
+ List<ResourceMethod> methods = methodTarget.model.getSubResourceMethods();
+ Iterator<ResourceMethod> it = methods.iterator();
+ while(it.hasNext())
+ {
+ ResourceMethod method = it.next();
+ RegexQualifier qualifier = method.resolve(uriToken);
+ if(qualifier!=null && ("".equals(qualifier.nextUriToken) || "/".equals(qualifier.nextUriToken)))
+ {
+ matches.add(
+ new ResourceMatch<ResourceMethod>(method, qualifier)
+ );
+ }
+ }
+
+ if(!matches.isEmpty())
+ {
+ Collections.sort(matches);
+ match = matches.get(0).model;
+ }
+
+ return match;
+ }
+
+ class ResourceMatch<T> implements Comparable
+ {
+ final T model;
+ final RegexQualifier qualifier;
+
+ public ResourceMatch(T model, RegexQualifier weight)
+ {
+ this.model = model;
+ this.qualifier = weight;
+ }
+
+ public int compareTo(Object o)
+ {
+ return qualifier.compareTo(((ResourceMatch<T>)o).qualifier);
+ }
+
+ public String toString()
+ {
+ return "ResourceMatch {model="+model+", weight="+ qualifier +"}";
+ }
+ }
+
+}
Property changes on: stack/native/branches/rest/src/main/java/org/jboss/rs/model/ResourceResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResolverTestCase.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResolverTestCase.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResolverTestCase.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -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.rs.model;
+
+import junit.framework.TestCase;
+import org.jboss.rs.ResourceRegistry;
+import org.jboss.rs.model.ResourceModel;
+import org.jboss.rs.model.ResourceModelFactory;
+import org.jboss.rs.model.ResourceResolver;
+import org.jboss.rs.model.ResourceMethod;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class ResolverTestCase extends TestCase
+{
+
+ ResourceRegistry registry;
+ List<ResourceModel> rootModels;
+
+ protected void setUp() throws Exception
+ {
+ this.registry = new ResourceRegistry();
+ ResourceModel root = ResourceModelFactory.createModel(WidgetList.class);
+ registry.addResourceModelForContext("/rest", root);
+ rootModels = registry.getResourceModelsForContext("/rest");
+ }
+
+ public void testRegexResolver1() throws Exception
+ {
+ ResourceResolver resolver = new ResourceResolver();
+ ResourceMethod method = resolver.resolve(rootModels, "widgets/Id/spec");
+
+ assertNotNull(method);
+ assertEquals(method.getUriTemplate(), "spec");
+ }
+
+ public void testRegexResolver2() throws Exception
+ {
+ ResourceResolver resolver = new ResourceResolver();
+
+ ResourceMethod method = resolver.resolve(rootModels, "widgets/special");
+
+ assertNotNull(method);
+ assertEquals(method.getUriTemplate(), "special");
+ }
+
+ public void testRegexResolver3() throws Exception
+ {
+ ResourceResolver resolver = new ResourceResolver();
+
+ ResourceMethod method = resolver.resolve(rootModels, "widgets/offers");
+
+ assertNotNull(method);
+ assertEquals(method.getUriTemplate(), "offers");
+ assertTrue(method.getEntityModel().getImplementation().equals(WidgetList.class));
+ }
+
+ public void testRegexResolver4() throws Exception
+ {
+ ResourceResolver resolver = new ResourceResolver();
+
+ ResourceMethod method = resolver.resolve(rootModels, "widgets/Id/spec/SpecName");
+
+ assertNotNull(method);
+ assertEquals(method.getUriTemplate(), "spec/{name}");
+ assertTrue(method.getEntityModel().getImplementation().equals(Specification.class));
+ }
+
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResolverTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResourceFactoryTestCase.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResourceFactoryTestCase.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResourceFactoryTestCase.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.rs.model;
+
+import junit.framework.TestCase;
+import org.jboss.rs.model.ResourceModelFactory;
+import org.jboss.rs.model.ResourceModel;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class ResourceFactoryTestCase extends TestCase
+{
+ public void testParseMetaModel() throws Exception
+ {
+ ResourceModel root = ResourceModelFactory.createModel(WidgetList.class);
+ }
+
+ private void dumpModel(ResourceModel model)
+ {
+
+ }
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/ResourceFactoryTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/RunRegex.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/RunRegex.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/RunRegex.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.rs.model;
+
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class RunRegex
+{
+ public static void main(String[] args)
+ {
+ String s = "special";
+ System.out.println("> " +s);
+ Pattern p = Pattern.compile("(\\bspec\\b)(/)?");//Pattern.compile("(.*?)(/.*)?");
+ Matcher m = p.matcher(s);
+
+ System.out.println("? " + m.find());
+ System.out.println("! "+m.groupCount());
+ System.out.println("# " + s.substring(m.end()));
+ for(int i=0; i<=m.groupCount(); i++)
+ {
+ System.out.println("g '" + m.group(i) + "'");
+ }
+
+ System.out.println("< "+m.group(m.groupCount()));
+ System.out.println("---");
+
+
+ }
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/RunRegex.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Specification.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Specification.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Specification.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.rs.model;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class Specification
+{
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Specification.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Widget.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Widget.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Widget.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.rs.model;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.UriTemplate;
+import javax.ws.rs.UriParam;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class Widget
+{
+ String id;
+
+ public Widget(String id)
+ {
+ this.id = id;
+ }
+
+ @GET
+ @UriTemplate("spec")
+ Specification[] getSpecification() {
+ return new Specification[]{ new Specification() };
+ }
+
+ @GET
+ @UriTemplate("spec/{name}")
+ Specification getSpecByName(@UriParam("name")String name)
+ {
+ return new Specification();
+ }
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/Widget.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/WidgetList.java
===================================================================
--- stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/WidgetList.java (rev 0)
+++ stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/WidgetList.java 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.rs.model;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.UriParam;
+import javax.ws.rs.UriTemplate;
+
+@UriTemplate("widgets")
+public class WidgetList
+{
+ @GET
+ @UriTemplate("offers")
+ WidgetList getDiscounted() {
+ return null;
+ }
+
+ @GET
+ @UriTemplate("special")
+ void getDiscounted(Widget special) {
+
+ }
+
+ @UriTemplate("{id}")
+ Widget findWidget(@UriParam("id") String id) {
+ return new Widget(id);
+ }
+}
Property changes on: stack/native/branches/rest/src/test/java/org/jboss/test/rs/model/WidgetList.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/rest/src/test/resources/test-excludes-jboss423.txt
===================================================================
--- stack/native/branches/rest/src/test/resources/test-excludes-jboss423.txt (rev 0)
+++ stack/native/branches/rest/src/test/resources/test-excludes-jboss423.txt 2007-10-29 13:14:58 UTC (rev 4914)
@@ -0,0 +1,7 @@
+# EJB3/Injection excludes
+org/jboss/test/ws/jaxws/samples/webserviceref/**
+org/jboss/test/ws/jaxws/webserviceref/**
+
+# [JBWS-1797] Setting .NET friendly Endpoint in web.xml
+org/jboss/test/ws/jaxws/jbws1797/**
+
Property changes on: stack/native/branches/rest/src/test/resources/test-excludes-jboss423.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 2 months
JBossWS SVN: r4913 - stack/native/branches.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-10-29 09:12:16 -0400 (Mon, 29 Oct 2007)
New Revision: 4913
Added:
stack/native/branches/rest/
Log:
Start work on 311 implementation
Copied: stack/native/branches/rest (from rev 4912, stack/native/trunk)
17 years, 2 months
JBossWS SVN: r4912 - in stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security: element and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2007-10-29 06:52:58 -0400 (Mon, 29 Oct 2007)
New Revision: 4912
Added:
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/FailedAuthenticationException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/FailedCheckException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/InvalidSecurityHeaderException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/InvalidSecurityTokenException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/SecurityTokenUnavailableException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/UnsupportedAlgorithmException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/UnsupportedSecurityTokenException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/WSSecurityException.java
Removed:
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java
Modified:
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java
Log:
Refactoring, moving exceptions to their own package
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -23,6 +23,7 @@
import org.jboss.ws.extensions.security.element.BinarySecurityToken;
import org.jboss.ws.extensions.security.element.X509Token;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
/**
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -24,6 +24,7 @@
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;
/**
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -32,6 +32,9 @@
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;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -23,6 +23,7 @@
import java.util.List;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Document;
/**
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -38,6 +38,7 @@
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;
Deleted: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -1,64 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class FailedAuthenticationException extends WSSecurityException
-{
- public static final QName faultCode = new QName(Constants.WSSE_NS, "FailedAuthentication", Constants.WSSE_PREFIX);
-
- public static final String faultString = "The security token could not be authenticated or authorized.";
-
- public FailedAuthenticationException()
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public FailedAuthenticationException(Throwable cause)
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public FailedAuthenticationException(String message)
- {
- super(message);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-
- public FailedAuthenticationException(String message, Throwable cause)
- {
- super(message, cause);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-}
Deleted: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -1,64 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class FailedCheckException extends WSSecurityException
-{
- public static final QName faultCode = new QName(Constants.WSSE_NS, "FailedCheck", Constants.WSSE_PREFIX);
-
- public static final String faultString = "The signature or decryption was invlaid.";
-
- public FailedCheckException()
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public FailedCheckException(Throwable cause)
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public FailedCheckException(String message)
- {
- super(message);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-
- public FailedCheckException(String message, Throwable cause)
- {
- super(message, cause);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-}
Deleted: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -1,64 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class InvalidSecurityHeaderException extends WSSecurityException
-{
- public static final QName faultCode = new QName(Constants.WSSE_NS, "InvalidSecurity", Constants.WSSE_PREFIX);
-
- public static final String faultString = "An error was dicovered processing the <wsse:Security> header.";
-
- public InvalidSecurityHeaderException()
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public InvalidSecurityHeaderException(Throwable cause)
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public InvalidSecurityHeaderException(String message)
- {
- super(message);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-
- public InvalidSecurityHeaderException(String message, Throwable cause)
- {
- super(message, cause);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-}
Deleted: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -1,64 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class InvalidSecurityTokenException extends WSSecurityException
-{
- public static final QName faultCode = new QName(Constants.WSSE_NS, "InvlalidSecurityToken", Constants.WSSE_PREFIX);
-
- public static final String faultString = "An invlaid security token was provided.";
-
- public InvalidSecurityTokenException()
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public InvalidSecurityTokenException(Throwable cause)
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public InvalidSecurityTokenException(String message)
- {
- super(message);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-
- public InvalidSecurityTokenException(String message, Throwable cause)
- {
- super(message, cause);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-}
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -35,6 +35,8 @@
import org.jboss.ws.extensions.security.element.SecurityTokenReference;
import org.jboss.ws.extensions.security.element.X509IssuerSerial;
import org.jboss.ws.extensions.security.element.X509Token;
+import org.jboss.ws.extensions.security.exception.SecurityTokenUnavailableException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -26,6 +26,7 @@
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;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -22,6 +22,7 @@
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
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -24,6 +24,7 @@
import java.util.Collection;
import java.util.List;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Document;
/**
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -22,6 +22,7 @@
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
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -28,6 +28,8 @@
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;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -27,6 +27,8 @@
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;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -38,6 +38,7 @@
import org.jboss.ws.core.utils.ThreadLocalAssociation;
import org.jboss.ws.extensions.security.element.BinarySecurityToken;
import org.jboss.ws.extensions.security.element.SecurityTokenReference;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -34,6 +34,7 @@
import org.jboss.ws.extensions.security.element.Timestamp;
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.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -25,6 +25,7 @@
import java.util.List;
import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -50,6 +50,8 @@
import java.util.StringTokenizer;
import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.security.exception.FailedAuthenticationException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
/**
* <code>SecurityStore</code> holds and loads the keystore and truststore required for encyption and signing.
Deleted: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -1,64 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class SecurityTokenUnavailableException extends WSSecurityException
-{
- public static final QName faultCode = new QName(Constants.WSSE_NS, "SecurityTokenUnavailable", Constants.WSSE_PREFIX);
-
- public static final String faultString = "Referenced security token could not be retrieved.";
-
- public SecurityTokenUnavailableException()
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public SecurityTokenUnavailableException(Throwable cause)
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public SecurityTokenUnavailableException(String message)
- {
- super(message);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-
- public SecurityTokenUnavailableException(String message, Throwable cause)
- {
- super(message, cause);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-}
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -25,6 +25,7 @@
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
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -39,6 +39,7 @@
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;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -31,6 +31,8 @@
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
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -25,6 +25,7 @@
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
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -24,6 +24,8 @@
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;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -22,6 +22,7 @@
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;
/**
Deleted: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -1,65 +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 javax.xml.namespace.QName;
-
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-
-public class UnsupportedAlgorithmException extends WSSecurityException
-{
- public static final QName faultCode = new QName("UnsupportedAlgorithm", Constants.WSSE_PREFIX, Constants.WSSE_NS);
-
- public static final String faultString = "An unsupported signature or encryption algorithm was used.";
-
- public UnsupportedAlgorithmException()
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public UnsupportedAlgorithmException(Throwable cause)
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public UnsupportedAlgorithmException(String message)
- {
- super(message);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-
- public UnsupportedAlgorithmException(String message, Throwable cause)
- {
- super(message, cause);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-}
Deleted: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -1,64 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class UnsupportedSecurityTokenException extends WSSecurityException
-{
- public static final QName faultCode = new QName("UnsupportedSecurityToken", Constants.WSSE_PREFIX, Constants.WSSE_NS);
-
- public static final String faultString = "An unsupported token was provided.";
-
- public UnsupportedSecurityTokenException()
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public UnsupportedSecurityTokenException(Throwable cause)
- {
- super(faultString);
- setFaultCode(faultCode);
- setFaultString(faultString);
- }
-
- public UnsupportedSecurityTokenException(String message)
- {
- super(message);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-
- public UnsupportedSecurityTokenException(String message, Throwable cause)
- {
- super(message, cause);
- setFaultCode(faultCode);
- setFaultString(message);
- }
-}
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -39,6 +39,8 @@
import org.jboss.ws.core.CommonSOAPFaultException;
import org.jboss.ws.core.StubExt;
import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.extensions.security.exception.InvalidSecurityHeaderException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.wsse.Config;
Deleted: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -1,74 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.extensions.security;
-
-import javax.xml.namespace.QName;
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class WSSecurityException extends Exception
-{
- private boolean internal = false;
-
- private QName faultCode = new QName(Constants.JBOSS_WSSE_NS, "InternalError", Constants.JBOSS_WSSE_PREFIX);
-
- private String faultString = "An internal WS-Security error occurred. See log for details";
-
- public WSSecurityException(String message)
- {
- super(message);
- this.internal = true;
- }
-
- public WSSecurityException(String message, Throwable cause)
- {
- super(message, cause);
- this.internal = true;
- }
-
- protected void setFaultCode(QName faultCode)
- {
- this.faultCode = faultCode;
- }
-
- protected void setFaultString(String faultMessage)
- {
- this.faultString = faultMessage;
- }
-
- public boolean isInternalError()
- {
- return internal;
- }
-
- public QName getFaultCode()
- {
- return faultCode;
- }
-
- public String getFaultString()
- {
- return faultString;
- }
-}
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -23,7 +23,7 @@
import org.jboss.ws.extensions.security.Constants;
import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -22,7 +22,7 @@
package org.jboss.ws.extensions.security.element;
import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -29,10 +29,10 @@
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.keys.KeyInfo;
import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.InvalidSecurityHeaderException;
import org.jboss.ws.extensions.security.KeyResolver;
import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
+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;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -27,7 +27,7 @@
import org.apache.xml.security.utils.Base64;
import org.apache.xml.security.utils.XMLUtils;
import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.security.element;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Element;
abstract public class Reference implements SecurityElement
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.security.element;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -28,9 +28,9 @@
import org.jboss.ws.extensions.security.Constants;
import org.jboss.ws.extensions.security.KeyResolver;
import org.jboss.ws.extensions.security.SecurityStore;
-import org.jboss.ws.extensions.security.UnsupportedSecurityTokenException;
import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.UnsupportedSecurityTokenException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -23,7 +23,7 @@
import org.jboss.ws.extensions.security.Constants;
import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -26,7 +26,7 @@
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.signature.XMLSignature;
import org.jboss.ws.extensions.security.KeyResolver;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -28,7 +28,7 @@
import org.apache.xml.security.utils.XMLUtils;
import org.jboss.ws.extensions.security.Constants;
import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -24,7 +24,7 @@
import org.apache.xml.security.utils.XMLUtils;
import org.jboss.ws.extensions.security.Constants;
import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -25,9 +25,9 @@
import org.apache.xml.security.utils.XMLUtils;
import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.InvalidSecurityHeaderException;
import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
+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;
Modified: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java 2007-10-29 10:24:23 UTC (rev 4911)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -29,7 +29,7 @@
import org.apache.xml.security.utils.XMLUtils;
import org.jboss.util.Base64;
import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.WSSecurityException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Copied: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/FailedAuthenticationException.java (from rev 4893, stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java)
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/FailedAuthenticationException.java (rev 0)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/FailedAuthenticationException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.exception;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.security.Constants;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class FailedAuthenticationException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS, "FailedAuthentication", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "The security token could not be authenticated or authorized.";
+
+ public FailedAuthenticationException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedAuthenticationException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedAuthenticationException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public FailedAuthenticationException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/FailedCheckException.java (from rev 4893, stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java)
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/FailedCheckException.java (rev 0)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/FailedCheckException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.exception;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.security.Constants;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class FailedCheckException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS, "FailedCheck", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "The signature or decryption was invlaid.";
+
+ public FailedCheckException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedCheckException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedCheckException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public FailedCheckException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/InvalidSecurityHeaderException.java (from rev 4893, stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java)
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/InvalidSecurityHeaderException.java (rev 0)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/InvalidSecurityHeaderException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.exception;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.security.Constants;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class InvalidSecurityHeaderException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS, "InvalidSecurity", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "An error was dicovered processing the <wsse:Security> header.";
+
+ public InvalidSecurityHeaderException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityHeaderException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityHeaderException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public InvalidSecurityHeaderException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/InvalidSecurityTokenException.java (from rev 4893, stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java)
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/InvalidSecurityTokenException.java (rev 0)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/InvalidSecurityTokenException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.exception;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.security.Constants;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class InvalidSecurityTokenException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS, "InvlalidSecurityToken", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "An invlaid security token was provided.";
+
+ public InvalidSecurityTokenException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityTokenException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityTokenException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public InvalidSecurityTokenException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/SecurityTokenUnavailableException.java (from rev 4893, stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java)
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/SecurityTokenUnavailableException.java (rev 0)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/SecurityTokenUnavailableException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.exception;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.security.Constants;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class SecurityTokenUnavailableException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS, "SecurityTokenUnavailable", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "Referenced security token could not be retrieved.";
+
+ public SecurityTokenUnavailableException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public SecurityTokenUnavailableException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public SecurityTokenUnavailableException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public SecurityTokenUnavailableException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/UnsupportedAlgorithmException.java (from rev 4893, stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java)
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/UnsupportedAlgorithmException.java (rev 0)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/UnsupportedAlgorithmException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.exception;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.security.Constants;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+
+public class UnsupportedAlgorithmException extends WSSecurityException
+{
+ public static final QName faultCode = new QName("UnsupportedAlgorithm", Constants.WSSE_PREFIX, Constants.WSSE_NS);
+
+ public static final String faultString = "An unsupported signature or encryption algorithm was used.";
+
+ public UnsupportedAlgorithmException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedAlgorithmException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedAlgorithmException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public UnsupportedAlgorithmException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/UnsupportedSecurityTokenException.java (from rev 4893, stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java)
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/UnsupportedSecurityTokenException.java (rev 0)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/UnsupportedSecurityTokenException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.exception;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.security.Constants;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class UnsupportedSecurityTokenException extends WSSecurityException
+{
+ public static final QName faultCode = new QName("UnsupportedSecurityToken", Constants.WSSE_PREFIX, Constants.WSSE_NS);
+
+ public static final String faultString = "An unsupported token was provided.";
+
+ public UnsupportedSecurityTokenException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedSecurityTokenException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedSecurityTokenException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public UnsupportedSecurityTokenException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied: stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/WSSecurityException.java (from rev 4893, stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java)
===================================================================
--- stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/WSSecurityException.java (rev 0)
+++ stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/extensions/security/exception/WSSecurityException.java 2007-10-29 10:52:58 UTC (rev 4912)
@@ -0,0 +1,76 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 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.exception;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.security.Constants;
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class WSSecurityException extends Exception
+{
+ private boolean internal = false;
+
+ private QName faultCode = new QName(Constants.JBOSS_WSSE_NS, "InternalError", Constants.JBOSS_WSSE_PREFIX);
+
+ private String faultString = "An internal WS-Security error occurred. See log for details";
+
+ public WSSecurityException(String message)
+ {
+ super(message);
+ this.internal = true;
+ }
+
+ public WSSecurityException(String message, Throwable cause)
+ {
+ super(message, cause);
+ this.internal = true;
+ }
+
+ protected void setFaultCode(QName faultCode)
+ {
+ this.faultCode = faultCode;
+ }
+
+ protected void setFaultString(String faultMessage)
+ {
+ this.faultString = faultMessage;
+ }
+
+ public boolean isInternalError()
+ {
+ return internal;
+ }
+
+ public QName getFaultCode()
+ {
+ return faultCode;
+ }
+
+ public String getFaultString()
+ {
+ return faultString;
+ }
+}
17 years, 2 months
JBossWS SVN: r4911 - stack/native/branches/jbossws-native-2.0.2/src/test/resources.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-10-29 06:24:23 -0400 (Mon, 29 Oct 2007)
New Revision: 4911
Modified:
stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt
Log:
JBWS-1852 Failed to create a new SAX parser
Modified: stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt 2007-10-29 10:20:52 UTC (rev 4910)
+++ stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt 2007-10-29 10:24:23 UTC (rev 4911)
@@ -7,7 +7,6 @@
# [JBAS-4890] EJBAccessException: Caller unauthorized
org/jboss/test/ws/jaxws/samples/context/**
-org/jboss/test/ws/jaxws/samples/wssecurity/**
# [JBAS-4903] EJB 2.1 view cannot be realized
org/jboss/test/ws/jaxws/jbws944/**
17 years, 2 months
JBossWS SVN: r4910 - stack/native/branches/jbossws-native-2.0.2/ant-import-tests.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-10-29 06:20:52 -0400 (Mon, 29 Oct 2007)
New Revision: 4910
Modified:
stack/native/branches/jbossws-native-2.0.2/ant-import-tests/build-testsuite.xml
Log:
JBWS-1852 Failed to create a new SAX parser
Modified: stack/native/branches/jbossws-native-2.0.2/ant-import-tests/build-testsuite.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/ant-import-tests/build-testsuite.xml 2007-10-29 10:14:37 UTC (rev 4909)
+++ stack/native/branches/jbossws-native-2.0.2/ant-import-tests/build-testsuite.xml 2007-10-29 10:20:52 UTC (rev 4910)
@@ -179,10 +179,8 @@
<classpath location="${tests.output.dir}/resources/jaxws/samples/wssecurityAnnotatedpolicy"/>
</taskdef>
- <!-- JBWS-1852 Failed to create a new SAX parser
<wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurity" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean" verbose="true"/>
<wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurityAnnotatedpolicy" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy.HelloJavaBean"/>
- -->
</target>
<target name="tests-compile-generated-resources" depends="servicegen,wstools,wsprovide">
17 years, 2 months
JBossWS SVN: r4909 - framework/branches/jbossws-framework-2.0.2/src/main/java/org/jboss/wsf/framework/deployment.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-10-29 06:14:37 -0400 (Mon, 29 Oct 2007)
New Revision: 4909
Modified:
framework/branches/jbossws-framework-2.0.2/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java
Log:
Fix NPE in context properties handling
Modified: framework/branches/jbossws-framework-2.0.2/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java
===================================================================
--- framework/branches/jbossws-framework-2.0.2/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java 2007-10-29 09:46:36 UTC (rev 4908)
+++ framework/branches/jbossws-framework-2.0.2/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java 2007-10-29 10:14:37 UTC (rev 4909)
@@ -52,12 +52,15 @@
@Override
public void create(Deployment dep)
{
- Iterator<String> it = contextProperties.keySet().iterator();
- while (it.hasNext())
+ if (contextProperties != null)
{
- String key = it.next();
- String value = contextProperties.get(key);
- dep.setProperty(key, value);
+ Iterator<String> it = contextProperties.keySet().iterator();
+ while (it.hasNext())
+ {
+ String key = it.next();
+ String value = contextProperties.get(key);
+ dep.setProperty(key, value);
+ }
}
}
}
\ No newline at end of file
17 years, 2 months