org.zeroexchange.money
Interface MoneyManager

All Known Implementing Classes:
DefaultMoneyManager

public interface MoneyManager

Author:
black

Method Summary
 void freeAmount(BigDecimal amount, ZECurrency currencyCode, User user)
          Frees amount of money in the specified currency.
 BigDecimal getAllowedDebt(ZECurrency currency, User user)
          Returns maximum allowed debt for user in the specified currency.
 BigDecimal getAvailableAmount(ZECurrency currency, User user)
          Returns available amount of the specified current user for the specified code.
 ZECurrency getDefaultCurrency()
          Returns default currency.
 BigDecimal getHourPrice(BigDecimal hourRate, ZECurrency currency, User currentUser)
          Returns price of the hour according the specified rate.
 BigDecimal getHourRate(BigDecimal hoursPrice, ZECurrency currency, User user)
          Returns the hour rate.
 Set<String> getSupportedCurrencies()
          Returns the codes of the supported currencies.
 boolean isAutoMovementEnabled(ZECurrency currency)
          Returns true if the money movement is enabled for the specified currency.
 boolean isCurrencyManagetExists(ZECurrency currency)
          Returns true if the currency manager exists.
 boolean isOutlayAllowed(ZECurrency che, User user, BigDecimal amount)
          Returns true if user is allowed outlay of the specified amount.
 void performAutoMovement(Collection<PayerData> payersData, Collection<User> consumers)
          Performs money movement.
 void reconcile(Set<PayerData> usersEfforts)
          Reconcile users.
 void reserveAmount(BigDecimal amount, ZECurrency currency, User user)
          Reserves amount of money in the specified currency.
 

Method Detail

getAvailableAmount

BigDecimal getAvailableAmount(ZECurrency currency,
                              User user)
Returns available amount of the specified current user for the specified code.


reserveAmount

void reserveAmount(BigDecimal amount,
                   ZECurrency currency,
                   User user)
Reserves amount of money in the specified currency.


freeAmount

void freeAmount(BigDecimal amount,
                ZECurrency currencyCode,
                User user)
Frees amount of money in the specified currency.


performAutoMovement

void performAutoMovement(Collection<PayerData> payersData,
                         Collection<User> consumers)
Performs money movement.


getSupportedCurrencies

Set<String> getSupportedCurrencies()
Returns the codes of the supported currencies.


isAutoMovementEnabled

boolean isAutoMovementEnabled(ZECurrency currency)
Returns true if the money movement is enabled for the specified currency.


isCurrencyManagetExists

boolean isCurrencyManagetExists(ZECurrency currency)
Returns true if the currency manager exists.


getHourRate

BigDecimal getHourRate(BigDecimal hoursPrice,
                       ZECurrency currency,
                       User user)
Returns the hour rate.


getHourPrice

BigDecimal getHourPrice(BigDecimal hourRate,
                        ZECurrency currency,
                        User currentUser)
Returns price of the hour according the specified rate.


reconcile

void reconcile(Set<PayerData> usersEfforts)
Reconcile users. Bring efforts of all users to the equal state.


getAllowedDebt

BigDecimal getAllowedDebt(ZECurrency currency,
                          User user)
Returns maximum allowed debt for user in the specified currency.


isOutlayAllowed

boolean isOutlayAllowed(ZECurrency che,
                        User user,
                        BigDecimal amount)
Returns true if user is allowed outlay of the specified amount.


getDefaultCurrency

ZECurrency getDefaultCurrency()
Returns default currency.



Copyright © 2013. All Rights Reserved.