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 and Description
    `ContextServerInterceptor()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `bind(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.
    `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> R` | `put(String key, T value)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ContextServerInterceptor

          public ContextServerInterceptor()

  - ### Method Detail

    - #### bind

          public abstract void bind(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> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT,RespT> call,
                                                                      Metadata metadata,
                                                                      ServerCallHandler<ReqT,RespT> handler)

      Specified by:
        `interceptCall` in interface `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)

Copyright © 2023 Eclipse. All rights reserved.