Package com.verisign.epp.codec.registry
Class EPPRegistryDomainPeriod
- java.lang.Object
-
- com.verisign.epp.codec.registry.EPPRegistryDomainPeriod
-
- All Implemented Interfaces:
EPPCodecComponent,java.io.Serializable,java.lang.Cloneable
public class EPPRegistryDomainPeriod extends java.lang.Object implements EPPCodecComponent
Defines the supported registration periods and default periods by command type. The required "command" attribute defines the command type with sample values of "create", "renew", and "transfer". The <registry:period> element contains ONE of the following elements:
-
<registry:length> - The default, minimum, and maximum period length for
the command type. Use
getLength()andsetLength(EPPRegistryMinMaxPeriod)to get and set this element. -
<registry:serverDecided> - The registration period is decided by the
server based on the relationship to a related object that MUST have the same
expiration date. Use
getServerDecided()andsetServerDecided(Boolean)to get and set this element.
- See Also:
EPPRegistryDomain,EPPRegistryMinMaxPeriod, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTR_COMMANDXML attribute name for thecommandattribute.static java.lang.StringELM_NAMEXML Element Name ofEPPRegistryDomainPeriodroot element.static java.lang.StringELM_SERVER_DECIDEDXML Element Name ofserverDecidedattribute.static intMAX_PERIODMaximum period in years as defined in RFC5731static intMIN_PERIODMaximum period in years as defined in RFC5731
-
Constructor Summary
Constructors Constructor Description EPPRegistryDomainPeriod()Default constructor.EPPRegistryDomainPeriod(java.lang.String command, int min, java.lang.String minUnit, int max, java.lang.String maxUnit, int defaultLength, java.lang.String defaultLengthUnit)Construct an instance ofEPPRegistryDomainPeriodwith the following inputs.EPPRegistryDomainPeriod(java.lang.String command, java.lang.Boolean serverDecided)Construct an instance ofEPPRegistryDomainPeriodwith the following inputs.EPPRegistryDomainPeriod(java.lang.String command, java.lang.Integer min, java.lang.String minUnit, java.lang.Integer max, java.lang.String maxUnit, java.lang.Integer defaultLength, java.lang.String defaultLengthUnit)Construct an instance ofEPPRegistryDomainPeriodwith the following inputs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()CloneEPPRegistryDomainPeriod.voiddecode(org.w3c.dom.Element aElement)Decode theEPPRegistryDomainPeriodattributes from the aElement DOM Element tree.org.w3c.dom.Elementencode(org.w3c.dom.Document aDocument)Encode a DOM Element tree from the attributes of theEPPRegistryDomainPeriodinstance.booleanequals(java.lang.Object aObject)implements a deepEPPRegistryDomainPeriodcompare.java.lang.StringgetCommand()Get the command type.EPPRegistryMinMaxPeriodgetLength()Get the length for an EPP domain transform command.java.lang.StringgetNamespace()Returns the XML namespace associated with theEPPCodecComponent.java.lang.BooleangetServerDecided()Get whether to have server decided expiration date.voidsetCommand(java.lang.String command)Set the command type.voidsetLength(EPPRegistryMinMaxPeriod length)Set the length for an EPP domain transform command.voidsetServerDecided(java.lang.Boolean serverDecided)Set whether to have server decided expiration date.java.lang.StringtoString()Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.
-
-
-
Field Detail
-
ELM_NAME
public static final java.lang.String ELM_NAME
XML Element Name ofEPPRegistryDomainPeriodroot element.- See Also:
- Constant Field Values
-
ELM_SERVER_DECIDED
public static final java.lang.String ELM_SERVER_DECIDED
XML Element Name ofserverDecidedattribute.- See Also:
- Constant Field Values
-
ATTR_COMMAND
public static final java.lang.String ATTR_COMMAND
XML attribute name for thecommandattribute.- See Also:
- Constant Field Values
-
MAX_PERIOD
public static final int MAX_PERIOD
Maximum period in years as defined in RFC5731- See Also:
- Constant Field Values
-
MIN_PERIOD
public static final int MIN_PERIOD
Maximum period in years as defined in RFC5731- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EPPRegistryDomainPeriod
public EPPRegistryDomainPeriod()
Default constructor. Attributes are set default values:command-nulllength-nullserverDecided-Boolean.FALSE
-
EPPRegistryDomainPeriod
public EPPRegistryDomainPeriod(java.lang.String command, java.lang.Integer min, java.lang.String minUnit, java.lang.Integer max, java.lang.String maxUnit, java.lang.Integer defaultLength, java.lang.String defaultLengthUnit)Construct an instance ofEPPRegistryDomainPeriodwith the following inputs.serverDecidedis set toBoolean.FALSE:- Parameters:
command- command typemin- minimum length numberminUnit- minimum length unitmax- maximum length numbermaxUnit- maximum length unitdefaultLength- default length numberdefaultLengthUnit- length unit
-
EPPRegistryDomainPeriod
public EPPRegistryDomainPeriod(java.lang.String command, int min, java.lang.String minUnit, int max, java.lang.String maxUnit, int defaultLength, java.lang.String defaultLengthUnit)Construct an instance ofEPPRegistryDomainPeriodwith the following inputs.serverDecidedis set toBoolean.FALSE:- Parameters:
command- command typemin- minimum length numberminUnit- minimum length unitmax- maximum length numbermaxUnit- maximum length unitdefaultLength- default length numberdefaultLengthUnit- length unit
-
EPPRegistryDomainPeriod
public EPPRegistryDomainPeriod(java.lang.String command, java.lang.Boolean serverDecided)Construct an instance ofEPPRegistryDomainPeriodwith the following inputs.lengthis set tonull:- Parameters:
command- command typeserverDecided- whether no not to have server decided expiration date
-
-
Method Detail
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeExceptionEncode a DOM Element tree from the attributes of theEPPRegistryDomainPeriodinstance.- Specified by:
encodein interfaceEPPCodecComponent- Parameters:
aDocument- DOM Document that is being built. Used as an Element factory.- Returns:
- Element Root DOM Element representing the
EPPRegistryDomainPeriodinstance. - Throws:
EPPEncodeException- - Unable to encodeEPPRegistryDomainPeriodinstance.
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeExceptionDecode theEPPRegistryDomainPeriodattributes from the aElement DOM Element tree.- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement- Root DOM Element to decodeEPPRegistryDomainPeriodfrom.- Throws:
EPPDecodeException- Unable to decode aElement
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionCloneEPPRegistryDomainPeriod.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classjava.lang.Object- Returns:
- clone of
EPPRegistryDomainPeriod - Throws:
java.lang.CloneNotSupportedException- standard Object.clone exception
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPRegistryDomainPeriodcompare.- Overrides:
equalsin classjava.lang.Object- Parameters:
aObject-EPPRegistryDomainPeriodinstance to compare with- Returns:
trueif this object is the same as the aObject argument;falseotherwise
-
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.
-
getLength
public EPPRegistryMinMaxPeriod getLength()
Get the length for an EPP domain transform command.- Returns:
- instance of
EPPRegistryMinMaxPeriodthat defines min/max/default period for a given command
-
setLength
public void setLength(EPPRegistryMinMaxPeriod length)
Set the length for an EPP domain transform command.- Parameters:
length- instance ofEPPRegistryMinMaxPeriodthat defines min/max/default period for a given command
-
getServerDecided
public java.lang.Boolean getServerDecided()
Get whether to have server decided expiration date.- Returns:
true- the registration period is decided by the server based on the relationship to a related object that MUST have the same expiration date.false- the registration period is specified in thelengthattribute.
-
setServerDecided
public void setServerDecided(java.lang.Boolean serverDecided)
Set whether to have server decided expiration date.- Parameters:
serverDecided-true- the registration period is decided by the server based on the relationship to a related object that MUST have the same expiration date.false- the registration period is specified in thelengthattribute.
-
getCommand
public java.lang.String getCommand()
Get the command type.- Returns:
- command type in
String. Valid values are "create", "renew" and "transfer".
-
setCommand
public void setCommand(java.lang.String command)
Set the command type.- Parameters:
command- command type inString. Valid values are "create", "renew" and "transfer".
-
getNamespace
public java.lang.String getNamespace()
Returns the XML namespace associated with theEPPCodecComponent.- Specified by:
getNamespacein interfaceEPPCodecComponent- Returns:
- XML namespace for the
EPPCodecComponent.
-
-