Class RecoveryManagerImpl

java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.recovery.RecoveryManagerImpl
All Implemented Interfaces:
com.rabbitmq.client.RecoveryListener, com.rabbitmq.client.ShutdownListener, RabbitMqSystemListener, EventRecoveryRequestIssuer, RecoveryManager, EventListener

public class RecoveryManagerImpl extends Object implements RecoveryManager, EventRecoveryRequestIssuer, RabbitMqSystemListener
An implementation of the RecoveryManager used to manage recovery operations
  • Method Details

    • onMessageProcessingStarted

      public void onMessageProcessingStarted(int uniqueMessageProcessorIdentifier, int producerId, Long requestId, long now)
      Description copied from interface: RecoveryManager
      Method invoked when the AMQP message processing started
      Specified by:
      onMessageProcessingStarted in interface RecoveryManager
      Parameters:
      uniqueMessageProcessorIdentifier - a unique representation of the message processor invoking the method
      producerId - the source producer of the message
      requestId - the recovery request id of the message (if present)
      now - the current timestamp
    • onMessageProcessingEnded

      public void onMessageProcessingEnded(int uniqueMessageProcessorIdentifier, int producerId, Long processedMessageGenTimestamp, String eventId)
      Description copied from interface: RecoveryManager
      Method invoked when the AMQP message processing ended
      Specified by:
      onMessageProcessingEnded in interface RecoveryManager
      Parameters:
      uniqueMessageProcessorIdentifier - a unique representation of the message processor invoking the method
      producerId - the source producer of the message
      processedMessageGenTimestamp - the generated timestamp of the processed message
      eventId - the eventId associated with feed message (if present)
    • onAliveReceived

      public void onAliveReceived(int producerId, long aliveGenTimestamp, long receivedTimestamp, boolean subscribed, boolean isSystemSession)
      Description copied from interface: RecoveryManager
      Method invoked when the message of type "Alive" is received
      Specified by:
      onAliveReceived in interface RecoveryManager
      Parameters:
      producerId - the producer which generated the Alive message
      aliveGenTimestamp - the message generation timestamp
      receivedTimestamp - the timestamp of when the message was received
      subscribed - an indication if the Alive message was sent from a producer that the SDK is subscribed to
      isSystemSession - an indication if the alive was received on the system session
    • onSnapshotCompleteReceived

      public void onSnapshotCompleteReceived(int producerId, long nowTimestamp, long requestId, MessageInterest sessionMessageInterest)
      Description copied from interface: RecoveryManager
      Method invoked when the message of type "SnapshotComplete" is received
      Specified by:
      onSnapshotCompleteReceived in interface RecoveryManager
      Parameters:
      producerId - the producer which generated the Alive message
      nowTimestamp - the timestamp of when the message was received
      requestId - the request id that is the cause of the SnapshotComplete
      sessionMessageInterest - the message interest of the session that received the message
    • initiateEventOddsMessagesRecovery

      public Long initiateEventOddsMessagesRecovery(Producer producer, Urn eventId)
      Description copied from interface: EventRecoveryRequestIssuer
      Initiates a odds recovery procedure for the event associated with the provided Urn identifier on the requested Producer (The odds recovery procedure re-sends all odds for all markets for a sport event) Note: The event must be either EventStatus.NotStarted or EventStatus.Live
      Specified by:
      initiateEventOddsMessagesRecovery in interface EventRecoveryRequestIssuer
      Parameters:
      producer - the producer on which the recovery should be initialized
      eventId - the Urn identifier of the event for which the recovery is needed
      Returns:
      the identifier of the recovery request, if the request executed successfully; otherwise null
    • initiateEventStatefulMessagesRecovery

      public Long initiateEventStatefulMessagesRecovery(Producer producer, Urn eventId)
      Description copied from interface: EventRecoveryRequestIssuer
      Initiates a stateful recovery procedure for the event associated with the provided Urn identifier on the requested Producer (The stateful message recovery procedure re-sends all stateful-messages (BetSettlement, RollbackBetSettlement, BetCancel, UndoBetCancel) for a sport event) Note: The event can be up to 30 days in the past
      Specified by:
      initiateEventStatefulMessagesRecovery in interface EventRecoveryRequestIssuer
      Parameters:
      producer - the producer on which the recovery should be initialized
      eventId - the Urn identifier of the event for which the recovery is needed
      Returns:
      the identifier of the recovery request, if the request executed successfully; otherwise null
    • handleRecovery

      public void handleRecovery(com.rabbitmq.client.Recoverable recoverable)
      This method gets invoked by the RabbitMQ library when the auto-recovery kicks-in
      Specified by:
      handleRecovery in interface com.rabbitmq.client.RecoveryListener
    • handleRecoveryStarted

      public void handleRecoveryStarted(com.rabbitmq.client.Recoverable recoverable)
      Specified by:
      handleRecoveryStarted in interface com.rabbitmq.client.RecoveryListener
    • handleTopologyRecoveryStarted

      public void handleTopologyRecoveryStarted(com.rabbitmq.client.Recoverable recoverable)
      Specified by:
      handleTopologyRecoveryStarted in interface com.rabbitmq.client.RecoveryListener
    • shutdownCompleted

      public void shutdownCompleted(com.rabbitmq.client.ShutdownSignalException cause)
      This method is called when the AMQP channel gets shut down/disconnect detected
      Specified by:
      shutdownCompleted in interface com.rabbitmq.client.ShutdownListener
    • requestManualProducerRecovery

      public void requestManualProducerRecovery(int id, long timestampForRecovery)