public class LeaseDTO extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
LeaseDTO(long accountId,
BalanceManager balanceManager)
Create a
LeaseDTO instance for the given account id |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustLeaseChunkAmount(long leaseTimeDelta) |
protected 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() |
protected double |
getLease(double lease,
boolean partialEnabled)
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
|
protected 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.protected double getLease(double lease,
boolean partialEnabled)
lease - The amount to be added to the leasepartialEnabled - if caller can be happy with partial lease, then this value must be true.protected 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 © 2022. All rights reserved.