Class EPPDefRegRenewCmd

All Implemented Interfaces:
EPPCodecComponent, EPPMessage, Serializable, Cloneable

public class EPPDefRegRenewCmd extends EPPRenewCmd
Represents an EPP DefReg <renew> command, which provides a transform operation that allows a client to extend the validity period of a defReg object. In addition to the standard EPP command elements, the <renew> command MUST contain a <defReg:renew> element that identifies the defReg namespace. The <defReg:renew> element contains the following child elements:
  • A <defReg:roid> element that contains the repository object identifier assigned to the defReg object when the object was created.
  • A <defReg:curExpDate> element that contains the date on which the current validity period ends. This value ensures that repeated <renew> commands do not result in multiple unanticipated successful renewals.
  • An OPTIONAL <defReg:period> element that contains the number of units to be added to the registration period of the defReg object.
See Also:
  • Constructor Details

    • EPPDefRegRenewCmd

      public EPPDefRegRenewCmd()
      Allocates a new EPPDefRegRenewCmd with default attribute values. the defaults include the following:

      • roid is set to null
      • period is set to 1 year
      • current expiration date to null

      The name and current expiration year must be set before invoking encode.
    • EPPDefRegRenewCmd

      public EPPDefRegRenewCmd(String aTransId, String aRoid, Date aCurExpDate)
      EPPDefRegRenewCmd constructor that takes the defReg name and the current expiration year as arguments. The period will default to 1 year.
      Parameters:
      aTransId - Transaction Id associated with command.
      aRoid - DefReg name to renew.
      aCurExpDate - The current expiration date of the defReg
    • EPPDefRegRenewCmd

      public EPPDefRegRenewCmd(String aTransId, String aRoid, Date aCurExpDate, EPPDefRegPeriod aPeriod)
      EPPDefRegRenewCmd constructor that takes all of the attributes of the renew command as arguments.
      Parameters:
      aTransId - Transaction Id associated with command.
      aRoid - DefReg name to renew.
      aCurExpDate - The current expiration date of the defReg.
      aPeriod - Registration period in years.
  • Method Details

    • getNamespace

      public String getNamespace()
      Gets the EPP command Namespace associated with EPPDefRegRenewCmd.
      Specified by:
      getNamespace in interface EPPCodecComponent
      Specified by:
      getNamespace in interface EPPMessage
      Specified by:
      getNamespace in class EPPCommand
      Returns:
      EPPDefRegMapFactory.NS
    • getKey

      public String getKey()
      Gets the key for the defensive registration object, which is the defensive registration ROID.
      Overrides:
      getKey in class EPPCommand
      Returns:
      The defensive registration ROID if set; null otherwise.
    • getRoid

      public String getRoid()
      Gets the defReg roid to renew.
      Returns:
      DefReg Roid if defined; null otherwise.
    • setRoid

      public void setRoid(String aRoid)
      Sets the defReg roid to renew.
      Parameters:
      aRoid - DefReg Roid
    • equals

      public boolean equals(Object aObject)
      Compare an instance of EPPDefRegRenewCmd with this instance.
      Overrides:
      equals in class EPPRenewCmd
      Parameters:
      aObject - Object to compare with.
      Returns:
      DOCUMENT ME!
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPDefRegRenewCmd.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class EPPCommand
      Returns:
      clone of EPPDefRegRenewCmd
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • 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 EPPCommand
      Returns:
      Indented XML String if successful; ERROR otherwise.
    • getCurExpDate

      public Date getCurExpDate()
      Get current expiration date.
      Returns:
      java.util.Date
    • getPeriod

      public EPPDefRegPeriod getPeriod()
      Gets the registration period of the renew command in years.
      Returns:
      Registration Period in years.
    • setCurExpDate

      public void setCurExpDate(Date newCurExpDate)
      Set current expiration date.
      Parameters:
      newCurExpDate - java.util.Date
    • setPeriod

      public void setPeriod(EPPDefRegPeriod aPeriod)
      Sets the registration period of the renew command in years.
      Parameters:
      aPeriod - Registration Period in years.
    • doEncode

      protected Element doEncode(Document aDocument) throws EPPEncodeException
      Encode a DOM Element tree from the attributes of the EPPDefRegRenewCmd instance.
      Specified by:
      doEncode in class EPPRenewCmd
      Parameters:
      aDocument - DOM Document that is being built. Used as an Element factory.
      Returns:
      Root DOM Element representing the EPPDefRegRenewCmd instance.
      Throws:
      EPPEncodeException - Unable to encode EPPDefRegRenewCmd instance.
    • doDecode

      protected void doDecode(Element aElement) throws EPPDecodeException
      Decode the EPPDefRegRenewCmd attributes from the aElement DOM Element tree.
      Specified by:
      doDecode in class EPPRenewCmd
      Parameters:
      aElement - Root DOM Element to decode EPPDefRegRenewCmd from.
      Throws:
      EPPDecodeException - Unable to decode aElement