Package io.vertx.grpc
Class ContextServerInterceptor
- java.lang.Object
-
- io.vertx.grpc.ContextServerInterceptor
-
- All Implemented Interfaces:
ServerInterceptor
public abstract class ContextServerInterceptor extends Object implements 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 Summary
Constructors Constructor Description ContextServerInterceptor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
bind(Metadata metadata)
This method is called before theinterceptCall(ServerCall, Metadata, ServerCallHandler)
call happens and allows extracting data from the metadata to the vert.x context.static <T> T
get(String key)
static <T> T
getOrDefault(String key, T defaultValue)
<ReqT,RespT>
ServerCall.Listener<ReqT>interceptCall(ServerCall<ReqT,RespT> call, Metadata metadata, ServerCallHandler<ReqT,RespT> handler)
static <R,T>
Rput(String key, T value)
-
-
-
Method Detail
-
bind
public abstract void bind(Metadata metadata)
This method is called before theinterceptCall(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> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT,RespT> call, Metadata metadata, ServerCallHandler<ReqT,RespT> handler)
- Specified by:
interceptCall
in interfaceServerInterceptor
-
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)
-
-