|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zeroexchange.common.AbstractBeansRegistry<T> org.zeroexchange.common.TypedBeansRegistry<CurrencyManager> org.zeroexchange.money.DefaultMoneyManager
public class DefaultMoneyManager
Constructor Summary | |
---|---|
DefaultMoneyManager()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
void |
freeAmount(BigDecimal amount,
ZECurrency currencyCode,
User user)
Frees amount of money in the specified currency. |
BigDecimal |
getAllowedDebt(ZECurrency currencyCode,
User user)
Returns maximum allowed debt for user in the specified currency. |
BigDecimal |
getAvailableAmount(ZECurrency currencyCode,
User user)
Returns available amount of the specified current user for the specified code. |
protected Class<?> |
getBeanClass()
|
protected Map<String,CurrencyManager> |
getCurrencyCode2AmountProvider()
Returns map of currencies 2 money amount managers. |
protected CurrencyManager |
getCurrencyManager(ZECurrency currencyCode)
Returns currency manager by the currency code. |
ZECurrency |
getDefaultCurrency()
Returns default currency. |
BigDecimal |
getHourPrice(BigDecimal rate,
ZECurrency currencyCode,
User user)
Returns price of the hour according the specified rate. |
BigDecimal |
getHourRate(BigDecimal hoursPrice,
ZECurrency currencyCode,
User user)
Returns the hour rate. |
Set<String> |
getSupportedCurrencies()
Returns the codes of the supported currencies. |
boolean |
isAutoMovementEnabled(ZECurrency currencyCode)
Returns true if the money movement is enabled for the specified currency. |
boolean |
isCurrencyManagetExists(ZECurrency currencyCode)
Returns true if the currency manager exists. |
boolean |
isOutlayAllowed(ZECurrency currencyCode,
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 currencyCode,
User user)
Reserves amount of money in the specified currency. |
void |
setDefaultCurrency(ZECurrency defaultCurrency)
|
Methods inherited from class org.zeroexchange.common.TypedBeansRegistry |
---|
isElected |
Methods inherited from class org.zeroexchange.common.AbstractBeansRegistry |
---|
createBeansCollection, getBeans, postProcessAfterInitialization, postProcessBeforeInitialization |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultMoneyManager()
Method Detail |
---|
public BigDecimal getAvailableAmount(ZECurrency currencyCode, User user)
getAvailableAmount
in interface MoneyManager
public void reserveAmount(BigDecimal amount, ZECurrency currencyCode, User user)
reserveAmount
in interface MoneyManager
public void freeAmount(BigDecimal amount, ZECurrency currencyCode, User user)
freeAmount
in interface MoneyManager
@Transactional public void performAutoMovement(Collection<PayerData> payersData, Collection<User> consumers)
performAutoMovement
in interface MoneyManager
public boolean isAutoMovementEnabled(ZECurrency currencyCode)
isAutoMovementEnabled
in interface MoneyManager
public Set<String> getSupportedCurrencies()
getSupportedCurrencies
in interface MoneyManager
public boolean isCurrencyManagetExists(ZECurrency currencyCode)
isCurrencyManagetExists
in interface MoneyManager
public BigDecimal getHourRate(BigDecimal hoursPrice, ZECurrency currencyCode, User user)
getHourRate
in interface MoneyManager
public BigDecimal getHourPrice(BigDecimal rate, ZECurrency currencyCode, User user)
getHourPrice
in interface MoneyManager
protected CurrencyManager getCurrencyManager(ZECurrency currencyCode)
protected Map<String,CurrencyManager> getCurrencyCode2AmountProvider()
public void reconcile(Set<PayerData> usersEfforts)
reconcile
in interface MoneyManager
public BigDecimal getAllowedDebt(ZECurrency currencyCode, User user)
getAllowedDebt
in interface MoneyManager
public boolean isOutlayAllowed(ZECurrency currencyCode, User user, BigDecimal amount)
isOutlayAllowed
in interface MoneyManager
public ZECurrency getDefaultCurrency()
getDefaultCurrency
in interface MoneyManager
public void setDefaultCurrency(ZECurrency defaultCurrency)
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class TypedBeansRegistry<CurrencyManager>
Exception
protected Class<?> getBeanClass()
getBeanClass
in class TypedBeansRegistry<CurrencyManager>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |