com.antiaction.dns.record
Class DNSRDataSOA

java.lang.Object
  |
  +--com.antiaction.dns.record.DNSRDataSOA
All Implemented Interfaces:
java.lang.Cloneable, DNSRDataInterface

public class DNSRDataSOA
extends java.lang.Object
implements DNSRDataInterface

DNS SOA Record container. As defined in rfc1035.

Version:
2.00
Author:
Nicholas Clarke

Field Summary
protected  int expire
          A 32 bit time value that specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative.
protected  int minimum
          The unsigned 32 bit minimum TTL field that should be exported with any RR from this zone.
protected  java.lang.String mname
          Name server that was the original or primary source of data for this zone.
protected  int refresh
          A 32 bit time interval before the zone should be refreshed.
protected  int retry
          A 32 bit time interval that should elapse before a failed refresh should be retried.
protected  java.lang.String rname
          Mailbox of the person responsible for this zone.
protected static int rtype
          Record of type SOA.
protected  int serial
          The unsigned 32 bit version number of the original copy of the zone.
 
Constructor Summary
DNSRDataSOA()
          Instantiate and initialize a default SOA record object.
 
Method Summary
 byte[] buildPacket(DNSName dnsname, int globalIdx)
          Build and return the rdata packet on the internal state.
 java.lang.Object clone()
          Overrides Cloneable.
 void disassemblePacket(DNSName dnsname, byte[] pDat, int pIdx, int pLen)
          Parses the rdata part of a record.
 int getDisassembledLen()
          Returns the length of the previously disassembled rdata part.
 int getExpire()
          Get the 32 bit time value that specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative.
 int getMinimum()
          Get the unsigned 32 bit minimum TTL field that should be exported with any RR from this zone.
 java.lang.String getMName()
          Get the Name server that was the original or primary source of data for this zone.
 int getRefresh()
          Get the 32 bit time interval before the zone should be refreshed.
 int getRetry()
          Get the 32 bit time interval that should elapse before a failed refresh should be retried.
 java.lang.String getRName()
          Get the mailbox of the person responsible for this zone.
 int getRType()
          Get the record type.
 int getSerial()
          Get the unsigned 32 bit version number of the original copy of the zone.
 void setDebug(boolean b)
          Toggle debug status.
 void setExpire(int e)
          Set the 32 bit time value that specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative.
 void setMinimum(int ttl)
          Set the unsigned 32 bit minimum TTL field that should be exported with any RR from this zone.
 void setMName(java.lang.String mn)
          Set the Name server that was the original or primary source of data for this zone.
 void setRefresh(int r)
          Set the 32 bit time interval before the zone should be refreshed.
 void setRetry(int r)
          Set the 32 bit time interval that should elapse before a failed refresh should be retried.
 void setRName(java.lang.String rn)
          Set the mailbox of the person responsible for this zone.
 void setSerial(int s)
          Set the unsigned 32 bit version number of the original copy of the zone.
 java.lang.String toString()
          Returns a string representation of the internal state, mostly for debugging purposes.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rtype

protected static int rtype
Record of type SOA.

mname

protected java.lang.String mname
Name server that was the original or primary source of data for this zone.

rname

protected java.lang.String rname
Mailbox of the person responsible for this zone.

serial

protected int serial
The unsigned 32 bit version number of the original copy of the zone.

refresh

protected int refresh
A 32 bit time interval before the zone should be refreshed.

retry

protected int retry
A 32 bit time interval that should elapse before a failed refresh should be retried.

expire

protected int expire
A 32 bit time value that specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative.

minimum

protected int minimum
The unsigned 32 bit minimum TTL field that should be exported with any RR from this zone.
Constructor Detail

DNSRDataSOA

public DNSRDataSOA()
Instantiate and initialize a default SOA record object.
Method Detail

clone

public java.lang.Object clone()
Overrides Cloneable.
Specified by:
clone in interface DNSRDataInterface
Overrides:
clone in class java.lang.Object
Returns:
a clone of this instance.
Throws:
OutOfMemoryError - if there is not enough memory.
See Also:
Cloneable

setDebug

public void setDebug(boolean b)
Toggle debug status.
Specified by:
setDebug in interface DNSRDataInterface
Parameters:
b - boolean.

buildPacket

public byte[] buildPacket(DNSName dnsname,
                          int globalIdx)
                   throws DNSNameException
Build and return the rdata packet on the internal state.
Specified by:
buildPacket in interface DNSRDataInterface
Parameters:
dnsname - used for domain name compression in the same message.
globalIdx - current index of the message being assembled. (Domain name compression)
Returns:
the rdata part of the message as a byte array.
Throws:
DNSNameException - if the domain name is invalid.

getDisassembledLen

public int getDisassembledLen()
Returns the length of the previously disassembled rdata part.
Specified by:
getDisassembledLen in interface DNSRDataInterface
See Also:
disassemblePacket(DNSName, byte[], int, int)

disassemblePacket

public void disassemblePacket(DNSName dnsname,
                              byte[] pDat,
                              int pIdx,
                              int pLen)
                       throws DNSNameException,
                              DNSRDataException
Parses the rdata part of a record.
Specified by:
disassemblePacket in interface DNSRDataInterface
Parameters:
dnsname - used for domain name compression in the same message.
pDat - array containing the complete packet.
pIdx - index to where in the array the rdata part begins.
pLen - length of the whole packet.
Throws:
DNSRDataException - if the packet is corrupted.
DNSNameException - if the domain name is invalid.
See Also:
getDisassembledLen()

getRType

public int getRType()
Get the record type.
Specified by:
getRType in interface DNSRDataInterface
Returns:
record type.

setMName

public void setMName(java.lang.String mn)
Set the Name server that was the original or primary source of data for this zone.
Parameters:
mn - nameserver.

getMName

public java.lang.String getMName()
Get the Name server that was the original or primary source of data for this zone.
Returns:
nameserver.

setRName

public void setRName(java.lang.String rn)
Set the mailbox of the person responsible for this zone.
Parameters:
rn - mailbox.

getRName

public java.lang.String getRName()
Get the mailbox of the person responsible for this zone.
Returns:
mailbox.

setSerial

public void setSerial(int s)
Set the unsigned 32 bit version number of the original copy of the zone.
Parameters:
s - serial number.

getSerial

public int getSerial()
Get the unsigned 32 bit version number of the original copy of the zone.
Returns:
serial number.

setRefresh

public void setRefresh(int r)
Set the 32 bit time interval before the zone should be refreshed.
Parameters:
r - time interval.

getRefresh

public int getRefresh()
Get the 32 bit time interval before the zone should be refreshed.
Returns:
time interval.

setRetry

public void setRetry(int r)
Set the 32 bit time interval that should elapse before a failed refresh should be retried.
Parameters:
r - time interval.

getRetry

public int getRetry()
Get the 32 bit time interval that should elapse before a failed refresh should be retried.
Returns:
time interval.

setExpire

public void setExpire(int e)
Set the 32 bit time value that specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative.
Parameters:
e - time interval.

getExpire

public int getExpire()
Get the 32 bit time value that specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative.
Returns:
time interval.

setMinimum

public void setMinimum(int ttl)
Set the unsigned 32 bit minimum TTL field that should be exported with any RR from this zone.
Parameters:
ttl - Time To Live.

getMinimum

public int getMinimum()
Get the unsigned 32 bit minimum TTL field that should be exported with any RR from this zone.
Returns:
Time To Live.

toString

public java.lang.String toString()
Returns a string representation of the internal state, mostly for debugging purposes.
Specified by:
toString in interface DNSRDataInterface
Overrides:
toString in class java.lang.Object
Returns:
debug string.