org.xbill.DNS
public class Zone extends java.lang.Object implements java.io.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,
java.lang.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,
java.lang.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 |
---|---|
void |
addRecord(Record r)
Adds a Record to the Zone
|
void |
addRRset(RRset rrset)
Adds an RRset to the Zone
|
java.util.Iterator |
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
|
java.util.Iterator |
iterator()
Returns an Iterator over the RRsets in the zone.
|
void |
removeRecord(Record r)
Removes a record from the Zone
|
java.lang.String |
toMasterFile()
Returns the contents of the Zone in master file format.
|
java.lang.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, java.lang.String file) throws java.io.IOException
zone
- The name of the zone.file
- The master file to read from.java.io.IOException
Master
public Zone(Name zone, Record[] records) throws java.io.IOException
zone
- The name of the zone.records
- The records to add to the zone.java.io.IOException
Master
public Zone(ZoneTransferIn xfrin) throws java.io.IOException, ZoneTransferException
xfrin
- The incoming zone transfer to execute.java.io.IOException
ZoneTransferException
ZoneTransferIn
public Zone(Name zone, int dclass, java.lang.String remote) throws java.io.IOException, ZoneTransferException
java.io.IOException
ZoneTransferException
ZoneTransferIn
public Name getOrigin()
public RRset getNS()
public SOARecord getSOA()
public int getDClass()
public SetResponse findRecords(Name name, int type)
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 void addRecord(Record r)
r
- The record to be addedRecord
public void removeRecord(Record r)
r
- The record to be removedRecord
public java.util.Iterator iterator()
public java.util.Iterator AXFR()
iterator()
except
that the SOA is returned at the end as well as the beginning.public java.lang.String toMasterFile()
public java.lang.String toString()
toString
in class java.lang.Object