Class ProducerImpl

java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.ProducerImpl
All Implemented Interfaces:
Producer

public class ProducerImpl extends Object implements Producer
  • Constructor Details

  • Method Details

    • getId

      public int getId()
      Description copied from interface: Producer
      Returns the unique producer identifier
      Specified by:
      getId in interface Producer
      Returns:
      the unique producer identifier
    • getName

      public String getName()
      Description copied from interface: Producer
      Returns the name of the producer
      Specified by:
      getName in interface Producer
      Returns:
      the name of the producer
    • getDescription

      public String getDescription()
      Description copied from interface: Producer
      Returns a short description of the producer
      Specified by:
      getDescription in interface Producer
      Returns:
      a short description of the producer
    • isAvailable

      public boolean isAvailable()
      Description copied from interface: Producer
      An indication if the producer is available with the token provided with the UofConfigurationImpl
      Specified by:
      isAvailable in interface Producer
      Returns:
      true if the producer is available, otherwise false
    • getLastMessageTimestamp

      public long getLastMessageTimestamp()
      Description copied from interface: Producer
      Returns a timestamp indicating when was the last message received from the associated producer
      Specified by:
      getLastMessageTimestamp in interface Producer
      Returns:
      a timestamp indicating when was the last message received
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: Producer
      An indication if the producer is enabled. The producer gets by default enabled based on the Producer.isAvailable(), but it can be disabled through the ProducerManager
      Specified by:
      isEnabled in interface Producer
      Returns:
      true if the producer is enabled, otherwise false
    • isFlaggedDown

      public boolean isFlaggedDown()
      Description copied from interface: Producer
      An indication if the producer is down/out of sync/invalid state
      Specified by:
      isFlaggedDown in interface Producer
      Returns:
      false if the producer is up, otherwise true
    • getApiUrl

      public String getApiUrl()
      Description copied from interface: Producer
      Returns the producer API url. This url may be used to perform additional requests that are specific per producer, as an example, the SDK uses this url to perform individual recovery requests
      Specified by:
      getApiUrl in interface Producer
      Returns:
      the producer API url
    • getProducerScopes

      public Set<ProducerScope> getProducerScopes()
      Description copied from interface: Producer
      Returns a Set of possible ProducerScopes. ProducerScopes indicate what type of event messages will be dispatched by the producer.
      Specified by:
      getProducerScopes in interface Producer
      Returns:
      a Set of possible ProducerScopes
    • getLastProcessedMessageGenTimestamp

      public long getLastProcessedMessageGenTimestamp()
      Description copied from interface: Producer
      Returns the last processed message generation timestamp
      Specified by:
      getLastProcessedMessageGenTimestamp in interface Producer
      Returns:
      the last processed message generation timestamp
    • getProcessingQueDelay

      public long getProcessingQueDelay()
      Description copied from interface: Producer
      Returns the messaging queue processing delay in milliseconds (current time - message generation timestamp difference)
      Specified by:
      getProcessingQueDelay in interface Producer
      Returns:
      the messaging queue processing delay in milliseconds (current time - message generation timestamp difference)
    • getTimestampForRecovery

      public long getTimestampForRecovery()
      Description copied from interface: Producer
      Returns a timestamp which indicates the last known verified time in which the SDK was in sync with the feed. The returned timestamp should be used to initiate the initial SDK recovery after a restart, this can be done through the ProducerManager.setProducerRecoveryFromTimestamp(int, long) method.
      Specified by:
      getTimestampForRecovery in interface Producer
      Returns:
      the last timestamp in which the SDK was in sync with the feed
    • getStatefulRecoveryWindowInMinutes

      public int getStatefulRecoveryWindowInMinutes()
      Description copied from interface: Producer
      Returns the max allowed stateful recovery window in minutes
      Specified by:
      getStatefulRecoveryWindowInMinutes in interface Producer
      Returns:
      the max allowed stateful recovery window in minutes
    • getRecoveryInfo

      public RecoveryInfo getRecoveryInfo()
      Description copied from interface: Producer
      Gets the recovery info about last recovery attempt
      Specified by:
      getRecoveryInfo in interface Producer
      Returns:
      the recovery info about last recovery attempt
    • toString

      public String toString()
      Overrides:
      toString in class Object