Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 35667 invoked from network); 15 Jun 2007 08:20:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Jun 2007 08:20:11 -0000 Received: (qmail 45871 invoked by uid 500); 15 Jun 2007 08:20:14 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 45834 invoked by uid 500); 15 Jun 2007 08:20:14 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 45823 invoked by uid 99); 15 Jun 2007 08:20:14 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jun 2007 01:20:14 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [82.223.190.84] (HELO flsc030.serveursdns.net) (82.223.190.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jun 2007 01:20:10 -0700 Received: from [192.168.0.228] (86.23.98-84.rev.gaoland.net [84.98.23.86]) by smtp-01.serveursdns.net (Postfix) with ESMTP id 5E6BC6E4325 for ; Fri, 15 Jun 2007 10:19:46 +0200 (CEST) Subject: Re: DNS : RecordStore From: Julien Vermillard Reply-To: jvermillard@archean.fr To: Apache Directory Developers List In-Reply-To: <568753d90706142105i702aa38duf9b3da1f6759cb88@mail.gmail.com> References: <1181658958.24438.34.camel@localhost> <568753d90706121415s77cf96e9g80c78acee11e2c76@mail.gmail.com> <1181725835.5935.26.camel@localhost> <1181726852.5935.31.camel@localhost> <1181727454.5935.38.camel@localhost> <568753d90706131735q695a4fc8jf3b5593f11398718@mail.gmail.com> <1181806852.5811.4.camel@localhost> <568753d90706141814g54b3c823qc3be53806fd919eb@mail.gmail.com> <568753d90706142105i702aa38duf9b3da1f6759cb88@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Organization: Archean Date: Fri, 15 Jun 2007 10:24:38 +0200 Message-Id: <1181895878.5809.7.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Le jeudi 14 juin 2007 à 21:05 -0700, Enrique Rodriguez a écrit : > On 6/14/07, Enrique Rodriguez wrote: > > ... > > I have duplicated this behavior and I have traced it back to bad > > encoding introduced in the last patch. Unfortunately, the bad > > encoding is reinforced by unit tests that I will have to correct, as > > well. I think I will have it sorted out in the next couple hours. > > Hi, Julien, > > I corrected the issue with encoding and was able to verify interop > with the dig command. > > If you'll 'svn up' you will get the fix as well as 2 new files: (1) a > stub implementation of the store called RecordStoreStub that is much > like your store and (2) a Main class with a main() method for starting > a DNS server with the stub store. A couple things to look at: > > a) The Main class shows how to use a class called "DnsServer" to > start an instance of a server. This is what we use in ApacheDS and it > encapsulates the combination of DNS configuration, a MINA UDP > acceptor, and a store implementation. By starting a DnsServer with a > DnsConfiguration and any store impl you can have a little DNS server. > This Main uses the stub store but in ApacheDS, of course, we use a > JNDI store. > > b) The store stub uses the modifier as I described. > > If you run the Main you can hit the DNS instance by default with: > > $ dig @localhost -p 10053 www.example.com > > I made the store return 2 records to make sure the encoding worked for > more than one record. > > HTH, > > Enrique Hi Enrique, I updated and now it's working like a charm :) A big thanks ! I'll be able to start adapting it to my needs. In org.apache.directory.server.dns.service.GetResourceRecords try { records = store.getRecords( question ); } catch ( LdapNameNotFoundException lnnfe ) { log.debug( "Name for DNS record search does not exist.", lnnfe ); throw new DnsException( ResponseCode.NAME_ERROR ); } LdapNameNotFoundException is an ldap exception, perhaps introducing a new RecordNotFoundException is an idea ? And changing RecordStore for using Exception subclasses : public interface RecordStore { public Set getRecords( QuestionRecord question ) throws RecordNotFoundException; } That would make the implementation of custom RecordStore easier. WDYT ? Julien