Class EPPFeeTransformResult

java.lang.Object
com.verisign.epp.codec.fee.v1_0.EPPFeeTransformResult
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable
Direct Known Subclasses:
EPPFeeCreData, EPPFeeDelData, EPPFeeRenData, EPPFeeTrnData, EPPFeeUpdData

public abstract class EPPFeeTransformResult extends Object implements EPPCodecComponent
Abstract base class for the transform results (create, renew, update, delete, transfer) for enabling the server to return the currency, fees, credits, balance, and credit limit where appropriate.
See Also:
  • Constructor Details

    • EPPFeeTransformResult

      public EPPFeeTransformResult()
      Default constructor for EPPFeeTransformResult.
    • EPPFeeTransformResult

      public EPPFeeTransformResult(String aCurrency, EPPFeeValue aFee)
      Constructor for EPPFeeTransformResult that takes the required currency parameter along with a single fee.
      Parameters:
      aCurrency - Currency of the fee
      aFee - A single fee value
    • EPPFeeTransformResult

      public EPPFeeTransformResult(String aCurrency, List<EPPFeeValue> aFees)
      Constructor for EPPFeeTransformResult that takes the required currency parameter along with a list of fees.
      Parameters:
      aCurrency - Currency of the fee
      aFees - The fees of the transform command
    • EPPFeeTransformResult

      public EPPFeeTransformResult(String aCurrency, EPPFeeCredit aCredit)
      Constructor for EPPFeeTransformResult that takes the required currency parameter along with a single credit.
      Parameters:
      aCurrency - Currency of the fee
      aCredit - A single credit value
    • EPPFeeTransformResult

      public EPPFeeTransformResult(String aCurrency, List<EPPFeeValue> aFees, BigDecimal aBalance, BigDecimal aCreditLimit)
      Constructor for EPPFeeTransformResult that takes all attributes that includes fees.
      Parameters:
      aCurrency - The currency of the fees
      aFees - The fees of the transform command
      aBalance - The remaining client balance
      aCreditLimit - The maximum credit available to the client
    • EPPFeeTransformResult

      public EPPFeeTransformResult(String aCurrency, BigDecimal aBalance, BigDecimal aCreditLimit, List<EPPFeeCredit> aCredits)
      Constructor for EPPFeeTransformResult that takes all attributes that includes credits.
      Parameters:
      aCurrency - The currency of the fees
      aBalance - The remaining client balance
      aCreditLimit - The maximum credit available to the client
      aCredits - The credits of the command
  • 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 result.
    • validateAttributes

      protected abstract void validateAttributes() throws EPPEncodeException
      Validate the set of attributes on encode. Each subclass must provide their own implementation of validateAttributes to validate that the required attributes are set and invalid attribute are not set prior to the encode.
      Throws:
      EPPEncodeException - When an attribute is incorrect set or not set.
    • hasCurrency

      public boolean hasCurrency()
      Is the currency defined?
      Returns:
      true if the currency is defined; false otherwise.
    • getCurrency

      public String getCurrency()
      Gets the currency value.
      Returns:
      Currency if defined; null otherwise.
    • setCurrency

      public void setCurrency(String aCurrency)
      Sets the currency value.
      Parameters:
      aCurrency - Currency value
    • hasPeriod

      public boolean hasPeriod()
      Is the period defined?
      Returns:
      true if the period is defined; false otherwise.
    • getPeriod

      public EPPFeePeriod getPeriod()
      Gets the period value.
      Returns:
      Period if defined; null otherwise.
    • setPeriod

      public void setPeriod(EPPFeePeriod aPeriod)
      Sets the period value.
      Parameters:
      aPeriod - Period value
    • hasFees

      public boolean hasFees()
      Are the fees defined?
      Returns:
      true if the fees are defined; false otherwise.
    • getFees

      public List<EPPFeeValue> getFees()
      Gets the list of fees if defined.
      Returns:
      List of fees if defined; empty list otherwise.
    • addFee

      public void addFee(EPPFeeValue aFee)
      Adds a fee to the list of fees.
      Parameters:
      aFee - The fee to add.
    • setFees

      public void setFees(List<EPPFeeValue> aFees)
      Sets the list of fees.
      Parameters:
      aFees - The fees to set.
    • hasCredits

      public boolean hasCredits()
      Are the credits defined? The credits are used on a delete response.
      Returns:
      true if the credits are defined; false otherwise.
    • getCredits

      public List<EPPFeeCredit> getCredits()
      Gets the list of credits if defined. The credits are used on a delete response.
      Returns:
      List of credits if defined; empty list otherwise.
    • addCredit

      public void addCredit(EPPFeeCredit aCredit)
      Adds a credit to the list of credits. The credits are used on a delete response.
      Parameters:
      aCredit - The credit to add.
    • setCredits

      public void setCredits(List<EPPFeeCredit> aCredits)
      Sets the list of credits. The credits are used on a delete response.
      Parameters:
      aCredits - The credits to set. Set to null for no credits.
    • hasBalance

      public boolean hasBalance()
      Is the balance defined?
      Returns:
      true if the balance is defined; false otherwise.
    • getBalance

      public BigDecimal getBalance()
      Gets the available balance of the client. The balance can be negative to indicate that the server has provided the client with credit.
      Returns:
      the balance if defined; null otherwise.
    • setBalance

      public void setBalance(BigDecimal aBalance)
      Sets the available balance of the client. The balance can be negative to indicate that the server has provided the client with credit.
      Parameters:
      aBalance - The available balance.
    • hasCreditLimit

      public boolean hasCreditLimit()
      Is the credit limit defined?
      Returns:
      true if the credit limit is defined; false otherwise.
    • getCreditLimit

      public BigDecimal getCreditLimit()
      Gets the maximum credit available to the client. This reflects how negative the balance attribute can go to.
      Returns:
      The maximum credit available to the client if defiend; null otherwise.
    • setCreditLimit

      public void setCreditLimit(BigDecimal aCreditLimit)
      Sets the maximum credit available to the client. This reflects how negative the balance attribute can go to.
      Parameters:
      aCreditLimit - The maximum credit available to the client.
    • 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 EPPFeeTransformResult
    • 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 EPPFeeTransformResult instance.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      clone of concrete EPPFeeTransformResult
      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 EPPFeeTransformResult with this instance.
      Overrides:
      equals in class Object
      Parameters:
      aObject - Object to compare with.
      Returns:
      true if equal; false otherwise.