org.xbill.DNS
Class Zone

java.lang.Object
  |
  +--org.xbill.DNS.NameSet
        |
        +--org.xbill.DNS.Zone

public class Zone
extends org.xbill.DNS.NameSet

A DNS Zone. This encapsulates all data related to a Zone, and provides convienient lookup methods.


Field Summary
static int PRIMARY
          A primary zone
static int SECONDARY
          A secondary zone (unimplemented)
 
Constructor Summary
Zone(Name zone, short _dclass, String remote, Cache cache)
          Creates a Zone from the records in the specified master file.
Zone(String file, Cache cache)
          Creates a Zone from the records in the specified master file.
 
Method Summary
 void addRecord(Record r)
          Adds a record to the Zone
 Enumeration AXFR()
           
 RRset findExactMatch(Name name, short type)
          Looks up Records in the zone, finding exact matches only.
 SetResponse findRecords(Name name, short type)
          Looks up Records in the Zone.
 short 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
 
Methods inherited from class org.xbill.DNS.NameSet
addSet, clear, findExactSet, findName, findSets, removeName, removeSet, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRIMARY

public static final int PRIMARY
A primary zone

SECONDARY

public static final int SECONDARY
A secondary zone (unimplemented)
Constructor Detail

Zone

public Zone(String file,
            Cache cache)
     throws IOException
Creates a Zone from the records in the specified master file. All records that do not belong in the Zone are added to the specified Cache.
See Also:
Cache, Master

Zone

public Zone(Name zone,
            short _dclass,
            String remote,
            Cache cache)
     throws IOException
Creates a Zone from the records in the specified master file. All records that do not belong in the Zone are added to the specified Cache.
See Also:
Cache, Master
Method Detail

getOrigin

public Name getOrigin()
Returns the Zone's origin

getNS

public RRset getNS()
Returns the Zone origin's NS records

getSOA

public SOARecord getSOA()
Returns the Zone's SOA record

getDClass

public short getDClass()
Returns the Zone's class

findRecords

public SetResponse findRecords(Name name,
                               short type)
Looks up Records in the Zone. This follows CNAMEs and wildcards.
Parameters:
name - The name to look up
type - The type to look up
Returns:
A SetResponse object
See Also:
SetResponse

findExactMatch

public RRset findExactMatch(Name name,
                            short type)
Looks up Records in the zone, finding exact matches only.
Parameters:
name - The name to look up
type - The type to look up
Returns:
The matching RRset
See Also:
RRset

addRecord

public void addRecord(Record r)
Adds a record to the Zone
Parameters:
r - The record to be added
See Also:
Record

AXFR

public Enumeration AXFR()