gatein SVN: r5988 - portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-03-09 11:54:37 -0500 (Wed, 09 Mar 2011)
New Revision: 5988
Modified:
portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml
Log:
GTNWSRP-123: Fix typo
Modified: portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml
===================================================================
--- portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml 2011-03-09 16:53:01 UTC (rev 5987)
+++ portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml 2011-03-09 16:54:37 UTC (rev 5988)
@@ -3,6 +3,6 @@
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
- <!-- Configuration for the GateIn WSRP Producer WS-Security -->
+ <!-- Configuration for the GateIn WSRP Consumer WS-Security -->
</jboss-ws-security>
13 years, 9 months
gatein SVN: r5987 - portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-03-09 11:53:01 -0500 (Wed, 09 Mar 2011)
New Revision: 5987
Modified:
portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml
Log:
GTNWSRP-123: remove default wss configuration options, configuration and securing the soap messages should be responsibility of the admin.
Modified: portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml
===================================================================
--- portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml 2011-03-09 16:21:39 UTC (rev 5986)
+++ portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml 2011-03-09 16:53:01 UTC (rev 5987)
@@ -3,7 +3,6 @@
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
- <config>
- <username/>
- </config>
+ <!-- Configuration for the GateIn WSRP Producer WS-Security -->
+
</jboss-ws-security>
13 years, 9 months
gatein SVN: r5986 - components/sso/branches/sso-wci/agent/src/main/java/org/gatein/sso/agent/opensso.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2011-03-09 11:21:39 -0500 (Wed, 09 Mar 2011)
New Revision: 5986
Modified:
components/sso/branches/sso-wci/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java
Log:
opensso cookie processing fix
Modified: components/sso/branches/sso-wci/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java
===================================================================
--- components/sso/branches/sso-wci/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java 2011-03-09 16:15:10 UTC (rev 5985)
+++ components/sso/branches/sso-wci/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java 2011-03-09 16:21:39 UTC (rev 5986)
@@ -83,6 +83,11 @@
break;
}
}
+
+ if(token == null)
+ {
+ throw new IllegalStateException("No SSO Tokens Found");
+ }
if(token != null)
{
13 years, 9 months
gatein SVN: r5985 - portal/branches/wsrp-extraction.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-03-09 11:15:10 -0500 (Wed, 09 Mar 2011)
New Revision: 5985
Modified:
portal/branches/wsrp-extraction/pom.xml
Log:
GTNWSRP-123: update parent pom.xml to specify new dependencies.
Modified: portal/branches/wsrp-extraction/pom.xml
===================================================================
--- portal/branches/wsrp-extraction/pom.xml 2011-03-09 15:21:37 UTC (rev 5984)
+++ portal/branches/wsrp-extraction/pom.xml 2011-03-09 16:15:10 UTC (rev 5985)
@@ -640,6 +640,12 @@
</dependency>
<dependency>
<groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wss</artifactId>
+ <scope>provided</scope>
+ <version>${org.gatein.wsrp.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-wss-jboss5</artifactId>
<scope>provided</scope>
<version>${org.gatein.wsrp.version}</version>
13 years, 9 months
gatein SVN: r5984 - in portal/branches/wsrp-extraction: packaging/jboss-as5/pkg/src/main/resources/jboss/server/default/deploy/gatein.ear/META-INF and 6 other directories.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-03-09 10:21:37 -0500 (Wed, 09 Mar 2011)
New Revision: 5984
Added:
portal/branches/wsrp-extraction/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/
portal/branches/wsrp-extraction/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/JBoss5WSSServiceIntegration.java
portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml
Modified:
portal/branches/wsrp-extraction/packaging/jboss-as5/pkg/pom.xml
portal/branches/wsrp-extraction/packaging/jboss-as5/pkg/src/main/resources/jboss/server/default/deploy/gatein.ear/META-INF/application.xml
portal/branches/wsrp-extraction/wsrp-integration/extension-component/pom.xml
portal/branches/wsrp-extraction/wsrp-integration/extension-ear/pom.xml
portal/branches/wsrp-extraction/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml
portal/branches/wsrp-extraction/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
Log:
GTNWSRP-123: update to use jbws configuration files. Add option to enable to dissable wss from the admin gui.
Update the pkg-jbossas5 build to work with the new wsrp integration ear.
Modified: portal/branches/wsrp-extraction/packaging/jboss-as5/pkg/pom.xml
===================================================================
--- portal/branches/wsrp-extraction/packaging/jboss-as5/pkg/pom.xml 2011-03-09 04:29:59 UTC (rev 5983)
+++ portal/branches/wsrp-extraction/packaging/jboss-as5/pkg/pom.xml 2011-03-09 15:21:37 UTC (rev 5984)
@@ -464,10 +464,6 @@
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.gadgets-core</artifactId>
</dependency>
- <dependency>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>gatein.portal.component.wsrp</artifactId>
- </dependency>
<!-- Provided -->
<dependency>
@@ -773,49 +769,7 @@
<version>1.2.3</version>
</dependency>
- <!-- WSRP -->
<dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-producer-lib</artifactId>
- <version>${org.gatein.wsrp.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-common</artifactId>
- <version>${org.gatein.wsrp.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-wsrp1-ws</artifactId>
- <version>${org.gatein.wsrp.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-wsrp2-ws</artifactId>
- <version>${org.gatein.wsrp.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-consumer</artifactId>
- <version>${org.gatein.wsrp.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-integration-api</artifactId>
- <version>${org.gatein.wsrp.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-jcr-impl</artifactId>
- <version>${org.gatein.wsrp.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-wss-jboss5</artifactId>
- <version>${org.gatein.wsrp.version}</version>
- </dependency>
-
- <dependency>
<?context LIB?>
<?move jcip-annotations.jar?>
<groupId>net.jcip</groupId>
@@ -902,21 +856,6 @@
<artifactId>gatein-sample-skin</artifactId>
<type>war</type>
</dependency>
- <dependency>
- <?move gatein.ear/wsrp-producer.war?>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-producer</artifactId>
- <type>war</type>
- <version>${org.gatein.wsrp.version}</version>
- </dependency>
- <dependency>
- <?move gatein.ear/wsrp-admin-gui.war?>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-admin-gui</artifactId>
- <type>war</type>
- <version>${org.gatein.wsrp.version}</version>
- </dependency>
-
</dependencies>
Modified: portal/branches/wsrp-extraction/packaging/jboss-as5/pkg/src/main/resources/jboss/server/default/deploy/gatein.ear/META-INF/application.xml
===================================================================
--- portal/branches/wsrp-extraction/packaging/jboss-as5/pkg/src/main/resources/jboss/server/default/deploy/gatein.ear/META-INF/application.xml 2011-03-09 04:29:59 UTC (rev 5983)
+++ portal/branches/wsrp-extraction/packaging/jboss-as5/pkg/src/main/resources/jboss/server/default/deploy/gatein.ear/META-INF/application.xml 2011-03-09 15:21:37 UTC (rev 5984)
@@ -56,16 +56,4 @@
<context-root>web</context-root>
</web>
</module>
- <module>
- <web>
- <web-uri>wsrp-admin-gui.war</web-uri>
- <context-root>wsrp-admin-gui</context-root>
- </web>
- </module>
- <module>
- <web>
- <web-uri>wsrp-producer.war</web-uri>
- <context-root>wsrp-producer</context-root>
- </web>
- </module>
</application>
Modified: portal/branches/wsrp-extraction/wsrp-integration/extension-component/pom.xml
===================================================================
--- portal/branches/wsrp-extraction/wsrp-integration/extension-component/pom.xml 2011-03-09 04:29:59 UTC (rev 5983)
+++ portal/branches/wsrp-extraction/wsrp-integration/extension-component/pom.xml 2011-03-09 15:21:37 UTC (rev 5984)
@@ -63,6 +63,11 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wss-jboss5</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
<scope>provided</scope>
@@ -97,6 +102,12 @@
<groupId>org.gatein.wci</groupId>
<artifactId>wci-wci</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.ws.native</groupId>
+ <artifactId>jbossws-native-core</artifactId>
+ <version>3.1.2.GA</version>
+ <scope>provided</scope>
+ </dependency>
<!-- tests -->
<dependency>
Added: portal/branches/wsrp-extraction/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/JBoss5WSSServiceIntegration.java
===================================================================
--- portal/branches/wsrp-extraction/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/JBoss5WSSServiceIntegration.java (rev 0)
+++ portal/branches/wsrp-extraction/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/JBoss5WSSServiceIntegration.java 2011-03-09 15:21:37 UTC (rev 5984)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.portal.wsrp.wss;
+
+import org.gatein.wsrp.wss.WebServiceSecurityFactory;
+import org.picocontainer.Startable;
+import org.wsrp.wss.jboss5.handlers.consumer.WSSecurityCredentialHandler;
+import org.wsrp.wss.jboss5.handlers.consumer.JBWSSecurityHandlerWrapper;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class JBoss5WSSServiceIntegration implements Startable
+{
+ private final WebServiceSecurityFactory wssFactory;
+
+ private final WSSecurityCredentialHandler WS_CREDENTIAL_HANDLER = new WSSecurityCredentialHandler();
+ private final JBWSSecurityHandlerWrapper JBWS_SECURITY_WRAPPER = new JBWSSecurityHandlerWrapper();
+
+ public JBoss5WSSServiceIntegration()
+ {
+ wssFactory = WebServiceSecurityFactory.getInstance();
+ }
+
+ public void start()
+ {
+ startConsumer();
+ }
+
+ public void stop()
+ {
+ stopConsumer();
+ }
+
+ protected void startConsumer()
+ {
+ wssFactory.registerWebServiceSecurityHandler(WS_CREDENTIAL_HANDLER);
+ wssFactory.registerWebServiceSecurityHandler(JBWS_SECURITY_WRAPPER);
+ }
+
+ protected void stopConsumer()
+ {
+ wssFactory.unregisterWebServiceSecurityHandler(WS_CREDENTIAL_HANDLER);
+ wssFactory.unregisterWebServiceSecurityHandler(JBWS_SECURITY_WRAPPER);
+ }
+}
+
Modified: portal/branches/wsrp-extraction/wsrp-integration/extension-ear/pom.xml
===================================================================
--- portal/branches/wsrp-extraction/wsrp-integration/extension-ear/pom.xml 2011-03-09 04:29:59 UTC (rev 5983)
+++ portal/branches/wsrp-extraction/wsrp-integration/extension-ear/pom.xml 2011-03-09 15:21:37 UTC (rev 5984)
@@ -97,6 +97,10 @@
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-wss-jboss5</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wss</artifactId>
+ </dependency>
</dependencies>
<build>
@@ -175,6 +179,10 @@
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-wss-jboss5</artifactId>
</jarModule>
+ <jarModule>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wss</artifactId>
+ </jarModule>
</modules>
</configuration>
</plugin>
Added: portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml
===================================================================
--- portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml (rev 0)
+++ portal/branches/wsrp-extraction/wsrp-integration/extension-ear/src/main/application/META-INF/gatein-wsse-consumer.xml 2011-03-09 15:21:37 UTC (rev 5984)
@@ -0,0 +1,9 @@
+ <jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config
+ http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+
+ <config>
+ <username/>
+ </config>
+</jboss-ws-security>
Modified: portal/branches/wsrp-extraction/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml
===================================================================
--- portal/branches/wsrp-extraction/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml 2011-03-09 04:29:59 UTC (rev 5983)
+++ portal/branches/wsrp-extraction/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml 2011-03-09 15:21:37 UTC (rev 5984)
@@ -92,6 +92,10 @@
onParentVersion="COPY" protected="false" multiple="false">
<valueConstraints/>
</propertyDefinition>
+ <propertyDefinition name="enablewss" requiredType="boolean" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
</propertyDefinitions>
</nodeType>
Modified: portal/branches/wsrp-extraction/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
===================================================================
--- portal/branches/wsrp-extraction/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2011-03-09 04:29:59 UTC (rev 5983)
+++ portal/branches/wsrp-extraction/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2011-03-09 15:21:37 UTC (rev 5984)
@@ -44,6 +44,12 @@
</init-params>
</component>
+ <!-- TODO: this should be removed to a JBoss5 specific configuration file -->
+ <component>
+ <type>org.gatein.portal.wsrp.wss.JBoss5WSSServiceIntegration</type>
+ </component>
+
+
<external-component-plugins>
<target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
<component-plugin>
13 years, 9 months
gatein SVN: r5983 - components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-03-08 23:29:59 -0500 (Tue, 08 Mar 2011)
New Revision: 5983
Modified:
components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/JBWSSecurityHandlerWrapper.java
Log:
GTNWSRP-123: Update name of configuration file for wsrp-integration.xml
Modified: components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/JBWSSecurityHandlerWrapper.java
===================================================================
--- components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/JBWSSecurityHandlerWrapper.java 2011-03-08 18:32:24 UTC (rev 5982)
+++ components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/JBWSSecurityHandlerWrapper.java 2011-03-09 04:29:59 UTC (rev 5983)
@@ -49,7 +49,7 @@
@Override
protected String getConfigResourceName()
{
- return "wsrp/gatein-wsse-consumer.xml";
+ return "gatein-wsse-consumer.xml";
}
}
13 years, 9 months
gatein SVN: r5982 - in components/wsrp/trunk/ws-security: jboss5/src/main/java/org/wsrp/wss/jboss5/handlers and 10 other directories.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-03-08 13:32:24 -0500 (Tue, 08 Mar 2011)
New Revision: 5982
Added:
components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/
components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/JBWSSecurityHandlerWrapper.java
components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/WSSecurityCredentialHandler.java
components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/producer/
components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/producer/JBWSSecurityHandlerWrapper.java
components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/producer/WSSecurityCredentialHandler.java
components/wsrp/trunk/ws-security/wss/
components/wsrp/trunk/ws-security/wss/pom.xml
components/wsrp/trunk/ws-security/wss/src/
components/wsrp/trunk/ws-security/wss/src/main/
components/wsrp/trunk/ws-security/wss/src/main/java/
components/wsrp/trunk/ws-security/wss/src/main/java/org/
components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/
components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/
components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/
components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/WebServiceSecurityFactory.java
Removed:
components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/ConsumerWSSecurityHandler.java
components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/ProducerWSSecurityHandler.java
Log:
GTNWSRP-123: Update wss work. Allow for option in wsrp-admin to enable or disable wss on consumer side. Remove xml handler configuration files for the consumer and dynamically add them in the java code. Update to use JBWS wsse configuration files.
Deleted: components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/ConsumerWSSecurityHandler.java
===================================================================
--- components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/ConsumerWSSecurityHandler.java 2011-03-08 18:23:21 UTC (rev 5981)
+++ components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/ConsumerWSSecurityHandler.java 2011-03-08 18:32:24 UTC (rev 5982)
@@ -1,166 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2011, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.wsrp.wss.jboss5.handlers;
-
-import java.security.Principal;
-import java.security.cert.X509Certificate;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPHandler;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.gatein.wci.security.Credentials;
-import org.gatein.wsrp.servlet.ServletAccess;
-import org.jboss.aspects.security.SecurityClientInterceptor;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.security.SecurityContextAssociation;
-import org.jboss.security.SecurityContextUtil;
-import org.jboss.security.client.SecurityClient;
-import org.jboss.security.client.SecurityClientFactory;
-import org.jboss.web.tomcat.security.SecurityAssociationValve;
-import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.UsernameToken;
-import org.jboss.ws.extensions.security.element.X509Token;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-
-/**
- * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
- * @version $Revision$
- */
-public class ConsumerWSSecurityHandler implements SOAPHandler<SOAPMessageContext>
-{
- private static Logger log = LoggerFactory.getLogger(ConsumerWSSecurityHandler.class);
-
- public void close(MessageContext arg0)
- {
- //Nothing to do for now
- }
-
- public boolean handleFault(SOAPMessageContext soapMessageContext)
- {
- return true;
- }
-
- public boolean handleMessage(SOAPMessageContext soapMessageContext)
- {
- // outbound message means request
- if (Boolean.TRUE.equals(soapMessageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)))
- {
- return handleRequest(soapMessageContext);
- }
- else
- {
- return handleResponse(soapMessageContext);
- }
- }
-
- private boolean handleRequest(SOAPMessageContext soapMessageContext)
- {
- try
- {
-
- log.debug("Attempting to convert security context to WS-Security header");
-
- Principal principal = SecurityAssociation.getPrincipal();
- Object credential = SecurityAssociation.getCredential();
-
- SOAPMessageContext smc = (SOAPMessageContext) soapMessageContext;
- SOAPMessage message = smc.getMessage();
- SecurityHeader header = new SecurityHeader(message.getSOAPHeader().getOwnerDocument());
-
- if (principal == null)
- {
-
- log.debug("No principal to put in WS-Security header");
- return true;
-
- }
- else if (credential instanceof X509Certificate[])
- {
-
- log.debug("Adding X509Token to WSRP WS-Security header");
- header.addToken(new X509Token(((X509Certificate[]) credential)[0], message.getSOAPHeader()
- .getOwnerDocument()));
- Element soapHeader = Util.findOrCreateSoapHeader(message.getSOAPHeader().getOwnerDocument()
- .getDocumentElement());
-
- Element wsse = header.getElement();
- wsse.setAttributeNS(soapHeader.getNamespaceURI(), soapHeader.getPrefix() + ":mustUnderstand", "1");
- soapHeader.insertBefore(wsse, soapHeader.getFirstChild());
-
- }
- else if (credential instanceof String)
- {
-
- log.debug("Adding UsernameToken to WSRP WS-Security header");
-
- boolean digest = false;
- String nonce = null;
- String created = null;
-
- header.addToken(new UsernameToken(principal.getName(), (String) credential, message.getSOAPHeader()
- .getOwnerDocument(), digest, nonce, created));
- Element soapHeader = Util.findOrCreateSoapHeader(message.getSOAPHeader().getOwnerDocument()
- .getDocumentElement());
-
- Element wsse = header.getElement();
- wsse.setAttributeNS(soapHeader.getNamespaceURI(), soapHeader.getPrefix() + ":mustUnderstand", "1");
- soapHeader.insertBefore(wsse, soapHeader.getFirstChild());
-
- }
- else
- {
-
- log.warn("Principal exists, but can not propogate in WS-Security header");
-
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- //throw new JAXRPCException(e);
- }
-
- return true;
- }
-
- private boolean handleResponse(SOAPMessageContext soapMessageContext)
- {
- return false;
- }
-
- public Set<QName> getHeaders()
- {
- return null;
- }
-
-}
-
Deleted: components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/ProducerWSSecurityHandler.java
===================================================================
--- components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/ProducerWSSecurityHandler.java 2011-03-08 18:23:21 UTC (rev 5981)
+++ components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/ProducerWSSecurityHandler.java 2011-03-08 18:32:24 UTC (rev 5982)
@@ -1,183 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2011, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.wsrp.wss.jboss5.handlers;
-
-import java.security.Principal;
-import java.security.cert.X509Certificate;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPHandler;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.apache.catalina.connector.Request;
-import org.gatein.wsrp.servlet.ServletAccess;
-import org.jboss.web.tomcat.security.SecurityAssociationValve;
-import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.element.BinarySecurityToken;
-import org.jboss.ws.extensions.security.element.UsernameToken;
-import org.jboss.ws.extensions.security.element.X509Token;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-
-/**
- * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
- * @version $Revision$
- */
-public class ProducerWSSecurityHandler implements SOAPHandler<SOAPMessageContext>
-{
- private static Logger log = LoggerFactory.getLogger(ProducerWSSecurityHandler.class);
-
- public Set<QName> getHeaders()
- {
- Set<QName> qNames = new HashSet<QName>();
- qNames.add(Constants.WSSE_HEADER_QNAME);
- return qNames;
- }
-
- public void close(MessageContext arg0)
- {
- //Nothing to do for now
- }
-
- public boolean handleFault(SOAPMessageContext arg0)
- {
- return false;
- }
-
- public boolean handleMessage(SOAPMessageContext soapMessageContext)
- {
- // outbound message means request
- if (Boolean.TRUE.equals(soapMessageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)))
- {
- return handleRequest(soapMessageContext);
- }
- else
- {
- return handleResponse(soapMessageContext);
- }
- }
-
- private boolean handleResponse(SOAPMessageContext soapMessageContext)
- {
- try
- {
- log.debug("Attempting to extract WS-Security header and create user context");
- //final Request r = (Request)ServletAccess.getRequest();
- final Request r = (Request) (SecurityAssociationValve.activeRequest.get());
-
- SOAPMessageContext smc = (SOAPMessageContext) soapMessageContext;
- SOAPMessage message = smc.getMessage();
-
- Element headerElement = Util.findElement(message.getSOAPHeader().getOwnerDocument().getDocumentElement(),
- "Security", Constants.WSSE_NS);
-
- if (headerElement != null)
- {
- Element child = Util.getFirstChildElement(headerElement);
- String tag = child.getLocalName();
-
- if (tag.equals("BinarySecurityToken"))
- {
-
- log.debug("Attempting to authenticate with a BinarySecurityToken");
- BinarySecurityToken token = BinarySecurityToken.createBinarySecurityToken(child);
- if (token instanceof X509Token)
- {
- X509Certificate cert = ((X509Token) token).getCert();
- Principal principal = r.getContext().getRealm().authenticate(new X509Certificate[]
- {cert});
- if (principal != null)
- {
- r.setAuthType(tag);
- r.setUserPrincipal(principal);
- }
- else
- {
- throw new Exception("Could not authenticate principal from BinarySecurityToken");
- }
- }
- else
- {
- //throw new UnsupportedSecurityTokenException(tag + ": Only an X509 BinarySecurityToken is suppported.");
- System.out.println(tag + ": Only an X509 BinarySecurityToken is suppported.");
- }
-
- }
- else if (tag.equals("UsernameToken"))
- {
-
- log.debug("Attempting to authenticate with a UsernameToken");
- UsernameToken token = new UsernameToken(child);
- Principal principal = r.getContext().getRealm().authenticate(token.getUsername(), token.getPassword());
- if (principal != null)
- {
- r.setAuthType(tag);
- r.setUserPrincipal(principal);
- }
- else
- {
- throw new Exception("Could not authenticate from UsernameToken");
- }
-
- }
- else
- {
-
- //throw new UnsupportedSecurityTokenException(tag + ": Only BinarySecurityToken or UsernameToken is suppported.");
- System.out.println(tag + ": Only BinarySecurityToken or UsernameToken is suppported.");
-
- }
-
- if (Util.getNextSiblingElement(headerElement) != null)
- {
- //throw new UnsupportedSecurityTokenException(tag + ": Only a single X509 BinarySecurityToken or UsernameToken is suppported.");
- System.out.println(tag + ": Only a single X509 BinarySecurityToken or UsernameToken is suppported.");
- }
-
- //Remove the header since it's been processed
- headerElement.getParentNode().removeChild(headerElement);
- }
- }
- catch (Exception e)
- {
- //throw new JAXRPCException(e);
- e.printStackTrace();
- }
-
- return true;
- }
-
- private boolean handleRequest(SOAPMessageContext soapMessageContext)
- {
- //The Producer should only handle setting the header for now
- return false;
- }
-
-}
Added: components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/JBWSSecurityHandlerWrapper.java
===================================================================
--- components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/JBWSSecurityHandlerWrapper.java (rev 0)
+++ components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/JBWSSecurityHandlerWrapper.java 2011-03-08 18:32:24 UTC (rev 5982)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.wsrp.wss.jboss5.handlers.consumer;
+
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.ws.extensions.security.jaxws.WSSecurityHandler;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class JBWSSecurityHandlerWrapper extends WSSecurityHandler
+{
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ return handleInboundSecurity(msgContext);
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ return handleOutboundSecurity(msgContext);
+ }
+
+
+ @Override
+ protected String getConfigResourceName()
+ {
+ return "wsrp/gatein-wsse-consumer.xml";
+ }
+
+}
+
Added: components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/WSSecurityCredentialHandler.java
===================================================================
--- components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/WSSecurityCredentialHandler.java (rev 0)
+++ components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/WSSecurityCredentialHandler.java 2011-03-08 18:32:24 UTC (rev 5982)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.wsrp.wss.jboss5.handlers.consumer;
+
+import java.security.Principal;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.security.SecurityAssociation;
+import org.jboss.ws.core.CommonMessageContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class WSSecurityCredentialHandler implements SOAPHandler<SOAPMessageContext>
+{
+ private static Logger log = LoggerFactory.getLogger(WSSecurityCredentialHandler.class);
+
+ public void close(MessageContext arg0)
+ {
+ //Nothing to do for now
+ }
+
+ public boolean handleFault(SOAPMessageContext soapMessageContext)
+ {
+ return true;
+ }
+
+ public boolean handleMessage(SOAPMessageContext soapMessageContext)
+ {
+ if (Boolean.TRUE.equals(soapMessageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)))
+ {
+ return handleRequest(soapMessageContext);
+ }
+ else
+ {
+ return handleResponse(soapMessageContext);
+ }
+ }
+
+ private boolean handleRequest(SOAPMessageContext soapMessageContext)
+ {
+ try
+ {
+
+ log.debug("Attempting to convert security context to WS-Security header");
+
+ CommonMessageContext ctx = (CommonMessageContext) soapMessageContext;
+
+ Principal principal = SecurityAssociation.getPrincipal();
+ Object credential = SecurityAssociation.getCredential();
+
+ if (principal == null)
+ {
+
+ log.debug("No principal to put in WS-Security header");
+ return true;
+
+ }
+ else
+ {
+ //add the credentials to the context, this will then be picked up by the JBossWS Security Handler
+ ctx.put(BindingProvider.USERNAME_PROPERTY, principal.getName());
+ ctx.put(BindingProvider.PASSWORD_PROPERTY, credential);
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn("Error occured when trying to add the credentials to the BindingProvider for WS-Security.", e);
+ }
+
+ return true;
+ }
+
+ private boolean handleResponse(SOAPMessageContext soapMessageContext)
+ {
+ return false;
+ }
+
+ public Set<QName> getHeaders()
+ {
+ return null;
+ }
+
+}
Added: components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/producer/JBWSSecurityHandlerWrapper.java
===================================================================
--- components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/producer/JBWSSecurityHandlerWrapper.java (rev 0)
+++ components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/producer/JBWSSecurityHandlerWrapper.java 2011-03-08 18:32:24 UTC (rev 5982)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.wsrp.wss.jboss5.handlers.producer;
+
+import javax.xml.ws.handler.MessageContext;
+
+import org.apache.catalina.connector.Request;
+import org.jboss.web.tomcat.security.SecurityAssociationValve;
+import org.jboss.web.tomcat.security.login.WebAuthentication;
+import org.jboss.ws.extensions.security.jaxws.WSSecurityHandler;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class JBWSSecurityHandlerWrapper extends WSSecurityHandler
+{
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ return handleInboundSecurity(msgContext);
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ return handleOutboundSecurity(msgContext);
+ }
+
+
+ @Override
+ protected String getConfigResourceName()
+ {
+ return "conf/gatein-wsse-producer.xml";
+ }
+
+}
+
Added: components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/producer/WSSecurityCredentialHandler.java
===================================================================
--- components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/producer/WSSecurityCredentialHandler.java (rev 0)
+++ components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/producer/WSSecurityCredentialHandler.java 2011-03-08 18:32:24 UTC (rev 5982)
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.wsrp.wss.jboss5.handlers.producer;
+
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.web.tomcat.security.login.WebAuthentication;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class WSSecurityCredentialHandler implements SOAPHandler<SOAPMessageContext>
+ {
+ private static Logger log = LoggerFactory.getLogger(WSSecurityCredentialHandler.class);
+
+ public void close(MessageContext arg0)
+ {
+ //Nothing to do for now
+ }
+
+ public boolean handleFault(SOAPMessageContext soapMessageContext)
+ {
+ return true;
+ }
+
+ public boolean handleMessage(SOAPMessageContext soapMessageContext)
+ {
+ if (Boolean.TRUE.equals(soapMessageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)))
+ {
+ return handleRequest(soapMessageContext);
+ }
+ else
+ {
+ return handleResponse(soapMessageContext);
+ }
+ }
+
+ private boolean handleResponse(SOAPMessageContext soapMessageContext)
+ {
+ try
+ {
+ log.debug("Attempting to add the security Credentials to the current Request");
+
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter();
+
+ if (securityAdaptor != null && securityAdaptor.getPrincipal() != null && securityAdaptor.getPrincipal().getName() != null && securityAdaptor.getCredential() != null)
+ {
+ WebAuthentication wa = new WebAuthentication();
+ wa.login(securityAdaptor.getPrincipal().getName(), securityAdaptor.getCredential());
+ }
+ else
+ {
+ log.debug("No securityAdaptor available. Cannot add credentials from the WS Security");
+ }
+
+ }
+ catch (Exception e)
+ {
+ log.warn("Error occured when trying to programatically login using the ws-security credentials.", e);
+ }
+
+ return true;
+ }
+
+ private boolean handleRequest(SOAPMessageContext soapMessageContext)
+ {
+ return false;
+ }
+
+ public Set<QName> getHeaders()
+ {
+ return null;
+ }
+ }
+
Added: components/wsrp/trunk/ws-security/wss/pom.xml
===================================================================
--- components/wsrp/trunk/ws-security/wss/pom.xml (rev 0)
+++ components/wsrp/trunk/ws-security/wss/pom.xml 2011-03-08 18:32:24 UTC (rev 5982)
@@ -0,0 +1,126 @@
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2010, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-parent</artifactId>
+ <version>2.1.0-Alpha01-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wsrp-wss</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn WSRP WS Security</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-integration-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wsrp2-ws</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-portlet</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-federation</artifactId>
+ </dependency>
+
+<!-- <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-spi</artifactId>
+ <version>1.1.2.GA</version>
+ </dependency>-->
+ <dependency>
+ <groupId>org.jboss.ws.native</groupId>
+ <artifactId>jbossws-native-core</artifactId>
+ <version>3.1.2.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx-client</artifactId>
+ <version>2.0.3.SP1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss.web</groupId>
+ <artifactId>jbossweb</artifactId>
+ <version>2.1.3.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-tomcat</artifactId>
+ <version>5.1.0.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- Ignore all classes in the org.gatein.wsrp.test packages as they are not tests -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/gatein/wsrp/test/**</exclude>
+ </excludes>
+ <!--<parallel>classes</parallel>
+ <threadCount>2</threadCount>-->
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/WebServiceSecurityFactory.java
===================================================================
--- components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/WebServiceSecurityFactory.java (rev 0)
+++ components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/WebServiceSecurityFactory.java 2011-03-08 18:32:24 UTC (rev 5982)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wsrp.wss;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class WebServiceSecurityFactory
+{
+
+ public static final WebServiceSecurityFactory instance = new WebServiceSecurityFactory();
+
+ public static WebServiceSecurityFactory getInstance()
+ {
+ return instance;
+ }
+
+ private List<SOAPHandler<SOAPMessageContext>> handlers;
+
+ public void registerWebServiceSecurityHandler(SOAPHandler<SOAPMessageContext> handler)
+ {
+ if (handlers == null)
+ {
+ handlers = new ArrayList<SOAPHandler<SOAPMessageContext>>();
+ }
+ handlers.add(handler);
+ }
+
+ public List<SOAPHandler<SOAPMessageContext>> getHandlers()
+ {
+ return handlers;
+ }
+
+ public void unregisterWebServiceSecurityHandler(SOAPHandler<SOAPMessageContext> handler)
+ {
+ if (handlers != null)
+ {
+ handlers.remove(handler);
+ }
+ }
+
+}
+
13 years, 9 months
gatein SVN: r5981 - components/wsrp/trunk.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-03-08 13:23:21 -0500 (Tue, 08 Mar 2011)
New Revision: 5981
Modified:
components/wsrp/trunk/pom.xml
Log:
GTNWSRP-123: Update wss work. Allow for option in wsrp-admin to enable or disable wss on consumer side. Remove xml handler configuration files for the consumer and dynamically add them in the java code. Update to use JBWS wsse configuration files.
Modified: components/wsrp/trunk/pom.xml
===================================================================
--- components/wsrp/trunk/pom.xml 2011-03-08 18:14:47 UTC (rev 5980)
+++ components/wsrp/trunk/pom.xml 2011-03-08 18:23:21 UTC (rev 5981)
@@ -103,6 +103,11 @@
<artifactId>wsrp-integration-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wss</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.gatein.common</groupId>
@@ -193,6 +198,7 @@
<module>hibernate-impl</module>
<module>jcr-impl</module>
<module>ws-security/jboss5</module>
+ <module>ws-security/wss</module>
</modules>
<repositories>
13 years, 9 months
gatein SVN: r5980 - in components/wsrp/trunk: admin-gui/src/main/webapp/WEB-INF/classes and 12 other directories.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-03-08 13:14:47 -0500 (Tue, 08 Mar 2011)
New Revision: 5980
Added:
components/wsrp/trunk/wsrp-producer-war/src/main/webapp/WEB-INF/conf/gatein-wsse-producer.xml
Removed:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/interfaces/
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/interfaces/
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/editConsumer.xhtml
components/wsrp/trunk/consumer/pom.xml
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceFactory.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1PortletManagementService.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1RegistrationService.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1ServiceDescriptionService.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2MarkupService.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2PortletManagementService.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2RegistrationService.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2ServiceDescriptionService.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/services/SOAPServiceFactoryTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/BehaviorBackedServiceFactory.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestWSRPProducerImpl.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/BehaviorBackedServiceFactory.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/MarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/PortletManagementBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/RegistrationBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/ServiceDescriptionBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/TestWSRPProducerImpl.java
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/mapping/EndpointInfoMapping.java
components/wsrp/trunk/wsrp-producer-war/src/main/resources/org/gatein/wsrp/endpoints/producer-handler-chains.xml
Log:
GTNWSRP-123: Update wss work. Allow for option in wsrp-admin to enable or disable wss on consumer side. Remove xml handler configuration files for the consumer and dynamically add them in the java code. Update to use JBWS wsse configuration files.
Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -704,6 +704,16 @@
{
return consumer.getMigrationService().isAvailableExportInfosEmpty();
}
+
+ public boolean isWssEnabled()
+ {
+ return consumer.getProducerInfo().getEndpointConfigurationInfo().getWSSEnabled();
+ }
+
+ public void setWssEnabled(boolean enable)
+ {
+ consumer.getProducerInfo().getEndpointConfigurationInfo().setWSSEnabled(enable);
+ }
public static class SelectablePortletHandle implements Comparable<SelectablePortletHandle>
{
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties 2011-03-08 18:14:47 UTC (rev 5980)
@@ -140,6 +140,7 @@
edit_consumer_import_title = Importing portlets
edit_consumer_export = Export portlets
edit_consumer_export_title = Exporting portlets
+edit_enable_ws_security= Enable WS Security:
# Confirm registration property deletion screen
confirm_delete_reg_property_title = Delete ''{0}'' registration property description?
@@ -221,4 +222,4 @@
INVALID_NAME_ERROR=''{0}'' is an invalid {1} name: Cannot be null, empty or contain '/', '.', '\\', '<', '>', '(', ')', '=' or '%5c'
DUPLICATE_ERROR=A {1} named ''{0}'' already exists!
-unavailable_service = WSRP service is unavailble. Please activate it before using this portlet.
\ No newline at end of file
+unavailable_service = WSRP service is unavailble. Please activate it before using this portlet.
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/editConsumer.xhtml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/editConsumer.xhtml 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/editConsumer.xhtml 2011-03-08 18:14:47 UTC (rev 5980)
@@ -64,6 +64,13 @@
<h:message styleClass="portlet-msg-error" for="wsdl"/>
</td>
</tr>
+<tr>
+ <th>#{i18n.edit_enable_ws_security}</th>
+ <td>
+ <h:selectBooleanCheckbox value="#{consumer.wssEnabled}"/>
+ <h:message styleClass="portlet-msg-error" for="wsdl"/>
+ </td>
+</tr>
<c:if test="#{consumer.localInfoPresent}">
<tr>
<th>#{i18n.edit_consumer_registration}</th>
Modified: components/wsrp/trunk/consumer/pom.xml
===================================================================
--- components/wsrp/trunk/consumer/pom.xml 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/pom.xml 2011-03-08 18:14:47 UTC (rev 5980)
@@ -46,6 +46,10 @@
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-wsrp2-ws</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wss</artifactId>
+ </dependency>
<dependency>
<groupId>org.gatein.common</groupId>
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -237,4 +237,14 @@
{
return serviceFactory.getWSRPVersion();
}
+
+ public boolean getWSSEnabled()
+ {
+ return serviceFactory.isWSSEnabled();
+ }
+
+ public void setWSSEnabled(boolean enable)
+ {
+ serviceFactory.enableWSS(enable);
+ }
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -30,18 +30,19 @@
import org.gatein.wsrp.services.v1.V1PortletManagementService;
import org.gatein.wsrp.services.v1.V1RegistrationService;
import org.gatein.wsrp.services.v1.V1ServiceDescriptionService;
-import org.gatein.wsrp.services.v1.interfaces.V1MarkupPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1PortletManagementPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1RegistrationPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1ServiceDescriptionPortType;
import org.gatein.wsrp.services.v2.V2MarkupService;
import org.gatein.wsrp.services.v2.V2PortletManagementService;
import org.gatein.wsrp.services.v2.V2RegistrationService;
import org.gatein.wsrp.services.v2.V2ServiceDescriptionService;
-import org.gatein.wsrp.services.v2.interfaces.V2MarkupPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2PortletManagementPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2RegistrationPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2ServiceDescriptionPortType;
+import org.gatein.wsrp.wss.WebServiceSecurityFactory;
+import org.oasis.wsrp.v1.WSRPV1MarkupPortType;
+import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
+import org.oasis.wsrp.v1.WSRPV1RegistrationPortType;
+import org.oasis.wsrp.v1.WSRPV1ServiceDescriptionPortType;
+import org.oasis.wsrp.v2.WSRPV2MarkupPortType;
+import org.oasis.wsrp.v2.WSRPV2PortletManagementPortType;
+import org.oasis.wsrp.v2.WSRPV2RegistrationPortType;
+import org.oasis.wsrp.v2.WSRPV2ServiceDescriptionPortType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -55,6 +56,9 @@
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
@@ -96,6 +100,8 @@
private boolean failed;
private boolean available;
private int msBeforeTimeOut = DEFAULT_TIMEOUT_MS;
+
+ private boolean wssEnabled;
private void setTimeout(Map<String, Object> requestContext)
{
@@ -132,12 +138,16 @@
{
handlerChain.add(REQUEST_HEADER_CLIENT_HANDLER);
}
+
+ addWSSHandlers(handlerChain);
}
else
{
// otherwise, create a handler chain and add our handler to it
handlerChain = new ArrayList<Handler>(1);
handlerChain.add(REQUEST_HEADER_CLIENT_HANDLER);
+
+ addWSSHandlers(handlerChain);
}
binding.setHandlerChain(handlerChain);
@@ -168,25 +178,25 @@
//
String portAddress = null;
boolean isMandatoryInterface = false;
- if (V2ServiceDescriptionPortType.class.isAssignableFrom(clazz)
- || V1ServiceDescriptionPortType.class.isAssignableFrom(clazz))
+ if (WSRPV2ServiceDescriptionPortType.class.isAssignableFrom(clazz)
+ || WSRPV1ServiceDescriptionPortType.class.isAssignableFrom(clazz))
{
portAddress = serviceDescriptionURL;
isMandatoryInterface = true;
}
- else if (V2MarkupPortType.class.isAssignableFrom(clazz)
- || V1MarkupPortType.class.isAssignableFrom(clazz))
+ else if (WSRPV2MarkupPortType.class.isAssignableFrom(clazz)
+ || WSRPV1MarkupPortType.class.isAssignableFrom(clazz))
{
portAddress = markupURL;
isMandatoryInterface = true;
}
- else if (V2RegistrationPortType.class.isAssignableFrom(clazz)
- || V1RegistrationPortType.class.isAssignableFrom(clazz))
+ else if (WSRPV2RegistrationPortType.class.isAssignableFrom(clazz)
+ || WSRPV1RegistrationPortType.class.isAssignableFrom(clazz))
{
portAddress = registrationURL;
}
- else if (V2PortletManagementPortType.class.isAssignableFrom(clazz)
- || V1PortletManagementPortType.class.isAssignableFrom(clazz))
+ else if (WSRPV2PortletManagementPortType.class.isAssignableFrom(clazz)
+ || WSRPV1PortletManagementPortType.class.isAssignableFrom(clazz))
{
portAddress = portletManagementURL;
}
@@ -304,12 +314,12 @@
Class portTypeClass = null;
try
{
- portTypeClass = V2MarkupPortType.class;
- V2MarkupPortType markupPortType = wsService.getPort(V2MarkupPortType.class);
+ portTypeClass = WSRPV2MarkupPortType.class;
+ WSRPV2MarkupPortType markupPortType = wsService.getPort(WSRPV2MarkupPortType.class);
markupURL = (String)((BindingProvider)markupPortType).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
- portTypeClass = V2ServiceDescriptionPortType.class;
- V2ServiceDescriptionPortType sdPort = wsService.getPort(V2ServiceDescriptionPortType.class);
+ portTypeClass = WSRPV2ServiceDescriptionPortType.class;
+ WSRPV2ServiceDescriptionPortType sdPort = wsService.getPort(WSRPV2ServiceDescriptionPortType.class);
serviceDescriptionURL = (String)((BindingProvider)sdPort).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
}
catch (Exception e)
@@ -321,7 +331,7 @@
try
{
- V2PortletManagementPortType managementPortType = wsService.getPort(V2PortletManagementPortType.class);
+ WSRPV2PortletManagementPortType managementPortType = wsService.getPort(WSRPV2PortletManagementPortType.class);
portletManagementURL = (String)((BindingProvider)managementPortType).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
}
catch (Exception e)
@@ -332,7 +342,7 @@
try
{
- V2RegistrationPortType registrationPortType = wsService.getPort(V2RegistrationPortType.class);
+ WSRPV2RegistrationPortType registrationPortType = wsService.getPort(WSRPV2RegistrationPortType.class);
registrationURL = (String)((BindingProvider)registrationPortType).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
}
catch (Exception e)
@@ -352,12 +362,12 @@
Class portTypeClass = null;
try
{
- portTypeClass = V1MarkupPortType.class;
- V1MarkupPortType markupPortType = wsService.getPort(V1MarkupPortType.class);
+ portTypeClass = WSRPV1MarkupPortType.class;
+ WSRPV1MarkupPortType markupPortType = wsService.getPort(WSRPV1MarkupPortType.class);
markupURL = (String)((BindingProvider)markupPortType).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
- portTypeClass = V1ServiceDescriptionPortType.class;
- V1ServiceDescriptionPortType sdPort = wsService.getPort(V1ServiceDescriptionPortType.class);
+ portTypeClass = WSRPV1ServiceDescriptionPortType.class;
+ WSRPV1ServiceDescriptionPortType sdPort = wsService.getPort(WSRPV1ServiceDescriptionPortType.class);
serviceDescriptionURL = (String)((BindingProvider)sdPort).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
}
catch (Exception e)
@@ -368,7 +378,7 @@
try
{
- V1PortletManagementPortType managementPortType = wsService.getPort(V1PortletManagementPortType.class);
+ WSRPV1PortletManagementPortType managementPortType = wsService.getPort(WSRPV1PortletManagementPortType.class);
portletManagementURL = (String)((BindingProvider)managementPortType).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
}
catch (Exception e)
@@ -379,7 +389,7 @@
try
{
- V1RegistrationPortType registrationPortType = wsService.getPort(V1RegistrationPortType.class);
+ WSRPV1RegistrationPortType registrationPortType = wsService.getPort(WSRPV1RegistrationPortType.class);
registrationURL = (String)((BindingProvider)registrationPortType).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
}
catch (Exception e)
@@ -415,12 +425,12 @@
{
if (isV2)
{
- V2ServiceDescriptionPortType port = getService(V2ServiceDescriptionPortType.class);
+ WSRPV2ServiceDescriptionPortType port = getService(WSRPV2ServiceDescriptionPortType.class);
return new V2ServiceDescriptionService(port);
}
else
{
- V1ServiceDescriptionPortType port = getService(V1ServiceDescriptionPortType.class);
+ WSRPV1ServiceDescriptionPortType port = getService(WSRPV1ServiceDescriptionPortType.class);
return new V1ServiceDescriptionService(port);
}
}
@@ -429,12 +439,12 @@
{
if (isV2)
{
- V2MarkupPortType port = getService(V2MarkupPortType.class);
+ WSRPV2MarkupPortType port = getService(WSRPV2MarkupPortType.class);
return new V2MarkupService(port);
}
else
{
- V1MarkupPortType port = getService(V1MarkupPortType.class);
+ WSRPV1MarkupPortType port = getService(WSRPV1MarkupPortType.class);
return new V1MarkupService(port);
}
}
@@ -443,12 +453,12 @@
{
if (isV2)
{
- V2PortletManagementPortType port = getService(V2PortletManagementPortType.class);
+ WSRPV2PortletManagementPortType port = getService(WSRPV2PortletManagementPortType.class);
return new V2PortletManagementService(port);
}
else
{
- V1PortletManagementPortType port = getService(V1PortletManagementPortType.class);
+ WSRPV1PortletManagementPortType port = getService(WSRPV1PortletManagementPortType.class);
return new V1PortletManagementService(port);
}
}
@@ -457,12 +467,12 @@
{
if (isV2)
{
- V2RegistrationPortType port = getService(V2RegistrationPortType.class);
+ WSRPV2RegistrationPortType port = getService(WSRPV2RegistrationPortType.class);
return new V2RegistrationService(port);
}
else
{
- V1RegistrationPortType port = getService(V1RegistrationPortType.class);
+ WSRPV1RegistrationPortType port = getService(WSRPV1RegistrationPortType.class);
return new V1RegistrationService(port);
}
}
@@ -499,6 +509,42 @@
return false;
}
+ public void enableWSS(boolean enable)
+ {
+ this.wssEnabled = enable;
+ }
+
+ public boolean isWSSEnabled()
+ {
+ return this.wssEnabled;
+ }
+
+ protected void addWSSHandlers(List<Handler> handlerChain)
+ {
+ if (wssEnabled)
+ {
+ WebServiceSecurityFactory wssFactory = WebServiceSecurityFactory.getInstance();
+ if (wssFactory.getHandlers() != null)
+ {
+ for (SOAPHandler<SOAPMessageContext> wssHandler : wssFactory.getHandlers())
+ {
+ if (!handlerChain.contains(wssHandler))
+ {
+ handlerChain.add(wssHandler);
+ }
+ }
+ }
+ else
+ {
+ log.debug("WSS enabled, but no handlers provided. WSS will not be able to work properly.");
+ }
+ }
+ else
+ {
+ log.debug("WSS disabled.");
+ }
+ }
+
protected class WSDLInfo
{
private final QName wsrp2ServiceQName;
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceFactory.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceFactory.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceFactory.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -91,4 +91,7 @@
Version getWSRPVersion();
boolean refresh(boolean force) throws Exception;
+
+ void enableWSS(boolean enable);
+ boolean isWSSEnabled();
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -26,7 +26,6 @@
import org.gatein.wsrp.WSRPExceptionFactory;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.services.MarkupService;
-import org.gatein.wsrp.services.v1.interfaces.V1MarkupPortType;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
import org.gatein.wsrp.spec.v1.V2ToV1Converter;
import org.oasis.wsrp.v1.V1AccessDenied;
@@ -47,6 +46,7 @@
import org.oasis.wsrp.v1.V1UnsupportedMode;
import org.oasis.wsrp.v1.V1UnsupportedWindowState;
import org.oasis.wsrp.v1.V1UpdateResponse;
+import org.oasis.wsrp.v1.WSRPV1MarkupPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.EventParams;
import org.oasis.wsrp.v2.Extension;
@@ -86,9 +86,9 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class V1MarkupService extends MarkupService<V1MarkupPortType>
+public class V1MarkupService extends MarkupService<WSRPV1MarkupPortType>
{
- public V1MarkupService(V1MarkupPortType port)
+ public V1MarkupService(WSRPV1MarkupPortType port)
{
super(port);
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1PortletManagementService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1PortletManagementService.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1PortletManagementService.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -27,7 +27,6 @@
import org.gatein.wsrp.WSRPExceptionFactory;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.services.PortletManagementService;
-import org.gatein.wsrp.services.v1.interfaces.V1PortletManagementPortType;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
import org.gatein.wsrp.spec.v1.V2ToV1Converter;
import org.oasis.wsrp.v1.V1AccessDenied;
@@ -44,6 +43,7 @@
import org.oasis.wsrp.v1.V1Property;
import org.oasis.wsrp.v1.V1ResetProperty;
import org.oasis.wsrp.v1.V1ResourceList;
+import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.CopiedPortlet;
import org.oasis.wsrp.v2.ExportByValueNotSupported;
@@ -83,9 +83,9 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class V1PortletManagementService extends PortletManagementService<V1PortletManagementPortType>
+public class V1PortletManagementService extends PortletManagementService<WSRPV1PortletManagementPortType>
{
- public V1PortletManagementService(V1PortletManagementPortType port)
+ public V1PortletManagementService(WSRPV1PortletManagementPortType port)
{
super(port);
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1RegistrationService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1RegistrationService.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1RegistrationService.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -26,13 +26,13 @@
import org.gatein.wsrp.WSRPExceptionFactory;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.services.RegistrationService;
-import org.gatein.wsrp.services.v1.interfaces.V1RegistrationPortType;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
import org.gatein.wsrp.spec.v1.V2ToV1Converter;
import org.oasis.wsrp.v1.V1Extension;
import org.oasis.wsrp.v1.V1InvalidRegistration;
import org.oasis.wsrp.v1.V1MissingParameters;
import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.WSRPV1RegistrationPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.GetRegistrationLifetime;
@@ -56,9 +56,9 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class V1RegistrationService extends RegistrationService<V1RegistrationPortType>
+public class V1RegistrationService extends RegistrationService<WSRPV1RegistrationPortType>
{
- public V1RegistrationService(V1RegistrationPortType service)
+ public V1RegistrationService(WSRPV1RegistrationPortType service)
{
super(service);
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1ServiceDescriptionService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1ServiceDescriptionService.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1ServiceDescriptionService.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -25,7 +25,6 @@
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.services.ServiceDescriptionService;
-import org.gatein.wsrp.services.v1.interfaces.V1ServiceDescriptionPortType;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
import org.gatein.wsrp.spec.v1.V2ToV1Converter;
import org.oasis.wsrp.v1.V1CookieProtocol;
@@ -37,6 +36,7 @@
import org.oasis.wsrp.v1.V1PortletDescription;
import org.oasis.wsrp.v1.V1RegistrationContext;
import org.oasis.wsrp.v1.V1ResourceList;
+import org.oasis.wsrp.v1.WSRPV1ServiceDescriptionPortType;
import org.oasis.wsrp.v2.CookieProtocol;
import org.oasis.wsrp.v2.EventDescription;
import org.oasis.wsrp.v2.ExportDescription;
@@ -61,9 +61,9 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class V1ServiceDescriptionService extends ServiceDescriptionService<V1ServiceDescriptionPortType>
+public class V1ServiceDescriptionService extends ServiceDescriptionService<WSRPV1ServiceDescriptionPortType>
{
- public V1ServiceDescriptionService(V1ServiceDescriptionPortType port)
+ public V1ServiceDescriptionService(WSRPV1ServiceDescriptionPortType port)
{
super(port);
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2MarkupService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2MarkupService.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2MarkupService.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -24,7 +24,6 @@
package org.gatein.wsrp.services.v2;
import org.gatein.wsrp.services.MarkupService;
-import org.gatein.wsrp.services.v2.interfaces.V2MarkupPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.EventParams;
import org.oasis.wsrp.v2.Extension;
@@ -56,6 +55,7 @@
import org.oasis.wsrp.v2.UnsupportedWindowState;
import org.oasis.wsrp.v2.UpdateResponse;
import org.oasis.wsrp.v2.UserContext;
+import org.oasis.wsrp.v2.WSRPV2MarkupPortType;
import javax.xml.ws.Holder;
import java.util.List;
@@ -64,9 +64,9 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class V2MarkupService extends MarkupService<V2MarkupPortType>
+public class V2MarkupService extends MarkupService<WSRPV2MarkupPortType>
{
- public V2MarkupService(V2MarkupPortType port)
+ public V2MarkupService(WSRPV2MarkupPortType port)
{
super(port);
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2PortletManagementService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2PortletManagementService.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2PortletManagementService.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -23,7 +23,6 @@
package org.gatein.wsrp.services.v2;
import org.gatein.wsrp.services.PortletManagementService;
-import org.gatein.wsrp.services.v2.interfaces.V2PortletManagementPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.CopiedPortlet;
import org.oasis.wsrp.v2.ExportByValueNotSupported;
@@ -55,6 +54,7 @@
import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.SetExportLifetime;
import org.oasis.wsrp.v2.UserContext;
+import org.oasis.wsrp.v2.WSRPV2PortletManagementPortType;
import javax.xml.ws.Holder;
import java.util.List;
@@ -63,9 +63,9 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class V2PortletManagementService extends PortletManagementService<V2PortletManagementPortType>
+public class V2PortletManagementService extends PortletManagementService<WSRPV2PortletManagementPortType>
{
- public V2PortletManagementService(V2PortletManagementPortType port)
+ public V2PortletManagementService(WSRPV2PortletManagementPortType port)
{
super(port);
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2RegistrationService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2RegistrationService.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2RegistrationService.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -23,7 +23,6 @@
package org.gatein.wsrp.services.v2;
import org.gatein.wsrp.services.RegistrationService;
-import org.gatein.wsrp.services.v2.interfaces.V2RegistrationPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.GetRegistrationLifetime;
@@ -39,6 +38,7 @@
import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.SetRegistrationLifetime;
import org.oasis.wsrp.v2.UserContext;
+import org.oasis.wsrp.v2.WSRPV2RegistrationPortType;
import javax.xml.ws.Holder;
import java.util.List;
@@ -47,9 +47,9 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class V2RegistrationService extends RegistrationService<V2RegistrationPortType>
+public class V2RegistrationService extends RegistrationService<WSRPV2RegistrationPortType>
{
- public V2RegistrationService(V2RegistrationPortType service)
+ public V2RegistrationService(WSRPV2RegistrationPortType service)
{
super(service);
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2ServiceDescriptionService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2ServiceDescriptionService.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v2/V2ServiceDescriptionService.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -23,7 +23,6 @@
package org.gatein.wsrp.services.v2;
import org.gatein.wsrp.services.ServiceDescriptionService;
-import org.gatein.wsrp.services.v2.interfaces.V2ServiceDescriptionPortType;
import org.oasis.wsrp.v2.CookieProtocol;
import org.oasis.wsrp.v2.EventDescription;
import org.oasis.wsrp.v2.ExportDescription;
@@ -40,6 +39,7 @@
import org.oasis.wsrp.v2.ResourceList;
import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.UserContext;
+import org.oasis.wsrp.v2.WSRPV2ServiceDescriptionPortType;
import javax.xml.ws.Holder;
import java.util.List;
@@ -48,9 +48,9 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class V2ServiceDescriptionService extends ServiceDescriptionService<V2ServiceDescriptionPortType> implements V2ServiceDescriptionPortType
+public class V2ServiceDescriptionService extends ServiceDescriptionService<WSRPV2ServiceDescriptionPortType> implements WSRPV2ServiceDescriptionPortType
{
- public V2ServiceDescriptionService(V2ServiceDescriptionPortType service)
+ public V2ServiceDescriptionService(WSRPV2ServiceDescriptionPortType service)
{
super(service);
}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/services/SOAPServiceFactoryTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/services/SOAPServiceFactoryTestCase.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/services/SOAPServiceFactoryTestCase.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -25,14 +25,6 @@
import junit.framework.TestCase;
import org.gatein.wsrp.services.SOAPServiceFactory;
-import org.gatein.wsrp.services.v1.interfaces.V1MarkupPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1PortletManagementPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1RegistrationPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1ServiceDescriptionPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2MarkupPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2PortletManagementPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2RegistrationPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2ServiceDescriptionPortType;
import org.oasis.wsrp.v1.WSRPV1MarkupPortType;
import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
import org.oasis.wsrp.v1.WSRPV1RegistrationPortType;
@@ -52,8 +44,8 @@
public class SOAPServiceFactoryTestCase extends TestCase
{
private SOAPServiceFactory factory;
- public static final Class[] WSRP2_PORT_TYPES = new Class[]{V2MarkupPortType.class, V2ServiceDescriptionPortType.class, V2PortletManagementPortType.class, V2RegistrationPortType.class};
- public static final Class[] WSRP1_PORT_TYPES = new Class[]{V1MarkupPortType.class, V1ServiceDescriptionPortType.class, V1PortletManagementPortType.class, V1RegistrationPortType.class};
+ public static final Class[] WSRP2_PORT_TYPES = new Class[]{WSRPV2MarkupPortType.class, WSRPV2ServiceDescriptionPortType.class, WSRPV2PortletManagementPortType.class, WSRPV2RegistrationPortType.class};
+ public static final Class[] WSRP1_PORT_TYPES = new Class[]{WSRPV1MarkupPortType.class, WSRPV1ServiceDescriptionPortType.class, WSRPV1PortletManagementPortType.class, WSRPV1RegistrationPortType.class};
@Override
protected void setUp() throws Exception
@@ -92,7 +84,7 @@
factory.setWsdlDefinitionURL(getWSDLURL("wsdl/missing-registration-non-std-ns.wsdl"));
// missing-registration-non-std-ns.wsdl doesn't contain registration port
- checkPorts(V2MarkupPortType.class, V2ServiceDescriptionPortType.class, V2PortletManagementPortType.class);
+ checkPorts(WSRPV2MarkupPortType.class, WSRPV2ServiceDescriptionPortType.class, WSRPV2PortletManagementPortType.class);
}
public void testSimpleV2Service() throws Exception
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/BehaviorBackedServiceFactory.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/BehaviorBackedServiceFactory.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/BehaviorBackedServiceFactory.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -36,10 +36,6 @@
import org.gatein.wsrp.services.v1.V1PortletManagementService;
import org.gatein.wsrp.services.v1.V1RegistrationService;
import org.gatein.wsrp.services.v1.V1ServiceDescriptionService;
-import org.gatein.wsrp.services.v1.interfaces.V1MarkupPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1PortletManagementPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1RegistrationPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1ServiceDescriptionPortType;
import org.gatein.wsrp.test.support.RequestedMarkupBehavior;
import org.oasis.wsrp.v1.V1AccessDenied;
import org.oasis.wsrp.v1.V1GetMarkup;
@@ -160,22 +156,22 @@
public ServiceDescriptionService getServiceDescriptionService() throws Exception
{
- return new V1ServiceDescriptionService(getService(V1ServiceDescriptionPortType.class));
+ return new V1ServiceDescriptionService(getService(WSRPV1ServiceDescriptionPortType.class));
}
public MarkupService getMarkupService() throws Exception
{
- return new V1MarkupService(getService(V1MarkupPortType.class));
+ return new V1MarkupService(getService(WSRPV1MarkupPortType.class));
}
public PortletManagementService getPortletManagementService() throws Exception
{
- return new V1PortletManagementService(getService(V1PortletManagementPortType.class));
+ return new V1PortletManagementService(getService(WSRPV1PortletManagementPortType.class));
}
public RegistrationService getRegistrationService() throws Exception
{
- return new V1RegistrationService(getService(V1RegistrationPortType.class));
+ return new V1RegistrationService(getService(WSRPV1RegistrationPortType.class));
}
public Version getWSRPVersion()
@@ -242,4 +238,16 @@
return MARKUP;
}
}
+
+ public void enableWSS(boolean enable)
+ {
+ // FIXME enableWSS
+
+ }
+
+ public boolean isWSSEnabled()
+ {
+ // FIXME isWSSEnabled
+ return false;
+ }
}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -27,7 +27,6 @@
import org.gatein.pc.api.Mode;
import org.gatein.pc.api.WindowState;
import org.gatein.wsrp.WSRPUtils;
-import org.gatein.wsrp.services.v1.interfaces.V1MarkupPortType;
import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.oasis.wsrp.v1.V1AccessDenied;
import org.oasis.wsrp.v1.V1Extension;
@@ -70,7 +69,7 @@
* @version $Revision: 10337 $
* @since 2.6
*/
-public abstract class MarkupBehavior extends TestProducerBehavior implements V1MarkupPortType
+public abstract class MarkupBehavior extends TestProducerBehavior implements WSRPV1MarkupPortType
{
private List<String> handles = new ArrayList<String>(3);
private BehaviorRegistry registry;
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -23,7 +23,6 @@
package org.gatein.wsrp.test.protocol.v1;
-import org.gatein.wsrp.services.v1.interfaces.V1PortletManagementPortType;
import org.oasis.wsrp.v1.V1AccessDenied;
import org.oasis.wsrp.v1.V1DestroyFailed;
import org.oasis.wsrp.v1.V1Extension;
@@ -54,7 +53,7 @@
* @version $Revision: 8784 $
* @since 2.6
*/
-public class PortletManagementBehavior extends TestProducerBehavior implements V1PortletManagementPortType
+public class PortletManagementBehavior extends TestProducerBehavior implements WSRPV1PortletManagementPortType
{
public void getPortletDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales, @WebParam(name = "portletDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT) Holder<V1PortletDescription> portletDescription, @WebParam(name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT) Holder<V1ResourceList> resourceList, @WebParam(name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT) Holder<List<V1Extension>> extens!
ions) throws V1AccessDenied, V1InconsistentParameters, V1InvalidHandle, V1InvalidRegistration, V1InvalidUserCategory, V1MissingParameters, V1OperationFailed
{
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -23,7 +23,6 @@
package org.gatein.wsrp.test.protocol.v1;
-import org.gatein.wsrp.services.v1.interfaces.V1RegistrationPortType;
import org.oasis.wsrp.v1.V1Extension;
import org.oasis.wsrp.v1.V1InvalidRegistration;
import org.oasis.wsrp.v1.V1MissingParameters;
@@ -42,7 +41,7 @@
* @version $Revision: 8784 $
* @since 2.6
*/
-public class RegistrationBehavior extends TestProducerBehavior implements V1RegistrationPortType
+public class RegistrationBehavior extends TestProducerBehavior implements WSRPV1RegistrationPortType
{
public static final String REGISTRATION_HANDLE = "registration";
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -24,7 +24,6 @@
package org.gatein.wsrp.test.protocol.v1;
import org.gatein.wsrp.WSRPConstants;
-import org.gatein.wsrp.services.v1.interfaces.V1ServiceDescriptionPortType;
import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.oasis.wsrp.v1.V1CookieProtocol;
import org.oasis.wsrp.v1.V1Extension;
@@ -53,7 +52,7 @@
* @version $Revision: 11320 $
* @since 2.6
*/
-public class ServiceDescriptionBehavior extends TestProducerBehavior implements V1ServiceDescriptionPortType
+public class ServiceDescriptionBehavior extends TestProducerBehavior implements WSRPV1ServiceDescriptionPortType
{
protected V1ServiceDescription serviceDescription;
private static final V1ServiceDescription DEFAULT_SERVICE_DESCRIPTION = WSRP1TypeFactory.createServiceDescription(false);
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestWSRPProducerImpl.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestWSRPProducerImpl.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestWSRPProducerImpl.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -23,10 +23,6 @@
package org.gatein.wsrp.test.protocol.v1;
-import org.gatein.wsrp.services.v1.interfaces.V1MarkupPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1PortletManagementPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1RegistrationPortType;
-import org.gatein.wsrp.services.v1.interfaces.V1ServiceDescriptionPortType;
import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.oasis.wsrp.v1.V1AccessDenied;
import org.oasis.wsrp.v1.V1CookieProtocol;
@@ -80,7 +76,7 @@
* @version $Revision: 12020 $
* @since 2.4
*/
-public class TestWSRPProducerImpl implements TestWSRPProducer, V1MarkupPortType, V1PortletManagementPortType, V1RegistrationPortType, V1ServiceDescriptionPortType
+public class TestWSRPProducerImpl implements TestWSRPProducer, WSRPV1MarkupPortType, WSRPV1PortletManagementPortType, WSRPV1RegistrationPortType, WSRPV1ServiceDescriptionPortType
{
private int sessionExpirationTime = 600;
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/BehaviorBackedServiceFactory.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/BehaviorBackedServiceFactory.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/BehaviorBackedServiceFactory.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -36,10 +36,6 @@
import org.gatein.wsrp.services.v2.V2PortletManagementService;
import org.gatein.wsrp.services.v2.V2RegistrationService;
import org.gatein.wsrp.services.v2.V2ServiceDescriptionService;
-import org.gatein.wsrp.services.v2.interfaces.V2MarkupPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2PortletManagementPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2RegistrationPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2ServiceDescriptionPortType;
import org.gatein.wsrp.test.support.RequestedMarkupBehavior;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.GetMarkup;
@@ -55,6 +51,10 @@
import org.oasis.wsrp.v2.UnsupportedMimeType;
import org.oasis.wsrp.v2.UnsupportedMode;
import org.oasis.wsrp.v2.UnsupportedWindowState;
+import org.oasis.wsrp.v2.WSRPV2MarkupPortType;
+import org.oasis.wsrp.v2.WSRPV2PortletManagementPortType;
+import org.oasis.wsrp.v2.WSRPV2RegistrationPortType;
+import org.oasis.wsrp.v2.WSRPV2ServiceDescriptionPortType;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -89,11 +89,11 @@
start();
}
- if (V2ServiceDescriptionPortType.class.isAssignableFrom(serviceClass))
+ if (WSRPV2ServiceDescriptionPortType.class.isAssignableFrom(serviceClass))
{
return (T)registry.getServiceDescriptionBehavior();
}
- if (V2MarkupPortType.class.isAssignableFrom(serviceClass))
+ if (WSRPV2MarkupPortType.class.isAssignableFrom(serviceClass))
{
String requestedMarkupBehavior = RequestedMarkupBehavior.getRequestedMarkupBehavior();
if (requestedMarkupBehavior == null)
@@ -102,11 +102,11 @@
}
return (T)registry.getMarkupBehaviorFor(requestedMarkupBehavior);
}
- if (V2PortletManagementPortType.class.isAssignableFrom(serviceClass))
+ if (WSRPV2PortletManagementPortType.class.isAssignableFrom(serviceClass))
{
return (T)registry.getPortletManagementBehavior();
}
- if (V2RegistrationPortType.class.isAssignableFrom(serviceClass))
+ if (WSRPV2RegistrationPortType.class.isAssignableFrom(serviceClass))
{
return (T)registry.getRegistrationBehavior();
}
@@ -115,22 +115,22 @@
public ServiceDescriptionService getServiceDescriptionService() throws Exception
{
- return new V2ServiceDescriptionService(getService(V2ServiceDescriptionPortType.class));
+ return new V2ServiceDescriptionService(getService(WSRPV2ServiceDescriptionPortType.class));
}
public MarkupService getMarkupService() throws Exception
{
- return new V2MarkupService(getService(V2MarkupPortType.class));
+ return new V2MarkupService(getService(WSRPV2MarkupPortType.class));
}
public PortletManagementService getPortletManagementService() throws Exception
{
- return new V2PortletManagementService(getService(V2PortletManagementPortType.class));
+ return new V2PortletManagementService(getService(WSRPV2PortletManagementPortType.class));
}
public RegistrationService getRegistrationService() throws Exception
{
- return new V2RegistrationService(getService(V2RegistrationPortType.class));
+ return new V2RegistrationService(getService(WSRPV2RegistrationPortType.class));
}
public Version getWSRPVersion()
@@ -234,4 +234,16 @@
return MARKUP;
}
}
+
+ public void enableWSS(boolean enable)
+ {
+ // FIXME enableWSS
+
+ }
+
+ public boolean isWSSEnabled()
+ {
+ // FIXME isWSSEnabled
+ return false;
+ }
}
\ No newline at end of file
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/MarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/MarkupBehavior.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/MarkupBehavior.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -29,7 +29,6 @@
import org.gatein.pc.api.WindowState;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
-import org.gatein.wsrp.services.v2.interfaces.V2MarkupPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.EventParams;
import org.oasis.wsrp.v2.Extension;
@@ -65,6 +64,7 @@
import org.oasis.wsrp.v2.UnsupportedWindowState;
import org.oasis.wsrp.v2.UpdateResponse;
import org.oasis.wsrp.v2.UserContext;
+import org.oasis.wsrp.v2.WSRPV2MarkupPortType;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
@@ -78,7 +78,7 @@
* @version $Revision: 10337 $
* @since 2.6
*/
-public abstract class MarkupBehavior extends TestProducerBehavior implements V2MarkupPortType
+public abstract class MarkupBehavior extends TestProducerBehavior implements WSRPV2MarkupPortType
{
private List<String> handles = new ArrayList<String>(3);
private BehaviorRegistry registry;
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/PortletManagementBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/PortletManagementBehavior.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/PortletManagementBehavior.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -24,7 +24,6 @@
package org.gatein.wsrp.test.protocol.v2;
import org.gatein.common.NotYetImplemented;
-import org.gatein.wsrp.services.v2.interfaces.V2PortletManagementPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.CopiedPortlet;
import org.oasis.wsrp.v2.ExportByValueNotSupported;
@@ -68,7 +67,7 @@
* @version $Revision: 8784 $
* @since 2.6
*/
-public class PortletManagementBehavior extends TestProducerBehavior implements V2PortletManagementPortType
+public class PortletManagementBehavior extends TestProducerBehavior implements WSRPV2PortletManagementPortType
{
public void getPortletPropertyDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") UserContext userContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") List<String> desiredLocales, @WebParam(name = "modelDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<ModelDescription> modelDescription, @WebParam(name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<ResourceList> resourceList, @WebParam(name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<List<Extension>> extensions) thro!
ws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
{
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/RegistrationBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/RegistrationBehavior.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/RegistrationBehavior.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -24,7 +24,6 @@
package org.gatein.wsrp.test.protocol.v2;
import org.gatein.common.NotYetImplemented;
-import org.gatein.wsrp.services.v2.interfaces.V2RegistrationPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.GetRegistrationLifetime;
@@ -51,7 +50,7 @@
* @version $Revision: 8784 $
* @since 2.6
*/
-public class RegistrationBehavior extends TestProducerBehavior implements V2RegistrationPortType
+public class RegistrationBehavior extends TestProducerBehavior implements WSRPV2RegistrationPortType
{
public static final String REGISTRATION_HANDLE = "registration";
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/ServiceDescriptionBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/ServiceDescriptionBehavior.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/ServiceDescriptionBehavior.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -25,7 +25,6 @@
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.WSRPTypeFactory;
-import org.gatein.wsrp.services.v2.interfaces.V2ServiceDescriptionPortType;
import org.oasis.wsrp.v2.CookieProtocol;
import org.oasis.wsrp.v2.EventDescription;
import org.oasis.wsrp.v2.ExportDescription;
@@ -44,6 +43,7 @@
import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.ServiceDescription;
import org.oasis.wsrp.v2.UserContext;
+import org.oasis.wsrp.v2.WSRPV2ServiceDescriptionPortType;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
@@ -59,7 +59,7 @@
* @version $Revision: 11320 $
* @since 2.6
*/
-public class ServiceDescriptionBehavior extends TestProducerBehavior implements V2ServiceDescriptionPortType
+public class ServiceDescriptionBehavior extends TestProducerBehavior implements WSRPV2ServiceDescriptionPortType
{
protected ServiceDescription serviceDescription;
private static final ServiceDescription DEFAULT_SERVICE_DESCRIPTION = WSRPTypeFactory.createServiceDescription(false);
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/TestWSRPProducerImpl.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/TestWSRPProducerImpl.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/TestWSRPProducerImpl.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -24,10 +24,6 @@
package org.gatein.wsrp.test.protocol.v2;
import org.gatein.common.NotYetImplemented;
-import org.gatein.wsrp.services.v2.interfaces.V2MarkupPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2PortletManagementPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2RegistrationPortType;
-import org.gatein.wsrp.services.v2.interfaces.V2ServiceDescriptionPortType;
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.CookieProtocol;
@@ -104,7 +100,7 @@
* @version $Revision: 12020 $
* @since 2.4
*/
-public class TestWSRPProducerImpl implements TestWSRPProducer, V2MarkupPortType, V2PortletManagementPortType, V2RegistrationPortType, V2ServiceDescriptionPortType
+public class TestWSRPProducerImpl implements TestWSRPProducer, WSRPV2MarkupPortType, WSRPV2PortletManagementPortType, WSRPV2RegistrationPortType, WSRPV2ServiceDescriptionPortType
{
private int sessionExpirationTime = 600;
Modified: components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/mapping/EndpointInfoMapping.java
===================================================================
--- components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/mapping/EndpointInfoMapping.java 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/mapping/EndpointInfoMapping.java 2011-03-08 18:14:47 UTC (rev 5980)
@@ -46,16 +46,23 @@
public abstract void setWSTimeoutMilliseconds(Integer expiration);
+ @Property(name = "enablewss", defaultValue = "false")
+ public abstract boolean getWSSEnabled();
+
+ public abstract void setWSSEnabled(boolean enable);
+
public void initFrom(EndpointConfigurationInfo info)
{
setWSDLURL(info.getWsdlDefinitionURL());
setWSTimeoutMilliseconds(info.getWSOperationTimeOut());
+ setWSSEnabled(info.getWSSEnabled());
}
EndpointConfigurationInfo toEndpointConfigurationInfo(EndpointConfigurationInfo initial)
{
initial.setWsdlDefinitionURL(getWSDLURL());
initial.setWSOperationTimeOut(getWSTimeoutMilliseconds());
+ initial.setWSSEnabled(getWSSEnabled());
return initial;
}
}
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/resources/org/gatein/wsrp/endpoints/producer-handler-chains.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/resources/org/gatein/wsrp/endpoints/producer-handler-chains.xml 2011-03-08 13:38:01 UTC (rev 5979)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/resources/org/gatein/wsrp/endpoints/producer-handler-chains.xml 2011-03-08 18:14:47 UTC (rev 5980)
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://org.jboss.ws/jaxws/samples/logicalhandler"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
- <handler-chain>
- <protocol-bindings>##SOAP11_HTTP</protocol-bindings>
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd"> <handler-chain>
+ <handler>
+ <handler-name>ProducerSecurityCredentialHandler</handler-name>
+ <handler-class>org.wsrp.wss.jboss5.handlers.producer.WSSecurityCredentialHandler</handler-class>
+ </handler>
<handler>
<handler-name>ProducerWSSecurityHandler</handler-name>
- <handler-class>org.wsrp.wss.jboss5.handlers.ProducerWSSecurityHandler</handler-class>
+ <handler-class>org.wsrp.wss.jboss5.handlers.producer.JBWSSecurityHandlerWrapper</handler-class>
</handler>
</handler-chain>
</handler-chains>
Added: components/wsrp/trunk/wsrp-producer-war/src/main/webapp/WEB-INF/conf/gatein-wsse-producer.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/webapp/WEB-INF/conf/gatein-wsse-producer.xml (rev 0)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/webapp/WEB-INF/conf/gatein-wsse-producer.xml 2011-03-08 18:14:47 UTC (rev 5980)
@@ -0,0 +1,9 @@
+ <jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config
+ http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+
+ <config>
+ <username/>
+ </config>
+</jboss-ws-security>
13 years, 9 months
gatein SVN: r5979 - in epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui: portal and 1 other directory.
by do-not-reply@jboss.org
Author: mputz
Date: 2011-03-08 08:38:01 -0500 (Tue, 08 Mar 2011)
New Revision: 5979
Modified:
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
Log:
JBEPP-813: Translation of navigation elements not working for languages defined with country variant
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java 2011-03-08 13:36:52 UTC (rev 5978)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java 2011-03-08 13:38:01 UTC (rev 5979)
@@ -407,8 +407,9 @@
{
if (nav.getOwnerType().equals(PortalConfig.USER_TYPE))
return;
+ String localeLanguage = (locale.getCountry().length() > 0) ? locale.getLanguage() + "_" + locale.getCountry() : locale.getLanguage();
ResourceBundle res =
- i18nManager.getNavigationResourceBundle(locale.getLanguage(), nav.getOwnerType(), nav.getOwnerId());
+ i18nManager.getNavigationResourceBundle(localeLanguage, nav.getOwnerType(), nav.getOwnerId());
for (PageNode node : nav.getNodes())
{
resolveLabel(res, node);
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java 2011-03-08 13:36:52 UTC (rev 5978)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java 2011-03-08 13:38:01 UTC (rev 5979)
@@ -183,8 +183,9 @@
private void localizeNavigation(Locale locale)
{
+ String localeLanguage = (locale.getCountry().length() > 0) ? locale.getLanguage() + "_" + locale.getCountry() : locale.getLanguage();
LocaleConfig localeConfig =
- getApplicationComponent(LocaleConfigService.class).getLocaleConfig(locale.getLanguage());
+ getApplicationComponent(LocaleConfigService.class).getLocaleConfig(localeLanguage);
String ownerType = edittedNavigation.getOwnerType();
if (!PortalConfig.USER_TYPE.equals(ownerType))
{
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-03-08 13:36:52 UTC (rev 5978)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-03-08 13:38:01 UTC (rev 5979)
@@ -382,7 +382,8 @@
ResourceBundleManager mgr = getApplicationComponent(ResourceBundleManager.class);
if (nav.getOwnerType().equals(PortalConfig.USER_TYPE))
return;
- ResourceBundle res = mgr.getNavigationResourceBundle(locale.getLanguage(), nav.getOwnerType(), nav.getOwnerId());
+ String localeLanguage = (locale.getCountry().length() > 0) ? locale.getLanguage() + "_" + locale.getCountry() : locale.getLanguage();
+ ResourceBundle res = mgr.getNavigationResourceBundle(localeLanguage, nav.getOwnerType(), nav.getOwnerId());
for (PageNode node : nav.getNodes())
{
resolveLabel(res, node);
13 years, 9 months