@Beta public class TrafficCollectorImpl extends Object implements TrafficCollector
| Modifier and Type | Class and Description |
|---|---|
static class |
TrafficCollectorImpl.Builder |
| Modifier | Constructor and Description |
|---|---|
protected |
TrafficCollectorImpl(TrafficCollectorImpl.Builder builder)
Constructs an instance of the class from the given builder.
|
protected |
TrafficCollectorImpl(WebDriverFactory webDriverFactory,
net.lightbody.bmp.mitm.CertificateAndKeySource certificateAndKeySource,
Supplier<InetSocketAddress> upstreamProxyProvider,
Iterable<? extends org.littleshoot.proxy.HttpFiltersSource> httpFiltersSources,
Supplier<? extends net.lightbody.bmp.BrowserMobProxy> interceptingProxyInstantiator,
Iterable<? extends HarPostProcessor> harPostProcessors,
ExceptionReactor exceptionReactor)
Constructs an instance of the class.
|
| Modifier and Type | Method and Description |
|---|---|
<R> HarPlus<R> |
collect(TrafficGenerator<R> generator)
Collects traffic generated by the given generator into a HAR.
|
<R> HarPlus<R> |
collect(TrafficGenerator<R> generator,
TrafficMonitor monitor)
Collects traffic generated by the given generator into a HAR.
|
protected void |
configureProxy(net.lightbody.bmp.BrowserMobProxy bmp,
net.lightbody.bmp.mitm.CertificateAndKeySource certificateAndKeySource,
TrafficMonitor trafficMonitor) |
protected org.littleshoot.proxy.MitmManager |
createMitmManager(net.lightbody.bmp.BrowserMobProxy proxy,
net.lightbody.bmp.mitm.CertificateAndKeySource certificateAndKeySource) |
<R> R |
drive(TrafficGenerator<R> generator)
Causes traffic to be generated by the given generator and returns the result.
|
protected Set<net.lightbody.bmp.proxy.CaptureType> |
getCaptureTypes() |
protected net.lightbody.bmp.BrowserMobProxy |
instantiateProxy() |
<R> R |
monitor(TrafficGenerator<R> generator,
TrafficMonitor monitor)
Monitors traffic generated by the given generator.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuilderprotected TrafficCollectorImpl(WebDriverFactory webDriverFactory, @Nullable net.lightbody.bmp.mitm.CertificateAndKeySource certificateAndKeySource, Supplier<InetSocketAddress> upstreamProxyProvider, Iterable<? extends org.littleshoot.proxy.HttpFiltersSource> httpFiltersSources, Supplier<? extends net.lightbody.bmp.BrowserMobProxy> interceptingProxyInstantiator, Iterable<? extends HarPostProcessor> harPostProcessors, ExceptionReactor exceptionReactor)
TrafficCollector.builder(WebDriverFactory) to create
an instance.webDriverFactory - web driver factory to usecertificateAndKeySource - credential sourceupstreamProxyProvider - upstream proxy provider; can supply null if no upstream proxy is to be usedhttpFiltersSources - list of filters sources; this should probably include AnonymizingFiltersSourceinterceptingProxyInstantiator - supplier that constructs the local proxy instanceharPostProcessors - list of HAR post-processorsexceptionReactor - exception reactorprotected TrafficCollectorImpl(TrafficCollectorImpl.Builder builder)
builder - the builderprotected Set<net.lightbody.bmp.proxy.CaptureType> getCaptureTypes()
public <R> HarPlus<R> collect(TrafficGenerator<R> generator) throws IOException, org.openqa.selenium.WebDriverException
TrafficCollectorTrafficCollector.collect(TrafficGenerator, TrafficMonitor) with a null monitor reference.collect in interface TrafficCollectorR - type of result the generator returnsgenerator - the generatorIOException - if something I/O related goes awryorg.openqa.selenium.WebDriverException - if the web driver could not be created or the generator throws onepublic <R> HarPlus<R> collect(TrafficGenerator<R> generator, @Nullable TrafficMonitor monitor) throws IOException, org.openqa.selenium.WebDriverException
TrafficCollectorcollect in interface TrafficCollectorR - type of result the generator returnsgenerator - the generatormonitor - a monitor, or nullIOException - on I/O errororg.openqa.selenium.WebDriverException - if the web driver could not be created or the generator throws onepublic <R> R monitor(TrafficGenerator<R> generator, TrafficMonitor monitor) throws IOException, org.openqa.selenium.WebDriverException
TrafficCollectorTrafficCollector.collect(TrafficGenerator, TrafficMonitor) but without capturing a HAR.monitor in interface TrafficCollectorR - generator result typegenerator - the traffic generatormonitor - the monitorIOException - on I/O errororg.openqa.selenium.WebDriverException - on webdriver errorpublic <R> R drive(TrafficGenerator<R> generator) throws IOException, org.openqa.selenium.WebDriverException
TrafficCollectorTrafficCollector.monitor(TrafficGenerator, TrafficMonitor) without
notifying a monitor of request/response interactions.drive in interface TrafficCollectorR - generator result typegenerator - the traffic generatorIOException - on I/O errororg.openqa.selenium.WebDriverException - on webdriver errorprotected org.littleshoot.proxy.MitmManager createMitmManager(net.lightbody.bmp.BrowserMobProxy proxy,
net.lightbody.bmp.mitm.CertificateAndKeySource certificateAndKeySource)
protected net.lightbody.bmp.BrowserMobProxy instantiateProxy()
protected void configureProxy(net.lightbody.bmp.BrowserMobProxy bmp,
net.lightbody.bmp.mitm.CertificateAndKeySource certificateAndKeySource,
@Nullable
TrafficMonitor trafficMonitor)
Copyright © 2016–2018. All rights reserved.