Class Mitigator

java.lang.Object
com.reve.balancemanager.mitigation.Mitigator
All Implemented Interfaces:
Callable<Boolean>
Direct Known Subclasses:
MitigatorImpl

public abstract class Mitigator extends Object implements Callable<Boolean>
  • Constructor Details

    • Mitigator

      public Mitigator()
  • Method Details

    • init

      public abstract void init(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 work
      Parameters:
      accountID - the account for which balance sync between MySQL and Redis will happen
      balance - Balance amount present in mysql for this account id.
      credit - Credit amount present in mysql for this account id.
      balanceManager - BalanceMitigator reference for mitigator
    • addBMToACKSet

      public abstract void addBMToACKSet(String BMIdentifier)
      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.
      Parameters:
      BMIdentifier - Identification name of the balance manager
    • addBMToFrozenSet

      public abstract void addBMToFrozenSet(String BMIdentifier)
      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.
      Parameters:
      BMIdentifier - Identification name of the balance manager
    • addBMToUnfrozenSet

      public abstract void addBMToUnfrozenSet(String BMIdentifier)
      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.
      Parameters:
      BMIdentifier - Identification name of the balance manager
    • getInstance

      public static Mitigator getInstance()
    • getClassReference

      protected static void getClassReference()