directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien Vermillard <jvermill...@archean.fr>
Subject Re: DNS : RecordStore
Date Fri, 15 Jun 2007 08:24:38 GMT
Le jeudi 14 juin 2007 à 21:05 -0700, Enrique Rodriguez a écrit :
> On 6/14/07, Enrique Rodriguez <enriquer9@gmail.com> 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<ResourceRecord> getRecords( QuestionRecord question )
throws RecordNotFoundException;
}

That would make the implementation of custom RecordStore easier.

WDYT ?

Julien


Mime
View raw message