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 anEPPHostCreateCmd
or in anEPPHostAddRemove
object of anEPPHostUpdateCmd
. An address consists of a name and a type, where type is eitherEPPHostAddress.IPV4
orEPPHostAddress.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 forEPPHostAddress
that the takes the string name of the IP address with the type set toIPV4
.EPPHostAddress(java.lang.String aName, short aType)
Constructor forEPPHostAddress
that the takes the string name of the IP address along with the type of the IP address using either the constantEPPHostAddress.IPV4
orEPPHostAddress.IPV6
.EPPHostAddress(java.lang.String aRootNS, java.lang.String aRootName, java.lang.String aName)
Constructor forEPPHostAddress
that 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 forEPPHostAddress
that 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.Object
clone()
CloneEPPHostAddress
.void
decode(org.w3c.dom.Element aElement)
Decode theEPPHostAddress
attributes from the aElement DOM Element tree.org.w3c.dom.Element
encode(org.w3c.dom.Document aDocument)
Encode a DOM Element tree from the attributes of theEPPHostAddress
instance.boolean
equals(java.lang.Object aObject)
implements a deepEPPHostAddress
compare.java.lang.String
getName()
Gets the addresss name in the format specified bygetType
.java.lang.String
getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.java.lang.String
getRootName()
Get root name such as domain.java.lang.String
getRootNS()
Gets the root element XML namespace URI.short
getType()
Gets the type of the address name, which should be either theEPPHostAddress.IPV4
or theEPPHostAddress.IPV6
constant.void
setName(java.lang.String aName)
Sets the address name in the format specified bysetType
.void
setName(java.lang.String aName, short aType)
Sets the address name and address type.void
setRootName(java.lang.String aRootNS, java.lang.String aRootName)
Set root name such as domain.void
setType(short aType)
Sets the type of the address name to either theEPPHostAddress.IPV4
or theEPPHostAddress.IPV6
constant.java.lang.String
toString()
Implementation ofObject.toString
, which will result in an indented XMLString
representation 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 ofEPPHostAddress
root 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 tonull
and must be set usingsetName
before invokingencode
. The type defaults to IPV4.
-
EPPHostAddress
public EPPHostAddress(java.lang.String aName)
Constructor forEPPHostAddress
that 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 forEPPHostAddress
that the takes the string name of the IP address along with the type of the IP address using either the constantEPPHostAddress.IPV4
orEPPHostAddress.IPV6
.- Parameters:
aName
- IP address name.aType
-EPPHostAddress.IPV4
orEPPHostAddress.IPV6
constant.
-
EPPHostAddress
public EPPHostAddress(java.lang.String aRootNS, java.lang.String aRootName, java.lang.String aName)
Constructor forEPPHostAddress
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 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 forEPPHostAddress
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 URIaRootName
- Root tag for the elementaName
- IP address name in IPV4 format.aType
-EPPHostAddress.IPV4
orEPPHostAddress.IPV6
constant.
-
-
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
String
instance if defined;null
otherwise.
-
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.aType
should be eitherEPPHostAddress.IPV4
orEPPHostAddress.IPV6
, and the address name should conform to the format of the type.- Parameters:
aName
- address nameaType
- address type ((EPPHostAddress.IPV4
orEPPHostAddress.IPV6
)
-
getType
public short getType()
Gets the type of the address name, which should be either theEPPHostAddress.IPV4
or theEPPHostAddress.IPV6
constant.- Returns:
- Type of the address (
EPPHostAddress.IPV4
orEPPHostAddress.IPV6
)
-
setType
public void setType(short aType)
Sets the type of the address name to either theEPPHostAddress.IPV4
or theEPPHostAddress.IPV6
constant.- Parameters:
aType
-IPV4
orIPV6
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
Encode a DOM Element tree from the attributes of theEPPHostAddress
instance.- Specified by:
encode
in interfaceEPPCodecComponent
- 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 encodeEPPHostAddress
instance.
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException
Decode theEPPHostAddress
attributes from the aElement DOM Element tree.- Specified by:
decode
in interfaceEPPCodecComponent
- Parameters:
aElement
- Root DOM Element to decodeEPPHostAddress
from.- Throws:
EPPDecodeException
- Unable to decode aElement.
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPHostAddress
compare.- Overrides:
equals
in classjava.lang.Object
- Parameters:
aObject
-EPPHostAddress
instance to compare with- Returns:
true
ifaObject
is equal;false
otherwise.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPHostAddress
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in 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 XMLString
representation of the concreteEPPCodecComponent
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Indented XML
String
if successful;ERROR
otherwise.
-
getNamespace
public java.lang.String getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.- Specified by:
getNamespace
in interfaceEPPCodecComponent
- Returns:
- XML namespace for the
EPPCodecComponent
.
-
-