de.knipp.rritoolkit.dns
Class DnsEntry

java.lang.Object
  extended by de.knipp.rritoolkit.dns.DnsEntry
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DnsEntryAddress, DnsEntryDNSKEY, DnsEntryMX, DnsEntryNS

public abstract class DnsEntry
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

base class for all name server entries

Version:
$Revision: 15112 $
Author:
Klaus Malorny
See Also:
Serialized Form

Field Summary
private  java.lang.String owner
          the owner name
private static java.util.regex.Pattern parsePattern
          the pattern to match the entry
 
Constructor Summary
DnsEntry()
           
 
Method Summary
abstract  void accept(DnsEntryVisitor visitor)
          accepts the given visitor
static java.util.List<DnsEntry> allFromList(KVList list, java.lang.String encodedDomainName)
          create an instances from the given key-value list
 DnsEntry clone()
          creates a clone of this instance.
private static DnsEntry createNSEntry(java.lang.String value)
          create an name server entry
static DnsEntry fromXml(org.w3c.dom.Element el)
          creates an instance from the given XML element
 java.lang.String getOwner()
          returns the owner
protected static boolean isIPv6(java.lang.String addr)
          test whether the given address is an IPv6 address
protected  void setOwner(java.lang.String theOwner)
          sets the owner
abstract  void toList(KVList list)
          converts the instance to an entry in the given list
abstract  void toXml(org.w3c.dom.Node node, java.lang.String encodedDomainName)
          converts the instance to XML
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner

private java.lang.String owner
the owner name


parsePattern

private static final java.util.regex.Pattern parsePattern
the pattern to match the entry

Constructor Detail

DnsEntry

public DnsEntry()
Method Detail

createNSEntry

private static DnsEntry createNSEntry(java.lang.String value)
                               throws ResponseParseException
create an name server entry

Parameters:
value - the value
Returns:
the created object
Throws:
ResponseParseException - if the data was not recognized

allFromList

public static java.util.List<DnsEntry> allFromList(KVList list,
                                                   java.lang.String encodedDomainName)
                                            throws ResponseParseException
create an instances from the given key-value list

Parameters:
list - the list
encodedDomainName - the encoded domain name from the domain info data
Returns:
the created objects
Throws:
ResponseParseException - if the data was not recognized

fromXml

public static DnsEntry fromXml(org.w3c.dom.Element el)
                        throws org.w3c.dom.DOMException,
                               ResponseParseException
creates an instance from the given XML element

Parameters:
el - the element
Returns:
the created object
Throws:
org.w3c.dom.DOMException - on DOM exceptions
ResponseParseException - if the data was not recognized

toList

public abstract void toList(KVList list)
                     throws EncodeException
converts the instance to an entry in the given list

Parameters:
list - the list
Throws:
EncodeException - if the encoding fails

toXml

public abstract void toXml(org.w3c.dom.Node node,
                           java.lang.String encodedDomainName)
                    throws org.w3c.dom.DOMException,
                           EncodeException
converts the instance to XML

Parameters:
node - the node to append to
encodedDomainName - the encoded domain name from the domain info data
Throws:
org.w3c.dom.DOMException - on DOM exceptions
EncodeException - if the encoding fails

accept

public abstract void accept(DnsEntryVisitor visitor)
accepts the given visitor

Parameters:
visitor - the visitor

clone

public DnsEntry clone()
creates a clone of this instance.

Overrides:
clone in class java.lang.Object
Returns:
the clone

isIPv6

protected static boolean isIPv6(java.lang.String addr)
test whether the given address is an IPv6 address

Parameters:
addr - the address
Returns:
true if it is likely an IPv6 address

getOwner

public java.lang.String getOwner()
returns the owner

Returns:
the owner

setOwner

protected void setOwner(java.lang.String theOwner)
sets the owner

Parameters:
theOwner - the owner


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH