Class MetadataUtils.MetadataAttachingServerInterceptor.MetadataAttachingServerCall<ReqT,RespT>
- java.lang.Object
-
- io.grpc.ServerCall<ReqT,RespT>
-
- io.grpc.PartialForwardingServerCall<ReqT,RespT>
-
- io.grpc.ForwardingServerCall<ReqT,RespT>
-
- io.grpc.ForwardingServerCall.SimpleForwardingServerCall<ReqT,RespT>
-
- io.grpc.stub.MetadataUtils.MetadataAttachingServerInterceptor.MetadataAttachingServerCall<ReqT,RespT>
-
- Enclosing class:
- MetadataUtils.MetadataAttachingServerInterceptor
final class MetadataUtils.MetadataAttachingServerInterceptor.MetadataAttachingServerCall<ReqT,RespT> extends ForwardingServerCall.SimpleForwardingServerCall<ReqT,RespT>
-
-
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 Modifier and Type Field Description (package private) boolean
headersSent
-
Constructor Summary
Constructors Constructor Description MetadataAttachingServerCall(ServerCall<ReqT,RespT> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close(Status status, Metadata trailers)
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
-
-
-
-
Constructor Detail
-
MetadataAttachingServerCall
MetadataAttachingServerCall(ServerCall<ReqT,RespT> delegate)
-
-
Method Detail
-
sendHeaders
public void sendHeaders(Metadata headers)
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
public void close(Status status, Metadata trailers)
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>
-
-