public class LeaseDTO extends Object
| Constructor and Description |
|---|
LeaseDTO(long accountId,
BalanceManager balanceManager)
Create a
LeaseDTO instance for the given account id |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustLeaseChunkAmount(long leaseTimeDelta) |
void |
decreaseLeaseAmount(double extraLease)
Extra amount left at the end of the call is added to the lease (make sure to provide +ve
value).
|
long |
getAccountId() |
double |
getAvailableLocalBalance() |
double |
getLease(double lease)
Try to get a lease from this account balance.
|
void |
returnAvailableBalancePercentage(double percentage)
A percentage of available balance for this account will be returned to redis cluster when this method is called.
|
void |
setFrozen(boolean frozen)
Setter for freeze/unfreeze state of an account
|
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 void returnAvailableBalancePercentage(double percentage)
percentage - What percentage of the available will be returned. For a full return percentage will be 100public void adjustLeaseChunkAmount(long leaseTimeDelta)
public long getAccountId()
public double getAvailableLocalBalance()
public void setFrozen(boolean frozen)
frozen - Boolean to freeze or unfreeze accountCopyright © 2021. All rights reserved.