Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 94729 invoked from network); 8 Oct 2010 09:27:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Oct 2010 09:27:21 -0000 Received: (qmail 64765 invoked by uid 500); 8 Oct 2010 09:27:21 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 64680 invoked by uid 500); 8 Oct 2010 09:27:20 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 64673 invoked by uid 99); 8 Oct 2010 09:27:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Oct 2010 09:27:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Oct 2010 09:27:17 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5C2FD23889BB; Fri, 8 Oct 2010 09:26:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1005742 - in /directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config: ConfigPartitionReader.java beans/DhcpServerBean.java beans/DnsServerBean.java Date: Fri, 08 Oct 2010 09:26:56 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101008092656.5C2FD23889BB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Fri Oct 8 09:26:55 2010 New Revision: 1005742 URL: http://svn.apache.org/viewvc?rev=1005742&view=rev Log: Added the DHCPServer and DNSServer beans Added: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DhcpServerBean.java directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DnsServerBean.java Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=1005742&r1=1005741&r2=1005742&view=diff ============================================================================== --- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java (original) +++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java Fri Oct 8 09:26:55 2010 @@ -58,6 +58,7 @@ import javax.naming.directory.SearchCont import org.apache.directory.server.changepw.ChangePasswordServer; import org.apache.directory.server.config.beans.ChangeLogBean; +import org.apache.directory.server.config.beans.DnsServerBean; import org.apache.directory.server.config.beans.JdbmIndexBean; import org.apache.directory.server.config.beans.JournalBean; import org.apache.directory.server.config.beans.KdcServerBean; @@ -525,7 +526,13 @@ public class ConfigPartitionReader } - public DnsServer createDnsServer() throws Exception + /** + * Read the DnsServer configuration from the DIT + * + * @return A bean containing the DnsServer configuration + * @throws Exception If the configuration cannot be read + */ + public DnsServerBean readDnsServer() throws Exception { EqualityNode filter = new EqualityNode( OBJECT_CLASS_AT, new StringValue( ConfigSchemaConstants.ADS_DNS_SERVER_OC ) ); @@ -553,19 +560,43 @@ public class ConfigPartitionReader return null; } - DnsServer dnsServer = new DnsServer(); + DnsServerBean dnsServerBean = new DnsServerBean(); - dnsServer.setServiceId( getString( ConfigSchemaConstants.ADS_SERVER_ID, dnsEntry ) ); + dnsServerBean.setServiceId( getString( ConfigSchemaConstants.ADS_SERVER_ID, dnsEntry ) ); - Transport[] transports = createTransports( dnsEntry.getDn() ); - dnsServer.setTransports( transports ); + TransportBean[] transports = readTransports( dnsEntry.getDn() ); + dnsServerBean.setTransports( transports ); - return dnsServer; + return dnsServerBean; } + + /** + * Create an instance of DnsServer reading its configuration in the DIT + * + * @return An instance of a DnsServer + * @throws Exception If the instance cannot be created + */ + public DnsServer createDnsServer() throws Exception + { + DnsServerBean dnsServerBean = readDnsServer(); + DnsServer dnsServer = new DnsServer(); + + for ( TransportBean transportBean : dnsServerBean.getTransports() ) + { + Transport transport = createTransport( transportBean ); + + dnsServer.addTransports( transport ); + } + + dnsServer.setServiceId( dnsServerBean.getServiceId() ); + + + return dnsServer; + } //TODO making this method invisible cause there is no DhcpServer exists as of now - private DhcpService createDhcpServer() throws Exception + private DhcpService readDhcpServer() throws Exception { EqualityNode filter = new EqualityNode( OBJECT_CLASS_AT, new StringValue( ConfigSchemaConstants.ADS_DHCP_SERVER_OC ) ); @@ -593,13 +624,19 @@ public class ConfigPartitionReader return null; } + return null; + } + + + //TODO making this method invisible cause there is no DhcpServer exists as of now + private DhcpService createDhcpServer() throws Exception + { DhcpStore dhcpStore = new SimpleDhcpStore(); DhcpService dhcpService = new StoreBasedDhcpService( dhcpStore ); return dhcpService; } - /** * Read the NtpServer configuration from the DIT * Added: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DhcpServerBean.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DhcpServerBean.java?rev=1005742&view=auto ============================================================================== --- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DhcpServerBean.java (added) +++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DhcpServerBean.java Fri Oct 8 09:26:55 2010 @@ -0,0 +1,38 @@ +/* + * 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.directory.server.config.beans; + + +/** + * A class used to store the DhcpServer configuration. + * + * @author Apache Directory Project + */ +public class DhcpServerBean extends DirectoryBackedServiceBean +{ + /** + * Create a new DhcpServerBean instance + */ + public DhcpServerBean() + { + // Enabled by default + setEnabled( true ); + } +} Added: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DnsServerBean.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DnsServerBean.java?rev=1005742&view=auto ============================================================================== --- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DnsServerBean.java (added) +++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DnsServerBean.java Fri Oct 8 09:26:55 2010 @@ -0,0 +1,38 @@ +/* + * 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.directory.server.config.beans; + + +/** + * A class used to store the DnsServer configuration. + * + * @author Apache Directory Project + */ +public class DnsServerBean extends DirectoryBackedServiceBean +{ + /** + * Create a new DnsServerBean instance + */ + public DnsServerBean() + { + // Enabled by default + setEnabled( true ); + } +}