public class SaslStreamClientDriver extends Object implements io.grpc.stub.StreamObserver<SaslMessage>
SaslStreamClientDriver
and
SaslStreamServerDriver
respectively. This drivers are wrappers over gRPC
StreamObserver
s that manages the stream traffic destined for the other participant. They
make sure messages are exchanged between client and server one by one synchronously.
Sasl handshake is initiated by the client. Following the initiate call, depending on the scheme,
one or more messages are exchanged to establish authenticated session between client and server.
After the authentication is established, client and server streams are not closed in order to use
them as long polling on authentication state changes. Client closing the stream means that it
doesn't want to be authenticated anymore. Server closing the stream means the client is not
authenticated at the server anymore.Constructor and Description |
---|
SaslStreamClientDriver(SaslHandshakeClientHandler handshakeClient,
AtomicBoolean authenticated,
GrpcChannelKey channelKey,
long grpcAuthTimeoutMs)
Creates client driver with given handshake handler.
|
Modifier and Type | Method and Description |
---|---|
void |
onCompleted() |
void |
onError(Throwable throwable) |
void |
onNext(SaslMessage saslMessage) |
void |
setServerObserver(io.grpc.stub.StreamObserver<SaslMessage> requestObserver)
Sets the server's Sasl stream.
|
void |
start()
Starts authentication with the server and wait until completion.
|
void |
stop()
Stops authenticated session with the server by releasing the long poll.
|
public SaslStreamClientDriver(SaslHandshakeClientHandler handshakeClient, AtomicBoolean authenticated, GrpcChannelKey channelKey, long grpcAuthTimeoutMs)
handshakeClient
- client handshake handlerauthenticated
- boolean reference to receive authentication state changeschannelKey
- channel keygrpcAuthTimeoutMs
- authentication timeout in millisecondspublic void setServerObserver(io.grpc.stub.StreamObserver<SaslMessage> requestObserver)
requestObserver
- server Sasl streampublic void onNext(SaslMessage saslMessage)
onNext
in interface io.grpc.stub.StreamObserver<SaslMessage>
public void onError(Throwable throwable)
onError
in interface io.grpc.stub.StreamObserver<SaslMessage>
public void onCompleted()
onCompleted
in interface io.grpc.stub.StreamObserver<SaslMessage>
public void start() throws AlluxioStatusException
public void stop()
Copyright © 2023. All Rights Reserved.