Class EPPRegistryDomainPeriod

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

public class EPPRegistryDomainPeriod extends 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:

See Also:
  • Field Details

    • ELM_NAME

      public static final String ELM_NAME
      XML Element Name of EPPRegistryDomainPeriod root element.
      See Also:
    • ELM_SERVER_DECIDED

      public static final String ELM_SERVER_DECIDED
      XML Element Name of serverDecided attribute.
      See Also:
    • ATTR_COMMAND

      public static final String ATTR_COMMAND
      XML attribute name for the command attribute.
      See Also:
    • MAX_PERIOD

      public static final int MAX_PERIOD
      Maximum period in years as defined in RFC5731
      See Also:
    • MIN_PERIOD

      public static final int MIN_PERIOD
      Maximum period in years as defined in RFC5731
      See Also:
  • Constructor Details

    • EPPRegistryDomainPeriod

      public EPPRegistryDomainPeriod()
      Default constructor. Attributes are set default values:
      • command - null
      • length - null
      • serverDecided - Boolean.FALSE
    • EPPRegistryDomainPeriod

      public EPPRegistryDomainPeriod(String command, Integer min, String minUnit, Integer max, String maxUnit, Integer defaultLength, String defaultLengthUnit)
      Construct an instance of EPPRegistryDomainPeriod with the following inputs. serverDecided is set to Boolean.FALSE:
      Parameters:
      command - command type
      min - minimum length number
      minUnit - minimum length unit
      max - maximum length number
      maxUnit - maximum length unit
      defaultLength - default length number
      defaultLengthUnit - length unit
    • EPPRegistryDomainPeriod

      public EPPRegistryDomainPeriod(String command, int min, String minUnit, int max, String maxUnit, int defaultLength, String defaultLengthUnit)
      Construct an instance of EPPRegistryDomainPeriod with the following inputs. serverDecided is set to Boolean.FALSE:
      Parameters:
      command - command type
      min - minimum length number
      minUnit - minimum length unit
      max - maximum length number
      maxUnit - maximum length unit
      defaultLength - default length number
      defaultLengthUnit - length unit
    • EPPRegistryDomainPeriod

      public EPPRegistryDomainPeriod(String command, Boolean serverDecided)
      Construct an instance of EPPRegistryDomainPeriod with the following inputs. length is set to null:
      Parameters:
      command - command type
      serverDecided - whether no not to have server decided expiration date
  • Method Details

    • encode

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

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

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

      public boolean equals(Object aObject)
      implements a deep EPPRegistryDomainPeriod compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPRegistryDomainPeriod instance to compare with
      Returns:
      true if this object is the same as the aObject argument; false otherwise
    • 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.
    • getLength

      public EPPRegistryMinMaxPeriod getLength()
      Get the length for an EPP domain transform command.
      Returns:
      instance of EPPRegistryMinMaxPeriod that 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 of EPPRegistryMinMaxPeriod that defines min/max/default period for a given command
    • getServerDecided

      public 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 the length attribute.
    • setServerDecided

      public void setServerDecided(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 the length attribute.
    • getCommand

      public String getCommand()
      Get the command type.
      Returns:
      command type in String. Valid values are "create", "renew" and "transfer".
    • setCommand

      public void setCommand(String command)
      Set the command type.
      Parameters:
      command - command type in String. Valid values are "create", "renew" and "transfer".
    • getNamespace

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