001    /*
002     *  Licensed to the Apache Software Foundation (ASF) under one
003     *  or more contributor license agreements.  See the NOTICE file
004     *  distributed with this work for additional information
005     *  regarding copyright ownership.  The ASF licenses this file
006     *  to you under the Apache License, Version 2.0 (the
007     *  "License"); you may not use this file except in compliance
008     *  with the License.  You may obtain a copy of the License at
009     *  
010     *    http://www.apache.org/licenses/LICENSE-2.0
011     *  
012     *  Unless required by applicable law or agreed to in writing,
013     *  software distributed under the License is distributed on an
014     *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     *  KIND, either express or implied.  See the License for the
016     *  specific language governing permissions and limitations
017     *  under the License. 
018     *  
019     */
020    package org.apache.directory.server.dns.service;
021    
022    
023    import java.util.ArrayList;
024    import java.util.Collection;
025    import java.util.List;
026    
027    import org.apache.directory.server.dns.DnsServer;
028    import org.apache.directory.server.dns.messages.DnsMessage;
029    import org.apache.directory.server.dns.messages.ResourceRecord;
030    import org.apache.directory.server.dns.store.RecordStore;
031    
032    
033    /**
034     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
035     * @version $Rev: 583938 $, $Date: 2007-10-11 21:57:20 +0200 (Thu, 11 Oct 2007) $
036     */
037    public class DnsContext
038    {
039        private static final long serialVersionUID = -5911142975867852436L;
040    
041        private DnsServer config;
042        private RecordStore store;
043        private DnsMessage reply;
044        private List<ResourceRecord> records = new ArrayList<ResourceRecord>();
045    
046    
047        /**
048         * @return Returns the recordEntry.
049         */
050        public List<ResourceRecord> getResourceRecords()
051        {
052            return records;
053        }
054    
055    
056        /**
057         * @param resourceRecord The resourceRecord to add.
058         */
059        public void addResourceRecord( ResourceRecord resourceRecord )
060        {
061            this.records.add( resourceRecord );
062        }
063    
064    
065        /**
066         * @param resourceRecords The resourceRecords to add.
067         */
068        public void addResourceRecords( Collection<ResourceRecord> resourceRecords )
069        {
070            this.records.addAll( resourceRecords );
071        }
072    
073    
074        /**
075         * @return Returns the config.
076         */
077        public DnsServer getConfig()
078        {
079            return config;
080        }
081    
082    
083        /**
084         * @param config The config to set.
085         */
086        public void setConfig( DnsServer config )
087        {
088            this.config = config;
089        }
090    
091    
092        /**
093         * @return Returns the reply.
094         */
095        public DnsMessage getReply()
096        {
097            return reply;
098        }
099    
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    }