Interface V5AuthenticationProvider


public interface V5AuthenticationProvider
Implemented by a legacy v4 org.apache.pulsar.client.api.Authentication that owns a v5-native body, so the client can drive the v5 body directly instead of bridging the v4 plugin (PIP-478).

The client drives the v5 authentication model natively: it resolves exactly one v5 Authentication per client and drives every transport from it. A v4 plugin therefore has to be turned into a v5 one, and there are two ways to do that. The built-in shims already have a v5-native body — the v4 class is a thin compatibility surface over it — so they hand that body over through this interface. Everything else is wrapped by LegacyV4AuthenticationAdapter, which re-expresses the v4 surface as v5 capabilities and off-loads every v4 call to the client's blocking executor.

Handing over the native body is not merely tidier: the generic bridge exists to make an unknown plugin safe, and it pays for that with an executor hop per call and a start-time probe of the v4 plugin's capabilities. A built-in whose body is already asynchronous and non-blocking needs neither.

The body is requested once per client, during client construction, and must be cheap to produce — credential acquisition belongs in the body's own asynchronous methods, not here. Implementations must return a body that reads any mutable configuration (a rotated token, for instance) at call time rather than capturing it, since the same body serves the whole client lifetime.

The .internal. subpackage signals "stable internal" — application code should not implement this interface; it is observed by the framework.

  • Method Summary

    Modifier and Type
    Method
    Description
    The v5-native authentication body this v4 plugin delegates to.
  • Method Details

    • v5Authentication

      Authentication v5Authentication()
      The v5-native authentication body this v4 plugin delegates to.
      Returns:
      the v5 authentication to drive; never null