-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.config.Configurable,java.lang.AutoCloseable
public interface Protocol implements Configurable, AutoCloseable
A retriever of url content. Implemented by protocol extensions.
TODO: protocols are designed to be initialized at setConf() method, which is not good
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classProtocol.Companion
-
Method Summary
Modifier and Type Method Description UnitsetResponse(Response response)Collection<Response>getResponses(Collection<WebPage> pages, VolatileConfig volatileConfig)Unitreset()Reset the protocol environment, so the peer host view the client as a new one Unitcancel(WebPage page)Cancel the page UnitcancelAll()Cancel all fetching tasks abstract ProtocolOutputgetProtocolOutput(WebPage page)Returns the ProtocolOutput for a fetch list entry. abstract ProtocolOutputgetProtocolOutputDeferred(WebPage page)Returns the ProtocolOutput for a fetch list entry. abstract BaseRobotRulesgetRobotRules(WebPage page)Retrieve robot rules applicable for this url. Unitclose()abstract BooleangetSupportParallel()-
-
Method Detail
-
setResponse
Unit setResponse(Response response)
-
getResponses
Collection<Response> getResponses(Collection<WebPage> pages, VolatileConfig volatileConfig)
-
getProtocolOutput
abstract ProtocolOutput getProtocolOutput(WebPage page)
Returns the ProtocolOutput for a fetch list entry.
-
getProtocolOutputDeferred
abstract ProtocolOutput getProtocolOutputDeferred(WebPage page)
Returns the ProtocolOutput for a fetch list entry.
-
getRobotRules
abstract BaseRobotRules getRobotRules(WebPage page)
Retrieve robot rules applicable for this url.
- Parameters:
page- The Web page
-
getSupportParallel
abstract Boolean getSupportParallel()
-
-
-
-