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¶m=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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpBandwidthUrlSelector
(INodeService nodeService, IBandwidthService bandwidthService) -
Method Summary
Modifier and TypeMethodDescriptionprotected long
getMaxSampleDuration
(Map<String, String> params) getParameters
(URI uri) protected long
getSampleSize
(Map<String, String> params) protected long
getSampleTTL
(Map<String, String> params) protected List<org.jumpmind.symmetric.transport.http.HttpBandwidthUrlSelector.SyncUrl>
protected boolean
isInitialLoadOnly
(Map<String, String> params) resolveUrl
(URI uri) void
setDefaultMaxSampleDuration
(long defaultMaxSampleDuration) void
setDefaultSampleSize
(long sampleSize) void
setDefaultSampleTTL
(long sampleTTL)
-
Field Details
-
log
protected final org.slf4j.Logger log -
PARAM_PRELOAD_ONLY
-
PARAM_SAMPLE_SIZE
-
PARAM_SAMPLE_TTL
-
PARAM_MAX_SAMPLE_DURATION
-
lastSampleTs
protected long lastSampleTs
-
-
Constructor Details
-
HttpBandwidthUrlSelector
-
-
Method Details
-
resolveUrl
- Specified by:
resolveUrl
in interfaceISyncUrlExtension
-
getSampleSize
-
getMaxSampleDuration
-
getSampleTTL
-
isInitialLoadOnly
-
getUrls
-
getParameters
-
setDefaultSampleSize
public void setDefaultSampleSize(long sampleSize) -
setDefaultSampleTTL
public void setDefaultSampleTTL(long sampleTTL) -
setDefaultMaxSampleDuration
public void setDefaultMaxSampleDuration(long defaultMaxSampleDuration)
-