Package io.vertx.grpc

Class ContextServerInterceptor

  • All Implemented Interfaces:
    io.grpc.ServerInterceptor

    public abstract class ContextServerInterceptor
    extends Object
    implements io.grpc.ServerInterceptor
    An abstract interceptor that allows capturing data from the metadata to the vertx context so it can be used later on the asynchronous APIs.
    • Constructor Detail

      • ContextServerInterceptor

        public ContextServerInterceptor()
    • Method Detail

      • bind

        public abstract void bind​(io.grpc.Metadata metadata)
        This method is called before the interceptCall(ServerCall, Metadata, ServerCallHandler) call happens and allows extracting data from the metadata to the vert.x context.
        Parameters:
        metadata - the grpc connection context
      • interceptCall

        public <ReqT,​RespT> io.grpc.ServerCall.Listener<ReqT> interceptCall​(io.grpc.ServerCall<ReqT,​RespT> call,
                                                                                  io.grpc.Metadata metadata,
                                                                                  io.grpc.ServerCallHandler<ReqT,​RespT> handler)
        Specified by:
        interceptCall in interface io.grpc.ServerInterceptor
      • get

        public static <T> T get​(String key)
      • getOrDefault

        public static <T> T getOrDefault​(String key,
                                         T defaultValue)
      • put

        public static <R,​T> R put​(String key,
                                        T value)