Class HttpBandwidthUrlSelector

java.lang.Object
org.jumpmind.symmetric.transport.http.HttpBandwidthUrlSelector
All Implemented Interfaces:
IBuiltInExtensionPoint, IExtensionPoint, ISyncUrlExtension

public class HttpBandwidthUrlSelector extends Object implements ISyncUrlExtension, IBuiltInExtensionPoint
This ISyncUrlExtension is capable of measuring the bandwidth of a list of urls in order to select the one with the most bandwidth for use.

Use the URI notation of: ext://httpBandwidthUrlSelector?1=http://url.1.com&2=http://url.2.com&param=value

Valid parameters are constants on this class that start with PARAM_. Any parameter that is a numeral will be designated a possible URL.

  • Field Details

    • log

      protected final org.slf4j.Logger log
    • PARAM_PRELOAD_ONLY

      public static String PARAM_PRELOAD_ONLY
    • PARAM_SAMPLE_SIZE

      public static String PARAM_SAMPLE_SIZE
    • PARAM_SAMPLE_TTL

      public static String PARAM_SAMPLE_TTL
    • PARAM_MAX_SAMPLE_DURATION

      public static String PARAM_MAX_SAMPLE_DURATION
    • lastSampleTs

      protected long lastSampleTs
  • Constructor Details

  • Method Details

    • resolveUrl

      public String resolveUrl(URI uri)
      Specified by:
      resolveUrl in interface ISyncUrlExtension
    • getSampleSize

      protected long getSampleSize(Map<String,String> params)
    • getMaxSampleDuration

      protected long getMaxSampleDuration(Map<String,String> params)
    • getSampleTTL

      protected long getSampleTTL(Map<String,String> params)
    • isInitialLoadOnly

      protected boolean isInitialLoadOnly(Map<String,String> params)
    • getUrls

      protected List<org.jumpmind.symmetric.transport.http.HttpBandwidthUrlSelector.SyncUrl> getUrls(Map<String,String> params)
    • getParameters

      protected Map<String,String> getParameters(URI uri)
    • setDefaultSampleSize

      public void setDefaultSampleSize(long sampleSize)
    • setDefaultSampleTTL

      public void setDefaultSampleTTL(long sampleTTL)
    • setDefaultMaxSampleDuration

      public void setDefaultMaxSampleDuration(long defaultMaxSampleDuration)