Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleSaslClientAuthenticator.initiateReauthentication()
    public void initiateReauthentication(Time time,
            AuthenticationSuccessOrFailureReceiver authenticationSuccessOrFailureReceiver) {
        if (saslState != SaslState.SEND_APIVERSIONS_REQUEST) {
            // it is possible that the connection was closed; don't retry
            if (saslState != SaslState.CLOSED)
                saslState = SaslState.FAILED;
            authenticationSuccessOrFailureReceiver.reauthenticationFailed(RetryIndication.DO_NOT_RETRY, String.format(
                    "Re-authentication initiated but authenticator initial state is incorrect (expected %s): %s",
                    SaslState.SEND_APIVERSIONS_REQUEST, saslState));
            if (saslState != SaslState.CLOSED)
                saslState = SaslState.FAILED;
            return;
        }
        authenticationRequestEnqueuer().enqueueRequest(this.node, new ApiVersionsRequest.Builder((short) 0),
                authenticationRequestCompletionHandlerForApiVersionsRequest(time,
                        authenticationSuccessOrFailureReceiver));
    }

...