public static AltsProtocolNegotiator createServerNegotiator ( final TsiHandshakerFactory handshakerFactory , final LazyChannel lazyHandshakerChannel ) { final class ServerAltsProtocolNegotiator extends AltsProtocolNegotiator { @ Override public ChannelHandler newHandler ( GrpcHttp2ConnectionHandler grpcHandler ) { TsiHandshaker handshaker = handshakerFactory . newHandshaker ( /*authority=*/ null ) ; return new BufferUntilAltsNegotiatedHandler ( grpcHandler , new TsiHandshakeHandler ( new NettyTsiHandshaker ( handshaker ) ) , new TsiFrameHandler ( ) ) ; } @ Override public void close ( ) { logger . finest ( "ALTS Server ProtocolNegotiator Closed" ) ; lazyHandshakerChannel . close ( ) ; } } return new ServerAltsProtocolNegotiator ( ) ; }
Creates a negotiator used for ALTS server .