Class ClientIpAddressInjector

  • All Implemented Interfaces:
    io.grpc.ServerInterceptor

    public class ClientIpAddressInjector
    extends java.lang.Object
    implements io.grpc.ServerInterceptor
    Server side interceptor that is used to put remote client's IP Address to thread local storage.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getIpAddress()  
      <ReqT,​RespT>
      io.grpc.ServerCall.Listener<ReqT>
      interceptCall​(io.grpc.ServerCall<ReqT,​RespT> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<ReqT,​RespT> next)  
      • Methods inherited from class java.lang.Object

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

      • ClientIpAddressInjector

        public ClientIpAddressInjector()
    • Method Detail

      • getIpAddress

        public static java.lang.String getIpAddress()
        Returns:
        IP address of the gRPC client that is making the call
      • interceptCall

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