Class AuthenticatedChannelClientDriver

  • All Implemented Interfaces:
    io.grpc.stub.StreamObserver<alluxio.grpc.SaslMessage>

    public class AuthenticatedChannelClientDriver
    extends java.lang.Object
    implements io.grpc.stub.StreamObserver<alluxio.grpc.SaslMessage>
    Responsible for driving authentication traffic from client-side. An authentication between client and server is managed by AuthenticatedChannelClientDriver and AuthenticatedChannelServerDriver respectively. These drivers are wrappers over gRPC StreamObservers that manages the stream traffic destined for the other participant. They make sure messages are exchanged between client and server synchronously. Authentication 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Stops authenticated session with the server by releasing the long poll.
      boolean isAuthenticated()  
      void onCompleted()  
      void onError​(java.lang.Throwable throwable)  
      void onNext​(alluxio.grpc.SaslMessage saslMessage)  
      void setServerObserver​(io.grpc.stub.StreamObserver<alluxio.grpc.SaslMessage> requestObserver)
      Sets the server's Sasl stream.
      void startAuthenticatedChannel​(long timeoutMs)
      Starts authentication with the server and wait until completion.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AuthenticatedChannelClientDriver

        public AuthenticatedChannelClientDriver​(SaslClientHandler saslClientHandler,
                                                GrpcChannelKey channelKey)
                                         throws javax.security.sasl.SaslException
        Creates client driver with given handshake handler.
        Parameters:
        saslClientHandler - sasl client handler
        channelKey - channel key
        Throws:
        javax.security.sasl.SaslException
    • Method Detail

      • setServerObserver

        public void setServerObserver​(io.grpc.stub.StreamObserver<alluxio.grpc.SaslMessage> requestObserver)
        Sets the server's Sasl stream.
        Parameters:
        requestObserver - server Sasl stream
      • onNext

        public void onNext​(alluxio.grpc.SaslMessage saslMessage)
        Specified by:
        onNext in interface io.grpc.stub.StreamObserver<alluxio.grpc.SaslMessage>
      • onError

        public void onError​(java.lang.Throwable throwable)
        Specified by:
        onError in interface io.grpc.stub.StreamObserver<alluxio.grpc.SaslMessage>
      • onCompleted

        public void onCompleted()
        Specified by:
        onCompleted in interface io.grpc.stub.StreamObserver<alluxio.grpc.SaslMessage>
      • close

        public void close()
        Stops authenticated session with the server by releasing the long poll.
      • isAuthenticated

        public boolean isAuthenticated()
        Returns:
        true if the channel is still authenticated