directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1030461 - /directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
Date Wed, 03 Nov 2010 13:43:14 GMT
Author: kayyagari
Date: Wed Nov  3 13:43:14 2010
New Revision: 1030461

URL: http://svn.apache.org/viewvc?rev=1030461&view=rev
Log:
o added code to handle configuration of http and https

Modified:
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java?rev=1030461&r1=1030460&r2=1030461&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
(original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
Wed Nov  3 13:43:14 2010
@@ -611,12 +611,12 @@ public class ConfigBuilder
      */
     public static Set<WebApp> createHttpWebApps( List<HttpWebAppBean> httpWebAppBeans,
DirectoryService directoryService ) throws LdapException
     {
-        if ( ( httpWebAppBeans == null ) || ( httpWebAppBeans.size() == 0 ) )
+        Set<WebApp> webApps = new HashSet<WebApp>();
+
+        if ( httpWebAppBeans == null )
         {
-            return null;
+            return webApps;
         }
-        
-        Set<WebApp> webApps = new HashSet<WebApp>();
 
         for ( HttpWebAppBean httpWebAppBean : httpWebAppBeans )
         {
@@ -665,10 +665,28 @@ public class ConfigBuilder
         
         for ( TransportBean transportBean : transports )
         {
+            if ( transportBean.isDisabled() )
+            {
+                continue;
+            }
+            
             if ( transportBean instanceof TcpTransportBean )
             {
-                httpServer.setPort( transportBean.getSystemPort() );
-                break;
+                TcpTransport transport = new TcpTransport( transportBean.getSystemPort()
);
+                transport.setAddress( transportBean.getTransportAddress() );
+                
+                if ( transportBean.getTransportId().equalsIgnoreCase( HttpServer.HTTP_TRANSPORT_ID
) )
+                {
+                    httpServer.setHttpTransport( transport );
+                }
+                else if ( transportBean.getTransportId().equalsIgnoreCase( HttpServer.HTTPS_TRANSPORT_ID
) )
+                {
+                    httpServer.setHttpsTransport( transport );
+                }
+                else
+                {
+                    LOG.warn( "Transport ids of HttpServer should be either 'http' or 'https'"
);
+                }
             }
         }
         



Mime
View raw message