1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.server.dns.store;
21
22
23 import java.util.HashSet;
24 import java.util.Set;
25
26 import org.apache.directory.server.dns.DnsException;
27 import org.apache.directory.server.dns.messages.QuestionRecord;
28 import org.apache.directory.server.dns.messages.RecordClass;
29 import org.apache.directory.server.dns.messages.RecordType;
30 import org.apache.directory.server.dns.messages.ResourceRecord;
31 import org.apache.directory.server.dns.messages.ResourceRecordModifier;
32
33
34
35
36
37 public class RecordStoreStub implements RecordStore
38 {
39
40 @SuppressWarnings("PMD.AvoidUsingHardCodedIP")
41 public Set<ResourceRecord> getRecords( QuestionRecord question ) throws DnsException
42 {
43 Set<ResourceRecord> set = new HashSet<ResourceRecord>();
44
45 ResourceRecordModifier rm = new ResourceRecordModifier();
46 rm.setDnsClass( RecordClass.IN );
47 rm.setDnsName( "ldap.example.com" );
48 rm.setDnsTtl( 100 );
49 rm.setDnsType( RecordType.A );
50 rm.put( DnsAttribute.IP_ADDRESS, "10.0.0.2" );
51
52 set.add( rm.getEntry() );
53
54 ResourceRecordModifier rm2 = new ResourceRecordModifier();
55 rm2.setDnsClass( RecordClass.IN );
56 rm2.setDnsName( "www.example.com" );
57 rm2.setDnsTtl( 100 );
58 rm2.setDnsType( RecordType.A );
59 rm2.put( DnsAttribute.IP_ADDRESS, "10.0.0.3" );
60
61 set.add( rm2.getEntry() );
62
63 return set;
64 }
65 }