Class EPPBalance
java.lang.Object
com.verisign.epp.codec.balance.v04.EPPBalance
- All Implemented Interfaces:
EPPCodecComponent,Serializable,Cloneable
A concrete
EPPResponse that knows how to encode/decode Balance Info
response from/to XML and object instance.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumLimit Based On attribute enumeration with the values:
BALANCE_AVAILABLE- Limit is based on the <balance:balanceAvailable> element.CASH_BALANCE- Limit is based on the <balance:cashBalance> element. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAttribute used for the limit attributes ofexecutionLimitandnotificationThreshold.static final StringAttribute used for the name of the balance, which is optional and is based on server policy.static final StringDefault currency is "USD".static final EPPBalance.LimitBasedOnDefault value for the "baseOn" attribute.static final StringThe balance XML tag namestatic final StringThe cashBalance XML tag namestatic final StringThe creditLimit XML tag namestatic final StringThe executionLimit XML tag namestatic final StringXML local name forEPPBalance.static final StringThe poll data XML tag namestatic final StringThe notificationThreshold XML tag namestatic final BigDecimalDefault execution limit is 0.0. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorEPPBalance(String aName, String aCurrency, List<EPPBalanceByCurrency> aCashBalanceByCurrencies, BigDecimal aBalanceAvailable, BigDecimal aCreditLine, BigDecimal aCashBalance, BigDecimal aExecutionLimit, BigDecimal aNotificationThreshold, EPPBalance.LimitBasedOn aLimitBasedOn) EPPBalancethat takes all of the attributes.EPPBalance(String aCurrency, BigDecimal aBalanceAvailable, BigDecimal aCreditLine, BigDecimal aCashBalance) EPPBalancethat takes all of the required attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCashBalanceByCurrency(EPPBalanceByCurrency aCashBalanceByCurrency) Adds a cash balance by currency to the list of cash balance by currencies.clone()CloneEPPLowBalancePollResponse.voidPopulates the data of this instance from the given XML Element which is part of a DOM DocumentEncode the Balance attributes to DOM.booleanimplements a deepEPPBalancecompare.Gets the balance that represents the calculated Balance Available using the equation Balance Available (B) = Credit Limit (CL) + Cash Balance (CB).Gets the cash balance that represents the cash on hand that is impacted by client payments and billable transaction debits and credits, inclusive of the fees and taxes.Gets the list of cash balance by currency objects that breakdown the cash balance by currency for multi-currency accounts.Gets the credit line that represents the calculated level of credit based on the set of active credit instruments.Gets the currency value.Gets the execution limitGets what the limit attributes, seegetExecutionLimit()andgetNotificationThreshold(), are based on, which is either theEPPBalance.LimitBasedOn.BALANCE_AVAILABLEor theEPPBalance.LimitBasedOn.CASH_BALANCE, with a default ofEPPBalance.LimitBasedOn.BALANCE_AVAILABLE.getName()Gets the optional balance name value.Returns the XML namespace associated with theEPPResponse.Gets the notification thresholdbooleanAre the cash balance by currencies defined?booleanIs the currency defined?booleanIs the execution limit defined?booleanhasName()Is the balance name defined?booleanIs the notification threshold defined?voidsetBalanceAvailable(BigDecimal aBalanceAvailable) Sets the balance that represents the calculated Balance Available using the equation Balance Available (BA) = Credit Limit (CL) + Cash Balance (CB).voidsetCashBalance(BigDecimal aCashBalance) Sets the cash balance that represents the cash on hand that is impacted by client payments and billable transaction debits and credits, inclusive of the fees and taxes.voidsetCashBalanceByCurrencies(List<EPPBalanceByCurrency> aCashBalanceByCurrencies) Sets the list of cash balance by currency objects that breakdown the cash balance by currency for multi-currency accounts.voidsetCreditLine(BigDecimal aCreditLine) Sets the credit Limit that represents the calculated level of credit based on the set of active credit instruments.voidsetCurrency(String aCurrency) Sets the currency value.voidsetExecutionLimit(BigDecimal aExecutionLimit) Sets the execution limitvoidsetLimitBasedOn(EPPBalance.LimitBasedOn aLimitBasedOn) Sets what the limit attributes, seegetExecutionLimit()andgetNotificationThreshold(), are based on, which is either theEPPBalance.LimitBasedOn.BALANCE_AVAILABLEor theEPPBalance.LimitBasedOn.CASH_BALANCE, with a default ofEPPBalance.LimitBasedOn.BALANCE_AVAILABLE.voidSets the balance name value.voidsetNotificationThreshold(BigDecimal aNotificationThreshold) Sets the notification threshold
-
Field Details
-
ELM_LOCALNAME
XML local name forEPPBalance.- See Also:
-
ELM_NAME
The poll data XML tag name- See Also:
-
CURRENCY_DEFAULT
Default currency is "USD". The specification doesn't include a default, but adding it to make it easier to transition from the proprietary Balance Mapping.- See Also:
-
DEFAULT_BASED_ON
Default value for the "baseOn" attribute. -
EXECUTION_LIMIT_DEFAULT
Default execution limit is 0.0. -
ELM_BALANCE_AVAILABLE
The balance XML tag name- See Also:
-
ELM_CREDIT_LINE
The creditLimit XML tag name- See Also:
-
ELM_CASH_BALANCE
The cashBalance XML tag name- See Also:
-
ELM_EXECUTION_LIMIT
The executionLimit XML tag name- See Also:
-
ELM_NOTIFICATION_THRESHOLD
The notificationThreshold XML tag name- See Also:
-
ATTR_NAME
Attribute used for the name of the balance, which is optional and is based on server policy.- See Also:
-
ATTR_BASED_ON
Attribute used for the limit attributes ofexecutionLimitandnotificationThreshold.- See Also:
-
-
Constructor Details
-
EPPBalance
public EPPBalance()Default constructor -
EPPBalance
public EPPBalance(String aCurrency, BigDecimal aBalanceAvailable, BigDecimal aCreditLine, BigDecimal aCashBalance) EPPBalancethat takes all of the required attributes.- Parameters:
aBalanceAvailable- Balance available to setaCreditLine- Credit line to setaCashBalance- Cash balance to set
-
EPPBalance
public EPPBalance(String aName, String aCurrency, List<EPPBalanceByCurrency> aCashBalanceByCurrencies, BigDecimal aBalanceAvailable, BigDecimal aCreditLine, BigDecimal aCashBalance, BigDecimal aExecutionLimit, BigDecimal aNotificationThreshold, EPPBalance.LimitBasedOn aLimitBasedOn) EPPBalancethat takes all of the attributes.- Parameters:
aName- Optional name of the balanceaBalanceAvailable- Balance available to setaCreditLine- Credit line to setaCashBalance- Cash balance to setaExecutionLimit- Execution limit to setaNotificationThreshold- Notification limit to setaLimitBasedOn- What the limit parameters ofaExecutionLimitandaNotificationThresholdare based on.
-
-
Method Details
-
getNamespace
Returns the XML namespace associated with theEPPResponse.- Specified by:
getNamespacein interfaceEPPCodecComponent- Returns:
- XML namespace for the
EPPResponse.
-
encode
Encode the Balance attributes to DOM.- Specified by:
encodein interfaceEPPCodecComponent- Parameters:
aDocument- the DOM Document to attach data to.- Returns:
- the element that is a parent of the poll data
- Throws:
EPPEncodeException- Thrown if any errors occur during the encode process
-
decode
Populates the data of this instance from the given XML Element which is part of a DOM Document- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement- the element that is a parent of the poll data- Throws:
EPPDecodeException- thrown if any errors occur during the decode operation
-
equals
implements a deepEPPBalancecompare. -
clone
CloneEPPLowBalancePollResponse.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classObject- Returns:
- clone of
EPPLowBalancePollResponse - Throws:
CloneNotSupportedException- standard Object.clone exception
-
hasName
public boolean hasName()Is the balance name defined?- Returns:
trueif the balance name is defined;falseotherwise.
-
getName
Gets the optional balance name value.- Returns:
- Balance name if defined;
nullotherwise.
-
setName
Sets the balance name value.- Parameters:
aName- Balance name. Setnullto unset the attribute.
-
hasCurrency
public boolean hasCurrency()Is the currency defined?- Returns:
trueif the currency is defined;falseotherwise.
-
getCurrency
Gets the currency value.- Returns:
- Currency if defined;
nullotherwise.
-
setCurrency
Sets the currency value.- Parameters:
aCurrency- Currency value
-
hasCashBalanceByCurrencies
public boolean hasCashBalanceByCurrencies()Are the cash balance by currencies defined?- Returns:
trueif the cash balance by currencies are defined;falseotherwise.
-
getCashBalanceByCurrencies
Gets the list of cash balance by currency objects that breakdown the cash balance by currency for multi-currency accounts.- Returns:
- The list of
EPPBalanceByCurrencyobjects
-
addCashBalanceByCurrency
Adds a cash balance by currency to the list of cash balance by currencies.- Parameters:
aCashBalanceByCurrency- The cash balance by currency to add.
-
setCashBalanceByCurrencies
Sets the list of cash balance by currency objects that breakdown the cash balance by currency for multi-currency accounts.- Parameters:
aCashBalanceByCurrencies- The list of cash balance by currency objects that breakdown the cash balance by currency for multi-currency accounts.
-
getBalanceAvailable
Gets the balance that represents the calculated Balance Available using the equation Balance Available (B) = Credit Limit (CL) + Cash Balance (CB).- Returns:
- balance if set;
nullotherwise.
-
setBalanceAvailable
Sets the balance that represents the calculated Balance Available using the equation Balance Available (BA) = Credit Limit (CL) + Cash Balance (CB).- Parameters:
aBalanceAvailable- Balance to set
-
getCreditLine
Gets the credit line that represents the calculated level of credit based on the set of active credit instruments.- Returns:
- credit limit if set;
nullotherwise.
-
setCreditLine
Sets the credit Limit that represents the calculated level of credit based on the set of active credit instruments.- Parameters:
aCreditLine- Credit line to set
-
getCashBalance
Gets the cash balance that represents the cash on hand that is impacted by client payments and billable transaction debits and credits, inclusive of the fees and taxes.- Returns:
- cash balance if set;
nullotherwise.
-
setCashBalance
Sets the cash balance that represents the cash on hand that is impacted by client payments and billable transaction debits and credits, inclusive of the fees and taxes.- Parameters:
aCashBalance- Cash balance to set
-
hasExecutionLimit
public boolean hasExecutionLimit()Is the execution limit defined?- Returns:
trueif the execution limit is defined;falseotherwise.
-
getExecutionLimit
Gets the execution limit- Returns:
- Execution limit if set;
nullotherwise.
-
setExecutionLimit
Sets the execution limit- Parameters:
aExecutionLimit- Credit threshold to set
-
hasNotificationThreshold
public boolean hasNotificationThreshold()Is the notification threshold defined?- Returns:
trueif the notification threshold is defined;falseotherwise.
-
getNotificationThreshold
Gets the notification threshold- Returns:
- Notification threshold if set;
nullotherwise.
-
setNotificationThreshold
Sets the notification threshold- Parameters:
aNotificationThreshold- Credit threshold to set
-
getLimitBasedOn
Gets what the limit attributes, seegetExecutionLimit()andgetNotificationThreshold(), are based on, which is either theEPPBalance.LimitBasedOn.BALANCE_AVAILABLEor theEPPBalance.LimitBasedOn.CASH_BALANCE, with a default ofEPPBalance.LimitBasedOn.BALANCE_AVAILABLE.- Returns:
- What the limit attributes are based on
-
setLimitBasedOn
Sets what the limit attributes, seegetExecutionLimit()andgetNotificationThreshold(), are based on, which is either theEPPBalance.LimitBasedOn.BALANCE_AVAILABLEor theEPPBalance.LimitBasedOn.CASH_BALANCE, with a default ofEPPBalance.LimitBasedOn.BALANCE_AVAILABLE.- Parameters:
aLimitBasedOn- What the limit attributes are based on
-