geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r560394 - /geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java
Date Fri, 27 Jul 2007 21:40:34 GMT
Author: jgenender
Date: Fri Jul 27 14:40:34 2007
New Revision: 560394

URL: http://svn.apache.org/viewvc?view=rev&rev=560394
Log:
Add APR connectors

Added:
    geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java

Added: geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java?view=auto&rev=560394
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java
(added)
+++ geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java
Fri Jul 27 14:40:34 2007
@@ -0,0 +1,182 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.tomcat.connector;
+
+import java.util.Map;
+
+import javax.net.ssl.KeyManagerFactory;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.management.geronimo.WebManager;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.tomcat.TomcatContainer;
+
+public abstract class AbstractHttp11ConnectorGBean extends BaseHttp11ConnectorGBean implements
Http11Protocol {
+    private String keystoreFileName;
+
+    private String truststoreFileName;
+
+    private String algorithm;
+    
+    public AbstractHttp11ConnectorGBean(String name, Map initParams, String tomcatProtocol,
String address, int port, TomcatContainer container, ServerInfo serverInfo) throws Exception
{
+        super(name, initParams, tomcatProtocol, address, port, container, serverInfo);
+    }
+
+    @Override
+    public int getDefaultPort() {
+        return 80;
+    }
+
+    @Override
+    public String getGeronimoProtocol() {
+        return WebManager.PROTOCOL_HTTP;
+    }
+    
+    // Generic SSL
+    public String getAlgorithm() {
+        return algorithm;
+    }
+
+    public String getCiphers() {
+        return (String) connector.getAttribute("ciphers");
+    }
+
+    public boolean getClientAuth() {
+        Object value = connector.getAttribute("clientAuth");
+        return value == null ? false : new Boolean(value.toString()).booleanValue();
+    }
+
+    public String getKeyAlias() {
+        return (String) connector.getAttribute("keyAlias");
+    }
+
+    public String getKeystoreFile() {
+        return keystoreFileName;
+    }
+
+    public String getKeystoreType() {
+        return (String) connector.getAttribute("keystoreType");
+    }
+
+    public String getSslProtocol() {
+        return (String) connector.getAttribute("sslProtocol");
+    }
+
+    public String getTruststoreFile() {
+        return truststoreFileName;
+    }
+
+    public String getTruststoreType() {
+        return (String) connector.getAttribute("truststoreType");
+    }
+
+    public void setAlgorithm(String algorithm) {
+        this.algorithm = algorithm;
+        if ("default".equalsIgnoreCase(algorithm)) {
+            algorithm = KeyManagerFactory.getDefaultAlgorithm();
+        }
+        connector.setAttribute("algorithm", algorithm);
+    }
+
+    public void setCiphers(String ciphers) {
+        connector.setAttribute("ciphers", ciphers);
+    }
+
+    public void setClientAuth(boolean clientAuth) {
+        connector.setAttribute("clientAuth", new Boolean(clientAuth));
+    }
+
+    public void setKeyAlias(String keyAlias) {
+        connector.setAttribute("keyAlias", keyAlias);
+    }
+
+    public void setKeystoreFile(String keystoreFile) {
+        keystoreFileName = keystoreFile;
+        connector.setAttribute("keystoreFile", serverInfo.resolveServerPath(keystoreFileName));
+    }
+
+    public void setKeystorePass(String keystorePass) {
+        connector.setAttribute("keystorePass", keystorePass);
+    }
+
+    public void setKeystoreType(String keystoreType) {
+        connector.setAttribute("keystoreType", keystoreType);
+    }
+
+    public void setSslProtocol(String sslProtocol) {
+        connector.setAttribute("sslProtocol", sslProtocol);
+    }
+
+    public void setTruststoreFile(String truststoreFile) {
+        truststoreFileName = truststoreFile;
+        connector.setAttribute("truststoreFile", serverInfo.resolveServerPath(truststoreFileName));
+    }
+
+    public void setTruststorePass(String truststorePass) {
+        connector.setAttribute("truststorePass", truststorePass);
+    }
+
+    public void setTruststoreType(String truststoreType) {
+        connector.setAttribute("truststoreType", truststoreType);
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Tomcat Connector",
AbstractHttp11ConnectorGBean.class, BaseHttp11ConnectorGBean.GBEAN_INFO);
+        infoFactory.addInterface(Http11Protocol.class, 
+                new String[] {
+                    //SSL Attributes
+                    "algorithm",
+                    "clientAuth",
+                    "keystoreFile",
+                    "keystorePass",
+                    "keystoreType",
+                    "sslProtocol",
+                    "ciphers",
+                    "keyAlias",
+                    "truststoreFile",
+                    "truststorePass",
+                    "truststoreType"
+                },
+                new String[] {
+                    //SSL Attributes
+                    "algorithm",
+                    "clientAuth",
+                    "keystoreFile",
+                    "keystorePass",
+                    "keystoreType",
+                    "sslProtocol",
+                    "ciphers",
+                    "keyAlias",
+                    "truststoreFile",
+                    "truststorePass",
+                    "truststoreType"
+                }
+        );
+        infoFactory.setConstructor(new String[] { "name", "initParams", "tomcatProtocol",
"address", "port", "TomcatContainer", "ServerInfo"});
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+    
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+    
+}



Mime
View raw message