directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r520748 - in /directory/apacheds/branches/apacheds-sasl-branch/server-jndi: ./ src/main/java/org/apache/directory/server/configuration/ src/main/java/org/apache/directory/server/jndi/
Date Wed, 21 Mar 2007 04:59:39 GMT
Author: erodriguez
Date: Tue Mar 20 21:59:39 2007
New Revision: 520748

URL: http://svn.apache.org/viewvc?view=rev&rev=520748
Log:
Enabled DNS service:
o  Added DNS configuration to ServerStartupConfiguration.
o  Added DNS startup support in ServerContextFactory.
o  Added DNS protocol dependency to POM.

Modified:
    directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml
    directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java
    directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java
    directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml?view=diff&rev=520748&r1=520747&r2=520748
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml Tue Mar 20 21:59:39
2007
@@ -48,6 +48,11 @@
     </dependency>  
     <dependency>
       <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-protocol-dns</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core</artifactId>
       <version>${pom.version}</version>
     </dependency>  

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java?view=diff&rev=520748&r1=520747&r2=520748
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java
Tue Mar 20 21:59:39 2007
@@ -26,6 +26,7 @@
 
 import org.apache.directory.server.changepw.ChangePasswordConfiguration;
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
+import org.apache.directory.server.dns.DnsConfiguration;
 import org.apache.directory.server.kerberos.kdc.KdcConfiguration;
 import org.apache.directory.server.ldap.LdapConfiguration;
 import org.apache.directory.server.ntp.NtpConfiguration;
@@ -180,5 +181,11 @@
     public void setChangePasswordConfiguration( ChangePasswordConfiguration changePasswordConfiguration
)
     {
         super.setChangePasswordConfiguration( changePasswordConfiguration );
+    }
+
+
+    public void setDnsConfiguration( DnsConfiguration dnsConfiguration )
+    {
+        super.setDnsConfiguration( dnsConfiguration );
     }
 }

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java?view=diff&rev=520748&r1=520747&r2=520748
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java
Tue Mar 20 21:59:39 2007
@@ -26,6 +26,7 @@
 
 import org.apache.directory.server.changepw.ChangePasswordConfiguration;
 import org.apache.directory.server.core.configuration.StartupConfiguration;
+import org.apache.directory.server.dns.DnsConfiguration;
 import org.apache.directory.server.kerberos.kdc.KdcConfiguration;
 import org.apache.directory.server.ldap.LdapConfiguration;
 import org.apache.directory.server.ntp.NtpConfiguration;
@@ -56,6 +57,7 @@
     private LdapConfiguration ldapsConfiguration = new LdapConfiguration();
     private ChangePasswordConfiguration changePasswordConfiguration = new ChangePasswordConfiguration();
     private NtpConfiguration ntpConfiguration = new NtpConfiguration();
+    private DnsConfiguration dnsConfiguration = new DnsConfiguration();
 
 
     protected ServerStartupConfiguration()
@@ -190,5 +192,17 @@
     public ChangePasswordConfiguration getChangePasswordConfiguration()
     {
         return changePasswordConfiguration;
+    }
+
+
+    protected void setDnsConfiguration( DnsConfiguration dnsConfiguration )
+    {
+        this.dnsConfiguration = dnsConfiguration;
+    }
+
+
+    public DnsConfiguration getDnsConfiguration()
+    {
+        return dnsConfiguration;
     }
 }

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java?view=diff&rev=520748&r1=520747&r2=520748
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
Tue Mar 20 21:59:39 2007
@@ -41,6 +41,10 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.jndi.CoreContextFactory;
 import org.apache.directory.server.core.partition.PartitionNexus;
+import org.apache.directory.server.dns.DnsConfiguration;
+import org.apache.directory.server.dns.DnsServer;
+import org.apache.directory.server.dns.store.JndiRecordStoreImpl;
+import org.apache.directory.server.dns.store.RecordStore;
 import org.apache.directory.server.kerberos.kdc.KdcConfiguration;
 import org.apache.directory.server.kerberos.kdc.KerberosServer;
 import org.apache.directory.server.kerberos.shared.store.JndiPrincipalStoreImpl;
@@ -102,6 +106,7 @@
     private static ChangePasswordServer udpChangePasswordServer;
     private static NtpServer tcpNtpServer;
     private static NtpServer udpNtpServer;
+    private static DnsServer udpDnsServer;
     private DirectoryService directoryService;
 
 
@@ -198,6 +203,16 @@
             }
             udpNtpServer = null;
         }
+
+        if ( udpDnsServer != null )
+        {
+            udpDnsServer.destroy();
+            if ( log.isInfoEnabled() )
+            {
+                log.info( "Unbind of DNS Service complete: " + udpDnsServer );
+            }
+            udpDnsServer = null;
+        }
     }
 
 
@@ -224,6 +239,7 @@
             startKerberos( cfg.getKdcConfiguration() );
             startChangePassword( cfg.getChangePasswordConfiguration() );
             startNTP( cfg.getNtpConfiguration() );
+            startDNS( cfg.getDnsConfiguration() );
         }
     }
 
@@ -571,6 +587,30 @@
         catch ( Throwable t )
         {
             log.error( "Failed to start the NTP service", t );
+        }
+    }
+
+
+    private void startDNS( DnsConfiguration dnsConfig )
+    {
+        // Skip if disabled
+        if ( !dnsConfig.isEnabled() )
+        {
+            return;
+        }
+
+        try
+        {
+            RecordStore store = new JndiRecordStoreImpl( dnsConfig, this );
+
+            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
+            udpConfig.setThreadModel( threadModel );
+
+            udpDnsServer = new DnsServer( dnsConfig, udpAcceptor, udpConfig, store );
+        }
+        catch ( Throwable t )
+        {
+            log.error( "Failed to start the DNS service", t );
         }
     }
 



Mime
View raw message