[jboss-svn-commits] JBL Code SVN: r19683 - in labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product: etc/schemas/xml and 21 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Apr 22 07:25:25 EDT 2008
Author: tfennelly
Date: 2008-04-22 07:25:24 -0400 (Tue, 22 Apr 2008)
New Revision: 19683
Added:
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/GETHttpMethodFactory.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpHeader.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpMethodFactory.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpResponse.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpRouter.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/POSTHttpMethodFactory.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/ResponseType.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AbstractProtocolSocketFactoryBuilder.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AuthSSLProtocolSocketFactoryBuilder.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/ProtocolSocketFactoryBuilder.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/SelfSignedSSLProtocolSocketFactoryBuilder.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SSLUtil.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SelfSignedTrustManager.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/HttpRouter-localhost-https-9433.properties
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/build.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbm-queue-service.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbmq-queue-service.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbossesb-service.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jndi.properties
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/readme.txt
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/HttpResponsePrinter.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/HttpRequestPrinter.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/SendJMSMessage.java
Removed:
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/GETHttpMethodFactory.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpHeader.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpMethodFactory.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpResponse.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpRouter.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/POSTHttpMethodFactory.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/ResponseType.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AbstractProtocolSocketFactoryBuilder.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AuthSSLProtocolSocketFactoryBuilder.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/ProtocolSocketFactoryBuilder.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/SelfSignedSSLProtocolSocketFactoryBuilder.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SSLUtil.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SelfSignedTrustManager.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/HttpRouter-localhost-https-9433.properties
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/build.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbm-queue-service.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbmq-queue-service.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbossesb-service.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jndi.properties
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/readme.txt
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/HttpResponsePrinter.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/HttpRequestPrinter.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/SendJMSMessage.java
Modified:
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/build-distr.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/xml/jbossesb-1.0.1.xsd
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/configurators/HttpProtocol.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
Log:
HTTP Support: http://jira.jboss.com/jira/browse/JBESB-1585
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/build-distr.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/build-distr.xml 2008-04-22 10:33:16 UTC (rev 19682)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/build-distr.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -114,6 +114,8 @@
<fileset dir="${lib.ext.dir}" includes="mvel*.jar"/>
<!-- Quartz -->
<fileset dir="${lib.ext.dir}" includes="quartz*.jar"/>
+ <!-- Commons SSL -->
+ <fileset dir="${lib.ext.dir}" includes="commons-ssl-*.jar"/>
</copy>
<copy todir="${build.dir}/jbossesb.sar">
<fileset dir="${installation.files.dir}/jUDDI-registry" includes="juddi.war"/>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/xml/jbossesb-1.0.1.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2008-04-22 10:33:16 UTC (rev 19682)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1532,7 +1532,9 @@
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="http" />
+ <xsd:enumeration value="https" />
<xsd:enumeration value="socket" />
+ <xsd:enumeration value="sslsocket" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java 2008-04-22 10:33:16 UTC (rev 19682)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -48,7 +48,7 @@
* Unwrap the message payload before routing.
*/
public boolean unwrap = false;
- private MessagePayloadProxy payloadProxy;
+ protected MessagePayloadProxy payloadProxy;
/**
* Public constructor.
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java 2008-04-22 10:33:16 UTC (rev 19682)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -46,6 +46,8 @@
* </Action>
* </pre>
*
+ *
+ *
* @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
*/
public class HttpRouter extends AbstractActionPipelineProcessor {
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http)
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/GETHttpMethodFactory.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/GETHttpMethodFactory.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/GETHttpMethodFactory.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.actions.routing.http;
-
-import org.apache.commons.httpclient.HttpMethodBase;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-import java.io.IOException;
-import java.net.URL;
-
-/**
- * HTTP GET Factory.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class GETHttpMethodFactory implements HttpMethodFactory {
-
- private URL url;
-
- public void setEndpoint(URL url) {
- this.url = url;
- }
-
- public void setConfiguration(ConfigTree config) throws ConfigurationException {
- }
-
- public HttpMethodBase getInstance(Message message) throws IOException {
- return new GetMethod(url.toString());
- }
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/GETHttpMethodFactory.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/GETHttpMethodFactory.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/GETHttpMethodFactory.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/GETHttpMethodFactory.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.routing.http;
+
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * HTTP GET Factory.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class GETHttpMethodFactory implements HttpMethodFactory {
+
+ private URL url;
+
+ public void setEndpoint(URL url) {
+ this.url = url;
+ }
+
+ public void setConfiguration(ConfigTree config) throws ConfigurationException {
+ }
+
+ public HttpMethodBase getInstance(Message message) throws IOException {
+ return new GetMethod(url.toString());
+ }
+}
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpHeader.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpHeader.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpHeader.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.actions.routing.http;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-
-import java.io.Serializable;
-
-/**
- * Http header.
- * <p/>
- * Simple name-value pair.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class HttpHeader implements Serializable {
-
- private String name;
- private String value;
-
- public HttpHeader(String name, String value) {
- AssertArgument.isNotNullAndNotEmpty(name, "name");
- AssertArgument.isNotNullAndNotEmpty(value, "value");
- this.name = name;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
-
- public String getValue() {
- return value;
- }
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpHeader.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpHeader.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpHeader.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpHeader.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.routing.http;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+
+import java.io.Serializable;
+
+/**
+ * Http header.
+ * <p/>
+ * Simple name-value pair.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class HttpHeader implements Serializable {
+
+ private String name;
+ private String value;
+
+ public HttpHeader(String name, String value) {
+ AssertArgument.isNotNullAndNotEmpty(name, "name");
+ AssertArgument.isNotNullAndNotEmpty(value, "value");
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+}
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpMethodFactory.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpMethodFactory.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpMethodFactory.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.actions.routing.http;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.Configurable;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.apache.commons.httpclient.HttpMethodBase;
-
-import java.io.IOException;
-import java.net.URL;
-
-/**
- * Http method executor.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public interface HttpMethodFactory extends Configurable {
-
- public void setEndpoint(URL url);
-
- public HttpMethodBase getInstance(Message message) throws IOException;
-
- /**
- * Uitility factory class for reflective {@link HttpMethodFactory} construction.
- */
- public static class Factory {
-
- public static HttpMethodFactory getInstance(String method, ConfigTree config, URL endpointUrl) throws ConfigurationException {
- AssertArgument.isNotNullAndNotEmpty(method, "method");
- AssertArgument.isNotNull(config, "config");
- AssertArgument.isNotNull(endpointUrl, "endpointUrl");
-
- String className = HttpMethodFactory.class.getPackage().getName() + "." + method + HttpMethodFactory.class.getSimpleName();
-
- try {
- HttpMethodFactory factory = (HttpMethodFactory) ClassUtil.forName(className, HttpMethodFactory.class).newInstance();
- factory.setEndpoint(endpointUrl);
- factory.setConfiguration(config);
- return factory;
- } catch (ClassCastException e) {
- throw new ConfigurationException("Class '" + className + "' must implement '" + HttpMethodFactory.class.getName() + "'.");
- } catch (ClassNotFoundException e) {
- throw new ConfigurationException("Class '" + className + "' not found on classpath.");
- } catch (IllegalAccessException e) {
- throw new ConfigurationException("Class '" + className + "' cannot be instantiated.", e);
- } catch (InstantiationException e) {
- throw new ConfigurationException("Class '" + className + "' cannot be instantiated.", e);
- }
- }
-
- }
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpMethodFactory.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpMethodFactory.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpMethodFactory.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpMethodFactory.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.routing.http;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.Configurable;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.apache.commons.httpclient.HttpMethodBase;
+
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * Http method executor.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public interface HttpMethodFactory extends Configurable {
+
+ public void setEndpoint(URL url);
+
+ public HttpMethodBase getInstance(Message message) throws IOException;
+
+ /**
+ * Uitility factory class for reflective {@link HttpMethodFactory} construction.
+ */
+ public static class Factory {
+
+ public static HttpMethodFactory getInstance(String method, ConfigTree config, URL endpointUrl) throws ConfigurationException {
+ AssertArgument.isNotNullAndNotEmpty(method, "method");
+ AssertArgument.isNotNull(config, "config");
+ AssertArgument.isNotNull(endpointUrl, "endpointUrl");
+
+ String className = HttpMethodFactory.class.getPackage().getName() + "." + method + HttpMethodFactory.class.getSimpleName();
+
+ try {
+ HttpMethodFactory factory = (HttpMethodFactory) ClassUtil.forName(className, HttpMethodFactory.class).newInstance();
+ factory.setEndpoint(endpointUrl);
+ factory.setConfiguration(config);
+ return factory;
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Class '" + className + "' must implement '" + HttpMethodFactory.class.getName() + "'.");
+ } catch (ClassNotFoundException e) {
+ throw new ConfigurationException("Class '" + className + "' not found on classpath.");
+ } catch (IllegalAccessException e) {
+ throw new ConfigurationException("Class '" + className + "' cannot be instantiated.", e);
+ } catch (InstantiationException e) {
+ throw new ConfigurationException("Class '" + className + "' cannot be instantiated.", e);
+ }
+ }
+
+ }
+}
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpResponse.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpResponse.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpResponse.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.actions.routing.http;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class HttpResponse implements Serializable {
-
- public static final String RESPONSE_KEY = HttpResponse.class.getName() + "#response";
-
- private int responseCode;
- private long length;
- private String encoding;
- private List<HttpHeader> headers = new ArrayList<HttpHeader>();
-
- public HttpResponse(int responseCode) {
- this.responseCode = responseCode;
- }
-
- public int getResponseCode() {
- return responseCode;
- }
-
- public long getLength() {
- return length;
- }
-
- public void setLength(long length) {
- this.length = length;
- }
-
- public String getEncoding() {
- return encoding;
- }
-
- public void setEncoding(String encoding) {
- this.encoding = encoding;
- }
-
- public List<HttpHeader> getHeaders() {
- return headers;
- }
-
- public void addHeader(HttpHeader header) {
- AssertArgument.isNotNull(header, "header");
- headers.add(header);
- }
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpResponse.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpResponse.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpResponse.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpResponse.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.routing.http;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class HttpResponse implements Serializable {
+
+ public static final String RESPONSE_KEY = HttpResponse.class.getName() + "#response";
+
+ private int responseCode;
+ private long length;
+ private String encoding;
+ private List<HttpHeader> headers = new ArrayList<HttpHeader>();
+
+ public HttpResponse(int responseCode) {
+ this.responseCode = responseCode;
+ }
+
+ public int getResponseCode() {
+ return responseCode;
+ }
+
+ public long getLength() {
+ return length;
+ }
+
+ public void setLength(long length) {
+ this.length = length;
+ }
+
+ public String getEncoding() {
+ return encoding;
+ }
+
+ public void setEncoding(String encoding) {
+ this.encoding = encoding;
+ }
+
+ public List<HttpHeader> getHeaders() {
+ return headers;
+ }
+
+ public void addHeader(HttpHeader header) {
+ AssertArgument.isNotNull(header, "header");
+ headers.add(header);
+ }
+}
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpRouter.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpRouter.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpRouter.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,186 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.actions.routing.http;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethodBase;
-import org.apache.commons.httpclient.HttpStatus;
-import org.apache.commons.httpclient.Header;
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.http.HttpClientFactory;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.routing.AbstractRouter;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.internal.soa.esb.util.StreamUtils;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Properties;
-
-/**
- * Http router.
- * <p/>
- * Uses HttpClient via the <a href="http://wiki.jboss.org/wiki/Wiki.jsp?page=HttpClientFactory">HttpClientFactory</a>.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class HttpRouter extends AbstractRouter {
-
- private static Logger logger = Logger.getLogger(HttpRouter.class);
-
- private ConfigTree config;
- private Properties httpClientProps = new Properties();
- private HttpClient httpclient;
- private URL endpointUrl;
- private String method;
- private HttpMethodFactory methodFactory;
- private ResponseType responseType;
- private String contentType;
- private ConfigTree[] requestHeaders;
-
- public HttpRouter(ConfigTree config) throws ConfigurationException {
- super(config);
- this.config = config;
- try {
- endpointUrl = new URL(config.getRequiredAttribute("endpointUrl"));
- } catch (MalformedURLException e) {
- throw new ConfigurationException("Invalid endpoint URL '" + config.getRequiredAttribute("endpointUrl") + "'.", e);
- }
-
- // Extract the HttpClient creation properties from the ConfigTree. These are passed
- // to the HttpClientFacatory...
- extractHttpClientProps(config);
- httpclient = HttpClientFactory.createHttpClient(httpClientProps);
- method = config.getRequiredAttribute("method");
- responseType = ResponseType.valueOf(config.getAttribute("responseType", ResponseType.STRING.toString()));
- methodFactory = HttpMethodFactory.Factory.getInstance(method, config, endpointUrl);
- contentType = config.getAttribute("Content-Type", "text/xml;charset=UTF-8");
- requestHeaders = config.getChildren("header");
- }
-
- public Message process(Message message) throws ActionProcessingException {
- HttpMethodBase method = null;
- try {
- method = methodFactory.getInstance(message);
-
- try {
- setRequestHeaders(method);
-
- int responseCode = httpclient.executeMethod(method);
- if(responseCode != HttpStatus.SC_OK) {
- logger.warn("Received status code '" + responseCode + "' on HTTP " + method + " request to '" + endpointUrl + "'.");
- }
- attachResponseDetails(message, method, responseCode);
-
- InputStream resultStream = method.getResponseBodyAsStream();
- try {
- byte[] bytes = StreamUtils.readStream(resultStream);
-
- if(responseType == ResponseType.STRING) {
- getPayloadProxy().setPayload(message, new String(bytes, method.getResponseCharSet()));
- } else {
- getPayloadProxy().setPayload(message, bytes);
- }
- } catch (MessageDeliverException e) {
- e.printStackTrace();
- } finally {
- resultStream.close();
- }
- } finally {
- method.releaseConnection();
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return message;
- }
-
- private void attachResponseDetails(Message message, HttpMethodBase method, int responseCode) {
- HttpResponse response = new HttpResponse(responseCode);
-
- response.setEncoding(method.getResponseCharSet());
- response.setLength(method.getResponseContentLength());
-
- Header[] responseHeaders = method.getRequestHeaders();
- for(Header responseHeader : responseHeaders) {
- response.addHeader(new HttpHeader(responseHeader.getName(), responseHeader.getValue()));
- }
-
- message.getBody().add(HttpResponse.RESPONSE_KEY, response);
- }
-
- private void setRequestHeaders(HttpMethodBase method) {
- method.setRequestHeader("Content-Type", contentType);
-
- for (int i = 0; i < requestHeaders.length; i++) {
- ConfigTree header = requestHeaders[i];
- String name = header.getAttribute("name");
- String value = header.getAttribute("value");
-
- if(name != null && value != null) {
- method.setRequestHeader(name, value);
- } else {
- logger.error("null Http request header name/value: '" + name + "':'" + value + "'.");
- }
- }
- }
-
- public void route(Object object) throws ActionProcessingException {
- // Not used!
- }
-
- public void destroy() throws ActionLifecycleException {
- if (httpclient != null) {
- HttpClientFactory.shutdown(httpclient);
- }
- super.destroy();
- }
-
- private void extractHttpClientProps(ConfigTree config) {
- ConfigTree[] httpClientConfigTrees = config.getChildren("http-client-property");
-
- httpClientProps.setProperty(HttpClientFactory.TARGET_HOST_URL, endpointUrl.toString());
- final ConfigTree parent = config.getParent() ;
- if (parent != null) {
- final String maxThreads = config.getParent().getAttribute(ListenerTagNames.MAX_THREADS_TAG) ;
- if (maxThreads != null) {
- httpClientProps.setProperty(HttpClientFactory.MAX_TOTAL_CONNECTIONS, maxThreads) ;
- }
- }
-
- // The HttpClient properties are attached under the factory class/impl property as <http-client-property name="x" value="y" /> nodes
- for(ConfigTree httpClientProp : httpClientConfigTrees) {
- String propName = httpClientProp.getAttribute("name");
- String propValue = httpClientProp.getAttribute("value");
-
- if(propName != null && propValue != null) {
- httpClientProps.setProperty(propName, propValue);
- }
- }
- }
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpRouter.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpRouter.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpRouter.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpRouter.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,186 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.routing.http;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.Header;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.http.HttpClientFactory;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.routing.AbstractRouter;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Properties;
+
+/**
+ * Http router.
+ * <p/>
+ * Uses HttpClient via the <a href="http://wiki.jboss.org/wiki/Wiki.jsp?page=HttpClientFactory">HttpClientFactory</a>.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class HttpRouter extends AbstractRouter {
+
+ private static Logger logger = Logger.getLogger(HttpRouter.class);
+
+ private ConfigTree config;
+ private Properties httpClientProps = new Properties();
+ private HttpClient httpclient;
+ private URL endpointUrl;
+ private String method;
+ private HttpMethodFactory methodFactory;
+ private ResponseType responseType;
+ private String contentType;
+ private ConfigTree[] requestHeaders;
+
+ public HttpRouter(ConfigTree config) throws ConfigurationException {
+ super(config);
+ this.config = config;
+ try {
+ endpointUrl = new URL(config.getRequiredAttribute("endpointUrl"));
+ } catch (MalformedURLException e) {
+ throw new ConfigurationException("Invalid endpoint URL '" + config.getRequiredAttribute("endpointUrl") + "'.", e);
+ }
+
+ // Extract the HttpClient creation properties from the ConfigTree. These are passed
+ // to the HttpClientFacatory...
+ extractHttpClientProps(config);
+ httpclient = HttpClientFactory.createHttpClient(httpClientProps);
+ method = config.getRequiredAttribute("method");
+ responseType = ResponseType.valueOf(config.getAttribute("responseType", ResponseType.STRING.toString()));
+ methodFactory = HttpMethodFactory.Factory.getInstance(method, config, endpointUrl);
+ contentType = config.getAttribute("Content-Type", "text/xml;charset=UTF-8");
+ requestHeaders = config.getChildren("header");
+ }
+
+ public Message process(Message message) throws ActionProcessingException {
+ HttpMethodBase method = null;
+ try {
+ method = methodFactory.getInstance(message);
+
+ try {
+ setRequestHeaders(method);
+
+ int responseCode = httpclient.executeMethod(method);
+ if(responseCode != HttpStatus.SC_OK) {
+ logger.warn("Received status code '" + responseCode + "' on HTTP " + method + " request to '" + endpointUrl + "'.");
+ }
+ attachResponseDetails(message, method, responseCode);
+
+ InputStream resultStream = method.getResponseBodyAsStream();
+ try {
+ byte[] bytes = StreamUtils.readStream(resultStream);
+
+ if(responseType == ResponseType.STRING) {
+ getPayloadProxy().setPayload(message, new String(bytes, method.getResponseCharSet()));
+ } else {
+ getPayloadProxy().setPayload(message, bytes);
+ }
+ } catch (MessageDeliverException e) {
+ e.printStackTrace();
+ } finally {
+ resultStream.close();
+ }
+ } finally {
+ method.releaseConnection();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return message;
+ }
+
+ private void attachResponseDetails(Message message, HttpMethodBase method, int responseCode) {
+ HttpResponse response = new HttpResponse(responseCode);
+
+ response.setEncoding(method.getResponseCharSet());
+ response.setLength(method.getResponseContentLength());
+
+ Header[] responseHeaders = method.getRequestHeaders();
+ for(Header responseHeader : responseHeaders) {
+ response.addHeader(new HttpHeader(responseHeader.getName(), responseHeader.getValue()));
+ }
+
+ message.getBody().add(HttpResponse.RESPONSE_KEY, response);
+ }
+
+ private void setRequestHeaders(HttpMethodBase method) {
+ method.setRequestHeader("Content-Type", contentType);
+
+ for (int i = 0; i < requestHeaders.length; i++) {
+ ConfigTree header = requestHeaders[i];
+ String name = header.getAttribute("name");
+ String value = header.getAttribute("value");
+
+ if(name != null && value != null) {
+ method.setRequestHeader(name, value);
+ } else {
+ logger.error("null Http request header name/value: '" + name + "':'" + value + "'.");
+ }
+ }
+ }
+
+ public void route(Object object) throws ActionProcessingException {
+ // Not used!
+ }
+
+ public void destroy() throws ActionLifecycleException {
+ if (httpclient != null) {
+ HttpClientFactory.shutdown(httpclient);
+ }
+ super.destroy();
+ }
+
+ private void extractHttpClientProps(ConfigTree config) {
+ ConfigTree[] httpClientConfigTrees = config.getChildren("http-client-property");
+
+ httpClientProps.setProperty(HttpClientFactory.TARGET_HOST_URL, endpointUrl.toString());
+ final ConfigTree parent = config.getParent() ;
+ if (parent != null) {
+ final String maxThreads = config.getParent().getAttribute(ListenerTagNames.MAX_THREADS_TAG) ;
+ if (maxThreads != null) {
+ httpClientProps.setProperty(HttpClientFactory.MAX_TOTAL_CONNECTIONS, maxThreads) ;
+ }
+ }
+
+ // The HttpClient properties are attached under the factory class/impl property as <http-client-property name="x" value="y" /> nodes
+ for(ConfigTree httpClientProp : httpClientConfigTrees) {
+ String propName = httpClientProp.getAttribute("name");
+ String propValue = httpClientProp.getAttribute("value");
+
+ if(propName != null && propValue != null) {
+ httpClientProps.setProperty(propName, propValue);
+ }
+ }
+ }
+}
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/POSTHttpMethodFactory.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/POSTHttpMethodFactory.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/POSTHttpMethodFactory.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.actions.routing.http;
-
-import org.apache.commons.httpclient.HttpMethodBase;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.StringRequestEntity;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.MessagePayloadProxy;
-
-import java.io.IOException;
-import java.net.URL;
-
-/**
- * HTTP POST Factory.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class POSTHttpMethodFactory implements HttpMethodFactory {
-
- private URL url;
- private MessagePayloadProxy payloadProxy;
-
- public void setEndpoint(URL url) {
- this.url = url;
- }
-
- public void setConfiguration(ConfigTree config) throws ConfigurationException {
- payloadProxy = new MessagePayloadProxy(config);
- }
-
- public HttpMethodBase getInstance(Message message) throws IOException {
- PostMethod method = new PostMethod(url.toString());
- try {
- method.setRequestEntity(new StringRequestEntity(payloadProxy.getPayload(message).toString()));
- } catch (MessageDeliverException e) {
- IOException ioe = new IOException("Failed to access message payload.");
- ioe.initCause(e);
- throw ioe;
- }
- return method;
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/POSTHttpMethodFactory.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/POSTHttpMethodFactory.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/POSTHttpMethodFactory.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/POSTHttpMethodFactory.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.routing.http;
+
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
+
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * HTTP POST Factory.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class POSTHttpMethodFactory implements HttpMethodFactory {
+
+ private URL url;
+ private MessagePayloadProxy payloadProxy;
+
+ public void setEndpoint(URL url) {
+ this.url = url;
+ }
+
+ public void setConfiguration(ConfigTree config) throws ConfigurationException {
+ payloadProxy = new MessagePayloadProxy(config);
+ }
+
+ public HttpMethodBase getInstance(Message message) throws IOException {
+ PostMethod method = new PostMethod(url.toString());
+ try {
+ method.setRequestEntity(new StringRequestEntity(payloadProxy.getPayload(message).toString()));
+ } catch (MessageDeliverException e) {
+ IOException ioe = new IOException("Failed to access message payload.");
+ ioe.initCause(e);
+ throw ioe;
+ }
+ return method;
+ }
+}
\ No newline at end of file
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/ResponseType.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/ResponseType.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/ResponseType.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.actions.routing.http;
-
-/**
- * Http Response type.
- * <p/>
- * Response payload mime ('ish) type enumeration.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public enum ResponseType {
- STRING,
- BYTES
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/ResponseType.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/ResponseType.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/ResponseType.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/actions/routing/http/ResponseType.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.routing.http;
+
+/**
+ * Http Response type.
+ * <p/>
+ * Response payload mime ('ish) type enumeration.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public enum ResponseType {
+ STRING,
+ BYTES
+}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/configurators/HttpProtocol.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/configurators/HttpProtocol.java 2008-04-22 10:33:16 UTC (rev 19682)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/configurators/HttpProtocol.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -21,24 +21,28 @@
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.contrib.ssl.StrictSSLProtocolSocketFactory;
-import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
import org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory;
import org.apache.commons.httpclient.protocol.Protocol;
+import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
import org.apache.commons.ssl.KeyMaterial;
import org.apache.commons.ssl.SSLClient;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.http.Configurator;
+import org.jboss.soa.esb.http.protocol.ProtocolSocketFactoryBuilder;
import org.jboss.soa.esb.util.ClassUtil;
-import java.util.Properties;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
-import java.io.*;
import java.security.GeneralSecurityException;
+import java.security.KeyManagementException;
+import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
-import java.security.KeyStoreException;
-import java.security.KeyManagementException;
import java.security.cert.CertificateException;
+import java.util.Properties;
/**
* HTTP Protocol configurator.
@@ -53,8 +57,10 @@
* <li><b>keystore-passwd</b>: (Optional). See {@link KeyMaterial}. Defaults to "changeit".</li>
* <li><b>protocol-socket-factory</b>: See {@link Protocol}. (Optional).
* Defaults to {@link StrictSSLProtocolSocketFactory} for HTTPS, otherwise defaults to {@link DefaultProtocolSocketFactory}.
- * Configure with {@link org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory} if you wish
- * to allow the target server to authenticate with a self-signed certificate</li>
+ * Configure with {@link org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory} for unauthenticated
+ * SSL. To authenticate with a self-signed certificate, use the
+ * {@link org.jboss.soa.esb.http.protocol.SelfSignedSSLProtocolSocketFactoryBuilder} (test/demo only) and to perform
+ * full authentication (2way) with CA Signed certs, use the {@link org.jboss.soa.esb.http.protocol.AuthSSLProtocolSocketFactoryBuilder}.</li>
* </ul>
* <p/>
* See <a href="http://jakarta.apache.org/commons/httpclient/sslguide.html">HttpClient HttpProtocol Guide</a>.
@@ -91,7 +97,7 @@
}
}
assertPropertySetAndNotBlank(factory, "protocol-socket-factory");
- socketFactory = createFactoryClass(factory, keyMaterial);
+ socketFactory = createFactoryClass(factory, keyMaterial, properties);
// And finally... configure the host with the protocol....
protocol = new Protocol(scheme, socketFactory, port);
@@ -138,11 +144,25 @@
throw new ConfigurationException("Failed to locate keystore '" + keyStore + "'.");
}
- private ProtocolSocketFactory createFactoryClass(String factory, KeyMaterial keyMaterial) throws ConfigurationException {
+ private ProtocolSocketFactory createFactoryClass(String factory, KeyMaterial keyMaterial, Properties properties) throws ConfigurationException {
ProtocolSocketFactory socketFactory = null;
try {
- socketFactory = (ProtocolSocketFactory) ClassUtil.forName(factory, HttpProtocol.class).newInstance();
+ Class factoryClass = ClassUtil.forName(factory, HttpProtocol.class);
+
+ if(ProtocolSocketFactoryBuilder.class.isAssignableFrom(factoryClass)) {
+ try {
+ ProtocolSocketFactoryBuilder factoryBuilder = (ProtocolSocketFactoryBuilder) factoryClass.newInstance();
+ factoryBuilder.setConfiguration(properties);
+ socketFactory = factoryBuilder.newInstance();
+ } catch (InstantiationException e) {
+ throw new ConfigurationException("Failed to instantiate ProtocolSocketFactoryBuilder implementation class [" + factory + "]. Must provide a default constructor.", e);
+ } catch (IllegalAccessException e) {
+ throw new ConfigurationException("Failed to instantiate ProtocolSocketFactoryBuilder implementation class [" + factory + "]. Must provide a default constructor.", e);
+ }
+ } else {
+ socketFactory = (ProtocolSocketFactory) factoryClass.newInstance();
+ }
} catch (ClassCastException e) {
throw new ConfigurationException("Class [" + factory + "] must implement [" + ProtocolSocketFactory.class.getName() + "].", e);
} catch (ClassNotFoundException e) {
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/http/protocol)
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AbstractProtocolSocketFactoryBuilder.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/http/protocol/AbstractProtocolSocketFactoryBuilder.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AbstractProtocolSocketFactoryBuilder.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,144 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.http.protocol;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.util.ssl.SSLUtil;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.KeyStore;
-import java.security.NoSuchAlgorithmException;
-import java.security.KeyStoreException;
-import java.security.cert.CertificateException;
-import java.util.Properties;
-
-/**
- * Abstract {@link ProtocolSocketFactoryBuilder} providing utility methods
- * for concrete implementations.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class AbstractProtocolSocketFactoryBuilder implements ProtocolSocketFactoryBuilder {
-
- private Properties configuration;
-
- public void setConfiguration(Properties configuration) throws ConfigurationException {
- this.configuration = configuration;
- }
-
- protected String getTruststorePassword() {
- return configuration.getProperty("truststore-passw");
- }
-
- protected String getKeystorePassword() {
- return configuration.getProperty("keystore-passw");
- }
-
- protected String getKeystoreType() {
- return configuration.getProperty("keystore-type", "jks");
- }
-
- protected String getTruststoreType() {
- return configuration.getProperty("truststore-type", "jks");
- }
-
- protected URL getTruststoreURL() throws ConfigurationException {
- URL trustStoreURL = null;
- String trustStoreConfig = configuration.getProperty("truststore");
-
- if(trustStoreConfig != null) {
- try {
- trustStoreURL = new URL(trustStoreConfig);
- } catch (MalformedURLException e) {
- throw new ConfigurationException("Invalid 'truststore' config. Must be valid URL.", e);
- }
- }
-
- return trustStoreURL;
- }
-
- protected URL getKeystoreURL() throws ConfigurationException {
- String keyStoreConfig = configuration.getProperty("keystore");
- URL keyStoreURL = null;
-
- if(keyStoreConfig != null) {
- try {
- keyStoreURL = new URL(keyStoreConfig);
- } catch (MalformedURLException e) {
- throw new ConfigurationException("Invalid 'keystore' config. Must be valid URL.", e);
- }
- }
-
- return keyStoreURL;
- }
-
- protected KeyStore getKeystore() throws ConfigurationException {
- URL url = getKeystoreURL();
-
- if(url != null) {
- try {
- InputStream keystoreStream = url.openStream();
- if(keystoreStream != null) {
- return SSLUtil.loadKeyStore(keystoreStream, getKeystoreType(), getKeystorePassword());
- } else {
- throw new ConfigurationException("Unable to open keystore '" + url.toString() + "' for loading.");
- }
- } catch (IOException e) {
- throw new ConfigurationException("Unable to open keystore '" + url.toString() + "' for loading.", e);
- } catch (NoSuchAlgorithmException e) {
- throw new ConfigurationException("Unable to load keystore '" + url.toString() + "'.", e);
- } catch (KeyStoreException e) {
- throw new ConfigurationException("Unable to load keystore '" + url.toString() + "'.", e);
- } catch (CertificateException e) {
- throw new ConfigurationException("Unable to load keystore '" + url.toString() + "'.", e);
- }
- }
-
- return null;
- }
-
- protected KeyStore getTruststore() throws ConfigurationException {
- URL url = getTruststoreURL();
-
- if(url != null) {
- try {
- InputStream truststoreStream = url.openStream();
- if(truststoreStream != null) {
- return SSLUtil.loadKeyStore(truststoreStream, getTruststoreType(), getTruststorePassword());
- } else {
- throw new ConfigurationException("Unable to open truststore '" + url.toString() + "' for loading.");
- }
- } catch (IOException e) {
- throw new ConfigurationException("Unable to open truststore '" + url.toString() + "' for loading.", e);
- } catch (NoSuchAlgorithmException e) {
- throw new ConfigurationException("Unable to load truststore '" + url.toString() + "'.", e);
- } catch (KeyStoreException e) {
- throw new ConfigurationException("Unable to load truststore '" + url.toString() + "'.", e);
- } catch (CertificateException e) {
- throw new ConfigurationException("Unable to load truststore '" + url.toString() + "'.", e);
- }
- }
-
- return null;
- }
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AbstractProtocolSocketFactoryBuilder.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/http/protocol/AbstractProtocolSocketFactoryBuilder.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AbstractProtocolSocketFactoryBuilder.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AbstractProtocolSocketFactoryBuilder.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.http.protocol;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.util.ssl.SSLUtil;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.KeyStoreException;
+import java.security.cert.CertificateException;
+import java.util.Properties;
+
+/**
+ * Abstract {@link ProtocolSocketFactoryBuilder} providing utility methods
+ * for concrete implementations.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract class AbstractProtocolSocketFactoryBuilder implements ProtocolSocketFactoryBuilder {
+
+ private Properties configuration;
+
+ public void setConfiguration(Properties configuration) throws ConfigurationException {
+ this.configuration = configuration;
+ }
+
+ protected String getTruststorePassword() {
+ return configuration.getProperty("truststore-passw");
+ }
+
+ protected String getKeystorePassword() {
+ return configuration.getProperty("keystore-passw");
+ }
+
+ protected String getKeystoreType() {
+ return configuration.getProperty("keystore-type", "jks");
+ }
+
+ protected String getTruststoreType() {
+ return configuration.getProperty("truststore-type", "jks");
+ }
+
+ protected URL getTruststoreURL() throws ConfigurationException {
+ URL trustStoreURL = null;
+ String trustStoreConfig = configuration.getProperty("truststore");
+
+ if(trustStoreConfig != null) {
+ try {
+ trustStoreURL = new URL(trustStoreConfig);
+ } catch (MalformedURLException e) {
+ throw new ConfigurationException("Invalid 'truststore' config. Must be valid URL.", e);
+ }
+ }
+
+ return trustStoreURL;
+ }
+
+ protected URL getKeystoreURL() throws ConfigurationException {
+ String keyStoreConfig = configuration.getProperty("keystore");
+ URL keyStoreURL = null;
+
+ if(keyStoreConfig != null) {
+ try {
+ keyStoreURL = new URL(keyStoreConfig);
+ } catch (MalformedURLException e) {
+ throw new ConfigurationException("Invalid 'keystore' config. Must be valid URL.", e);
+ }
+ }
+
+ return keyStoreURL;
+ }
+
+ protected KeyStore getKeystore() throws ConfigurationException {
+ URL url = getKeystoreURL();
+
+ if(url != null) {
+ try {
+ InputStream keystoreStream = url.openStream();
+ if(keystoreStream != null) {
+ return SSLUtil.loadKeyStore(keystoreStream, getKeystoreType(), getKeystorePassword());
+ } else {
+ throw new ConfigurationException("Unable to open keystore '" + url.toString() + "' for loading.");
+ }
+ } catch (IOException e) {
+ throw new ConfigurationException("Unable to open keystore '" + url.toString() + "' for loading.", e);
+ } catch (NoSuchAlgorithmException e) {
+ throw new ConfigurationException("Unable to load keystore '" + url.toString() + "'.", e);
+ } catch (KeyStoreException e) {
+ throw new ConfigurationException("Unable to load keystore '" + url.toString() + "'.", e);
+ } catch (CertificateException e) {
+ throw new ConfigurationException("Unable to load keystore '" + url.toString() + "'.", e);
+ }
+ }
+
+ return null;
+ }
+
+ protected KeyStore getTruststore() throws ConfigurationException {
+ URL url = getTruststoreURL();
+
+ if(url != null) {
+ try {
+ InputStream truststoreStream = url.openStream();
+ if(truststoreStream != null) {
+ return SSLUtil.loadKeyStore(truststoreStream, getTruststoreType(), getTruststorePassword());
+ } else {
+ throw new ConfigurationException("Unable to open truststore '" + url.toString() + "' for loading.");
+ }
+ } catch (IOException e) {
+ throw new ConfigurationException("Unable to open truststore '" + url.toString() + "' for loading.", e);
+ } catch (NoSuchAlgorithmException e) {
+ throw new ConfigurationException("Unable to load truststore '" + url.toString() + "'.", e);
+ } catch (KeyStoreException e) {
+ throw new ConfigurationException("Unable to load truststore '" + url.toString() + "'.", e);
+ } catch (CertificateException e) {
+ throw new ConfigurationException("Unable to load truststore '" + url.toString() + "'.", e);
+ }
+ }
+
+ return null;
+ }
+}
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AuthSSLProtocolSocketFactoryBuilder.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/http/protocol/AuthSSLProtocolSocketFactoryBuilder.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AuthSSLProtocolSocketFactoryBuilder.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.http.protocol;
-
-import org.apache.commons.httpclient.contrib.ssl.AuthSSLProtocolSocketFactory;
-import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
-import org.jboss.soa.esb.ConfigurationException;
-
-import java.net.URL;
-import java.security.GeneralSecurityException;
-import java.io.IOException;
-
-/**
- * Creates and configures an instance of the {@link org.apache.commons.httpclient.contrib.ssl.AuthSSLProtocolSocketFactory}
- * class for 2way authentication.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class AuthSSLProtocolSocketFactoryBuilder extends AbstractProtocolSocketFactoryBuilder {
-
- public ProtocolSocketFactory newInstance() throws ConfigurationException {
- String keyStorePW = getKeystorePassword();
- String trustStorePW = getTruststorePassword();
- URL keyStoreURL = getKeystoreURL();
- URL trustStoreURL = getTruststoreURL();
-
- try {
- return new AuthSSLProtocolSocketFactory(keyStoreURL, keyStorePW, trustStoreURL, trustStorePW);
- } catch (GeneralSecurityException e) {
- throw new ConfigurationException("Failed to create AuthSSLProtocolSocketFactory instance.", e);
- } catch (IOException e) {
- throw new ConfigurationException("Failed to create AuthSSLProtocolSocketFactory instance.", e);
- }
- }
-
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AuthSSLProtocolSocketFactoryBuilder.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/http/protocol/AuthSSLProtocolSocketFactoryBuilder.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AuthSSLProtocolSocketFactoryBuilder.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/AuthSSLProtocolSocketFactoryBuilder.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.http.protocol;
+
+import org.apache.commons.httpclient.contrib.ssl.AuthSSLProtocolSocketFactory;
+import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
+import org.jboss.soa.esb.ConfigurationException;
+
+import java.net.URL;
+import java.security.GeneralSecurityException;
+import java.io.IOException;
+
+/**
+ * Creates and configures an instance of the {@link org.apache.commons.httpclient.contrib.ssl.AuthSSLProtocolSocketFactory}
+ * class for 2way authentication.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class AuthSSLProtocolSocketFactoryBuilder extends AbstractProtocolSocketFactoryBuilder {
+
+ public ProtocolSocketFactory newInstance() throws ConfigurationException {
+ String keyStorePW = getKeystorePassword();
+ String trustStorePW = getTruststorePassword();
+ URL keyStoreURL = getKeystoreURL();
+ URL trustStoreURL = getTruststoreURL();
+
+ try {
+ return new AuthSSLProtocolSocketFactory(keyStoreURL, keyStorePW, trustStoreURL, trustStorePW);
+ } catch (GeneralSecurityException e) {
+ throw new ConfigurationException("Failed to create AuthSSLProtocolSocketFactory instance.", e);
+ } catch (IOException e) {
+ throw new ConfigurationException("Failed to create AuthSSLProtocolSocketFactory instance.", e);
+ }
+ }
+
+}
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/ProtocolSocketFactoryBuilder.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/http/protocol/ProtocolSocketFactoryBuilder.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/ProtocolSocketFactoryBuilder.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.http.protocol;
-
-import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
-import org.jboss.soa.esb.ConfigurationException;
-
-import java.util.Properties;
-
-/**
- * {@link ProtocolSocketFactory} Builder.
- * <p/>
- * This builder is needed because some of the HttpClient ProtocolSocketFactory
- * are not easily created and configured reflectively.
- * <p/>
- * <b>Implementations must provide a default (no-arg) constructor.</b>
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public interface ProtocolSocketFactoryBuilder {
-
- /**
- * Set the builder configuration.
- * @param configuration The configuration.
- * @throws ConfigurationException Bad configuration.
- */
- public void setConfiguration(Properties configuration) throws ConfigurationException;
-
- /**
- * Create a new instance of the {@link ProtocolSocketFactory} based on the supplied
- * {@link org.jboss.soa.esb.http.HttpClientFactory} configuration.
- *
- * @return The configured ProtocolSocketFactory implementation.
- * @throws ConfigurationException Bad configuration.
- */
- public ProtocolSocketFactory newInstance() throws ConfigurationException;
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/ProtocolSocketFactoryBuilder.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/http/protocol/ProtocolSocketFactoryBuilder.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/ProtocolSocketFactoryBuilder.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/ProtocolSocketFactoryBuilder.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.http.protocol;
+
+import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
+import org.jboss.soa.esb.ConfigurationException;
+
+import java.util.Properties;
+
+/**
+ * {@link ProtocolSocketFactory} Builder.
+ * <p/>
+ * This builder is needed because some of the HttpClient ProtocolSocketFactory
+ * are not easily created and configured reflectively.
+ * <p/>
+ * <b>Implementations must provide a default (no-arg) constructor.</b>
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public interface ProtocolSocketFactoryBuilder {
+
+ /**
+ * Set the builder configuration.
+ * @param configuration The configuration.
+ * @throws ConfigurationException Bad configuration.
+ */
+ public void setConfiguration(Properties configuration) throws ConfigurationException;
+
+ /**
+ * Create a new instance of the {@link ProtocolSocketFactory} based on the supplied
+ * {@link org.jboss.soa.esb.http.HttpClientFactory} configuration.
+ *
+ * @return The configured ProtocolSocketFactory implementation.
+ * @throws ConfigurationException Bad configuration.
+ */
+ public ProtocolSocketFactory newInstance() throws ConfigurationException;
+}
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/SelfSignedSSLProtocolSocketFactoryBuilder.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/http/protocol/SelfSignedSSLProtocolSocketFactoryBuilder.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/SelfSignedSSLProtocolSocketFactoryBuilder.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.http.protocol;
-
-import org.apache.commons.httpclient.ConnectTimeoutException;
-import org.apache.commons.httpclient.params.HttpConnectionParams;
-import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
-import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.util.ssl.SSLUtil;
-import org.jboss.soa.esb.util.ssl.SelfSignedTrustManager;
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-
-import javax.net.SocketFactory;
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import java.io.IOException;
-import java.net.*;
-import java.security.*;
-
-/**
- * Builder for creating a ProtocolSocketFactory that supports Self-Signed Server
- * certificates.
- * <p/>
- * <b>For test/demo purposes only.</b>
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class SelfSignedSSLProtocolSocketFactoryBuilder extends AbstractProtocolSocketFactoryBuilder {
-
- public ProtocolSocketFactory newInstance() throws ConfigurationException {
- try {
- return new SelfSignedSSLProtocolSocketFactory(getKeystore(), getKeystorePassword(), getTruststore());
- } catch (NoSuchAlgorithmException e) {
- throw new ConfigurationException("Failed to create SelfSignedSSLProtocolSocketFactory.", e);
- } catch (KeyStoreException e) {
- throw new ConfigurationException("Failed to create SelfSignedSSLProtocolSocketFactory.", e);
- } catch (UnrecoverableKeyException e) {
- throw new ConfigurationException("Failed to create SelfSignedSSLProtocolSocketFactory.", e);
- }
- }
-
- private static class SelfSignedSSLProtocolSocketFactory implements SecureProtocolSocketFactory {
-
- private SSLContext sslContext;
-
- public SelfSignedSSLProtocolSocketFactory(KeyStore keystore, String keystorePassword, KeyStore truststore) throws NoSuchAlgorithmException, KeyStoreException, ConfigurationException, UnrecoverableKeyException {
- KeyManager[] keyManagers = SSLUtil.getKeyManagers(keystore, keystorePassword);
- SelfSignedTrustManager trustManager = new SelfSignedTrustManager(truststore);
-
- sslContext = SSLContext.getInstance("SSL");
- try {
- sslContext.init(keyManagers, new TrustManager[]{trustManager}, null);
- } catch (KeyManagementException e) {
- throw new ConfigurationException("Failed to initialize SSL Context.", e);
- }
- }
-
- public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException {
- return sslContext.getSocketFactory().createSocket(socket, host, port, autoClose);
- }
-
- public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) throws IOException {
- return sslContext.getSocketFactory().createSocket(host, port, clientHost, clientPort);
- }
-
- public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) throws IOException, ConnectTimeoutException {
- AssertArgument.isNotNull(params, "params");
-
- SocketFactory socketfactory = sslContext.getSocketFactory();
- int connectTimeout = params.getConnectionTimeout();
-
- if (connectTimeout == 0) {
- return socketfactory.createSocket(host, port, localAddress, localPort);
- } else {
- Socket socket = socketfactory.createSocket();
- SocketAddress localSocketAddress = new InetSocketAddress(localAddress, localPort);
- SocketAddress remoteSocketAddress = new InetSocketAddress(host, port);
- socket.bind(localSocketAddress);
- socket.connect(remoteSocketAddress, connectTimeout);
-
- return socket;
- }
- }
-
- public Socket createSocket(String host, int port) throws IOException {
- return sslContext.getSocketFactory().createSocket(host, port);
- }
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/SelfSignedSSLProtocolSocketFactoryBuilder.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/http/protocol/SelfSignedSSLProtocolSocketFactoryBuilder.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/SelfSignedSSLProtocolSocketFactoryBuilder.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/http/protocol/SelfSignedSSLProtocolSocketFactoryBuilder.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.http.protocol;
+
+import org.apache.commons.httpclient.ConnectTimeoutException;
+import org.apache.commons.httpclient.params.HttpConnectionParams;
+import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
+import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.util.ssl.SSLUtil;
+import org.jboss.soa.esb.util.ssl.SelfSignedTrustManager;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+
+import javax.net.SocketFactory;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import java.io.IOException;
+import java.net.*;
+import java.security.*;
+
+/**
+ * Builder for creating a ProtocolSocketFactory that supports Self-Signed Server
+ * certificates.
+ * <p/>
+ * <b>For test/demo purposes only.</b>
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class SelfSignedSSLProtocolSocketFactoryBuilder extends AbstractProtocolSocketFactoryBuilder {
+
+ public ProtocolSocketFactory newInstance() throws ConfigurationException {
+ try {
+ return new SelfSignedSSLProtocolSocketFactory(getKeystore(), getKeystorePassword(), getTruststore());
+ } catch (NoSuchAlgorithmException e) {
+ throw new ConfigurationException("Failed to create SelfSignedSSLProtocolSocketFactory.", e);
+ } catch (KeyStoreException e) {
+ throw new ConfigurationException("Failed to create SelfSignedSSLProtocolSocketFactory.", e);
+ } catch (UnrecoverableKeyException e) {
+ throw new ConfigurationException("Failed to create SelfSignedSSLProtocolSocketFactory.", e);
+ }
+ }
+
+ private static class SelfSignedSSLProtocolSocketFactory implements SecureProtocolSocketFactory {
+
+ private SSLContext sslContext;
+
+ public SelfSignedSSLProtocolSocketFactory(KeyStore keystore, String keystorePassword, KeyStore truststore) throws NoSuchAlgorithmException, KeyStoreException, ConfigurationException, UnrecoverableKeyException {
+ KeyManager[] keyManagers = SSLUtil.getKeyManagers(keystore, keystorePassword);
+ SelfSignedTrustManager trustManager = new SelfSignedTrustManager(truststore);
+
+ sslContext = SSLContext.getInstance("SSL");
+ try {
+ sslContext.init(keyManagers, new TrustManager[]{trustManager}, null);
+ } catch (KeyManagementException e) {
+ throw new ConfigurationException("Failed to initialize SSL Context.", e);
+ }
+ }
+
+ public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException {
+ return sslContext.getSocketFactory().createSocket(socket, host, port, autoClose);
+ }
+
+ public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) throws IOException {
+ return sslContext.getSocketFactory().createSocket(host, port, clientHost, clientPort);
+ }
+
+ public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) throws IOException, ConnectTimeoutException {
+ AssertArgument.isNotNull(params, "params");
+
+ SocketFactory socketfactory = sslContext.getSocketFactory();
+ int connectTimeout = params.getConnectionTimeout();
+
+ if (connectTimeout == 0) {
+ return socketfactory.createSocket(host, port, localAddress, localPort);
+ } else {
+ Socket socket = socketfactory.createSocket();
+ SocketAddress localSocketAddress = new InetSocketAddress(localAddress, localPort);
+ SocketAddress remoteSocketAddress = new InetSocketAddress(host, port);
+ socket.bind(localSocketAddress);
+ socket.connect(remoteSocketAddress, connectTimeout);
+
+ return socket;
+ }
+ }
+
+ public Socket createSocket(String host, int port) throws IOException {
+ return sslContext.getSocketFactory().createSocket(host, port);
+ }
+ }
+}
\ No newline at end of file
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java 2008-04-22 10:33:16 UTC (rev 19682)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -62,6 +62,8 @@
// Map the standard listener attributes - common across all listener types...
MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
// Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
+ MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
if(listener.getIsGateway()) {
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java 2008-04-22 10:33:16 UTC (rev 19682)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -19,22 +19,17 @@
*/
package org.jboss.soa.esb.listeners.gateway;
-import java.net.InetAddress;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.UnknownHostException;
-import java.util.*;
-
-import javax.management.MBeanServer;
-
import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.remoting.HttpMarshaller;
+import org.jboss.internal.soa.esb.remoting.HttpUnmarshaller;
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.ServerInvocationHandler;
import org.jboss.remoting.ServerInvoker;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
import org.jboss.remoting.marshal.MarshalFactory;
import org.jboss.remoting.marshal.http.HTTPMarshaller;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.security.SSLSocketBuilder;
import org.jboss.remoting.transport.Connector;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.actions.ActionUtils;
@@ -47,15 +42,20 @@
import org.jboss.soa.esb.listeners.message.AbstractMessageComposer;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
+import org.jboss.soa.esb.message.*;
import org.jboss.soa.esb.message.MessagePayloadProxy.NullPayloadHandling;
-import org.jboss.soa.esb.message.*;
import org.jboss.soa.esb.message.Properties;
import org.jboss.soa.esb.message.body.content.BytesBody;
import org.jboss.soa.esb.services.registry.RegistryException;
import org.jboss.soa.esb.services.registry.RegistryFactory;
-import org.jboss.internal.soa.esb.remoting.HttpUnmarshaller;
-import org.jboss.internal.soa.esb.remoting.HttpMarshaller;
+import javax.management.MBeanServer;
+import java.net.InetAddress;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.UnknownHostException;
+import java.util.*;
+
/**
* JBoss Remoting listener implementation for receiving ESB unaware messages
* over a JBoss Remoting channel.
@@ -368,18 +368,40 @@
* @throws ConfigurationException Problem populating the configuration.
*/
protected void initaliseJBRConnectorConfiguration(Map<String, String> connectorConfig) throws ConfigurationException {
+ String protocol = getJbrServerLocatorURI().getScheme();
+ boolean isHttps = protocol.equals("https");
+ boolean isSecure = (isHttps || protocol.equals("sslsocket"));
+
// Initialse the JBR connector URI...
jbrServerLocatorURI = getJbrServerLocatorURI().toString();
+ // Make sure the "SSLImplementation" attribute is set for https...
+ if(isHttps) {
+ connectorConfig.put("SSLImplementation", "org.jboss.remoting.transport.coyote.ssl.RemotingSSLImplementation");
+ }
+
// Populate the connector config...
List<KeyValuePair> attributes = getConfig().attributesAsList();
for (KeyValuePair attribute : attributes) {
String attributeName = attribute.getKey();
if (attributeName.startsWith(JBR_PREFIX)) {
- connectorConfig.put(attributeName.substring(JBR_PREFIX.length()), attribute.getValue());
+ String jbrAttributeName = attributeName.substring(JBR_PREFIX.length());
+ String postv220JbrSSLAttributeName = legacySSLConfigNameMappings.get(jbrAttributeName);
+
+ connectorConfig.put(jbrAttributeName, attribute.getValue());
+ if(postv220JbrSSLAttributeName != null) {
+ connectorConfig.put(postv220JbrSSLAttributeName, attribute.getValue());
+ connectorConfig.put("UseSSLServerSocketFactory", "false");
+ } else if(legacySSLConfigNameMappings.containsValue(jbrAttributeName)) {
+ connectorConfig.put("UseSSLServerSocketFactory", "false");
+ }
}
}
+
+ if(isSecure && !connectorConfig.containsKey("serverSocketFactory")) {
+ logger.info("Secure endpoint '" + jbrServerLocatorURI + "' doesn't define a 'serverSocketFactory'. Using Server defaults. See JBossRemoting documentation.");
+ }
}
/**
@@ -498,4 +520,30 @@
}
}
+ private static Map<String, String> legacySSLConfigNameMappings = new HashMap<String, String>();
+ static {
+ /*
+ * The attribute names of some or all of the JBR SSLSocketBuilder config parameters have
+ * changed (post v2.2.0) and don't match the JBR documentation. This map is used to map
+ * them to their new names, where the legacy names are used ala the documentation.
+ *
+ * See http://jira.jboss.com/jira/browse/JBREM-925
+ */
+ legacySSLConfigNameMappings.put("ClientAuthMode", SSLSocketBuilder.REMOTING_CLIENT_AUTH_MODE);
+ legacySSLConfigNameMappings.put("KeyAlias", SSLSocketBuilder.REMOTING_KEY_ALIAS);
+ legacySSLConfigNameMappings.put("KeyPassword", SSLSocketBuilder.REMOTING_KEY_PASSWORD);
+ legacySSLConfigNameMappings.put("KeyStoreAlgorithm", SSLSocketBuilder.REMOTING_KEY_STORE_ALGORITHM);
+ legacySSLConfigNameMappings.put("KeyStorePassword", SSLSocketBuilder.REMOTING_KEY_STORE_PASSWORD);
+ legacySSLConfigNameMappings.put("KeyStoreType", SSLSocketBuilder.REMOTING_KEY_STORE_TYPE);
+ legacySSLConfigNameMappings.put("KeyStoreURL", SSLSocketBuilder.REMOTING_KEY_STORE_FILE_PATH);
+ legacySSLConfigNameMappings.put("ProviderName", SSLSocketBuilder.REMOTING_SSL_PROVIDER_NAME);
+ legacySSLConfigNameMappings.put("SecureSocketProtocol", SSLSocketBuilder.REMOTING_SSL_PROTOCOL);
+ legacySSLConfigNameMappings.put("ServerAuthMode", SSLSocketBuilder.REMOTING_SERVER_AUTH_MODE);
+ legacySSLConfigNameMappings.put("ServerSocketUse-ClientMode", SSLSocketBuilder.REMOTING_SERVER_SOCKET_USE_CLIENT_MODE);
+ legacySSLConfigNameMappings.put("SocketUseClient-Mode", SSLSocketBuilder.REMOTING_SOCKET_USE_CLIENT_MODE);
+ legacySSLConfigNameMappings.put("TrustStoreAlgorithm", SSLSocketBuilder.REMOTING_TRUST_STORE_ALGORITHM);
+ legacySSLConfigNameMappings.put("TrustStorePassword", SSLSocketBuilder.REMOTING_TRUST_STORE_PASSWORD);
+ legacySSLConfigNameMappings.put("TrustStoreType", SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE);
+ legacySSLConfigNameMappings.put("TrustStoreURL", SSLSocketBuilder.REMOTING_TRUST_STORE_FILE_PATH);
+ }
}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/util/ssl)
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SSLUtil.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/util/ssl/SSLUtil.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SSLUtil.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.util.ssl;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-
-import java.security.KeyStore;
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
-
-/**
- * SSL utility functions.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class SSLUtil {
-
- public static KeyManager[] getKeyManagers(KeyStore keystore, String password) throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException {
- AssertArgument.isNotNull(keystore, "keystore");
- KeyManagerFactory factory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
- factory.init(keystore, password != null ? password.toCharArray() : null);
- return factory.getKeyManagers();
- }
-
- public static TrustManager[] getTrustManagers(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException {
- AssertArgument.isNotNull(keystore, "keystore");
- TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
- factory.init(keystore);
- return factory.getTrustManagers();
- }
-
- public static KeyStore loadKeyStore(InputStream keystoreStream, String keystoreType, String password) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
- AssertArgument.isNotNull(keystoreStream, "keystoreStream");
-
- KeyStore keystore = KeyStore.getInstance(keystoreType);
- try {
- keystore.load(keystoreStream, password != null ? password.toCharArray() : null);
- } finally {
- keystoreStream.close();
- }
-
- return keystore;
- }
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SSLUtil.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/util/ssl/SSLUtil.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SSLUtil.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SSLUtil.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.util.ssl;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+
+import java.security.KeyStore;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+
+/**
+ * SSL utility functions.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract class SSLUtil {
+
+ public static KeyManager[] getKeyManagers(KeyStore keystore, String password) throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException {
+ AssertArgument.isNotNull(keystore, "keystore");
+ KeyManagerFactory factory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+ factory.init(keystore, password != null ? password.toCharArray() : null);
+ return factory.getKeyManagers();
+ }
+
+ public static TrustManager[] getTrustManagers(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException {
+ AssertArgument.isNotNull(keystore, "keystore");
+ TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+ factory.init(keystore);
+ return factory.getTrustManagers();
+ }
+
+ public static KeyStore loadKeyStore(InputStream keystoreStream, String keystoreType, String password) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
+ AssertArgument.isNotNull(keystoreStream, "keystoreStream");
+
+ KeyStore keystore = KeyStore.getInstance(keystoreType);
+ try {
+ keystore.load(keystoreStream, password != null ? password.toCharArray() : null);
+ } finally {
+ keystoreStream.close();
+ }
+
+ return keystore;
+ }
+}
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SelfSignedTrustManager.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/util/ssl/SelfSignedTrustManager.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SelfSignedTrustManager.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.util.ssl;
-
-import org.jboss.soa.esb.ConfigurationException;
-
-import javax.net.ssl.X509TrustManager;
-import javax.net.ssl.TrustManager;
-import java.security.KeyStore;
-import java.security.NoSuchAlgorithmException;
-import java.security.KeyStoreException;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-/**
- * {@link X509TrustManager} that trusts Self-Signed certificates.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class SelfSignedTrustManager implements X509TrustManager {
-
- private X509TrustManager trustManager;
-
- public SelfSignedTrustManager(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException, ConfigurationException {
- TrustManager[] trustManagers = SSLUtil.getTrustManagers(keystore);
- if(trustManagers.length == 0) {
- throw new ConfigurationException("No TrustManagers found in KeyStore.");
- }
- try {
- trustManager = (X509TrustManager) trustManagers[0];
- } catch(ClassCastException e) {
- throw new ConfigurationException("X509 TrustManager not found in KeyStore.");
- }
- }
-
- public void checkClientTrusted(X509Certificate[] x509Certificates, String authType) throws CertificateException {
- trustManager.checkClientTrusted(x509Certificates, authType);
- }
-
- public void checkServerTrusted(X509Certificate[] x509Certificates, String authType) throws CertificateException {
- if ((x509Certificates != null) && (x509Certificates.length == 1)) {
- x509Certificates[0].checkValidity();
- } else {
- trustManager.checkServerTrusted(x509Certificates, authType);
- }
- }
-
- public X509Certificate[] getAcceptedIssuers() {
- return trustManager.getAcceptedIssuers();
- }
-}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SelfSignedTrustManager.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/rosetta/src/org/jboss/soa/esb/util/ssl/SelfSignedTrustManager.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SelfSignedTrustManager.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/util/ssl/SelfSignedTrustManager.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.util.ssl;
+
+import org.jboss.soa.esb.ConfigurationException;
+
+import javax.net.ssl.X509TrustManager;
+import javax.net.ssl.TrustManager;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.KeyStoreException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+/**
+ * {@link X509TrustManager} that trusts Self-Signed certificates.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class SelfSignedTrustManager implements X509TrustManager {
+
+ private X509TrustManager trustManager;
+
+ public SelfSignedTrustManager(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException, ConfigurationException {
+ TrustManager[] trustManagers = SSLUtil.getTrustManagers(keystore);
+ if(trustManagers.length == 0) {
+ throw new ConfigurationException("No TrustManagers found in KeyStore.");
+ }
+ try {
+ trustManager = (X509TrustManager) trustManagers[0];
+ } catch(ClassCastException e) {
+ throw new ConfigurationException("X509 TrustManager not found in KeyStore.");
+ }
+ }
+
+ public void checkClientTrusted(X509Certificate[] x509Certificates, String authType) throws CertificateException {
+ trustManager.checkClientTrusted(x509Certificates, authType);
+ }
+
+ public void checkServerTrusted(X509Certificate[] x509Certificates, String authType) throws CertificateException {
+ if ((x509Certificates != null) && (x509Certificates.length == 1)) {
+ x509Certificates[0].checkValidity();
+ } else {
+ trustManager.checkServerTrusted(x509Certificates, authType);
+ }
+ }
+
+ public X509Certificate[] getAcceptedIssuers() {
+ return trustManager.getAcceptedIssuers();
+ }
+}
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl)
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/HttpRouter-localhost-https-9433.properties
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/HttpRouter-localhost-https-9433.properties 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/HttpRouter-localhost-https-9433.properties 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,15 +0,0 @@
-# See:
-# - http://wiki.jboss.org/wiki/Wiki.jsp?page=HttpRouter and
-# - http://wiki.jboss.org/wiki/Wiki.jsp?page=HttpClientFactory
-
-# Configurators
-configurators=HttpProtocol
-
-# HttpProtocol config...
-protocol-socket-factory=org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory
-#protocol-socket-factory=org.jboss.soa.esb.http.protocol.SelfSignedSSLProtocolSocketFactoryBuilder
-#protocol-socket-factory=org.jboss.soa.esb.http.protocol.AuthSSLProtocolSocketFactoryBuilder
-keystore=file:/@keystore@
-keystore-passw=https_2way_ssl_pass
-truststore=file:/@keystore@
-truststore-passw=https_2way_ssl_pass
\ No newline at end of file
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/HttpRouter-localhost-https-9433.properties (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/HttpRouter-localhost-https-9433.properties)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/HttpRouter-localhost-https-9433.properties (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/HttpRouter-localhost-https-9433.properties 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,15 @@
+# See:
+# - http://wiki.jboss.org/wiki/Wiki.jsp?page=HttpRouter and
+# - http://wiki.jboss.org/wiki/Wiki.jsp?page=HttpClientFactory
+
+# Configurators
+configurators=HttpProtocol
+
+# HttpProtocol config...
+protocol-socket-factory=org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory
+#protocol-socket-factory=org.jboss.soa.esb.http.protocol.SelfSignedSSLProtocolSocketFactoryBuilder
+#protocol-socket-factory=org.jboss.soa.esb.http.protocol.AuthSSLProtocolSocketFactoryBuilder
+keystore=file:/@keystore@
+keystore-passw=https_2way_ssl_pass
+truststore=file:/@keystore@
+truststore-passw=https_2way_ssl_pass
\ No newline at end of file
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/build.xml
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/build.xml 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/build.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,49 +0,0 @@
-<project name="quickstart_https_2way_ssl" default="deploy" basedir=".">
-
- <property environment="env" />
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <!-- Import the base Ant build script... -->
- <import file="../conf/base-build.xml"/>
-
- <target name="quickstart-specific-assemblies">
- <pathconvert targetos="unix" property="keystoredir">
- <path><pathelement location="${org.jboss.esb.server.home}"/></path>
- </pathconvert>
-
- <property name="keystore" value="${keystoredir}/https_2way_ssl.keystore" />
-
- <delete file="${keystore}" failonerror="false"/>
- <genkey keystore="${keystore}" storepass="https_2way_ssl_pass" keypass="https_2way_ssl_pass" keyalg="DSA" alias="https_2way_ssl">
- <dname>
- <param name="CN" value="localhost"/>
- <param name="OU" value="jbossesb"/>
- <param name="O" value="jbossesb"/>
- <param name="C" value="IE"/>
- </dname>
- </genkey>
-
- <copy file="jboss-esb-template.xml" tofile="build/META-INF/jboss-esb.xml">
- <filterset>
- <filter token="keystore" value="${keystore}" />
- </filterset>
- </copy>
- <copy file="HttpRouter-localhost-https-9433.properties" todir="build/META-INF">
- <filterset>
- <filter token="keystore" value="${keystore}" />
- </filterset>
- </copy>
- </target>
-
- <target name="runtest" depends="compile" description="runs Test JMS Sender">
- <echo>Runs Test JMS Sender</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.https.test.SendJMSMessage" failonerror="true">
- <classpath refid="exec-classpath" />
- </java>
- </target>
-
-</project>
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/build.xml (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/build.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/build.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/build.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,49 @@
+<project name="quickstart_https_2way_ssl" default="deploy" basedir=".">
+
+ <property environment="env" />
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="quickstart-specific-assemblies">
+ <pathconvert targetos="unix" property="keystoredir">
+ <path><pathelement location="${org.jboss.esb.server.home}"/></path>
+ </pathconvert>
+
+ <property name="keystore" value="${keystoredir}/https_2way_ssl.keystore" />
+
+ <delete file="${keystore}" failonerror="false"/>
+ <genkey keystore="${keystore}" storepass="https_2way_ssl_pass" keypass="https_2way_ssl_pass" keyalg="DSA" alias="https_2way_ssl">
+ <dname>
+ <param name="CN" value="localhost"/>
+ <param name="OU" value="jbossesb"/>
+ <param name="O" value="jbossesb"/>
+ <param name="C" value="IE"/>
+ </dname>
+ </genkey>
+
+ <copy file="jboss-esb-template.xml" tofile="build/META-INF/jboss-esb.xml">
+ <filterset>
+ <filter token="keystore" value="${keystore}" />
+ </filterset>
+ </copy>
+ <copy file="HttpRouter-localhost-https-9433.properties" todir="build/META-INF">
+ <filterset>
+ <filter token="keystore" value="${keystore}" />
+ </filterset>
+ </copy>
+ </target>
+
+ <target name="runtest" depends="compile" description="runs Test JMS Sender">
+ <echo>Runs Test JMS Sender</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.https.test.SendJMSMessage" failonerror="true">
+ <classpath refid="exec-classpath" />
+ </java>
+ </target>
+
+</project>
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/jbm-queue-service.xml 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbm-queue-service.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_https_2way_ssl_esb_runtest_gw"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_https_2way_ssl_esb_runtest_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_https_2way_ssl_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_https_2way_ssl_esb_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-</server>
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbm-queue-service.xml (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbm-queue-service.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_https_2way_ssl_esb_runtest_gw"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/jbmq-queue-service.xml 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbmq-queue-service.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_https_2way_ssl_esb_runtest_gw">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_https_2way_ssl_esb_runtest_esb">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_https_2way_ssl_esb">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_https_2way_ssl_esb_reply">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-</server>
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbmq-queue-service.xml (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbmq-queue-service.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_https_2way_ssl_esb_runtest_gw">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,80 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb
- xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
- parameterReloadSecs="5">
-
- <providers>
- <jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" jndi-URL="localhost">
- <jms-bus busid="runtestGateway">
- <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_https_2way_ssl_esb_runtest_gw" />
- </jms-bus>
- <jms-bus busid="runtestChannel">
- <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_https_2way_ssl_esb_runtest_esb" />
- </jms-bus>
- <jms-bus busid="httpsServerChannel">
- <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_https_2way_ssl_esb" />
- </jms-bus>
- </jms-provider>
-
- <jbr-provider name="https_2way" protocol="https" host="localhost">
- <!-- Https/SSL settings -->
- <property name="jbr-KeyStoreURL" value="@keystore@" />
- <property name="jbr-KeyStorePassword" value="https_2way_ssl_pass" />
- <property name="jbr-TrustStoreURL" value="@keystore@" />
- <property name="jbr-TrustStorePassword" value="https_2way_ssl_pass" />
- <property name="jbr-ClientAuthMode" value="need" />
-
- <jbr-bus busid="https_2way" port="9433"/>
- </jbr-provider>
-
- </providers>
-
- <services>
-
- <!--
- Https Client Service. Initiated by "ant runtest", which drops a message in a JMS queue.
- -->
- <service category="Https QS Category" name="RuntestClientService" description="HTTPS Gateway example - runtest">
-
- <listeners>
- <jms-listener name="gateway" busidref="runtestGateway" is-gateway="true" />
- <jms-listener name="esbaware" busidref="runtestChannel" />
- </listeners>
- <actions>
- <!--
- Route the payload to the https gateway of the other service using the HttpRouter...
- -->
- <action name="httprouter" class="org.jboss.soa.esb.actions.routing.http.HttpRouter">
- <property name="endpointUrl" value="https://localhost:9433/x/y">
- <http-client-property name="file" value="/META-INF/HttpRouter-localhost-https-9433.properties" />
- </property>
- <property name="method" value="POST" /> <!-- Currently only supports GET or POST - easy to add more! -->
- <property name="responseType" value="STRING" /> <!-- Response should be set back on message as STRING or BYTES - default STRING -->
- <property name="headers">
- <header name="blah" value="blahval" />
- </property>
- </action>
-
- <action name="printResponse" class="org.jboss.soa.esb.samples.https.client.HttpResponsePrinter" />
- </actions>
-
- </service>
-
- <!--
- Https Server Service. Called over https by the Https Client Service above.
- -->
- <service category="Https QS Category" name="MyHTTPSService" description="HTTPS Gateway example">
-
- <listeners>
- <jbr-listener name="https_2way" busidref="https_2way" is-gateway="true"/>
- <jms-listener name="esbaware" busidref="httpsServerChannel" />
- </listeners>
- <actions>
- <action name="printMessage" class="org.jboss.soa.esb.samples.https.server.HttpRequestPrinter"/>
- </actions>
-
- </service>
-
- </services>
-
-</jbossesb>
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,72 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
+ xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
+ parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JMS" connection-factory="ConnectionFactory" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" jndi-URL="localhost">
+ <jms-bus busid="runtestGateway">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_https_2way_ssl_esb_runtest_gw" />
+ </jms-bus>
+ </jms-provider>
+
+ <jbr-provider name="https_2way" protocol="https" host="localhost">
+ <!-- Https/SSL settings -->
+ <property name="jbr-KeyStoreURL" value="@keystore@" />
+ <property name="jbr-KeyStorePassword" value="https_2way_ssl_pass" />
+ <property name="jbr-TrustStoreURL" value="@keystore@" />
+ <property name="jbr-TrustStorePassword" value="https_2way_ssl_pass" />
+ <property name="jbr-ClientAuthMode" value="need" />
+
+ <jbr-bus busid="https_2way" port="9433"/>
+ </jbr-provider>
+
+ </providers>
+
+ <services>
+
+ <!--
+ Https Client Service. Initiated by "ant runtest", which drops a message in a JMS queue.
+ -->
+ <service category="Https QS Category" name="RuntestClientService" description="HTTPS Gateway example - runtest" invmScope="GLOBAL">
+
+ <listeners>
+ <jms-listener name="gateway" busidref="runtestGateway" is-gateway="true" />
+ </listeners>
+ <actions mep="OneWay">
+ <!--
+ Route the payload to the https gateway of the other service using the HttpRouter...
+ -->
+ <action name="httprouter" class="org.jboss.soa.esb.actions.routing.http.HttpRouter">
+ <property name="endpointUrl" value="https://localhost:9433/x/y">
+ <http-client-property name="file" value="/META-INF/HttpRouter-localhost-https-9433.properties" />
+ </property>
+ <property name="method" value="POST" /> <!-- Currently only supports GET or POST - easy to add more! -->
+ <property name="responseType" value="STRING" /> <!-- Response should be set back on message as STRING or BYTES - default STRING -->
+ <property name="headers"> <!-- Supports setting of arbitrary request headers -->
+ <header name="blah" value="blahval" />
+ </property>
+ </action>
+
+ <action name="printResponse" class="org.jboss.soa.esb.samples.https.client.HttpResponsePrinter" />
+ </actions>
+
+ </service>
+
+ <!--
+ Https Server Service. Called over https by the Https Client Service above.
+ -->
+ <service category="Https QS Category" name="MyHTTPSService" description="HTTPS Gateway example" invmScope="GLOBAL">
+
+ <listeners>
+ <jbr-listener name="https_2way" busidref="https_2way" is-gateway="true"/>
+ </listeners>
+ <actions mep="RequestResponse">
+ <action name="printMessage" class="org.jboss.soa.esb.samples.https.server.HttpRequestPrinter"/>
+ </actions>
+
+ </service>
+
+ </services>
+
+</jbossesb>
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbossesb-service.xml
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/jbossesb-service.xml 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbossesb-service.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
-
- <mbean code="org.jboss.remoting.security.SSLSocketBuilder" name="jboss.remoting:service=SocketBuilder,type=SSL" display-name="SSL Server Socket Factory Builder">
- <!-- IMPORTANT - If making ANY customizations, this MUST be set to false. -->
- <!-- Otherwise, will used default settings and the following attributes will be ignored. -->
- <attribute name="UseSSLServerSocketFactory">false</attribute>
- <!-- This is the url string to the key store to use -->
- <attribute name="KeyStoreURL">${jboss.home.dir}/https_2way_ssl.keystore</attribute>
- <!-- The password for the key store -->
- <attribute name="KeyStorePassword">https_2way_ssl_pass</attribute>
- <!-- The password for the keys (will use KeystorePassword if this is not set explicitly. -->
- <attribute name="KeyPassword">https_2way_ssl_pass</attribute>
- </mbean>
-
- <mbean code="org.jboss.remoting.security.SSLServerSocketFactoryService" name="jboss.remoting:service=ServerSocketFactory,type=SSL" display-name="SSL Server Socket Factory">
- <depends optional-attribute-name="SSLSocketBuilder" proxy-type="attribute">jboss.remoting:service=SocketBuilder,type=SSL</depends>
- </mbean>
-
-</server>
\ No newline at end of file
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbossesb-service.xml (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/jbossesb-service.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbossesb-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jbossesb-service.xml 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+ <mbean code="org.jboss.remoting.security.SSLSocketBuilder" name="jboss.remoting:service=SocketBuilder,type=SSL" display-name="SSL Server Socket Factory Builder">
+ <!-- IMPORTANT - If making ANY customizations, this MUST be set to false. -->
+ <!-- Otherwise, will used default settings and the following attributes will be ignored. -->
+ <attribute name="UseSSLServerSocketFactory">false</attribute>
+ <!-- This is the url string to the key store to use -->
+ <attribute name="KeyStoreURL">${jboss.home.dir}/https_2way_ssl.keystore</attribute>
+ <!-- The password for the key store -->
+ <attribute name="KeyStorePassword">https_2way_ssl_pass</attribute>
+ <!-- The password for the keys (will use KeystorePassword if this is not set explicitly. -->
+ <attribute name="KeyPassword">https_2way_ssl_pass</attribute>
+ </mbean>
+
+ <mbean code="org.jboss.remoting.security.SSLServerSocketFactoryService" name="jboss.remoting:service=ServerSocketFactory,type=SSL" display-name="SSL Server Socket Factory">
+ <depends optional-attribute-name="SSLSocketBuilder" proxy-type="attribute">jboss.remoting:service=SocketBuilder,type=SSL</depends>
+ </mbean>
+
+</server>
\ No newline at end of file
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jndi.properties
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/jndi.properties 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jndi.properties 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jndi.properties (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/jndi.properties)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jndi.properties (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/jndi.properties 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/readme.txt
===================================================================
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/readme.txt (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/readme.txt)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/readme.txt (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/readme.txt 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,30 @@
+Overview:
+=========
+ This quickstart demonstrates how to:
+ 1. Configure a HTTPS Endpoint.
+ 2. Configure the HttpRouter for performing HTTPS invocations on ESB Unaware
+ Endpoints.
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 3. Switch back to Application Server console to see the output from the ESB
+ 4. In this folder ("Window1"), type 'ant undeploy'.
+
+What to look at in this Quickstart:
+===================================
+ On running the 'ant runtest' command (step #2 above), the Ant script executes
+ the SendJMSMessage class, which sends a JMS message into the "RuntestClientService"
+ Service gateway (busidref="runtestGateway"). This Service takes the message payload
+ and, using the HttpRouter, makes a synchronous HTTPS invocation on the "MyHTTPSService"
+ Service gateway (busidref="https_2way"), which simply replies with the HTTP data
+ from the request.
+
+ All security artifacts are generated and deployed by the build.xml script.
\ No newline at end of file
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src)
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org)
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss)
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa)
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb)
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples)
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https)
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client)
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/HttpResponsePrinter.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/HttpResponsePrinter.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/HttpResponsePrinter.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,46 +0,0 @@
-package org.jboss.soa.esb.samples.https.client;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.actions.routing.http.HttpResponse;
-import org.jboss.soa.esb.actions.routing.http.HttpHeader;
-import org.jboss.soa.esb.message.Message;
-
-import java.util.List;
-
-public class HttpResponsePrinter extends AbstractActionLifecycle {
-
- protected ConfigTree _config;
-
- public HttpResponsePrinter(ConfigTree config) {
- _config = config;
- }
-
-
- public Message process(Message message) throws Exception {
-
- HttpResponse httpResponse = (HttpResponse) message.getBody().get(HttpResponse.RESPONSE_KEY);
-
- System.out.println("=========== Client Response: ===================================");
- System.out.println("Message Payload:");
- System.out.println("\t[" + message.getBody().get() + "]");
-
- System.out.println();
- System.out.println("Http Response:");
- System.out.println("\tCode: " + httpResponse.getResponseCode());
- System.out.println("\tLength: " + httpResponse.getLength());
- System.out.println("\tEncoding: " + httpResponse.getEncoding());
-
- System.out.println("\tHeaders:");
- List<HttpHeader> headers = httpResponse.getHeaders();
- for (HttpHeader header : headers) {
- System.out.println("\t\t" + header.getName() + ": " + header.getValue());
- }
-
- System.out.println("================================================================");
-
- return message;
- }
-
-
-}
\ No newline at end of file
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/HttpResponsePrinter.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/HttpResponsePrinter.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/HttpResponsePrinter.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/client/HttpResponsePrinter.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,46 @@
+package org.jboss.soa.esb.samples.https.client;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.actions.routing.http.HttpResponse;
+import org.jboss.soa.esb.actions.routing.http.HttpHeader;
+import org.jboss.soa.esb.message.Message;
+
+import java.util.List;
+
+public class HttpResponsePrinter extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+
+ public HttpResponsePrinter(ConfigTree config) {
+ _config = config;
+ }
+
+
+ public Message process(Message message) throws Exception {
+
+ HttpResponse httpResponse = (HttpResponse) message.getBody().get(HttpResponse.RESPONSE_KEY);
+
+ System.out.println("=========== Client Response: ===================================");
+ System.out.println("Message Payload:");
+ System.out.println("\t[" + message.getBody().get() + "]");
+
+ System.out.println();
+ System.out.println("Http Response:");
+ System.out.println("\tCode: " + httpResponse.getResponseCode());
+ System.out.println("\tLength: " + httpResponse.getLength());
+ System.out.println("\tEncoding: " + httpResponse.getEncoding());
+
+ System.out.println("\tHeaders:");
+ List<HttpHeader> headers = httpResponse.getHeaders();
+ for (HttpHeader header : headers) {
+ System.out.println("\t\t" + header.getName() + ": " + header.getValue());
+ }
+
+ System.out.println("================================================================");
+
+ return message;
+ }
+
+
+}
\ No newline at end of file
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server)
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/HttpRequestPrinter.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/HttpRequestPrinter.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/HttpRequestPrinter.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,55 +0,0 @@
-/*
- Milyn - Copyright (C) 2006
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License (version 2.1) as published by the Free Software
- Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- See the GNU Lesser General Public License for more details:
- http://www.gnu.org/licenses/lgpl.txt
-*/
-package org.jboss.soa.esb.samples.https.server;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.Properties;
-
-/**
- * @autour <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
- */
-public class HttpRequestPrinter extends AbstractActionLifecycle {
-
- protected ConfigTree _config;
-
- public HttpRequestPrinter(ConfigTree config) {
- _config = config;
- }
-
-
- public Message process(Message message) throws Exception {
- Properties properties = message.getProperties();
-
- System.out.println("=========== Server Request: ====================================");
- System.out.println("Message Payload:");
- System.out.println("\t[" + message.getBody().get() + "]");
-
- System.out.println();
- System.out.println("\tHeaders:");
- System.out.println("\t\thost: " + properties.getProperty("host"));
- System.out.println("\t\tMethod: " + properties.getProperty("MethodType"));
- System.out.println("\t\tPath: " + properties.getProperty("Path"));
- System.out.println("\t\tuser-agent: " + properties.getProperty("user-agent"));
- System.out.println("\t\tcontent-type: " + properties.getProperty("content-type"));
- System.out.println("================================================================");
-
- message.getBody().add("Http Response Payload!!");
-
- return message;
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/HttpRequestPrinter.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/HttpRequestPrinter.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/HttpRequestPrinter.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/server/HttpRequestPrinter.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,55 @@
+/*
+ Milyn - Copyright (C) 2006
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License (version 2.1) as published by the Free Software
+ Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Lesser General Public License for more details:
+ http://www.gnu.org/licenses/lgpl.txt
+*/
+package org.jboss.soa.esb.samples.https.server;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.Properties;
+
+/**
+ * @autour <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
+ */
+public class HttpRequestPrinter extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+
+ public HttpRequestPrinter(ConfigTree config) {
+ _config = config;
+ }
+
+
+ public Message process(Message message) throws Exception {
+ Properties properties = message.getProperties();
+
+ System.out.println("=========== Server Request: ====================================");
+ System.out.println("Message Payload:");
+ System.out.println("\t[" + message.getBody().get() + "]");
+
+ System.out.println();
+ System.out.println("\tHeaders:");
+ System.out.println("\t\thost: " + properties.getProperty("host"));
+ System.out.println("\t\tMethod: " + properties.getProperty("MethodType"));
+ System.out.println("\t\tPath: " + properties.getProperty("Path"));
+ System.out.println("\t\tuser-agent: " + properties.getProperty("user-agent"));
+ System.out.println("\t\tcontent-type: " + properties.getProperty("content-type"));
+ System.out.println("================================================================");
+
+ message.getBody().add("Http Response Payload!!");
+
+ return message;
+ }
+}
\ No newline at end of file
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test)
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/SendJMSMessage.java 2008-03-05 13:40:41 UTC (rev 18701)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/SendJMSMessage.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.https.test;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.soa.esb.util.FileUtil;
-
-public class SendJMSMessage {
- QueueConnection conn;
- QueueSession session;
- Queue que;
-
-
- public void setupConnection() throws JMSException, NamingException
- {
- InitialContext iniCtx = new InitialContext();
- Object tmp = iniCtx.lookup("ConnectionFactory");
- QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
- conn = qcf.createQueueConnection();
- que = (Queue) iniCtx.lookup("queue/quickstart_https_2way_ssl_esb_runtest_gw");
- session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- conn.start();
- System.out.println("Connection Started");
- }
-
- public void stop() throws JMSException
- {
- conn.stop();
- session.close();
- conn.close();
- }
-
- public void sendAMessage() throws JMSException, FileNotFoundException, IOException {
-
- QueueSender send = session.createSender(que);
- ObjectMessage tm;
- String message = "Request Payload!";
-
- tm = session.createObjectMessage(message);
- tm.setStringProperty("jbesbfilename", "httprouter.log");
- send.send(tm);
- send.close();
- }
-
- public static void main(String args[]) throws Exception
- {
- SendJMSMessage sm = new SendJMSMessage();
- sm.setupConnection();
- sm.sendAMessage();
- sm.stop();
- }
-
-}
\ No newline at end of file
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/SendJMSMessage.java (from rev 18701, labs/jbossesb/workspace/tfennelly_https/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/https_2way_ssl/src/org/jboss/soa/esb/samples/https/test/SendJMSMessage.java 2008-04-22 11:25:24 UTC (rev 19683)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.https.test;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.soa.esb.util.FileUtil;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_https_2way_ssl_esb_runtest_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage() throws JMSException, FileNotFoundException, IOException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm;
+ String message = "Request Payload!";
+
+ tm = session.createObjectMessage(message);
+ tm.setStringProperty("jbesbfilename", "httprouter.log");
+ send.send(tm);
+ send.close();
+ }
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage();
+ sm.stop();
+ }
+
+}
\ No newline at end of file
More information about the jboss-svn-commits
mailing list