接口 Authentication

  • 所有超级接口:
    java.lang.AutoCloseable, java.io.Closeable, java.io.Serializable

    @LimitedPrivate
    @Stable
    public interface Authentication
    extends java.io.Closeable, java.io.Serializable
    Interface of authentication providers.
    • 方法概要

      所有方法 实例方法 抽象方法 默认方法 已过时的方法 
      修饰符和类型 方法 说明
      default void authenticationStage​(java.lang.String requestUrl, AuthenticationDataProvider authData, java.util.Map<java.lang.String,​java.lang.String> previousResHeaders, java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,​java.lang.String>> authFuture)
      An authentication Stage.
      void configure​(java.util.Map<java.lang.String,​java.lang.String> authParams)
      已过时。
      This method will be deleted on version 2.0, instead please use configure(String encodedAuthParamString) which is in EncodedAuthenticationParameterSupport for now and will be integrated into this interface.
      default AuthenticationDataProvider getAuthData()  
      default AuthenticationDataProvider getAuthData​(java.lang.String brokerHostName)
      Get/Create an authentication data provider which provides the data that this client will be sent to the broker.
      java.lang.String getAuthMethodName()  
      default java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.String>> newRequestHeader​(java.lang.String hostName, AuthenticationDataProvider authData, java.util.Map<java.lang.String,​java.lang.String> previousResHeaders)
      Add an authenticationStage that will complete along with authFuture.
      void start()
      Initialize the authentication provider.
      • 从接口继承的方法 java.io.Closeable

        close
    • 方法详细资料

      • getAuthMethodName

        java.lang.String getAuthMethodName()
        返回:
        the identifier for this authentication method
      • getAuthData

        default AuthenticationDataProvider getAuthData​(java.lang.String brokerHostName)
                                                throws PulsarClientException
        Get/Create an authentication data provider which provides the data that this client will be sent to the broker. Some authentication method need to auth between each client channel. So it need the broker, who it will talk to.
        参数:
        brokerHostName - target broker host name
        返回:
        The authentication data provider
        抛出:
        PulsarClientException
      • configure

        @Deprecated
        void configure​(java.util.Map<java.lang.String,​java.lang.String> authParams)
        已过时。
        This method will be deleted on version 2.0, instead please use configure(String encodedAuthParamString) which is in EncodedAuthenticationParameterSupport for now and will be integrated into this interface.
        Configure the authentication plugins with the supplied parameters.
        参数:
        authParams -
      • authenticationStage

        default void authenticationStage​(java.lang.String requestUrl,
                                         AuthenticationDataProvider authData,
                                         java.util.Map<java.lang.String,​java.lang.String> previousResHeaders,
                                         java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,​java.lang.String>> authFuture)
        An authentication Stage. when authentication complete, passed-in authFuture will contains authentication related http request headers.
      • newRequestHeader

        default java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.String>> newRequestHeader​(java.lang.String hostName,
                                                                                                             AuthenticationDataProvider authData,
                                                                                                             java.util.Map<java.lang.String,​java.lang.String> previousResHeaders)
                                                                                                      throws java.lang.Exception
        Add an authenticationStage that will complete along with authFuture.
        抛出:
        java.lang.Exception