Class MetadataUtils.MetadataAttachingServerInterceptor.MetadataAttachingServerCall<ReqT,RespT>
- Enclosing class:
MetadataUtils.MetadataAttachingServerInterceptor
-
Nested Class Summary
Nested classes/interfaces inherited from class io.grpc.ForwardingServerCall
ForwardingServerCall.SimpleForwardingServerCall<ReqT,
RespT> Nested classes/interfaces inherited from class io.grpc.ServerCall
ServerCall.Listener<ReqT>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Close the call with the provided status.void
sendHeaders
(Metadata headers) Send response header metadata prior to sending a response message.Methods inherited from class io.grpc.ForwardingServerCall.SimpleForwardingServerCall
delegate
Methods inherited from class io.grpc.ForwardingServerCall
getMethodDescriptor, sendMessage
Methods inherited from class io.grpc.PartialForwardingServerCall
getAttributes, getAuthority, getSecurityLevel, isCancelled, isReady, request, setCompression, setMessageCompression, setOnReadyThreshold, toString
-
Field Details
-
headersSent
boolean headersSent
-
-
Constructor Details
-
MetadataAttachingServerCall
MetadataAttachingServerCall(ServerCall<ReqT, RespT> delegate)
-
-
Method Details
-
sendHeaders
Description copied from class:ServerCall
Send response header metadata prior to sending a response message. This method may only be called once and cannot be called after calls toServerCall.sendMessage(RespT)
orServerCall.close(io.grpc.Status, io.grpc.Metadata)
.Since
Metadata
is not thread-safe, the caller must not access (read or write)headers
after this point.- Overrides:
sendHeaders
in classPartialForwardingServerCall<ReqT,
RespT> - Parameters:
headers
- metadata to send prior to any response body.
-
close
Description copied from class:ServerCall
Close the call with the provided status. No further sending or receiving will occur. IfStatus.isOk()
isfalse
, then the call is said to have failed.If no errors or cancellations are known to have occurred, then a
ServerCall.Listener.onComplete()
notification should be expected, independent ofstatus
. OtherwiseServerCall.Listener.onCancel()
has been or will be called.Since
Metadata
is not thread-safe, the caller must not access (read or write)trailers
after this point.This method implies the caller completed processing the RPC, but it does not imply the RPC is complete. The call implementation will need additional time to complete the RPC and during this time the client is still able to cancel the request or a network error might cause the RPC to fail. If you wish to know when the call is actually completed/closed, you have to use
ServerCall.Listener.onComplete()
orServerCall.Listener.onCancel()
instead. This method is not necessarily invoked when Listener.onCancel() is called.- Overrides:
close
in classPartialForwardingServerCall<ReqT,
RespT>
-