Interface PunishmentDetailsCalculator


public interface PunishmentDetailsCalculator
Client interface implemented in order to provide calculation of punishment details within the scope of a database transaction.
  • Method Details

    • compute

      Computes punishment details for the given victim.

      This method is typically called during the scope of a database transaction, so it should be fast and responsive. The implementation should be stateless, as it may be retried in the case of transaction serialization failure.

      Most implementations will wish to retrieve punishments for the specified victim. Punishment retrieval should be performed through and only through the provided selection order builder. A special implementation of the selection interfaces is utilized which completes database operations immediately using the same transaction within which this method is called.
      Parameters:
      track - the escalation track according to which to compute
      victim - the victim being punished
      selectionOrderBuilder - the selection order builder for which to retrieve punishments in the same context as this calculator is called. It is guaranteed that all futures returned from any built selection orders are completed immediately
      Returns:
      the calculated punishment details
      Throws:
      IllegalArgumentException - optionally, if this calculator does not support the specified escalation track