DNS
Class RRGroup

java.lang.Object
  extended byDNS.RRGroup
All Implemented Interfaces:
java.io.Serializable

public class RRGroup
extends java.lang.Object
implements java.io.Serializable

Class that holds a group of Resource Records. Note that this 'Group' is not a 'Set', as definted by DNS. In general, for standard DNS, each RRGroup will only have one element (except for SOA records): an A or NS record. But, DNSSEC will add SIG and NXT records to each group.

See Also:
Serialized Form

Field Summary
 long expires
          When this RRGroup expires.
 java.lang.String name
          The name of this RRGroup, the same as the name in its A and NS RRs
 java.util.LinkedList records
          Ordered list of RRs
 
Constructor Summary
RRGroup(java.lang.String name)
          Standard constructor for an RRGroup, specifies the name, initializes data structures, sets expires to be infinite.
 
Method Summary
 void add(ResourceRecord rr)
           
 void adjustSIGRecords()
           
 RRGroup cache()
          Basically a clone operator, copies the RRGroup so it can be sent.
 RRGroup cache(int time)
          Basically a clone operator, copies the RRGroup so it can be sent.
 boolean equals(java.lang.Object o)
           
 ResourceRecord getRecord(java.lang.String type)
          Get a record with a certain type (should not be used for SIG records).
 ResourceRecord getRecord(java.lang.String type, java.lang.String name)
          Get a record with a certain type and name (?!).
 java.util.ArrayList getTypes()
           
 int hashCode()
           
 boolean hasRecord(java.lang.String type)
          Determines wheter or not this RRGroup has an RR with a certain type.
 boolean isExpired()
           
 java.lang.String toString()
           
 void updateDurations(long time)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
The name of this RRGroup, the same as the name in its A and NS RRs


records

public java.util.LinkedList records
Ordered list of RRs


expires

public long expires
When this RRGroup expires. This is used for sending RRGroup information to other nodes. It should be the same (or very very close) to the expires fields of each RR.

Constructor Detail

RRGroup

public RRGroup(java.lang.String name)
Standard constructor for an RRGroup, specifies the name, initializes data structures, sets expires to be infinite.

Method Detail

cache

public RRGroup cache()
Basically a clone operator, copies the RRGroup so it can be sent. Recursively calls cache() on each RR.

Returns:
a copy of this RRGroup

cache

public RRGroup cache(int time)
Basically a clone operator, copies the RRGroup so it can be sent. Recursively calls cache() on each RR. Each RR is reinitialized to expire timems from now.

Parameters:
time - amount of this time this RRGroup should last.
Returns:
a copy of this RRGroup

getRecord

public ResourceRecord getRecord(java.lang.String type)
Get a record with a certain type (should not be used for SIG records).

Parameters:
type - the type this record should have.
Returns:
a Resource record with the specified type.

getRecord

public ResourceRecord getRecord(java.lang.String type,
                                java.lang.String name)
Get a record with a certain type and name (?!).

Parameters:
name - the name this RR should have
type - the type this record should have.
Returns:
a Resource record with the specified type and name.

hasRecord

public boolean hasRecord(java.lang.String type)
Determines wheter or not this RRGroup has an RR with a certain type.

Parameters:
type - The type to check for.
Returns:
whether we have an RR wit this type

adjustSIGRecords

public void adjustSIGRecords()

updateDurations

public void updateDurations(long time)

add

public void add(ResourceRecord rr)

getTypes

public java.util.ArrayList getTypes()

toString

public java.lang.String toString()

isExpired

public boolean isExpired()

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object o)