Interface AuthenticationInitContext
public interface AuthenticationInitContext
Runtime services handed to
Authentication.initializeAsync(AuthenticationInitContext) once when the client is built
(PIP-478).
The framework owns and closes these shared services (HTTP clients, scheduler, blocking executor);
the implementation may retain references for the lifetime of the client and releases its own
resources in Authentication.close().
-
Method Summary
Modifier and TypeMethodDescriptionDedicated executor for off-loading potentially-blocking authentication work, kept separate fromscheduler()so that blocking calls cannot starve the scheduler's threads or delay scheduled tasks.clock()org.apache.pulsar.http.PulsarHttpClientFactoryFactory forPulsarHttpClientinstances.io.opentelemetry.api.OpenTelemetryScheduler for delayed / periodic authentication work (e.g.
-
Method Details
-
httpClientFactory
org.apache.pulsar.http.PulsarHttpClientFactory httpClientFactory()Factory forPulsarHttpClientinstances. The framework manages lifecycle (event loop, timer, DNS cache, TLS material refresh integration); plugins describe what they need via aPulsarHttpClientConfigand receive a configured instance owned by the framework. Multiple instances with different TLS / timeouts may be obtained for different uses (e.g. OAuth2 mTLS to the IdP vs HTTP topic lookup).Plugins MUST NOT construct private HTTP clients directly — doing so defeats the framework's shared event-loop / DNS / refresh integration.
- Returns:
- the framework's HTTP client factory
-
scheduler
ScheduledExecutorService scheduler()Scheduler for delayed / periodic authentication work (e.g. proactive credential renewal). Never the Netty event loop. Reserved for scheduled tasks — potentially-blocking work belongs onblockingExecutor().- Returns:
- the framework-owned scheduler
-
blockingExecutor
Executor blockingExecutor()Dedicated executor for off-loading potentially-blocking authentication work, kept separate fromscheduler()so that blocking calls cannot starve the scheduler's threads or delay scheduled tasks. TheLegacyV4AuthenticationAdapteroffloads every synchronous v4 plugin call here. Never the Netty event loop. Framework-owned and shared perPulsarClient.- Returns:
- the framework-owned blocking executor
-
clock
Clock clock()- Returns:
- the clock used by implementations that schedule against wall-clock time
-
openTelemetry
io.opentelemetry.api.OpenTelemetry openTelemetry()- Returns:
- the telemetry root; the framework defaults to
OpenTelemetry.noop()if unset
-
clientInstanceId
String clientInstanceId()- Returns:
- a stable id of the owning
PulsarClient, for logging correlation
-