1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 *
19 */
20 package org.apache.directory.server.dns.service;
21
22
23 import java.util.ArrayList;
24 import java.util.Collection;
25 import java.util.List;
26
27 import org.apache.directory.server.dns.DnsServer;
28 import org.apache.directory.server.dns.messages.DnsMessage;
29 import org.apache.directory.server.dns.messages.ResourceRecord;
30 import org.apache.directory.server.dns.store.RecordStore;
31
32
33 /**
34 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
35 * @version $Rev: 583938 $, $Date: 2007-10-11 21:57:20 +0200 (Do, 11 Okt 2007) $
36 */
37 public class DnsContext
38 {
39 private static final long serialVersionUID = -5911142975867852436L;
40
41 private DnsServer config;
42 private RecordStore store;
43 private DnsMessage reply;
44 private List<ResourceRecord> records = new ArrayList<ResourceRecord>();
45
46
47 /**
48 * @return Returns the recordEntry.
49 */
50 public List<ResourceRecord> getResourceRecords()
51 {
52 return records;
53 }
54
55
56 /**
57 * @param resourceRecord The resourceRecord to add.
58 */
59 public void addResourceRecord( ResourceRecord resourceRecord )
60 {
61 this.records.add( resourceRecord );
62 }
63
64
65 /**
66 * @param resourceRecords The resourceRecords to add.
67 */
68 public void addResourceRecords( Collection<ResourceRecord> resourceRecords )
69 {
70 this.records.addAll( resourceRecords );
71 }
72
73
74 /**
75 * @return Returns the config.
76 */
77 public DnsServer getConfig()
78 {
79 return config;
80 }
81
82
83 /**
84 * @param config The config to set.
85 */
86 public void setConfig( DnsServer config )
87 {
88 this.config = config;
89 }
90
91
92 /**
93 * @return Returns the reply.
94 */
95 public DnsMessage getReply()
96 {
97 return reply;
98 }
99
100
101 /**
102 * @param reply The reply to set.
103 */
104 public void setReply( DnsMessage reply )
105 {
106 this.reply = reply;
107 }
108
109
110 /**
111 * @return Returns the store.
112 */
113 public RecordStore getStore()
114 {
115 return store;
116 }
117
118
119 /**
120 * @param store The store to set.
121 */
122 public void setStore( RecordStore store )
123 {
124 this.store = store;
125 }
126 }