Class EPPTtlExtension

java.lang.Object
com.verisign.epp.codec.ttl.v1_0.EPPTtlExtension
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable
Direct Known Subclasses:
EPPTtlCreate, EPPTtlInfData, EPPTtlUpdate

public abstract class EPPTtlExtension extends Object implements EPPCodecComponent
Abstract base class for the TTL extensions of the create and update commands and the info response, which all accept a list of EPPTtl objects.
See Also:
  • Constructor Details

    • EPPTtlExtension

      public EPPTtlExtension()
      Default constructor for EPPTtlExtension.
    • EPPTtlExtension

      public EPPTtlExtension(EPPTtl aTtl)
      Constructor for EPPTtlExtension that takes a single TTL.
      Parameters:
      aTtl - A single TTL value
    • EPPTtlExtension

      public EPPTtlExtension(List<EPPTtl> aTtls)
      Constructor for EPPTtlExtension that a list of TTLs.
      Parameters:
      aTtls - A list of TTLs
  • Method Details

    • getLocalName

      protected abstract String getLocalName()
      Abstract method that the sub-class must define to return the local name for the root element.
      Returns:
      Local name of the root element of the extensions.
    • hasTtls

      public boolean hasTtls()
      Are the TTLs defined?
      Returns:
      true if the TTLs are defined; false otherwise.
    • getTtls

      public List<EPPTtl> getTtls()
      Gets the list of TTLs if defined.
      Returns:
      List of TTLs if defined; empty list otherwise.
    • addTtl

      public void addTtl(EPPTtl aTtl)
      Adds a TTL to the list of TTLs.
      Parameters:
      aTtl - The TTL to add.
    • setTtls

      public void setTtls(List<EPPTtl> aTtls)
      Sets the list of TTLs.
      Parameters:
      aTtls - The TTLs to set.
    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Encode instance into a DOM element tree. A DOM Document is passed as an argument and functions as a factory for DOM objects. The root element associated with the instance is created and each instance attribute is appended as a child node.
      Specified by:
      encode in interface EPPCodecComponent
      Parameters:
      aDocument - DOM Document, which acts is an Element factory
      Returns:
      Element Root element associated with the object
      Throws:
      EPPEncodeException - Error encoding EPPTtlExtension
    • decode

      public void decode(Element aElement) throws EPPDecodeException
      Decode a DOM element tree to initialize the instance attributes. The aElement argument represents the root DOM element and is used to traverse the DOM nodes for instance attribute values.
      Specified by:
      decode in interface EPPCodecComponent
      Parameters:
      aElement - Element to decode
      Throws:
      EPPDecodeException - Error decoding Element
    • clone

      public Object clone() throws CloneNotSupportedException
      clone an EPPCodecComponent.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      clone of concrete EPPTtlExtension
      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 Object
      Returns:
      Indented XML String if successful; ERROR otherwise.
    • equals

      public boolean equals(Object aObject)
      Compare an instance of EPPTtlExtension with this instance.
      Overrides:
      equals in class Object
      Parameters:
      aObject - Object to compare with.
      Returns:
      true if equal; false otherwise.