DNS
Class ZoneData

java.lang.Object
  extended byDNS.ZoneData

public class ZoneData
extends java.lang.Object

Data structure that holds information about zones. In particular, holds a list of RRGroups which hold ResourceRecords. RRGroups are stored in Canonical Order (see RFC 2673).


Field Summary
 java.util.HashSet authoritativeRRGroups
          List of all names we are authoritative for, as defined by the AUTH keywods in the .dns file.
 java.util.LinkedList names
          List of RRGroups stored in canonical order.
 java.lang.String zone
          The zone this ZoneData object applies to.
 
Constructor Summary
ZoneData(java.lang.String zone)
          Constructor that specifies the zone and initializes the List for RRGroups.
 
Method Summary
 void addRR(java.lang.String name, ResourceRecord rr, boolean authoratativeKnowledge)
          Add a Resource Record to our database by finding the correct RRGroup and adding it to that group.
 void addRRGroup(java.lang.String name, boolean authoritativeKnowledge)
          Create and add an RRGroup that is defined by a certain name.
 void adjustSIGRecords()
           
 boolean authoritativeFor(java.lang.String name)
          Returns whether or not we are authoritative for this name.
 int getCannonicalIndex(java.lang.String name)
          Computes the Cannonical index of an RRGroup in our list of RRGroups.
 RRGroup getRRGroup(java.lang.String name)
          Method to retrieve an RRGroup with a certain name.
 RRGroup getRRGroup(java.lang.String type, java.lang.String name)
          Return the RRGropu that has a certain name and a Resource Record of a given type.
 java.util.LinkedList getRRGroups(java.lang.String type)
          Search for all RRGroups that have contain a ResourceRecord of a specified type.
 boolean isCannonicallyBefore(java.lang.String first, java.lang.String second)
          Determines if a record's name should come before another's according to Cannonical Ordering.
 java.lang.String toString()
          Standard toString method -- prints out each RRGroup (which prints out each RR)
 void updateDurations(long time)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

names

public java.util.LinkedList names
List of RRGroups stored in canonical order.


zone

public java.lang.String zone
The zone this ZoneData object applies to.


authoritativeRRGroups

public java.util.HashSet authoritativeRRGroups
List of all names we are authoritative for, as defined by the AUTH keywods in the .dns file.

Constructor Detail

ZoneData

public ZoneData(java.lang.String zone)
Constructor that specifies the zone and initializes the List for RRGroups.

Parameters:
zone - The name of this zone
Method Detail

authoritativeFor

public boolean authoritativeFor(java.lang.String name)
Returns whether or not we are authoritative for this name. This is determined by our hashset, as specified in the dns file we read on init (AUTH).


addRRGroup

public void addRRGroup(java.lang.String name,
                       boolean authoritativeKnowledge)
Create and add an RRGroup that is defined by a certain name.

Parameters:
name - The name of the RRGroup to add.

getRRGroups

public java.util.LinkedList getRRGroups(java.lang.String type)
Search for all RRGroups that have contain a ResourceRecord of a specified type. Useful for extracting all of our Name Servers

Parameters:
type - The type of record the RRGroup must have.

getRRGroup

public RRGroup getRRGroup(java.lang.String type,
                          java.lang.String name)
Return the RRGropu that has a certain name and a Resource Record of a given type.

Parameters:
type - The type of the RR that the returned RRGroup must contain
name - The name of the RRGroup tha is returned.
Returns:
An RRGroup that has the name name and an RR of type type. Null if no such RRGroup exists.

getRRGroup

public RRGroup getRRGroup(java.lang.String name)
Method to retrieve an RRGroup with a certain name.

Parameters:
name - The name the RRGroup should have
Returns:
The given RRGroup, null if it does not exist.

getCannonicalIndex

public int getCannonicalIndex(java.lang.String name)
Computes the Cannonical index of an RRGroup in our list of RRGroups.

Parameters:
name - The name of the RRGroup.
Returns:
The index this RRGroup should be placed at within our list.

isCannonicallyBefore

public boolean isCannonicallyBefore(java.lang.String first,
                                    java.lang.String second)
Determines if a record's name should come before another's according to Cannonical Ordering. See draft-ietf-dnsext-dnssec-records-05 for definition of Cannonical Ordering.

Parameters:
first - the name of the frist RRGroup we are checking
second - the name of the second RRGroup we are checking
Returns:
whether or not first is cannonically before second

addRR

public void addRR(java.lang.String name,
                  ResourceRecord rr,
                  boolean authoratativeKnowledge)
Add a Resource Record to our database by finding the correct RRGroup and adding it to that group. If that group does not exist, create it.

Parameters:
name - The name of the RR
rr - The actual RR.

adjustSIGRecords

public void adjustSIGRecords()

updateDurations

public void updateDurations(long time)

toString

public java.lang.String toString()
Standard toString method -- prints out each RRGroup (which prints out each RR)