Package com.verisign.epp.codec.host
Class EPPHostAddress
- java.lang.Object
-
- com.verisign.epp.codec.host.EPPHostAddress
-
- All Implemented Interfaces:
EPPCodecComponent,java.io.Serializable,java.lang.Cloneable
public class EPPHostAddress extends java.lang.Object implements EPPCodecComponent
Represents a host address specified in anEPPHostCreateCmdor in anEPPHostAddRemoveobject of anEPPHostUpdateCmd. An address consists of a name and a type, where type is eitherEPPHostAddress.IPV4orEPPHostAddress.IPV6. The default type isEPPHostAddress.IPV4.- See Also:
EPPHostCreateCmd,EPPHostUpdateCmd,EPPHostAddRemove, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EPPHostAddress()Default constructor forEPPHostAddress.EPPHostAddress(java.lang.String aName)Constructor forEPPHostAddressthat the takes the string name of the IP address with the type set toIPV4.EPPHostAddress(java.lang.String aName, short aType)Constructor forEPPHostAddressthat the takes the string name of the IP address along with the type of the IP address using either the constantEPPHostAddress.IPV4orEPPHostAddress.IPV6.EPPHostAddress(java.lang.String aRootNS, java.lang.String aRootName, java.lang.String aName)Constructor forEPPHostAddressthat the takes the string name of an IPV4 IP address and the root tag to use.EPPHostAddress(java.lang.String aRootNS, java.lang.String aRootName, java.lang.String aName, short aType)Constructor forEPPHostAddressthat the takes the string name of an IPV4 or IPV6 IP address and the root tag to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()CloneEPPHostAddress.voiddecode(org.w3c.dom.Element aElement)Decode theEPPHostAddressattributes from the aElement DOM Element tree.org.w3c.dom.Elementencode(org.w3c.dom.Document aDocument)Encode a DOM Element tree from the attributes of theEPPHostAddressinstance.booleanequals(java.lang.Object aObject)implements a deepEPPHostAddresscompare.java.lang.StringgetName()Gets the addresss name in the format specified bygetType.java.lang.StringgetNamespace()Returns the XML namespace associated with theEPPCodecComponent.java.lang.StringgetRootName()Get root name such as domain.java.lang.StringgetRootNS()Gets the root element XML namespace URI.shortgetType()Gets the type of the address name, which should be either theEPPHostAddress.IPV4or theEPPHostAddress.IPV6constant.voidsetName(java.lang.String aName)Sets the address name in the format specified bysetType.voidsetName(java.lang.String aName, short aType)Sets the address name and address type.voidsetRootName(java.lang.String aRootNS, java.lang.String aRootName)Set root name such as domain.voidsetType(short aType)Sets the type of the address name to either theEPPHostAddress.IPV4or theEPPHostAddress.IPV6constant.java.lang.StringtoString()Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.
-
-
-
Field Detail
-
IPV4
public static final short IPV4
IPV4 IP address constant. This is the default type.- See Also:
- Constant Field Values
-
IPV6
public static final short IPV6
IPV6 IP address constant.- See Also:
- Constant Field Values
-
ELM_NAME
public static final java.lang.String ELM_NAME
XML Element Name ofEPPHostAddressroot element.- See Also:
- Constant Field Values
-
ATTR_IPV6
public static final java.lang.String ATTR_IPV6
IPV6 IP address constant.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EPPHostAddress
public EPPHostAddress()
Default constructor forEPPHostAddress. The name attribute defaults tonulland must be set usingsetNamebefore invokingencode. The type defaults to IPV4.
-
EPPHostAddress
public EPPHostAddress(java.lang.String aName)
Constructor forEPPHostAddressthat the takes the string name of the IP address with the type set toIPV4.- Parameters:
aName- IP address name.
-
EPPHostAddress
public EPPHostAddress(java.lang.String aName, short aType)Constructor forEPPHostAddressthat the takes the string name of the IP address along with the type of the IP address using either the constantEPPHostAddress.IPV4orEPPHostAddress.IPV6.- Parameters:
aName- IP address name.aType-EPPHostAddress.IPV4orEPPHostAddress.IPV6constant.
-
EPPHostAddress
public EPPHostAddress(java.lang.String aRootNS, java.lang.String aRootName, java.lang.String aName)Constructor forEPPHostAddressthat 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 URIaRootName- Root tag for the elementaName- IP address name in IPV4 format.
-
EPPHostAddress
public EPPHostAddress(java.lang.String aRootNS, java.lang.String aRootName, java.lang.String aName, short aType)Constructor forEPPHostAddressthat 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 URIaRootName- Root tag for the elementaName- IP address name in IPV4 format.aType-EPPHostAddress.IPV4orEPPHostAddress.IPV6constant.
-
-
Method Detail
-
getRootNS
public java.lang.String getRootNS()
Gets the root element XML namespace URI.- Returns:
- root element XML namespace URI
-
getRootName
public java.lang.String getRootName()
Get root name such as domain.- Returns:
- Root element tag to use
-
setRootName
public void setRootName(java.lang.String aRootNS, java.lang.String aRootName)Set root name such as domain.- Parameters:
aRootNS- Root element namespace URIaRootName- Root element tag to use
-
getName
public java.lang.String getName()
Gets the addresss name in the format specified bygetType.- Returns:
- Address name
Stringinstance if defined;nullotherwise.
-
setName
public void setName(java.lang.String aName)
Sets the address name in the format specified bysetType.- Parameters:
aName- address name
-
setName
public void setName(java.lang.String aName, short aType)Sets the address name and address type.aTypeshould be eitherEPPHostAddress.IPV4orEPPHostAddress.IPV6, and the address name should conform to the format of the type.- Parameters:
aName- address nameaType- address type ((EPPHostAddress.IPV4orEPPHostAddress.IPV6)
-
getType
public short getType()
Gets the type of the address name, which should be either theEPPHostAddress.IPV4or theEPPHostAddress.IPV6constant.- Returns:
- Type of the address (
EPPHostAddress.IPV4orEPPHostAddress.IPV6)
-
setType
public void setType(short aType)
Sets the type of the address name to either theEPPHostAddress.IPV4or theEPPHostAddress.IPV6constant.- Parameters:
aType-IPV4orIPV6
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeExceptionEncode a DOM Element tree from the attributes of theEPPHostAddressinstance.- Specified by:
encodein interfaceEPPCodecComponent- Parameters:
aDocument- DOM Document that is being built. Used as an Element factory.- Returns:
- Root DOM Element representing the
EPPHostAddressinstance. - Throws:
EPPEncodeException- Unable to encodeEPPHostAddressinstance.
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeExceptionDecode theEPPHostAddressattributes from the aElement DOM Element tree.- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement- Root DOM Element to decodeEPPHostAddressfrom.- Throws:
EPPDecodeException- Unable to decode aElement.
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPHostAddresscompare.- Overrides:
equalsin classjava.lang.Object- Parameters:
aObject-EPPHostAddressinstance to compare with- Returns:
trueifaObjectis equal;falseotherwise.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionCloneEPPHostAddress.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classjava.lang.Object- Returns:
- clone of
EPPHostAddress - Throws:
java.lang.CloneNotSupportedException- standard Object.clone exception
-
toString
public java.lang.String toString()
Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.- Overrides:
toStringin classjava.lang.Object- Returns:
- Indented XML
Stringif successful;ERRORotherwise.
-
getNamespace
public java.lang.String getNamespace()
Returns the XML namespace associated with theEPPCodecComponent.- Specified by:
getNamespacein interfaceEPPCodecComponent- Returns:
- XML namespace for the
EPPCodecComponent.
-
-