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 */ 020package org.apache.directory.server.dns.service; 021 022 023import java.util.ArrayList; 024import java.util.Collection; 025import java.util.List; 026 027import org.apache.directory.server.dns.DnsServer; 028import org.apache.directory.server.dns.messages.DnsMessage; 029import org.apache.directory.server.dns.messages.ResourceRecord; 030import org.apache.directory.server.dns.store.RecordStore; 031 032 033/** 034 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 035 */ 036public class DnsContext 037{ 038 private static final long serialVersionUID = -5911142975867852436L; 039 040 private DnsServer config; 041 private RecordStore store; 042 private DnsMessage reply; 043 private List<ResourceRecord> records = new ArrayList<>(); 044 045 046 /** 047 * @return Returns the recordEntry. 048 */ 049 public List<ResourceRecord> getResourceRecords() 050 { 051 return records; 052 } 053 054 055 /** 056 * @param resourceRecord The resourceRecord to add. 057 */ 058 public void addResourceRecord( ResourceRecord resourceRecord ) 059 { 060 this.records.add( resourceRecord ); 061 } 062 063 064 /** 065 * @param resourceRecords The resourceRecords to add. 066 */ 067 public void addResourceRecords( Collection<ResourceRecord> resourceRecords ) 068 { 069 this.records.addAll( resourceRecords ); 070 } 071 072 073 /** 074 * @return Returns the config. 075 */ 076 public DnsServer getConfig() 077 { 078 return config; 079 } 080 081 082 /** 083 * @param config The config to set. 084 */ 085 public void setConfig( DnsServer config ) 086 { 087 this.config = config; 088 } 089 090 091 /** 092 * @return Returns the reply. 093 */ 094 public DnsMessage getReply() 095 { 096 return reply; 097 } 098 099 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}