Class FetchComponent
-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public class FetchComponent implements AutoCloseable
The fetch component is the portal to fetch the content of pages.
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleanisActiveprivate final CoreMetricscoreMetricsprivate final ProtocolFactoryprotocolFactoryprivate final ImmutableConfigimmutableConfig
-
Constructor Summary
Constructors Constructor Description FetchComponent(CoreMetrics coreMetrics, ProtocolFactory protocolFactory, ImmutableConfig immutableConfig)
-
Method Summary
Modifier and Type Method Description final BooleanisActive()final CoreMetricsgetCoreMetrics()final ProtocolFactorygetProtocolFactory()final ImmutableConfiggetImmutableConfig()final WebPagefetch(String url)Fetch an url final WebPagefetch(String url, LoadOptions options)Fetch an url final WebPagefetchContent(WebPage page)Fetch a page final WebPagefetchContent(FetchEntry fetchEntry)Fetch a page final WebPagefetchContentDeferred(WebPage page)Fetch a page Unitclose()-
-
Constructor Detail
-
FetchComponent
FetchComponent(CoreMetrics coreMetrics, ProtocolFactory protocolFactory, ImmutableConfig immutableConfig)
-
-
Method Detail
-
getCoreMetrics
final CoreMetrics getCoreMetrics()
-
getProtocolFactory
final ProtocolFactory getProtocolFactory()
-
getImmutableConfig
final ImmutableConfig getImmutableConfig()
-
fetch
final WebPage fetch(String url)
Fetch an url
- Parameters:
url- The url of web page to fetch- Returns:
The fetch result
-
fetch
final WebPage fetch(String url, LoadOptions options)
Fetch an url
- Parameters:
url- The url of web page to fetchoptions- The options- Returns:
The fetch result
-
fetchContent
final WebPage fetchContent(WebPage page)
Fetch a page
- Parameters:
page- The page to fetch- Returns:
The fetch result
-
fetchContent
final WebPage fetchContent(FetchEntry fetchEntry)
Fetch a page
- Parameters:
fetchEntry- The fetch entry- Returns:
The fetch result
-
fetchContentDeferred
final WebPage fetchContentDeferred(WebPage page)
Fetch a page
- Parameters:
page- The page to fetch- Returns:
The fetch result
-
-
-
-