-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.config.Parameterized
public class LoadOptions extends CommonOptions
LoadOptions can represent the controling arguments which effects how we load a webpage:
// fetch only when after 1d since last fetch session.load('https://www.jd.com', '-expires 1d') // fetch now ignoring errors session.load('https://www.jd.com', '-refresh') // do not fetch after dead time session.load('https://www.jd.com', '-deadTime 2022-04-15T18:36:54.941Z') // activate the parse phrase session.load('https://www.jd.com', '-parse') // write the page content into storage session.load('https://www.jd.com', '-storeContent')NOTICE: every option with name
optionNamehas to take a Parameter name -optionName.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLoadOptions.Companion
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LoadOptions(Array<String> argv, VolatileConfig conf, PulsarEventHandler eventHandler, PulsarEventHandler itemEventHandler)
-
Method Summary
Modifier and Type Method Description final StringgetLabel()The label of this load task. final UnitsetLabel(String label)The label of this load task. final StringgetTaskId()The task id. final UnitsetTaskId(String taskId)The task id. final InstantgetTaskTime()The task time, we usually use a task time to indicate the name of a batch task. final UnitsetTaskTime(Instant taskTime)The task time, we usually use a task time to indicate the name of a batch task. final InstantgetDeadTime()The dead time, if now deadTime, the task should be discarded as soon as possible. final UnitsetDeadTime(Instant deadTime)The dead time, if now deadTime, the task should be discarded as soon as possible. final StringgetAuthToken()The auth token for this task. final UnitsetAuthToken(String authToken)The auth token for this task. final BooleangetReadonly()If true, get a copy of the webpage and do not modify it. final UnitsetReadonly(Boolean readonly)If true, get a copy of the webpage and do not modify it. final BooleangetIsResource()If true, fetch the page content as a resource without browser rendering. final UnitsetIsResource(Boolean isResource)If true, fetch the page content as a resource without browser rendering. final DurationgetExpires()The expiry time. final UnitsetExpires(Duration expires)The expiry time. final InstantgetExpireAt()The time point to expire. final UnitsetExpireAt(Instant expireAt)The time point to expire. final DurationgetFetchInterval()The fetch interval, used for periodically tasks. final UnitsetFetchInterval(Duration fetchInterval)The fetch interval, used for periodically tasks. final StringgetOutLinkSelector()The CSS selector to select out links in the portal page. final UnitsetOutLinkSelector(String outLinkSelector)The CSS selector to select out links in the portal page. final StringgetOutLinkPattern()The pattern to select out links in the portal page. final UnitsetOutLinkPattern(String outLinkPattern)The pattern to select out links in the portal page. final StringgetClickTarget()The selector of the element to click for out links, if it's blank, no element should be clicked. final UnitsetClickTarget(String clickTarget)The selector of the element to click for out links, if it's blank, no element should be clicked. final StringgetNextPageSelector()The css selector of next page anchor. final UnitsetNextPageSelector(String nextPageSelector)The css selector of next page anchor. final IntegergetIframe()The iframe id to switch to. final UnitsetIframe(Integer iframe)The iframe id to switch to. final IntegergetTopLinks()Specify how many links to select if we deal with out-pages. final UnitsetTopLinks(Integer topLinks)Specify how many links to select if we deal with out-pages. final IntegergetTopNAnchorGroups()Try the top N anchor groups. final UnitsetTopNAnchorGroups(Integer topNAnchorGroups)Try the top N anchor groups. final StringgetWaitNonBlank()Wait for ajax content until the element is filled by a non-blank text. final UnitsetWaitNonBlank(String waitNonBlank)Wait for ajax content until the element is filled by a non-blank text. final StringgetRequireNotBlank()Keep the pages only if the required text is not blank. final UnitsetRequireNotBlank(String requireNotBlank)Keep the pages only if the required text is not blank. final IntegergetRequireSize()Fetch pages smaller than requireSize in bytes. final UnitsetRequireSize(Integer requireSize)Fetch pages smaller than requireSize in bytes. final IntegergetRequireImages()Re-fetch a page who's images less than requireImages. final UnitsetRequireImages(Integer requireImages)Re-fetch a page who's images less than requireImages. final IntegergetRequireAnchors()Re-fetch a page who's anchors less than requireAnchors. final UnitsetRequireAnchors(Integer requireAnchors)Re-fetch a page who's anchors less than requireAnchors. final FetchModegetFetchMode()The fetch mode. final UnitsetFetchMode(FetchMode fetchMode)The fetch mode. final BrowserTypegetBrowser()Specify which browser to use, google chrome is the default. final UnitsetBrowser(BrowserType browser)Specify which browser to use, google chrome is the default. final IntegergetScrollCount()The count to scroll down after a page being opened in a browser. final UnitsetScrollCount(Integer scrollCount)The count to scroll down after a page being opened in a browser. final DurationgetScrollInterval()The interval to scroll down after a page being opened in a browser. final UnitsetScrollInterval(Duration scrollInterval)The interval to scroll down after a page being opened in a browser. final DurationgetScriptTimeout()The maximum time to perform javascript injected into the browser. final UnitsetScriptTimeout(Duration scriptTimeout)The maximum time to perform javascript injected into the browser. final DurationgetPageLoadTimeout()The maximum time to wait for a page to finish. final UnitsetPageLoadTimeout(Duration pageLoadTimeout)The maximum time to wait for a page to finish. final BrowserTypegetItemBrowser()The browser used to visit the item pages. final UnitsetItemBrowser(BrowserType itemBrowser)The browser used to visit the item pages. final DurationgetItemExpires()The same as expires, but only works for item pages. final UnitsetItemExpires(Duration itemExpires)The same as expires, but only works for item pages. final InstantgetItemExpireAt()If an item page is expired, it should be fetched from the web again. final UnitsetItemExpireAt(Instant itemExpireAt)If an item page is expired, it should be fetched from the web again. final IntegergetItemScrollCount()The same as scrollCount, but only works for item pages. final UnitsetItemScrollCount(Integer itemScrollCount)The same as scrollCount, but only works for item pages. final DurationgetItemScrollInterval()The same as scrollInterval, but only works for item pages. final UnitsetItemScrollInterval(Duration itemScrollInterval)The same as scrollInterval, but only works for item pages. final DurationgetItemScriptTimeout()The same as scriptTimeout, but only works for item pages. final UnitsetItemScriptTimeout(Duration itemScriptTimeout)The same as scriptTimeout, but only works for item pages. final DurationgetItemPageLoadTimeout()The same as pageLoadTimeout, but only works for item pages. final UnitsetItemPageLoadTimeout(Duration itemPageLoadTimeout)The same as pageLoadTimeout, but only works for item pages. final StringgetItemRequireNotBlank()Re-fetch the item pages if the required text is blank. final UnitsetItemRequireNotBlank(String itemRequireNotBlank)Re-fetch the item pages if the required text is blank. final IntegergetItemRequireSize()Re-fetch item pages smaller than requireSize. final UnitsetItemRequireSize(Integer itemRequireSize)Re-fetch item pages smaller than requireSize. final IntegergetItemRequireImages()Re-fetch item pages who's images is less than requireImages. final UnitsetItemRequireImages(Integer itemRequireImages)Re-fetch item pages who's images is less than requireImages. final IntegergetItemRequireAnchors()Re-fetch item pages who's anchors is less than requireAnchors. final UnitsetItemRequireAnchors(Integer itemRequireAnchors)Re-fetch item pages who's anchors is less than requireAnchors. final BooleangetPersist()Persist fetched pages as soon as possible. final UnitsetPersist(Boolean persist)Persist fetched pages as soon as possible. final BooleangetStoreContent()If false, persist the page without the content which is usually very large final UnitsetStoreContent(Boolean storeContent)If false, persist the page without the content which is usually very large final BooleangetRefresh()Refresh the fetch state of a page, clear the retry counters. final UnitsetRefresh(Boolean refresh)final BooleangetRetryFailed()Force retry fetching the page if it's failed last time, or it's marked as gone. final UnitsetRetryFailed(@Deprecated(message = Replaced by ignoreFailure, will be removed in further versions) Boolean retryFailed)Force retry fetching the page if it's failed last time, or it's marked as gone. final BooleangetIgnoreFailure()Retry fetching the page even if it's failed last time. final UnitsetIgnoreFailure(Boolean ignoreFailure)Retry fetching the page even if it's failed last time. final IntegergetNMaxRetry()Retry to fetch at most n times, if page.fetchRetries nMaxRetry, the page is marked as gone and do not fetch it again until -refresh is set to clear page. final UnitsetNMaxRetry(Integer nMaxRetry)Retry to fetch at most n times, if page.fetchRetries nMaxRetry, the page is marked as gone and do not fetch it again until -refresh is set to clear page. final IntegergetNJitRetry()Retry at most n times at fetch phrase immediately if RETRY(1601) code return. final UnitsetNJitRetry(Integer nJitRetry)Retry at most n times at fetch phrase immediately if RETRY(1601) code return. final BooleangetLazyFlush()If false, pages are flushed into database as soon as possible. final UnitsetLazyFlush(Boolean lazyFlush)If false, pages are flushed into database as soon as possible. final BooleangetPreferParallel()Parallel fetch pages whenever applicable. final UnitsetPreferParallel(@Deprecated(message = Not used since there is no non-parallel fetching) Boolean preferParallel)Parallel fetch pages whenever applicable. final BooleangetIncognito()Run browser in incognito mode. final UnitsetIncognito(@Deprecated(message = Not used since the browser is always running in temporary contexts) Boolean incognito)Run browser in incognito mode. final BooleangetNoRedirect()Do not redirect. final UnitsetNoRedirect(Boolean noRedirect)Do not redirect. final BooleangetHardRedirect()If false, return the original page record but the redirect target's content, otherwise, return the page record of the redirected target. final UnitsetHardRedirect(Boolean hardRedirect)If false, return the original page record but the redirect target's content, otherwise, return the page record of the redirected target. final BooleangetParse()If true, run the parse phrase. final UnitsetParse(Boolean parse)If true, run the parse phrase. final BooleangetReparseLinks()Re-parse all links if the page is parsed. final UnitsetReparseLinks(Boolean reparseLinks)Re-parse all links if the page is parsed. final BooleangetIgnoreUrlQuery()If true, remove the query parameters in the url. final UnitsetIgnoreUrlQuery(Boolean ignoreUrlQuery)If true, remove the query parameters in the url. final BooleangetNoNorm()No normalizer is applied to parse links. final UnitsetNoNorm(Boolean noNorm)No normalizer is applied to parse links. final BooleangetNoFilter()No filter is applied to parse links. final UnitsetNoFilter(Boolean noFilter)No filter is applied to parse links. final ConditiongetNetCondition()Specify the network condition. final UnitsetNetCondition(Condition netCondition)Specify the network condition. final IntegergetTest()The test level, 0 to disable, we will talk more in test mode. final UnitsetTest(Integer test)The test level, 0 to disable, we will talk more in test mode. final StringgetVersion()The load option version. final UnitsetVersion(String version)The load option version. final StringgetOutLinkSelectorOrNull()final StringgetReferrer()The page referrer. final UnitsetReferrer(String referrer)The page referrer. ParamsgetModifiedParams()Map<String, Object>getModifiedOptions()final VolatileConfiggetConf()final PulsarEventHandlergetEventHandler()final UnitsetEventHandler(PulsarEventHandler eventHandler)final PulsarEventHandlergetItemEventHandler()final UnitsetItemEventHandler(PulsarEventHandler itemEventHandler)BooleangetIsHelp()UnitsetIsHelp(Boolean isHelp)final BooleangetExpandAtSign()final UnitsetExpandAtSign(Boolean expandAtSign)final BooleangetAcceptUnknownOptions()final UnitsetAcceptUnknownOptions(Boolean acceptUnknownOptions)final BooleangetAllowParameterOverwriting()final UnitsetAllowParameterOverwriting(Boolean allowParameterOverwriting)final StringgetArgs()final Array<String>getArgv()The argument vector final PulsarEventHandlerensureEventHandler()Ensure the EventHandler is created. final PulsarEventHandlerensureItemEventHandler()Booleanparse()Parse the arguments into LoadOptions with JCommander and with bug fixes. LoadOptionscreateItemOptions()Create options for item pages. final BooleanisExpired(Instant prevFetchTime)Check if the page has been expired. final BooleanisDead()If the page is dead, do not fetch it from the web. UnititemOptions2MajorOptions()Convert the item options to major options. final VolatileConfigoverrideConfiguration()Write some option values to conf. final VolatileConfigoverrideConfiguration(VolatileConfig conf)Write some option values to conf. BooleanisDefault(String option)Check if the option value is the default. ParamsgetParams()Convert the LoadOptions to be a Params. StringtoString()Convert the LoadOptions to be a string. Booleanequals(Object other)The equality check, two LoadOptions are equal only when the normalized arguments string are equal. IntegerhashCode()LoadOptionsclone()Create a new LoadOptions object. -
Methods inherited from class ai.platon.pulsar.common.options.CommonOptions
addObjects, parseOrExit, setObjects, toArgsMap, toArgv, toCmdLine, toMutableArgsMap, usage -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
LoadOptions
LoadOptions(Array<String> argv, VolatileConfig conf, PulsarEventHandler eventHandler, PulsarEventHandler itemEventHandler)
-
-
Method Detail
-
getTaskTime
final Instant getTaskTime()
The task time, we usually use a task time to indicate the name of a batch task.
-
setTaskTime
final Unit setTaskTime(Instant taskTime)
The task time, we usually use a task time to indicate the name of a batch task.
-
getDeadTime
final Instant getDeadTime()
The dead time, if now deadTime, the task should be discarded as soon as possible.
-
setDeadTime
final Unit setDeadTime(Instant deadTime)
The dead time, if now deadTime, the task should be discarded as soon as possible.
-
getAuthToken
final String getAuthToken()
The auth token for this task.
-
setAuthToken
final Unit setAuthToken(String authToken)
The auth token for this task.
-
getReadonly
final Boolean getReadonly()
If true, get a copy of the webpage and do not modify it.
-
setReadonly
final Unit setReadonly(Boolean readonly)
If true, get a copy of the webpage and do not modify it.
-
getIsResource
final Boolean getIsResource()
If true, fetch the page content as a resource without browser rendering.
-
setIsResource
final Unit setIsResource(Boolean isResource)
If true, fetch the page content as a resource without browser rendering.
-
getExpires
final Duration getExpires()
The expiry time. If a page is expired, it should be fetched from the web.
The term "expires" usually be used for an expiry time, for example, http-equiv, or in cookie specification, guess it means "expires at".
The expires field supports both ISO-8601 standard and hadoop time duration format: ISO-8601 standard : PnDTnHnMn.nS Hadoop time duration format : Valid units are : ns, us, ms, s, m, h, d.
-
setExpires
final Unit setExpires(Duration expires)
The expiry time. If a page is expired, it should be fetched from the web.
The term "expires" usually be used for an expiry time, for example, http-equiv, or in cookie specification, guess it means "expires at".
The expires field supports both ISO-8601 standard and hadoop time duration format: ISO-8601 standard : PnDTnHnMn.nS Hadoop time duration format : Valid units are : ns, us, ms, s, m, h, d.
-
getExpireAt
final Instant getExpireAt()
The time point to expire. If a page is expired, it should be fetched from the web.
-
setExpireAt
final Unit setExpireAt(Instant expireAt)
The time point to expire. If a page is expired, it should be fetched from the web.
-
getFetchInterval
final Duration getFetchInterval()
The fetch interval, used for periodically tasks.
-
setFetchInterval
final Unit setFetchInterval(Duration fetchInterval)
The fetch interval, used for periodically tasks.
-
getOutLinkSelector
final String getOutLinkSelector()
The CSS selector to select out links in the portal page.
-
setOutLinkSelector
final Unit setOutLinkSelector(String outLinkSelector)
The CSS selector to select out links in the portal page.
-
getOutLinkPattern
final String getOutLinkPattern()
The pattern to select out links in the portal page.
-
setOutLinkPattern
final Unit setOutLinkPattern(String outLinkPattern)
The pattern to select out links in the portal page.
-
getClickTarget
final String getClickTarget()
The selector of the element to click for out links, if it's blank, no element should be clicked. TODO: not implemented yet
-
setClickTarget
final Unit setClickTarget(String clickTarget)
The selector of the element to click for out links, if it's blank, no element should be clicked. TODO: not implemented yet
-
getNextPageSelector
final String getNextPageSelector()
The css selector of next page anchor. TODO: not implemented yet
-
setNextPageSelector
final Unit setNextPageSelector(String nextPageSelector)
The css selector of next page anchor. TODO: not implemented yet
-
getTopLinks
final Integer getTopLinks()
Specify how many links to select if we deal with out-pages.
-
setTopLinks
final Unit setTopLinks(Integer topLinks)
Specify how many links to select if we deal with out-pages.
-
getTopNAnchorGroups
final Integer getTopNAnchorGroups()
Try the top N anchor groups.
-
setTopNAnchorGroups
final Unit setTopNAnchorGroups(Integer topNAnchorGroups)
Try the top N anchor groups.
-
getWaitNonBlank
final String getWaitNonBlank()
Wait for ajax content until the element is filled by a non-blank text.
-
setWaitNonBlank
final Unit setWaitNonBlank(String waitNonBlank)
Wait for ajax content until the element is filled by a non-blank text.
-
getRequireNotBlank
final String getRequireNotBlank()
Keep the pages only if the required text is not blank.
-
setRequireNotBlank
final Unit setRequireNotBlank(String requireNotBlank)
Keep the pages only if the required text is not blank.
-
getRequireSize
final Integer getRequireSize()
Fetch pages smaller than requireSize in bytes.
-
setRequireSize
final Unit setRequireSize(Integer requireSize)
Fetch pages smaller than requireSize in bytes.
-
getRequireImages
final Integer getRequireImages()
Re-fetch a page who's images less than requireImages.
-
setRequireImages
final Unit setRequireImages(Integer requireImages)
Re-fetch a page who's images less than requireImages.
-
getRequireAnchors
final Integer getRequireAnchors()
Re-fetch a page who's anchors less than requireAnchors.
-
setRequireAnchors
final Unit setRequireAnchors(Integer requireAnchors)
Re-fetch a page who's anchors less than requireAnchors.
-
getFetchMode
final FetchMode getFetchMode()
The fetch mode.
-
setFetchMode
final Unit setFetchMode(FetchMode fetchMode)
The fetch mode.
-
getBrowser
final BrowserType getBrowser()
Specify which browser to use, google chrome is the default. TODO: session scope browser choice is not support by now
-
setBrowser
final Unit setBrowser(BrowserType browser)
Specify which browser to use, google chrome is the default. TODO: session scope browser choice is not support by now
-
getScrollCount
final Integer getScrollCount()
The count to scroll down after a page being opened in a browser.
-
setScrollCount
final Unit setScrollCount(Integer scrollCount)
The count to scroll down after a page being opened in a browser.
-
getScrollInterval
final Duration getScrollInterval()
The interval to scroll down after a page being opened in a browser.
-
setScrollInterval
final Unit setScrollInterval(Duration scrollInterval)
The interval to scroll down after a page being opened in a browser.
-
getScriptTimeout
final Duration getScriptTimeout()
The maximum time to perform javascript injected into the browser.
-
setScriptTimeout
final Unit setScriptTimeout(Duration scriptTimeout)
The maximum time to perform javascript injected into the browser.
-
getPageLoadTimeout
final Duration getPageLoadTimeout()
The maximum time to wait for a page to finish.
-
setPageLoadTimeout
final Unit setPageLoadTimeout(Duration pageLoadTimeout)
The maximum time to wait for a page to finish.
-
getItemBrowser
final BrowserType getItemBrowser()
The browser used to visit the item pages. TODO: session scope browser choice is not support by now
-
setItemBrowser
final Unit setItemBrowser(BrowserType itemBrowser)
The browser used to visit the item pages. TODO: session scope browser choice is not support by now
-
getItemExpires
final Duration getItemExpires()
The same as expires, but only works for item pages.
-
setItemExpires
final Unit setItemExpires(Duration itemExpires)
The same as expires, but only works for item pages.
-
getItemExpireAt
final Instant getItemExpireAt()
If an item page is expired, it should be fetched from the web again.
-
setItemExpireAt
final Unit setItemExpireAt(Instant itemExpireAt)
If an item page is expired, it should be fetched from the web again.
-
getItemScrollCount
final Integer getItemScrollCount()
The same as scrollCount, but only works for item pages.
-
setItemScrollCount
final Unit setItemScrollCount(Integer itemScrollCount)
The same as scrollCount, but only works for item pages.
-
getItemScrollInterval
final Duration getItemScrollInterval()
The same as scrollInterval, but only works for item pages.
-
setItemScrollInterval
final Unit setItemScrollInterval(Duration itemScrollInterval)
The same as scrollInterval, but only works for item pages.
-
getItemScriptTimeout
final Duration getItemScriptTimeout()
The same as scriptTimeout, but only works for item pages.
-
setItemScriptTimeout
final Unit setItemScriptTimeout(Duration itemScriptTimeout)
The same as scriptTimeout, but only works for item pages.
-
getItemPageLoadTimeout
final Duration getItemPageLoadTimeout()
The same as pageLoadTimeout, but only works for item pages.
-
setItemPageLoadTimeout
final Unit setItemPageLoadTimeout(Duration itemPageLoadTimeout)
The same as pageLoadTimeout, but only works for item pages.
-
getItemRequireNotBlank
final String getItemRequireNotBlank()
Re-fetch the item pages if the required text is blank.
-
setItemRequireNotBlank
final Unit setItemRequireNotBlank(String itemRequireNotBlank)
Re-fetch the item pages if the required text is blank.
-
getItemRequireSize
final Integer getItemRequireSize()
Re-fetch item pages smaller than requireSize.
-
setItemRequireSize
final Unit setItemRequireSize(Integer itemRequireSize)
Re-fetch item pages smaller than requireSize.
-
getItemRequireImages
final Integer getItemRequireImages()
Re-fetch item pages who's images is less than requireImages.
-
setItemRequireImages
final Unit setItemRequireImages(Integer itemRequireImages)
Re-fetch item pages who's images is less than requireImages.
-
getItemRequireAnchors
final Integer getItemRequireAnchors()
Re-fetch item pages who's anchors is less than requireAnchors.
-
setItemRequireAnchors
final Unit setItemRequireAnchors(Integer itemRequireAnchors)
Re-fetch item pages who's anchors is less than requireAnchors.
-
getPersist
final Boolean getPersist()
Persist fetched pages as soon as possible.
-
setPersist
final Unit setPersist(Boolean persist)
Persist fetched pages as soon as possible.
-
getStoreContent
final Boolean getStoreContent()
If false, persist the page without the content which is usually very large
-
setStoreContent
final Unit setStoreContent(Boolean storeContent)
If false, persist the page without the content which is usually very large
-
getRefresh
final Boolean getRefresh()
Refresh the fetch state of a page, clear the retry counters. If true, the page should be fetched, just like we click the refresh button on a real browser. The option can be explained as follows: -refresh = -ignoreFailure -i 0s and set page.fetchRetries = 0.
TODO: consider add an option itemRefresh
-
setRefresh
final Unit setRefresh(Boolean refresh)
-
getRetryFailed
final Boolean getRetryFailed()
Force retry fetching the page if it's failed last time, or it's marked as gone.
-
setRetryFailed
final Unit setRetryFailed(@Deprecated(message = Replaced by ignoreFailure, will be removed in further versions) Boolean retryFailed)
Force retry fetching the page if it's failed last time, or it's marked as gone.
-
getIgnoreFailure
final Boolean getIgnoreFailure()
Retry fetching the page even if it's failed last time.
-
setIgnoreFailure
final Unit setIgnoreFailure(Boolean ignoreFailure)
Retry fetching the page even if it's failed last time.
-
getNMaxRetry
final Integer getNMaxRetry()
Retry to fetch at most n times, if page.fetchRetries nMaxRetry, the page is marked as gone and do not fetch it again until -refresh is set to clear page.fetchRetries
-
setNMaxRetry
final Unit setNMaxRetry(Integer nMaxRetry)
Retry to fetch at most n times, if page.fetchRetries nMaxRetry, the page is marked as gone and do not fetch it again until -refresh is set to clear page.fetchRetries
-
getNJitRetry
final Integer getNJitRetry()
Retry at most n times at fetch phrase immediately if RETRY(1601) code return.
-
setNJitRetry
final Unit setNJitRetry(Integer nJitRetry)
Retry at most n times at fetch phrase immediately if RETRY(1601) code return.
-
getLazyFlush
final Boolean getLazyFlush()
If false, pages are flushed into database as soon as possible.
-
setLazyFlush
final Unit setLazyFlush(Boolean lazyFlush)
If false, pages are flushed into database as soon as possible.
-
getPreferParallel
final Boolean getPreferParallel()
Parallel fetch pages whenever applicable.
-
setPreferParallel
final Unit setPreferParallel(@Deprecated(message = Not used since there is no non-parallel fetching) Boolean preferParallel)
Parallel fetch pages whenever applicable.
-
getIncognito
final Boolean getIncognito()
Run browser in incognito mode. Not used since the browser is always running in temporary contexts
-
setIncognito
final Unit setIncognito(@Deprecated(message = Not used since the browser is always running in temporary contexts) Boolean incognito)
Run browser in incognito mode. Not used since the browser is always running in temporary contexts
-
getNoRedirect
final Boolean getNoRedirect()
Do not redirect. Ignored in browser mode since the browser handles the redirection itself.
-
setNoRedirect
final Unit setNoRedirect(Boolean noRedirect)
Do not redirect. Ignored in browser mode since the browser handles the redirection itself.
-
getHardRedirect
final Boolean getHardRedirect()
If false, return the original page record but the redirect target's content, otherwise, return the page record of the redirected target. If we use a browser, redirections are handled by the browser so the flag is ignored.
-
setHardRedirect
final Unit setHardRedirect(Boolean hardRedirect)
If false, return the original page record but the redirect target's content, otherwise, return the page record of the redirected target. If we use a browser, redirections are handled by the browser so the flag is ignored.
-
getReparseLinks
final Boolean getReparseLinks()
Re-parse all links if the page is parsed.
-
setReparseLinks
final Unit setReparseLinks(Boolean reparseLinks)
Re-parse all links if the page is parsed.
-
getIgnoreUrlQuery
final Boolean getIgnoreUrlQuery()
If true, remove the query parameters in the url.
-
setIgnoreUrlQuery
final Unit setIgnoreUrlQuery(Boolean ignoreUrlQuery)
If true, remove the query parameters in the url.
-
getNoFilter
final Boolean getNoFilter()
No filter is applied to parse links.
-
setNoFilter
final Unit setNoFilter(Boolean noFilter)
No filter is applied to parse links.
-
getNetCondition
final Condition getNetCondition()
Specify the network condition.
-
setNetCondition
final Unit setNetCondition(Condition netCondition)
Specify the network condition.
-
setTest
final Unit setTest(Integer test)
The test level, 0 to disable, we will talk more in test mode.
-
getVersion
final String getVersion()
The load option version.
-
setVersion
final Unit setVersion(String version)
The load option version.
-
getOutLinkSelectorOrNull
final String getOutLinkSelectorOrNull()
-
getReferrer
final String getReferrer()
The page referrer.
-
setReferrer
final Unit setReferrer(String referrer)
The page referrer.
-
getModifiedParams
Params getModifiedParams()
-
getModifiedOptions
Map<String, Object> getModifiedOptions()
-
getConf
final VolatileConfig getConf()
-
getEventHandler
final PulsarEventHandler getEventHandler()
-
setEventHandler
final Unit setEventHandler(PulsarEventHandler eventHandler)
-
getItemEventHandler
final PulsarEventHandler getItemEventHandler()
-
setItemEventHandler
final Unit setItemEventHandler(PulsarEventHandler itemEventHandler)
-
getExpandAtSign
final Boolean getExpandAtSign()
-
setExpandAtSign
final Unit setExpandAtSign(Boolean expandAtSign)
-
getAcceptUnknownOptions
final Boolean getAcceptUnknownOptions()
-
setAcceptUnknownOptions
final Unit setAcceptUnknownOptions(Boolean acceptUnknownOptions)
-
getAllowParameterOverwriting
final Boolean getAllowParameterOverwriting()
-
setAllowParameterOverwriting
final Unit setAllowParameterOverwriting(Boolean allowParameterOverwriting)
-
ensureEventHandler
final PulsarEventHandler ensureEventHandler()
Ensure the EventHandler is created.
-
ensureItemEventHandler
final PulsarEventHandler ensureItemEventHandler()
-
parse
Boolean parse()
Parse the arguments into LoadOptions with JCommander and with bug fixes.
-
createItemOptions
LoadOptions createItemOptions()
Create options for item pages.
-
itemOptions2MajorOptions
Unit itemOptions2MajorOptions()
Convert the item options to major options. The system do not use item options directly, we have to do the convert before we process item pages.
-
overrideConfiguration
final VolatileConfig overrideConfiguration()
Write some option values to conf.
LoadOptions is not globally visible, we have to pass some values to modules who can not see it through a VolatileConfig object.
-
overrideConfiguration
final VolatileConfig overrideConfiguration(VolatileConfig conf)
Write some option values to conf.
LoadOptions is not globally visible, we have to pass some values to modules who can not see it through a VolatileConfig object.
-
getParams
Params getParams()
Convert the LoadOptions to be a Params.
-
toString
String toString()
Convert the LoadOptions to be a string. The operation should be reversible:
val args = "..." val options1 = LoadOptions.parse(args) val normalizedArgs = options1 val options2 = LoadOptions.parse(normalizedArgs) require(normalizedArgs == options2.toString())
-
equals
Boolean equals(Object other)
The equality check, two LoadOptions are equal only when the normalized arguments string are equal.
-
clone
LoadOptions clone()
Create a new LoadOptions object.
-
-
-
-