Package org.apache.pulsar.client.api
Enum Class Socks5ProxyScope
- All Implemented Interfaces:
Serializable,Comparable<Socks5ProxyScope>,Constable
Selector that controls which kinds of connections should be routed through the configured
SOCKS5 proxy when a proxy address is set on a Pulsar client or admin builder.
Historically, the SOCKS5 proxy configured on PulsarClient only affected the Pulsar
binary protocol connections to brokers, and the HTTP lookup / failover clients inside
PulsarClient silently ignored it. The scope selector makes this behavior explicit and
also allows users to route HTTP traffic (HTTP lookups, failover HTTP clients, and
PulsarAdmin REST calls) through the same SOCKS5 proxy.
For PulsarClient, the default is BINARY_ONLY so existing behavior is
preserved. For PulsarAdmin, the default is HTTP_ONLY because admin traffic is
HTTP by nature.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionApply the SOCKS5 proxy only to Pulsar binary protocol connections to brokers.Apply the SOCKS5 proxy to both Pulsar binary protocol connections and HTTP traffic.Apply the SOCKS5 proxy only to HTTP traffic, i.e. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanstatic Socks5ProxyScopeReturns the enum constant of this class with the specified name.static Socks5ProxyScope[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BINARY_ONLY
Apply the SOCKS5 proxy only to Pulsar binary protocol connections to brokers. HTTP lookups and HTTP-based failover connections ignore the proxy. This matches the pre-existing behavior ofPulsarClientand is the default for client builders. -
HTTP_ONLY
Apply the SOCKS5 proxy only to HTTP traffic, i.e. HTTP/HTTPS lookups, failover HTTP clients, and REST calls issued byPulsarAdmin. Pulsar binary protocol connections to brokers do not use the proxy. -
BOTH
Apply the SOCKS5 proxy to both Pulsar binary protocol connections and HTTP traffic.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
appliesToBinary
public boolean appliesToBinary()- Returns:
trueif this scope routes Pulsar binary protocol connections through SOCKS5.
-
appliesToHttp
public boolean appliesToHttp()- Returns:
trueif this scope routes HTTP/HTTPS traffic through SOCKS5.
-