org.nhindirect.config.store
Class DNSRecord

java.lang.Object
  extended by org.nhindirect.config.store.DNSRecord

@Entity
public class DNSRecord
extends Object


Constructor Summary
DNSRecord()
           
 
Method Summary
 boolean equals(Object ob)
          
static DNSRecord fromWire(byte[] data)
          Converts a raw wire transfer format of a record to a DNS record.
 Calendar getCreateTime()
          Gets the date/time the record was created.
 byte[] getData()
          Get the rdata of the record.
 int getDclass()
          Gets the DNS record class such as IN, HS, and CH.
 long getId()
          Gets the internal id of the record.
 String getName()
          Gets the name associated with this DNS entry.
 long getTtl()
          Gets the record time to live in seconds.
 int getType()
          Gets the type of the DNS record such as A, SRV, CERT, MX, and SOA.
 void setCreateTime(Calendar timestamp)
          Sets the date/time the record was created.
 void setData(byte[] data)
          Sets the rdata of the record.
 void setDclass(int dclass)
          Sets the DNS record class.
 void setId(long id)
          Sets the internal id of the record.
 void setName(String name)
          Sets the name associated with this DNS entry.
 void setTtl(long ttl)
          Sets the record time to live in seconds.
 void setType(int type)
          Gets the type of the DNS record such as A, SRV, CERT, MX, and SOA.
static byte[] toWire(DNSRecord rec)
          Converts a DNS record to a raw wire transfer format.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DNSRecord

public DNSRecord()
Method Detail

getId

public long getId()
Gets the internal id of the record. The record id is the primary key of the record JPA store.

Returns:
The internal id of the record.

setId

public void setId(long id)
Sets the internal id of the record.

Parameters:
id - The internal id of the record.

getName

public String getName()
Gets the name associated with this DNS entry. The is generally the name that is used for lookup purposes.

Returns:
The name associated with this DNS entry.

setName

public void setName(String name)
Sets the name associated with this DNS entry.

Parameters:
name - The name associated with this DNS entry.

getType

public int getType()
Gets the type of the DNS record such as A, SRV, CERT, MX, and SOA.

Returns:
The type of the DNS record.

setType

public void setType(int type)
Gets the type of the DNS record such as A, SRV, CERT, MX, and SOA.

Parameters:
type - The type of the DNS record.

getDclass

public int getDclass()
Gets the DNS record class such as IN, HS, and CH.

Returns:
The DNS record class.

setDclass

public void setDclass(int dclass)
Sets the DNS record class.

Parameters:
dclass - The DNS record class.

getTtl

public long getTtl()
Gets the record time to live in seconds. The ttl represents how long a record can cached before it is considered stale.

Returns:
The record time to live in seconds.

setTtl

public void setTtl(long ttl)
Sets the record time to live in seconds.

Parameters:
ttl - The record time to live in seconds.

getCreateTime

public Calendar getCreateTime()
Gets the date/time the record was created.

Returns:
Gets the date/time the record was created.

setCreateTime

public void setCreateTime(Calendar timestamp)
Sets the date/time the record was created.

Parameters:
timestamp - The date/time the record was created.

getData

public byte[] getData()
Get the rdata of the record. Rdata is generally the value of a DNS lookup such an IP address for an A lookup or an X509 certificate for a CERT lookup.

Returns:
The Rdata of the record.

setData

public void setData(byte[] data)
Sets the rdata of the record.

Parameters:
data - The rdata of the record.

fromWire

public static DNSRecord fromWire(byte[] data)
                          throws IOException
Converts a raw wire transfer format of a record to a DNS record.

Parameters:
data - The raw byte stream of a record in wire transfer format.
Returns:
A DNSRecord converted from the wire format.
Throws:
IOException

toWire

public static byte[] toWire(DNSRecord rec)
                     throws IOException
Converts a DNS record to a raw wire transfer format.

Parameters:
rec - The DNSRecord to convert.
Returns:
A byte array representation of the DNSRecord in raw wire transfer format.
Throws:
IOException

equals

public boolean equals(Object ob)

Overrides:
equals in class Object
Returns:


Copyright © 2011. All Rights Reserved.