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 |
|---|---|
void |
addRecord(Record r)
Adds a Record to the Zone
|
void |
addRRset(RRset rrset)
Adds an RRset to the Zone
|
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
|
Iterator |
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.IOExceptionMasterpublic Zone(Name zone, Record[] records) throws IOException
zone - The name of the zone.records - The records to add to the zone.IOExceptionMasterpublic Zone(ZoneTransferIn xfrin) throws IOException, ZoneTransferException
xfrin - The incoming zone transfer to execute.IOExceptionZoneTransferExceptionZoneTransferInpublic Zone(Name zone, int dclass, String remote) throws IOException, ZoneTransferException
IOExceptionZoneTransferExceptionZoneTransferInpublic 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 upSetResponsepublic RRset findExactMatch(Name name, int type)
name - The name to look uptype - The type to look upRRsetpublic void addRRset(RRset rrset)
rrset - The RRset to be addedRRsetpublic void addRecord(Record r)
r - The record to be addedRecordpublic void removeRecord(Record r)
r - The record to be removedRecordpublic Iterator iterator()
public Iterator AXFR()
iterator() except
that the SOA is returned at the end as well as the beginning.public String toMasterFile()