Class EPPVerificationCode

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

public class EPPVerificationCode extends Object implements EPPCodecComponent
Class for representing the various forms of the verification code, which include:
  • Verification code signed and passed along with transform commands.
  • Verification code type returned in the missing element of the info response.
  • Verification code returned in the set element of the info response.
See Also:
  • Field Details

    • ELM_LOCALNAME

      public static final String ELM_LOCALNAME
      Constant for the local name
      See Also:
    • ELM_NAME

      public static final String ELM_NAME
      Constant for the tag name
      See Also:
    • UNDEFINED

      public static int UNDEFINED
      Undefined integer value
  • Constructor Details

    • EPPVerificationCode

      public EPPVerificationCode()
      Create an EPPVerificationCode instance.
    • EPPVerificationCode

      public EPPVerificationCode(String aCode, String aType)
      Create an EPPVerificationCode with the code value and the type. This constructor is used for passing the code with a transform command.
      Parameters:
      aCode - Verification code value
      aType - Verification code type
    • EPPVerificationCode

      public EPPVerificationCode(String aType, Date aDueDate)
      Create an EPPVerificationCode with the code type and due date. This constructor is used for the list of codes in the missing list.
      Parameters:
      aType - Verification code type
      aDueDate - Due date that the code must be set
    • EPPVerificationCode

      public EPPVerificationCode(String aCode, String aType, Date aSetDate)
      Create an EPPVerificationCode with the code, type, and set date. This constructor is used for the list of codes in the set list.
      Parameters:
      aCode - Verification code value. Pass null if the code value should not be set.
      aType - Verification code type
      aSetDate - Date that the code was set
  • Method Details

    • decode

      public void decode(Element aElement) throws EPPDecodeException
      Decode the EPPVerificationCode component
      Specified by:
      decode in interface EPPCodecComponent
      Parameters:
      aElement - Root element of the EPPVerificationCode
      Throws:
      EPPDecodeException - Error decoding the EPPVerificationCode
    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Sets all this instance's data in the given XML document
      Specified by:
      encode in interface EPPCodecComponent
      Parameters:
      aDocument - a DOM Document to attach data to.
      Returns:
      The root element of this component.
      Throws:
      EPPEncodeException - Thrown if any errors prevent encoding.
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPVerificationCode. Signature element is not cloned.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      clone of EPPVerificationCode
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • equals

      public boolean equals(Object aObject)
      implements a deep EPPVerificationCode compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPVerificationCode instance to compare with
      Returns:
      true if equal false otherwise
    • hasCode

      public boolean hasCode()
      Has the code been set?
      Returns:
      true if the code has been set; false otherwise.
    • getCode

      public String getCode()
      Gets the code value.
      Returns:
      The code value if defined: null otherwise.
    • setCode

      public void setCode(String aCode)
      Sets the code value.
      Parameters:
      aCode - Code value to set
    • getVspId

      public int getVspId()
      Gets the VSP Identifier (vsp-id) from the code.
      Returns:
      VSP Identifier (vsp-id) if defined; UNDEFINED otherwise.
    • getVerificationId

      public String getVerificationId()
      Gets the Verification Identifier (verification-id) from the code.
      Returns:
      Verification Identifier (verification-id) if defined; null otherwise.
    • getType

      public String getType()
      Gets the code type.
      Returns:
      The code type set.
    • setType

      public void setType(String aType)
      Sets the code type.
      Parameters:
      aType - Code type to set
    • hasSetDate

      public boolean hasSetDate()
      Has the set date been set?
      Returns:
      true if the set date has been set; false otherwise.
    • getSetDate

      public Date getSetDate()
      Gets the date that the verification code was set.
      Returns:
      The set date if defined: null otherwise.
    • setSetDate

      public void setSetDate(Date aSetDate)
      Sets the date that the verification code was set.
      Parameters:
      aSetDate - Date that the verification code was set.
    • hasDueDate

      public boolean hasDueDate()
      Has the due date been set?
      Returns:
      true if the due date has been set; false otherwise.
    • getDueDate

      public Date getDueDate()
      Gets the due date for the verification code.
      Returns:
      The due date if defined: null otherwise.
    • setDueDate

      public void setDueDate(Date aDueDate)
      Sets the due date for the verification code.
      Parameters:
      aDueDate - Due date for the verification code
    • 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.
    • getNamespace

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