Class EPPHostAddress

java.lang.Object
com.verisign.epp.codec.host.EPPHostAddress
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable

public class EPPHostAddress extends Object implements EPPCodecComponent
Represents a host address specified in an EPPHostCreateCmd or in an EPPHostAddRemove object of an EPPHostUpdateCmd. An address consists of a name and a type, where type is either EPPHostAddress.IPV4 or EPPHostAddress.IPV6. The default type is EPPHostAddress.IPV4.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    IPV6 IP address constant.
    static final String
    XML Element Name of EPPHostAddress root element.
    static final short
    IPV4 IP address constant.
    static final short
    IPV6 IP address constant.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for EPPHostAddress.
    Constructor for EPPHostAddress that the takes the string name of the IP address with the type set to IPV4.
    EPPHostAddress(String aName, short aType)
    Constructor for EPPHostAddress that the takes the string name of the IP address along with the type of the IP address using either the constant EPPHostAddress.IPV4 or EPPHostAddress.IPV6.
    EPPHostAddress(String aRootNS, String aRootName, String aName)
    Constructor for EPPHostAddress that the takes the string name of an IPV4 IP address and the root tag to use.
    EPPHostAddress(String aRootNS, String aRootName, String aName, short aType)
    Constructor for EPPHostAddress that the takes the string name of an IPV4 or IPV6 IP address and the root tag to use.
  • Method Summary

    Modifier and Type
    Method
    Description
    Clone EPPHostAddress.
    void
    decode(Element aElement)
    Decode the EPPHostAddress attributes from the aElement DOM Element tree.
    encode(Document aDocument)
    Encode a DOM Element tree from the attributes of the EPPHostAddress instance.
    boolean
    equals(Object aObject)
    implements a deep EPPHostAddress compare.
    Gets the addresss name in the format specified by getType.
    Returns the XML namespace associated with the EPPCodecComponent.
    Get root name such as domain.
    Gets the root element XML namespace URI.
    short
    Gets the type of the address name, which should be either the EPPHostAddress.IPV4 or the EPPHostAddress.IPV6 constant.
    void
    setName(String aName)
    Sets the address name in the format specified by setType.
    void
    setName(String aName, short aType)
    Sets the address name and address type.
    void
    setRootName(String aRootNS, String aRootName)
    Set root name such as domain.
    void
    setType(short aType)
    Sets the type of the address name to either the EPPHostAddress.IPV4 or the EPPHostAddress.IPV6 constant.
    Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • EPPHostAddress

      public EPPHostAddress()
      Default constructor for EPPHostAddress. The name attribute defaults to null and must be set using setName before invoking encode. The type defaults to IPV4.
    • EPPHostAddress

      public EPPHostAddress(String aName)
      Constructor for EPPHostAddress that the takes the string name of the IP address with the type set to IPV4.
      Parameters:
      aName - IP address name.
    • EPPHostAddress

      public EPPHostAddress(String aName, short aType)
      Constructor for EPPHostAddress that the takes the string name of the IP address along with the type of the IP address using either the constant EPPHostAddress.IPV4 or EPPHostAddress.IPV6.
      Parameters:
      aName - IP address name.
      aType - EPPHostAddress.IPV4 or EPPHostAddress.IPV6 constant.
    • EPPHostAddress

      public EPPHostAddress(String aRootNS, String aRootName, String aName)
      Constructor for EPPHostAddress that the takes the string name of an IPV4 IP address and the root tag to use. This constructor is useful for other mappings like domain.
      Parameters:
      aRootNS - Root element namespace URI
      aRootName - Root tag for the element
      aName - IP address name in IPV4 format.
    • EPPHostAddress

      public EPPHostAddress(String aRootNS, String aRootName, String aName, short aType)
      Constructor for EPPHostAddress that the takes the string name of an IPV4 or IPV6 IP address and the root tag to use. This constructor is useful for other mappings like domain.
      Parameters:
      aRootNS - Root element namespace URI
      aRootName - Root tag for the element
      aName - IP address name in IPV4 format.
      aType - EPPHostAddress.IPV4 or EPPHostAddress.IPV6 constant.
  • Method Details

    • getRootNS

      public String getRootNS()
      Gets the root element XML namespace URI.
      Returns:
      root element XML namespace URI
    • getRootName

      public String getRootName()
      Get root name such as domain.
      Returns:
      Root element tag to use
    • setRootName

      public void setRootName(String aRootNS, String aRootName)
      Set root name such as domain.
      Parameters:
      aRootNS - Root element namespace URI
      aRootName - Root element tag to use
    • getName

      public String getName()
      Gets the addresss name in the format specified by getType.
      Returns:
      Address name String instance if defined; null otherwise.
    • setName

      public void setName(String aName)
      Sets the address name in the format specified by setType.
      Parameters:
      aName - address name
    • setName

      public void setName(String aName, short aType)
      Sets the address name and address type. aType should be either EPPHostAddress.IPV4 or EPPHostAddress.IPV6, and the address name should conform to the format of the type.
      Parameters:
      aName - address name
      aType - address type ((EPPHostAddress.IPV4 or EPPHostAddress.IPV6)
    • getType

      public short getType()
      Gets the type of the address name, which should be either the EPPHostAddress.IPV4 or the EPPHostAddress.IPV6 constant.
      Returns:
      Type of the address (EPPHostAddress.IPV4 or EPPHostAddress.IPV6)
    • setType

      public void setType(short aType)
      Sets the type of the address name to either the EPPHostAddress.IPV4 or the EPPHostAddress.IPV6 constant.
      Parameters:
      aType - IPV4 or IPV6
    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Encode a DOM Element tree from the attributes of the EPPHostAddress instance.
      Specified by:
      encode in interface EPPCodecComponent
      Parameters:
      aDocument - DOM Document that is being built. Used as an Element factory.
      Returns:
      Root DOM Element representing the EPPHostAddress instance.
      Throws:
      EPPEncodeException - Unable to encode EPPHostAddress instance.
    • decode

      public void decode(Element aElement) throws EPPDecodeException
      Decode the EPPHostAddress attributes from the aElement DOM Element tree.
      Specified by:
      decode in interface EPPCodecComponent
      Parameters:
      aElement - Root DOM Element to decode EPPHostAddress from.
      Throws:
      EPPDecodeException - Unable to decode aElement.
    • equals

      public boolean equals(Object aObject)
      implements a deep EPPHostAddress compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPHostAddress instance to compare with
      Returns:
      true if aObject is equal; false otherwise.
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPHostAddress.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      clone of EPPHostAddress
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • toString

      public String toString()
      Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.
      Overrides:
      toString in class Object
      Returns:
      Indented XML String if successful; ERROR otherwise.
    • getNamespace

      public String getNamespace()
      Returns the XML namespace associated with the EPPCodecComponent.
      Specified by:
      getNamespace in interface EPPCodecComponent
      Returns:
      XML namespace for the EPPCodecComponent.