public class Zone extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static int |
PRIMARY
A primary zone
|
static int |
SECONDARY
A secondary zone
|
Constructor and Description |
---|
Zone(Name zone,
int dclass,
String remote)
Creates a Zone by performing a zone transfer to the specified host.
|
Zone(Name zone,
Record[] records)
Creates a Zone from an array of records.
|
Zone(Name zone,
String file)
Creates a Zone from the records in the specified master file.
|
Zone(ZoneTransferIn xfrin)
Creates a Zone by doing the specified zone transfer.
|
Modifier and Type | Method and Description |
---|---|
<T extends Record> |
addRecord(T r)
Adds a Record to the Zone
|
void |
addRRset(RRset rrset)
Adds an RRset to the Zone
|
Iterator<RRset> |
AXFR()
Returns an Iterator over the RRsets in the zone that can be used to construct an AXFR response.
|
RRset |
findExactMatch(Name name,
int type)
Looks up Records in the zone, finding exact matches only.
|
SetResponse |
findRecords(Name name,
int type)
Looks up Records in the Zone.
|
int |
getDClass()
Returns the Zone's class
|
RRset |
getNS()
Returns the Zone origin's NS records
|
Name |
getOrigin()
Returns the Zone's origin
|
SOARecord |
getSOA()
Returns the Zone's SOA record
|
Iterator<RRset> |
iterator()
Returns an Iterator over the RRsets in the zone.
|
void |
removeRecord(Record r)
Removes a record from the Zone
|
String |
toMasterFile()
Returns the contents of the Zone in master file format.
|
String |
toString()
Returns the contents of the Zone as a string (in master file format).
|
public static final int PRIMARY
public static final int SECONDARY
public Zone(Name zone, String file) throws IOException
zone
- The name of the zone.file
- The master file to read from.IOException
Master
public Zone(Name zone, Record[] records) throws IOException
zone
- The name of the zone.records
- The records to add to the zone.IOException
Master
public Zone(ZoneTransferIn xfrin) throws IOException, ZoneTransferException
xfrin
- The incoming zone transfer to execute.IOException
ZoneTransferException
ZoneTransferIn
public Zone(Name zone, int dclass, String remote) throws IOException, ZoneTransferException
IOException
ZoneTransferException
ZoneTransferIn
public Name getOrigin()
public RRset getNS()
public SOARecord getSOA()
public int getDClass()
public SetResponse findRecords(Name name, int type)
CNAME
instead of the actual requested
type and wildcards are expanded.name
- The name to look uptype
- The type to look upSetResponse
public RRset findExactMatch(Name name, int type)
name
- The name to look uptype
- The type to look upRRset
public void addRRset(RRset rrset)
rrset
- The RRset to be addedRRset
public <T extends Record> void addRecord(T r)
r
- The record to be addedRecord
public void removeRecord(Record r)
r
- The record to be removedRecord
public Iterator<RRset> AXFR()
iterator()
except that the SOA is returned at the end as well as
the beginning.public String toMasterFile()
Copyright © 2022 dnsjava.org. All rights reserved.