Package ai.platon.pulsar.common.proxy
Class ProxyEntry
-
- All Implemented Interfaces:
-
kotlin.Comparable
public class ProxyEntry implements Comparable<ProxyEntry>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumProxyEntry.Statuspublic enumProxyEntry.BanStatepublic classProxyEntry.Companion
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ProxyEntry(String host, Integer port, String username, String password, Proxy.Type type)
-
Method Summary
Modifier and Type Method Description final IntegergetId()The proxy entry id, it's unique in the process scope final UnitsetId(Integer id)The proxy entry id, it's unique in the process scope final StringgetOutIp()The out ip which will be seen by the target site final UnitsetOutIp(String outIp)The out ip which will be seen by the target site final StringgetAgentIp()final InstantgetDeclaredTTL()The time to live of the proxy entry declared by the proxy vendor final UnitsetDeclaredTTL(Instant declaredTTL)The time to live of the proxy entry declared by the proxy vendor final BooleangetRotatable()Specify whether we can rotate the out ip via a link. final UnitsetRotatable(Boolean rotatable)Specify whether we can rotate the out ip via a link. final StringgetRotateURL()The link to tell the proxy vendor to rotate the out ip. final UnitsetRotateURL(String rotateURL)The link to tell the proxy vendor to rotate the out ip. final StringgetLastTarget()The last target url final UnitsetLastTarget(String lastTarget)The last target url final List<URL>getTestUrls()The test urls final UnitsetTestUrls(List<URL> testUrls)The test urls final URLgetDefaultTestUrl()The default test url final UnitsetDefaultTestUrl(URL defaultTestUrl)The default test url final BooleanisTestIp()Check if the proxy is used for test final UnitsetTestIp(Boolean isTestIp)Check if the proxy is used for test final StringgetProtocol()final StringgetHostPort()final StringgetSegment()final StringgetOutSegment()final InstantgetStartTime()final DurationgetElapsedTime()final StringgetDisplay()final StringgetMetadata()final Function2<URL, Proxy, Boolean>getNetworkTester()final UnitsetNetworkTester(Function2<URL, Proxy, Boolean> networkTester)final AtomicIntegergetNumTests()final AtomicIntegergetNumConnectionLosses()final AtomicLonggetAccumResponseMillis()final InstantgetAvailableTime()final UnitsetAvailableTime(Instant availableTime)final AtomicIntegergetNumFailedPages()final AtomicIntegergetNumSuccessPages()final ConcurrentHashMultiset<String>getServedDomains()final AtomicReference<ProxyEntry.Status>getStatus()final DoublegetTestSpeed()final InstantgetTtl()final DurationgetTtlDuration()final BooleanisExpired()final BooleanisRetired()final BooleanisFree()final BooleanisWorking()final BooleanisBanned()final BooleanisFailed()final BooleanisGone()final AtomicIntegergetNumRunningTasks()final InstantgetLastActiveTime()Last time to use this proxy final UnitsetLastActiveTime(Instant lastActiveTime)Last time to use this proxy final DurationgetIdleTimeout()final UnitsetIdleTimeout(Duration idleTimeout)final DurationgetIdleTime()final BooleanisIdle()final BooleanisReady()final StringgetReadableState()final List<Pair<String, Serializable>>getParams()final StringgetHost()The host of the proxy server final UnitsetHost(String host)The host of the proxy server final IntegergetPort()The port of the proxy server final UnitsetPort(Integer port)The port of the proxy server final StringgetUsername()The username final UnitsetUsername(String username)The username final StringgetPassword()The password final UnitsetPassword(String password)The password final Proxy.TypegetType()The proxy type final UnitsetType(Proxy.Type type)The proxy type final URItoURI()final BooleanwillExpireAt(Instant instant)final BooleanwillExpireAfter(Duration duration)final UnitsetFree()final UnitstartWork()final Unitretire()final Unitrefresh()final BooleancanConnect()final Booleantest()final Booleantest(URL target, Duration timeout)final Stringserialize()The string representation, can be parsed using parse or deserialize final Stringserialize2()final Stringformat()The string representation, can be parsed using parse or deserialize IntegerhashCode()Booleanequals(Object other)StringtoString()The string representation, can be parsed using parse IntegercompareTo(ProxyEntry other)-
-
Constructor Detail
-
ProxyEntry
ProxyEntry(String host, Integer port, String username, String password, Proxy.Type type)
-
-
Method Detail
-
getAgentIp
final String getAgentIp()
-
getDeclaredTTL
final Instant getDeclaredTTL()
The time to live of the proxy entry declared by the proxy vendor
-
setDeclaredTTL
final Unit setDeclaredTTL(Instant declaredTTL)
The time to live of the proxy entry declared by the proxy vendor
-
getRotatable
final Boolean getRotatable()
Specify whether we can rotate the out ip via a link.
-
setRotatable
final Unit setRotatable(Boolean rotatable)
Specify whether we can rotate the out ip via a link.
-
getRotateURL
final String getRotateURL()
The link to tell the proxy vendor to rotate the out ip.
-
setRotateURL
final Unit setRotateURL(String rotateURL)
The link to tell the proxy vendor to rotate the out ip.
-
getLastTarget
final String getLastTarget()
The last target url
-
setLastTarget
final Unit setLastTarget(String lastTarget)
The last target url
-
getTestUrls
final List<URL> getTestUrls()
The test urls
-
setTestUrls
final Unit setTestUrls(List<URL> testUrls)
The test urls
-
getDefaultTestUrl
final URL getDefaultTestUrl()
The default test url
-
setDefaultTestUrl
final Unit setDefaultTestUrl(URL defaultTestUrl)
The default test url
-
getProtocol
final String getProtocol()
-
getHostPort
final String getHostPort()
-
getSegment
final String getSegment()
-
getOutSegment
final String getOutSegment()
-
getStartTime
final Instant getStartTime()
-
getElapsedTime
final Duration getElapsedTime()
-
getDisplay
final String getDisplay()
-
getMetadata
final String getMetadata()
-
getNetworkTester
final Function2<URL, Proxy, Boolean> getNetworkTester()
-
setNetworkTester
final Unit setNetworkTester(Function2<URL, Proxy, Boolean> networkTester)
-
getNumTests
final AtomicInteger getNumTests()
-
getNumConnectionLosses
final AtomicInteger getNumConnectionLosses()
-
getAccumResponseMillis
final AtomicLong getAccumResponseMillis()
-
getAvailableTime
final Instant getAvailableTime()
-
setAvailableTime
final Unit setAvailableTime(Instant availableTime)
-
getNumFailedPages
final AtomicInteger getNumFailedPages()
-
getNumSuccessPages
final AtomicInteger getNumSuccessPages()
-
getServedDomains
final ConcurrentHashMultiset<String> getServedDomains()
-
getStatus
final AtomicReference<ProxyEntry.Status> getStatus()
-
getTestSpeed
final Double getTestSpeed()
-
getTtlDuration
final Duration getTtlDuration()
-
getNumRunningTasks
final AtomicInteger getNumRunningTasks()
-
getLastActiveTime
final Instant getLastActiveTime()
Last time to use this proxy
-
setLastActiveTime
final Unit setLastActiveTime(Instant lastActiveTime)
Last time to use this proxy
-
getIdleTimeout
final Duration getIdleTimeout()
-
setIdleTimeout
final Unit setIdleTimeout(Duration idleTimeout)
-
getIdleTime
final Duration getIdleTime()
-
getReadableState
final String getReadableState()
-
getParams
final List<Pair<String, Serializable>> getParams()
-
getUsername
final String getUsername()
The username
-
setUsername
final Unit setUsername(String username)
The username
-
getPassword
final String getPassword()
The password
-
setPassword
final Unit setPassword(String password)
The password
-
getType
final Proxy.Type getType()
The proxy type
-
setType
final Unit setType(Proxy.Type type)
The proxy type
-
willExpireAt
final Boolean willExpireAt(Instant instant)
-
willExpireAfter
final Boolean willExpireAfter(Duration duration)
-
canConnect
final Boolean canConnect()
-
serialize
final String serialize()
The string representation, can be parsed using parse or deserialize
-
serialize2
final String serialize2()
-
format
final String format()
The string representation, can be parsed using parse or deserialize
-
compareTo
Integer compareTo(ProxyEntry other)
-
-
-
-