Le mercredi 13 juin 2007 à 17:35 -0700, Enrique Rodriguez a écrit :
> On 6/13/07, Julien Vermillard <[EMAIL PROTECTED]> wrote:
> > Please forget my last message, I pressed send too quicly :)
> >
> > After a little digging in
> > ResourceRecordImpl you have :
> >
> > public String get( String id )
> > {
> > return ( String ) attributes.get( id.toLowerCase() );
> > }
> >
> > Which return null for my address, due to the "toLowerCase()".
> >
> > Am I supposed to build my Attribute Set using .toLowerCase() for keys ?
> >
> > Like : attr.put(DnsAttribute.IP_ADDRESS.toLowerCase(),"192.168.66.66");
>
> That will do it, but the intention is for you to use the
> ResourceRecordModifier to create ResourceRecords. The
> ResourceRecordImpl should be packaged-scoped or something - my bad.
> If you look at ResourceRecordModifier#put the id is toLowerCase()'d
> such that when retrieved with 'get' it works. IIRC, this was to deal
> with some issues with the case of attributes being returned by our
> Directory store implementation.
>
> You can re-write your code to instantiate a ResourceRecordModifier.
> Then call sets/puts on the modifier and when you are done call
> getEntry to get a ResourceRecord. That will handle the needed
> canonicalization.
>
> Enrique
Ok, so how I build my RessourceRecord :
ResourceRecordModifier rm=new ResourceRecordModifier();
rm.setDnsClass(RecordClass.IN);
rm.setDnsName("www.test.net");
rm.setDnsTtl(100);
rm.setDnsType(RecordType.A);
rm.put(DnsAttribute.IP_ADDRESS.toLowerCase(),"192.168.66.66");
set.add(rm.getEntry());
return set;
Allways the same dig reply :
:~$ dig @192.168.0.228 -p 10053 www.test.net
;; Warning: Message parser reports malformed message packet.
; <<>> DiG 9.3.4 <<>> @192.168.0.228 -p 10053 www.test.net
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64595
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.test.net. IN A
;; Query time: 52 msec
;; SERVER: 192.168.0.228#10053(192.168.0.228)
;; WHEN: Thu Jun 14 09:32:33 2007
;; MSG SIZE rcvd: 58
I think I'll siwtch back to mina 1.x for see if it's not that
Julien