Package com.verisign.epp.codec.domain
Class EPPDomainPeriod
- java.lang.Object
-
- com.verisign.epp.codec.domain.EPPDomainPeriod
-
- All Implemented Interfaces:
EPPCodecComponent
,java.io.Serializable
,java.lang.Cloneable
public class EPPDomainPeriod extends java.lang.Object implements EPPCodecComponent
Represents a domain Period. A domain name object MAY have a specified validity period. If server policy supports domain object validity periods, the validity period is defined when a domain object is created, and it MAY be extended by the EPP <renew> or <transfer> commands. As a matter of server policy, this specification does not define actions to be taken upon expiration of a domain object's validity period.
Validity periods are measured in years or months with the appropriate units specified using theunit
attribute. Valid values for theunit
attribute arey
for years andm
for months.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ELM_LOCALNAME
XML local name forEPPDomainPeriod
.static java.lang.String
ELM_NAME
XML Element Name ofEPPDomainPeriod
root element.static java.lang.String
PERIOD_UNIT_MONTH
Period in Unit Monthstatic java.lang.String
PERIOD_UNIT_YEAR
Period in Unit Year
-
Constructor Summary
Constructors Constructor Description EPPDomainPeriod()
EPPDomainPeriod
default constructor.EPPDomainPeriod(int aPeriod)
EPPDomainPeriod
constructor that takes the domain period (in unit of year) as an argumentEPPDomainPeriod(java.lang.String aPUnit, int aPeriod)
EPPDomainPeriod
constructor that takes the domain period and period unit as an arguments
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
CloneEPPDomainPeriod
.void
decode(org.w3c.dom.Element aElement)
Decode the EPPDomainPeriod 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 the EPPDomainPeriod instance.boolean
equals(java.lang.Object aObject)
implements a deepEPPDomainPeriod
compare.java.lang.String
getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.int
getPeriod()
Get domain period.java.lang.String
getPUnit()
Get domain period unit.boolean
isPeriodUnspec()
Test whether the period has been specfied:true
is unspecified andfalse
is specified.void
setPeriod(int newPeriod)
Set domain period.void
setPUnit(java.lang.String newPUnit)
Set domain period of un.java.lang.String
toString()
Implementation ofObject.toString
, which will result in an indented XMLString
representation of the concreteEPPCodecComponent
.
-
-
-
Field Detail
-
ELM_LOCALNAME
public static final java.lang.String ELM_LOCALNAME
XML local name forEPPDomainPeriod
.- See Also:
- Constant Field Values
-
ELM_NAME
public static final java.lang.String ELM_NAME
XML Element Name ofEPPDomainPeriod
root element.- See Also:
- Constant Field Values
-
PERIOD_UNIT_MONTH
public static final java.lang.String PERIOD_UNIT_MONTH
Period in Unit Month- See Also:
- Constant Field Values
-
PERIOD_UNIT_YEAR
public static final java.lang.String PERIOD_UNIT_YEAR
Period in Unit Year- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EPPDomainPeriod
public EPPDomainPeriod()
EPPDomainPeriod
default constructor. The period is initialized tounspecified
. The period must be set before invokingencode
.
-
EPPDomainPeriod
public EPPDomainPeriod(int aPeriod)
EPPDomainPeriod
constructor that takes the domain period (in unit of year) as an argument- Parameters:
aPeriod
- int
-
EPPDomainPeriod
public EPPDomainPeriod(java.lang.String aPUnit, int aPeriod)
EPPDomainPeriod
constructor that takes the domain period and period unit as an arguments- Parameters:
aPUnit
- StringaPeriod
- int
-
-
Method Detail
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPDomainPeriod
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in classjava.lang.Object
- Returns:
- clone of
EPPDomainPeriod
- Throws:
java.lang.CloneNotSupportedException
- standard Object.clone exception
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException
Decode the EPPDomainPeriod attributes from the aElement DOM Element tree.- Specified by:
decode
in interfaceEPPCodecComponent
- Parameters:
aElement
- - Root DOM Element to decode EPPDomainPeriod from.- Throws:
EPPDecodeException
- Unable to decode aElement
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
Encode a DOM Element tree from the attributes of the EPPDomainPeriod instance.- Specified by:
encode
in interfaceEPPCodecComponent
- Parameters:
aDocument
- - DOM Document that is being built. Used as an Element factory.- Returns:
- Element - Root DOM Element representing the EPPDomainPeriod instance.
- Throws:
EPPEncodeException
- - Unable to encode EPPDomainPeriod instance.
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPDomainPeriod
compare.- Overrides:
equals
in classjava.lang.Object
- Parameters:
aObject
-EPPDomainPeriod
instance to compare with- Returns:
true
if equal;false
otherwise.
-
getPeriod
public int getPeriod()
Get domain period.- Returns:
- int
-
getPUnit
public java.lang.String getPUnit()
Get domain period unit.- Returns:
- String
-
isPeriodUnspec
public boolean isPeriodUnspec()
Test whether the period has been specfied:true
is unspecified andfalse
is specified.- Returns:
- boolean
-
setPeriod
public void setPeriod(int newPeriod) throws EPPCodecException
Set domain period.- Parameters:
newPeriod
- int- Throws:
EPPCodecException
- DOCUMENT ME!
-
setPUnit
public void setPUnit(java.lang.String newPUnit)
Set domain period of un. Creation date: (5/30/01 11:36:52 AM)- Parameters:
newPUnit
- java.lang.String
-
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
.
-
-