Uses of Class
io.grpc.Metadata
Packages that use Metadata
Package
Description
The gRPC core public API.
Interfaces and implementations that are internal to gRPC.
API for gRPC over Protocol Buffers, including tools for serializing and de-serializing protobuf
messages.
API for the Stub layer.
Utilities with advanced features in the core layer that user can optionally use.
-
Uses of Metadata in io.grpc
Modifier and TypeMethodDescriptionabstract Metadata
LoadBalancer.PickSubchannelArgs.getHeaders()
Headers of the call.final Metadata
StatusException.getTrailers()
Returns the received trailers.final Metadata
StatusRuntimeException.getTrailers()
Returns the received trailers.static Metadata
InternalMetadata.newMetadata
(byte[]... binaryValues) static Metadata
InternalMetadata.newMetadata
(int usedNames, byte[]... binaryValues) static Metadata
InternalMetadata.newMetadataWithParsedValues
(int usedNames, Object[] namesAndValues) Creates a newMetadata
instance from serialized data, with some values pre-parsed.static Metadata
Status.trailersFromThrowable
(Throwable t) Extract an error trailers from the causal chain of aThrowable
.Modifier and TypeMethodDescriptionabstract void
Called when headers are successfully generated.Status.asException
(Metadata trailers) Same asStatus.asException()
but includes the provided trailers in the returned exception.static final StatusRuntimeException
InternalStatus.asRuntimeException
(Status status, Metadata trailers, boolean fillInStackTrace) Create a newStatusRuntimeException
with the internal option of skipping the filling of the stack trace.Status.asRuntimeException
(Metadata trailers) Same asStatus.asRuntimeException()
but includes the provided trailers in the returned exception.protected abstract void
ClientInterceptors.CheckedForwardingClientCall.checkedStart
(ClientCall.Listener<RespT> responseListener, Metadata headers) Subclasses implement the start logic here that would normally belong tostart()
.abstract void
Close the call with the provided status.<ReqT,
RespT>
ExecutorServerCallExecutorSupplier.getExecutor
(ServerCall<ReqT, RespT> call, Metadata metadata) Returns an executor to handle the server call.static int
InternalMetadata.headerCount
(Metadata md) void
ClientStreamTracer.inboundHeaders
(Metadata headers) Headers has been received from the server.void
ClientStreamTracer.inboundTrailers
(Metadata trailers) Trailing metadata has been received from the server.static <ReqT,
RespT>
ServerCall.Listener<ReqT> Contexts.interceptCall
(Context context, ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) Make the providedContext
Context.current()
for the creation of a listener to a received call and for all events received by that listener.<ReqT,
RespT>
ServerCall.Listener<ReqT> ServerInterceptor.interceptCall
(ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) void
Perform a simple merge of two sets of metadata.void
Metadata.merge
(Metadata other, Set<Metadata.Key<?>> keys) Merge values from the given set of keys into this set of metadata.ClientStreamTracer.Factory.newClientStreamTracer
(ClientStreamTracer.StreamInfo info, Metadata headers) Creates aClientStreamTracer
for a new client stream.abstract ServerStreamTracer
ServerStreamTracer.Factory.newServerStreamTracer
(String fullMethodName, Metadata headers) Creates aServerStreamTracer
for a new server stream.void
The ClientCall has been closed.void
The response headers have been received.abstract void
ServerCall.sendHeaders
(Metadata headers) Send response header metadata prior to sending a response message.static byte[][]
static Object[]
InternalMetadata.serializePartial
(Metadata md) Serializes all metadata entries, leaving some values asInputStream
s.abstract void
ClientCall.start
(ClientCall.Listener<RespT> responseListener, Metadata headers) Start a call, usingresponseListener
for processing response messages.final void
ClientInterceptors.CheckedForwardingClientCall.start
(ClientCall.Listener<RespT> responseListener, Metadata headers) void
ForwardingClientCall.start
(ClientCall.Listener<RespT> responseListener, Metadata headers) ServerCallHandler.startCall
(ServerCall<RequestT, ResponseT> call, Metadata headers) Starts asynchronous processing of an incoming call.void
ClientStreamTracer.streamCreated
(Attributes transportAttrs, Metadata headers) The stream is being created on a ready transport.ModifierConstructorDescriptionStatusException
(Status status, Metadata trailers) Constructs an exception with both a status and trailers.StatusRuntimeException
(Status status, Metadata trailers) Constructs the exception with both a status and trailers. -
Uses of Metadata in io.grpc.internal
Methods in io.grpc.internal that return MetadataMethods in io.grpc.internal with parameters of type MetadataModifier and TypeMethodDescriptionvoid
StatsTraceContext.clientInboundHeaders
(Metadata headers) void
StatsTraceContext.clientInboundTrailers
(Metadata trailers) final void
void
Closes the stream for both reading and writing.void
ClientStreamListener.closed
(Status status, ClientStreamListener.RpcProgress rpcProgress, Metadata trailers) Called when the stream is fully closed.static ClientStreamTracer[]
GrpcUtil.getClientStreamTracers
(CallOptions callOptions, Metadata headers, int previousAttempts, boolean isTransparentRetry) Gets stream tracers based on CallOptions.void
ClientStreamListener.headersRead
(Metadata headers) Called upon receiving all header information from the remote end-point.protected abstract void
Http2ClientStreamTransportState.http2ProcessingFailed
(Status status, boolean stopDelivery, Metadata trailers) Called to process a failure in HTTP/2 processing.void
ForwardingClientStreamTracer.inboundHeaders
(Metadata headers) protected void
AbstractClientStream.TransportState.inboundHeadersReceived
(Metadata headers) Called by transport implementations when they receive headers.void
ForwardingClientStreamTracer.inboundTrailers
(Metadata trailers) protected void
AbstractClientStream.TransportState.inboundTrailersReceived
(Metadata trailers, Status status) Processes the trailers and status from the server.static StatsTraceContext
StatsTraceContext.newClientContext
(ClientStreamTracer[] tracers, Attributes transportAtts, Metadata headers) Factory method for the client-side.static StatsTraceContext
StatsTraceContext.newServerContext
(List<? extends ServerStreamTracer.Factory> factories, String fullMethodName, Metadata headers) Factory method for the server-side.ClientTransport.newStream
(MethodDescriptor<?, ?> method, Metadata headers, CallOptions callOptions, ClientStreamTracer[] tracers) Creates a new stream for sending messages to a remote end-point.final void
DelayedClientCall.start
(ClientCall.Listener<RespT> listener, Metadata headers) void
ForwardingClientStreamTracer.streamCreated
(Attributes transportAttrs, Metadata headers) void
ServerTransportListener.streamCreated
(ServerStream stream, String method, Metadata headers) Called when a new stream was created by the remote client.static byte[][]
TransportFrameUtil.toHttp2Headers
(Metadata headers) Transform the given headers to a format where only spec-compliant ASCII characters are allowed.protected void
Http2ClientStreamTransportState.transportHeadersReceived
(Metadata headers) Called by subclasses wheneverHeaders
are received from the transport.final void
AbstractClientStream.TransportState.transportReportStatus
(Status status, boolean stopDelivery, Metadata trailers) Report stream closure with status to the application layer if not already reported.final void
AbstractClientStream.TransportState.transportReportStatus
(Status status, ClientStreamListener.RpcProgress rpcProgress, boolean stopDelivery, Metadata trailers) Report stream closure with status to the application layer if not already reported.protected void
Http2ClientStreamTransportState.transportTrailersReceived
(Metadata trailers) Called by subclasses for the terminal trailer metadata on a stream.void
AbstractClientStream.Sink.writeHeaders
(Metadata metadata, byte[] payload) Sends the request headers to the remote end point.void
AbstractServerStream.Sink.writeHeaders
(Metadata headers, boolean flush) Sends response headers to the remote end point.final void
AbstractServerStream.writeHeaders
(Metadata headers, boolean flush) void
ServerStream.writeHeaders
(Metadata headers, boolean flush) Writes custom metadata as headers on the response stream sent to the client.void
AbstractServerStream.Sink.writeTrailers
(Metadata trailers, boolean headersSent, Status status) Sends trailers to the remote end point.Constructors in io.grpc.internal with parameters of type MetadataModifierConstructorDescriptionprotected
AbstractClientStream
(WritableBufferAllocator bufferAllocator, StatsTraceContext statsTraceCtx, TransportTracer transportTracer, Metadata headers, CallOptions callOptions, boolean useGet) PickSubchannelArgsImpl
(MethodDescriptor<?, ?> method, Metadata headers, CallOptions callOptions, LoadBalancer.PickDetailsConsumer pickDetailsConsumer) Creates call args object for given method with its call options, metadata. -
Uses of Metadata in io.grpc.protobuf
Methods in io.grpc.protobuf with parameters of type MetadataModifier and TypeMethodDescriptionstatic com.google.rpc.Status
StatusProto.fromStatusAndTrailers
(Status status, Metadata trailers) Extracts thegoogle.rpc.Status
from trailers, and makes sure they match the gRPCstatus
.static StatusException
StatusProto.toStatusException
(com.google.rpc.Status statusProto, Metadata metadata) Convert aStatus
instance to aStatusException
with additional metadata.static StatusException
StatusProto.toStatusException
(com.google.rpc.Status statusProto, Metadata metadata, Throwable cause) Convert aStatus
instance to aStatusException
with additional metadata and the root exception thrown.static StatusRuntimeException
StatusProto.toStatusRuntimeException
(com.google.rpc.Status statusProto, Metadata metadata) Convert aStatus
instance to aStatusRuntimeException
with additional metadata. -
Uses of Metadata in io.grpc.stub
Methods in io.grpc.stub with parameters of type MetadataModifier and TypeMethodDescriptionstatic ClientInterceptor
MetadataUtils.newAttachHeadersInterceptor
(Metadata extraHeaders) Returns a client interceptor that attaches a set of headers to requests.static ServerInterceptor
MetadataUtils.newAttachMetadataServerInterceptor
(Metadata extras) Returns a ServerInterceptor that adds the specified Metadata to every response stream, one way or another.Method parameters in io.grpc.stub with type arguments of type MetadataModifier and TypeMethodDescriptionstatic ClientInterceptor
MetadataUtils.newCaptureMetadataInterceptor
(AtomicReference<Metadata> headersCapture, AtomicReference<Metadata> trailersCapture) Captures the last received metadata on a channel. -
Uses of Metadata in io.grpc.util
Methods in io.grpc.util with parameters of type MetadataModifier and TypeMethodDescriptionvoid
ForwardingClientStreamTracer.inboundHeaders
(Metadata headers) void
ForwardingClientStreamTracer.inboundTrailers
(Metadata trailers) <ReqT,
RespT>
ServerCall.Listener<ReqT> TransmitStatusRuntimeExceptionInterceptor.interceptCall
(ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) void
ForwardingClientStreamTracer.streamCreated
(Attributes transportAttrs, Metadata headers)