View Javadoc
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   */
36  public class DnsContext
37  {
38      private static final long serialVersionUID = -5911142975867852436L;
39  
40      private DnsServer config;
41      private RecordStore store;
42      private DnsMessage reply;
43      private List<ResourceRecord> records = new ArrayList<>();
44  
45  
46      /**
47       * @return Returns the recordEntry.
48       */
49      public List<ResourceRecord> getResourceRecords()
50      {
51          return records;
52      }
53  
54  
55      /**
56       * @param resourceRecord The resourceRecord to add.
57       */
58      public void addResourceRecord( ResourceRecord resourceRecord )
59      {
60          this.records.add( resourceRecord );
61      }
62  
63  
64      /**
65       * @param resourceRecords The resourceRecords to add.
66       */
67      public void addResourceRecords( Collection<ResourceRecord> resourceRecords )
68      {
69          this.records.addAll( resourceRecords );
70      }
71  
72  
73      /**
74       * @return Returns the config.
75       */
76      public DnsServer getConfig()
77      {
78          return config;
79      }
80  
81  
82      /**
83       * @param config The config to set.
84       */
85      public void setConfig( DnsServer config )
86      {
87          this.config = config;
88      }
89  
90  
91      /**
92       * @return Returns the reply.
93       */
94      public DnsMessage getReply()
95      {
96          return reply;
97      }
98  
99  
100     /**
101      * @param reply The reply to set.
102      */
103     public void setReply( DnsMessage reply )
104     {
105         this.reply = reply;
106     }
107 
108 
109     /**
110      * @return Returns the store.
111      */
112     public RecordStore getStore()
113     {
114         return store;
115     }
116 
117 
118     /**
119      * @param store The store to set.
120      */
121     public void setStore( RecordStore store )
122     {
123         this.store = store;
124     }
125 }