Top Description Constructors Methods
io.grpc

pack-priv abstract Class PartialForwardingServerCall<ReqT, RespT>

extends ServerCall<ReqT, RespT>
Class Inheritance
Known Direct Subclasses
io.grpc.ForwardingServerCall
Imports
com.google.common.base.MoreObjects

A ServerCall which forwards all of it's methods to another ServerCall which may have a different sendMessage() message type.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close(Status status, Metadata trailers)

Implements abstract io.grpc.ServerCall.close.

Close the call with the provided status.
protected abstract ServerCall<?, ?>
delegate()

Returns the delegated ServerCall.

public Attributes
getAttributes()

Overrides io.grpc.ServerCall.getAttributes.

Returns properties of a single call.
public String
getAuthority()

Overrides io.grpc.ServerCall.getAuthority.

Gets the authority this call is addressed to.
public SecurityLevel
getSecurityLevel()

Overrides io.grpc.ServerCall.getSecurityLevel.

Returns the level of security guarantee in communications

Determining the level of security offered by the transport for RPCs on server-side.

public boolean
isCancelled()

Implements abstract io.grpc.ServerCall.isCancelled.

Returns true when the call is cancelled and the server is encouraged to abort processing to save resources, since the client will not be processing any further methods.
public boolean
isReady()

Overrides io.grpc.ServerCall.isReady.

If true, indicates that the call is capable of sending additional messages without requiring excessive buffering internally.
public void
request(int
the requested number of messages to be delivered to the listener.
numMessages
)

Implements abstract io.grpc.ServerCall.request.

Requests up to the given number of messages from the call to be delivered to Listener#onMessage(Object).
public void
sendHeaders(Metadata
metadata to send prior to any response body.
headers
)

Implements abstract io.grpc.ServerCall.sendHeaders.

Send response header metadata prior to sending a response message.
public void
setCompression(String
the name of the compressor to use.
compressor
)

Overrides io.grpc.ServerCall.setCompression.

Sets the compression algorithm for this call.
public void
setMessageCompression(boolean enabled)

Overrides io.grpc.ServerCall.setMessageCompression.

Enables per-message compression, if an encoding type has been negotiated.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from io.grpc.ServerCall:
getMethodDescriptorsendMessage

Constructor Detail

PartialForwardingServerCallback to summary
pack-priv PartialForwardingServerCall()

Method Detail

closeback to summary
public void close(Status status, Metadata trailers)

Implements abstract io.grpc.ServerCall.close.

Doc from io.grpc.ServerCall.close.

Close the call with the provided status. No further sending or receiving will occur. If Status#isOk is false, then the call is said to have failed.

If no errors or cancellations are known to have occurred, then a Listener#onComplete notification should be expected, independent of status. Otherwise 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 Listener#onComplete or Listener#onCancel instead. This method is not necessarily invoked when Listener.onCancel() is called.

Annotations
@Override
delegateback to summary
protected abstract ServerCall<?, ?> delegate()

Returns the delegated ServerCall.

getAttributesback to summary
public Attributes getAttributes()

Overrides io.grpc.ServerCall.getAttributes.

Doc from io.grpc.ServerCall.getAttributes.

Returns properties of a single call.

Attributes originate from the transport and can be altered by ServerTransportFilter.

Returns:Attributes

non-null Attributes container

Annotations
@Override
@ExperimentalApi:https://github.com/grpc/grpc-java/issues/1779
getAuthorityback to summary
public String getAuthority()

Overrides io.grpc.ServerCall.getAuthority.

Doc from io.grpc.ServerCall.getAuthority.

Gets the authority this call is addressed to.

Returns:String

the authority string. null if not available.

Annotations
@Override
getSecurityLevelback to summary
public SecurityLevel getSecurityLevel()

Overrides io.grpc.ServerCall.getSecurityLevel.

Doc from io.grpc.ServerCall.getSecurityLevel.

Returns the level of security guarantee in communications

Determining the level of security offered by the transport for RPCs on server-side. This can be approximated by looking for the SSLSession, but that doesn't work for ALTS and maybe some future TLS approaches. May return a lower security level when it cannot be determined precisely.

Returns:SecurityLevel

non-null SecurityLevel enum

Annotations
@Override
@ExperimentalApi:https://github.com/grpc/grpc-java/issues/4692
isCancelledback to summary
public boolean isCancelled()

Implements abstract io.grpc.ServerCall.isCancelled.

Doc from io.grpc.ServerCall.isCancelled.

Returns true when the call is cancelled and the server is encouraged to abort processing to save resources, since the client will not be processing any further methods. Cancellations can be caused by timeouts, explicit cancel by client, network errors, and similar.

This method may safely be called concurrently from multiple threads.

Annotations
@Override
isReadyback to summary
public boolean isReady()

Overrides io.grpc.ServerCall.isReady.

Doc from io.grpc.ServerCall.isReady.

If true, indicates that the call is capable of sending additional messages without requiring excessive buffering internally. This event is just a suggestion and the application is free to ignore it, however doing so may result in excessive buffering within the call.

If false, Listener#onReady() will be called after isReady() transitions to true.

This abstract class's implementation always returns true. Implementations generally override the method.

Annotations
@Override
requestback to summary
public void request(int numMessages)

Implements abstract io.grpc.ServerCall.request.

Doc from io.grpc.ServerCall.request.

Requests up to the given number of messages from the call to be delivered to Listener#onMessage(Object). Once numMessages have been delivered no further request messages will be delivered until more messages are requested by calling this method again.

Servers use this mechanism to provide back-pressure to the client for flow-control.

This method is safe to call from multiple threads without external synchronization.

Parameters
numMessages:int

the requested number of messages to be delivered to the listener.

Annotations
@Override
sendHeadersback to summary
public void sendHeaders(Metadata headers)

Implements abstract io.grpc.ServerCall.sendHeaders.

Doc from io.grpc.ServerCall.sendHeaders.

Send response header metadata prior to sending a response message. This method may only be called once and cannot be called after calls to sendMessage or close.

Since Metadata is not thread-safe, the caller must not access (read or write) headers after this point.

Parameters
headers:Metadata

metadata to send prior to any response body.

Annotations
@Override
setCompressionback to summary
public void setCompression(String compressor)

Overrides io.grpc.ServerCall.setCompression.

Doc from io.grpc.ServerCall.setCompression.

Sets the compression algorithm for this call. This compression is utilized for sending. If the server does not support the compression algorithm, the call will fail. This method may only be called before sendHeaders. The compressor to use will be looked up in the CompressorRegistry. Default gRPC servers support the "gzip" compressor.

It is safe to call this even if the client does not support the compression format chosen. The implementation will handle negotiation with the client and may fall back to no compression.

Parameters
compressor:String

the name of the compressor to use.

Annotations
@Override
@ExperimentalApi:https://github.com/grpc/grpc-java/issues/1704
setMessageCompressionback to summary
public void setMessageCompression(boolean enabled)

Overrides io.grpc.ServerCall.setMessageCompression.

Doc from io.grpc.ServerCall.setMessageCompression.

Enables per-message compression, if an encoding type has been negotiated. If no message encoding has been negotiated, this is a no-op. By default per-message compression is enabled, but may not have any effect if compression is not enabled on the call.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override