Package com.reve.balancemanager.impl
Class MitigatorImpl
java.lang.Object
com.reve.balancemanager.mitigation.Mitigator
com.reve.balancemanager.impl.MitigatorImpl
Thread class which will work on balance sync for a specified account
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBMToACKSet(String bmID) Add the name of the balance manager in the ack received list.voidaddBMToFrozenSet(String bmID) Add the name of the balance manager in the account freeze complete message received list.voidaddBMToUnfrozenSet(String bmID) Add the name of the balance manager in the account unfrozen complete received list.call()voidinit(BalanceManager balanceManager, long accountID, Double balance, Double credit) Initialize the instance specifying the account for which this thread will be called and under which mitigator this thread will workMethods inherited from class com.reve.balancemanager.mitigation.Mitigator
getClassReference, getInstance
-
Constructor Details
-
MitigatorImpl
public MitigatorImpl()
-
-
Method Details
-
init
Initialize the instance specifying the account for which this thread will be called and under which mitigator this thread will work- Specified by:
initin classMitigator- Parameters:
accountID- the account for which balance sync between MySQL and Redis will happenbalance- Balance amount present in mysql for this account id.credit- Credit amount present in mysql for this account id.balanceManager-BalanceMitigatorreference for mitigator
-
call
-
addBMToACKSet
Add the name of the balance manager in the ack received list. When account freeze ACK is received from any balance manager, this method should be called to add the name in the list.- Specified by:
addBMToACKSetin classMitigator- Parameters:
bmID- Identification name of the balance manager
-
addBMToFrozenSet
Add the name of the balance manager in the account freeze complete message received list. When account freeze complete is received from any balance manager, this method should be called to add the name in the list.- Specified by:
addBMToFrozenSetin classMitigator- Parameters:
bmID- Identification name of the balance manager
-
addBMToUnfrozenSet
Add the name of the balance manager in the account unfrozen complete received list. When account unfreeze complete is received from any balance manager, this method should be called to add the name in the list.- Specified by:
addBMToUnfrozenSetin classMitigator- Parameters:
bmID- Identification name of the balance manager
-