Package io.grpc.grpclb
Class TokenAttachingTracerFactory
- java.lang.Object
-
- io.grpc.ClientStreamTracer.Factory
-
- io.grpc.grpclb.TokenAttachingTracerFactory
-
final class TokenAttachingTracerFactory extends ClientStreamTracer.Factory
Wraps aClientStreamTracer.Factory
, retrieves tokens from transport attributes and attaches them to headers. This is only used in the PICK_FIRST mode.
-
-
Field Summary
Fields Modifier and Type Field Description private ClientStreamTracer.Factory
delegate
private static ClientStreamTracer
NOOP_TRACER
-
Constructor Summary
Constructors Constructor Description TokenAttachingTracerFactory(ClientStreamTracer.Factory delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
int
hashCode()
ClientStreamTracer
newClientStreamTracer(ClientStreamTracer.StreamInfo info, Metadata headers)
Creates aClientStreamTracer
for a new client stream.
-
-
-
Field Detail
-
NOOP_TRACER
private static final ClientStreamTracer NOOP_TRACER
-
delegate
@Nullable private final ClientStreamTracer.Factory delegate
-
-
Constructor Detail
-
TokenAttachingTracerFactory
TokenAttachingTracerFactory(@Nullable ClientStreamTracer.Factory delegate)
-
-
Method Detail
-
newClientStreamTracer
public ClientStreamTracer newClientStreamTracer(ClientStreamTracer.StreamInfo info, Metadata headers)
Description copied from class:ClientStreamTracer.Factory
Creates aClientStreamTracer
for a new client stream. This is called inside the transport when it's creating the stream.- Overrides:
newClientStreamTracer
in classClientStreamTracer.Factory
- Parameters:
info
- information about the streamheaders
- the mutable headers of the stream. It can be safely mutated within this method. Changes made to it will be sent by the stream. It should not be saved because it is not safe for read or write after the method returns.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-