public class LeaseDTO extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BALANCE_FIELD
Redis cluster balance field constant key.
|
static long |
WAIT_TIME_FULL_RELEASE |
| Constructor and Description |
|---|
LeaseDTO(long accountID,
BalanceManager balanceManager)
Create a
LeaseDTO instance for the given account id |
| Modifier and Type | Method and Description |
|---|---|
void |
decreaseLeaseAmount(double extraLease)
Extra amount left at the end of the call is added to the lease (make sure to provide +ve
value).
|
double |
getAvailableLocalBalance() |
double |
getLease(double lease)
Try to get a lease from this account balance.
|
double |
getLeasedBalance() |
void |
returnAvailableBalancePercentage(double percentage) |
public static final String BALANCE_FIELD
public static final long WAIT_TIME_FULL_RELEASE
public LeaseDTO(long accountID,
BalanceManager balanceManager)
LeaseDTO instance for the given account idaccountID - Account id for balance informationbalanceManager - Parent BalanceManager instance from where this LeaseDTO instance is being maintained.public double getLease(double lease)
lease - The amount to be added to the leasepublic void decreaseLeaseAmount(double extraLease)
extraLease - remaining lease amount. make sure that it's +vepublic double getLeasedBalance()
public void returnAvailableBalancePercentage(double percentage)
public double getAvailableLocalBalance()
Copyright © 2021. All rights reserved.