Package io.grpc.netty
Class NettyServerStream
- java.lang.Object
-
- io.grpc.internal.AbstractStream
-
- io.grpc.internal.AbstractServerStream
-
- io.grpc.netty.NettyServerStream
-
- All Implemented Interfaces:
MessageFramer.Sink
,ServerStream
,Stream
class NettyServerStream extends AbstractServerStream
Server stream for a Netty HTTP2 transport. Must only be called from the sending application thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
NettyServerStream.Sink
static class
NettyServerStream.TransportState
This should only be called from the transport thread.
-
Field Summary
Fields Modifier and Type Field Description private Attributes
attributes
private java.lang.String
authority
private static java.util.logging.Logger
log
private NettyServerStream.Sink
sink
private NettyServerStream.TransportState
state
private int
streamId
private WriteQueue
writeQueue
-
Constructor Summary
Constructors Constructor Description NettyServerStream(io.netty.channel.Channel channel, NettyServerStream.TransportState state, Attributes transportAttrs, java.lang.String authority, StatsTraceContext statsTraceCtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NettyServerStream.Sink
abstractServerStreamSink()
Sink for transport to be called to perform outbound operations.Attributes
getAttributes()
Attributes describing stream.java.lang.String
getAuthority()
Gets the authority this stream is addressed to.int
streamId()
The HTTP/2 stream id, or-1
if not supported.protected NettyServerStream.TransportState
transportState()
Obtain the transport state corresponding to this stream.-
Methods inherited from class io.grpc.internal.AbstractServerStream
cancel, close, deliverFrame, framer, isReady, setDecompressor, setListener, setOnReadyThreshold, statsTraceContext, writeHeaders
-
Methods inherited from class io.grpc.internal.AbstractStream
endOfMessages, flush, onSendingBytes, optimizeForDirectExecutor, request, setCompressor, setMessageCompression, writeMessage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.grpc.internal.Stream
flush, optimizeForDirectExecutor, request, setCompressor, setMessageCompression, writeMessage
-
-
-
-
Field Detail
-
log
private static final java.util.logging.Logger log
-
sink
private final NettyServerStream.Sink sink
-
state
private final NettyServerStream.TransportState state
-
writeQueue
private final WriteQueue writeQueue
-
attributes
private final Attributes attributes
-
authority
private final java.lang.String authority
-
streamId
private final int streamId
-
-
Constructor Detail
-
NettyServerStream
public NettyServerStream(io.netty.channel.Channel channel, NettyServerStream.TransportState state, Attributes transportAttrs, java.lang.String authority, StatsTraceContext statsTraceCtx)
-
-
Method Detail
-
transportState
protected NettyServerStream.TransportState transportState()
Description copied from class:AbstractStream
Obtain the transport state corresponding to this stream. Each stream must have its own unique transport state.- Specified by:
transportState
in classAbstractServerStream
-
abstractServerStreamSink
protected NettyServerStream.Sink abstractServerStreamSink()
Description copied from class:AbstractServerStream
Sink for transport to be called to perform outbound operations. Each stream must have its own unique sink.- Specified by:
abstractServerStreamSink
in classAbstractServerStream
-
getAttributes
public Attributes getAttributes()
Description copied from interface:ServerStream
Attributes describing stream. This is inherited from the transport attributes, and used as the basis ofServerCall.getAttributes()
.- Specified by:
getAttributes
in interfaceServerStream
- Overrides:
getAttributes
in classAbstractServerStream
- Returns:
- Attributes container
-
getAuthority
public java.lang.String getAuthority()
Description copied from interface:ServerStream
Gets the authority this stream is addressed to.- Specified by:
getAuthority
in interfaceServerStream
- Overrides:
getAuthority
in classAbstractServerStream
- Returns:
- the authority string.
null
if not available.
-
streamId
public int streamId()
Description copied from interface:ServerStream
The HTTP/2 stream id, or-1
if not supported.
-
-