protected InboundHttp2ToHttpAdapter(Http2Connection connection, int maxContentLength, boolean validateHttpHeaders, boolean propagateSettings) { checkNotNull(connection, "connection"); if (maxContentLength <= 0) { throw new IllegalArgumentException("maxContentLength: " + maxContentLength + " (expected: > 0)"); } this.connection = connection; this.maxContentLength = maxContentLength; this.validateHttpHeaders = validateHttpHeaders; this.propagateSettings = propagateSettings; sendDetector = DEFAULT_SEND_DETECTOR; messageKey = connection.newKey(); }
public DelegatingDecompressorFrameListener(Http2Connection connection, Http2FrameListener listener, boolean strict) { super(listener); this.connection = connection; this.strict = strict; propertyKey = connection.newKey(); connection.addListener(new Http2ConnectionAdapter() { @Override public void onStreamRemoved(Http2Stream stream) { final Http2Decompressor decompressor = decompressor(stream); if (decompressor != null) { cleanup(decompressor); } } }); }
MockApnsServerHandler(final Http2ConnectionDecoder decoder, final Http2ConnectionEncoder encoder, final Http2Settings initialSettings, final PushNotificationHandler pushNotificationHandler, final MockApnsServerListener listener) { super(decoder, encoder, initialSettings); this.headersPropertyKey = this.connection().newKey(); this.payloadPropertyKey = this.connection().newKey(); this.pushNotificationHandler = pushNotificationHandler; this.listener = listener != null ? listener : new NoopMockApnsServerListener(); }
ApnsClientHandler(final Http2ConnectionDecoder decoder, final Http2ConnectionEncoder encoder, final Http2Settings initialSettings, final String authority, final long idlePingIntervalMillis) { super(decoder, encoder, initialSettings); this.authority = authority; this.responseHeadersPropertyKey = this.connection().newKey(); this.responsePromisePropertyKey = this.connection().newKey(); this.streamErrorCausePropertyKey = this.connection().newKey(); this.connection().addListener(this); this.pingTimeoutMillis = idlePingIntervalMillis / 2; }
public CompressorHttp2ConnectionEncoder(Http2ConnectionEncoder delegate, int compressionLevel, int windowBits, int memLevel) { super(delegate); if (compressionLevel < 0 || compressionLevel > 9) { throw new IllegalArgumentException("compressionLevel: " + compressionLevel + " (expected: 0-9)"); } if (windowBits < 9 || windowBits > 15) { throw new IllegalArgumentException("windowBits: " + windowBits + " (expected: 9-15)"); } if (memLevel < 1 || memLevel > 9) { throw new IllegalArgumentException("memLevel: " + memLevel + " (expected: 1-9)"); } this.compressionLevel = compressionLevel; this.windowBits = windowBits; this.memLevel = memLevel; propertyKey = connection().newKey(); connection().addListener(new Http2ConnectionAdapter() { @Override public void onStreamRemoved(Http2Stream stream) { final EmbeddedChannel compressor = stream.getProperty(propertyKey); if (compressor != null) { cleanup(stream, compressor); } } }); }
Http2FrameCodec(Http2ConnectionEncoder encoder, Http2ConnectionDecoder decoder, Http2Settings initialSettings) { super(decoder, encoder, initialSettings); decoder.frameListener(new FrameListener()); connection().addListener(new ConnectionListener()); connection().remote().flowController().listener(new Http2RemoteFlowControllerListener()); streamKey = connection().newKey(); upgradeKey = connection().newKey(); initialFlowControlWindowSize = initialSettings.initialWindowSize(); }
public UniformStreamByteDistributor(Http2Connection connection) { // Add a state for the connection. stateKey = connection.newKey(); Http2Stream connectionStream = connection.connectionStream(); connectionStream.setProperty(stateKey, new State(connectionStream)); // Register for notification of new streams. connection.addListener(new Http2ConnectionAdapter() { @Override public void onStreamAdded(Http2Stream stream) { stream.setProperty(stateKey, new State(stream)); } @Override public void onStreamClosed(Http2Stream stream) { state(stream).close(); } }); }
Http2FrameCodec(Http2ConnectionEncoder encoder, Http2ConnectionDecoder decoder, Http2Settings initialSettings) { super(decoder, encoder, initialSettings); decoder.frameListener(new FrameListener()); connection().addListener(new ConnectionListener()); connection().remote().flowController().listener(new Http2RemoteFlowControllerListener()); streamKey = connection().newKey(); upgradeKey = connection().newKey(); initialFlowControlWindowSize = initialSettings.initialWindowSize(); }
Http2FrameCodec(Http2ConnectionEncoder encoder, Http2ConnectionDecoder decoder, Http2Settings initialSettings) { super(decoder, encoder, initialSettings); decoder.frameListener(new FrameListener()); connection().addListener(new ConnectionListener()); connection().remote().flowController().listener(new Http2RemoteFlowControllerListener()); streamKey = connection().newKey(); upgradeKey = connection().newKey(); initialFlowControlWindowSize = initialSettings.initialWindowSize(); }
stateKey = connection.newKey(); final Http2Stream connectionStream = connection.connectionStream(); connectionStream.setProperty(stateKey, connectionState = new State(connectionStream, 16));
stateKey = connection.newKey(); connectionState = new FlowState(connection.connectionStream()); connection.connectionStream().setProperty(stateKey, connectionState);
stateKey = connection.newKey(); FlowState connectionState = autoRefillConnectionWindow ? new AutoRefillState(connection.connectionStream(), initialWindowSize) :
@Override public PropertyKey getPropertyKey(String keyName) { return propertyKeyMap.computeIfAbsent(keyName, name -> http2Connection.newKey()); }
protected InboundHttp2ToHttpAdapter(Http2Connection connection, int maxContentLength, boolean validateHttpHeaders, boolean propagateSettings) { checkNotNull(connection, "connection"); if (maxContentLength <= 0) { throw new IllegalArgumentException("maxContentLength: " + maxContentLength + " (expected: > 0)"); } this.connection = connection; this.maxContentLength = maxContentLength; this.validateHttpHeaders = validateHttpHeaders; this.propagateSettings = propagateSettings; sendDetector = DEFAULT_SEND_DETECTOR; messageKey = connection.newKey(); }
MockApnsServerHandler(final Http2ConnectionDecoder decoder, final Http2ConnectionEncoder encoder, final Http2Settings initialSettings, final PushNotificationHandler pushNotificationHandler, final MockApnsServerListener listener) { super(decoder, encoder, initialSettings); this.headersPropertyKey = this.connection().newKey(); this.payloadPropertyKey = this.connection().newKey(); this.pushNotificationHandler = pushNotificationHandler; this.listener = listener != null ? listener : new NoopMockApnsServerListener(); }
ApnsClientHandler(final Http2ConnectionDecoder decoder, final Http2ConnectionEncoder encoder, final Http2Settings initialSettings, final String authority, final long idlePingIntervalMillis) { super(decoder, encoder, initialSettings); this.authority = authority; this.responseHeadersPropertyKey = this.connection().newKey(); this.responsePromisePropertyKey = this.connection().newKey(); this.streamErrorCausePropertyKey = this.connection().newKey(); this.connection().addListener(this); this.pingTimeoutMillis = idlePingIntervalMillis / 2; }
public ConnectionImpl(NettyHttp2Handler nettyHttp2Handler, ChannelHandlerContext ctx) { this.http2Connection = nettyHttp2Handler.connection(); this.decoder = nettyHttp2Handler.decoder(); this.encoder = nettyHttp2Handler.encoder(); this.ctx = ctx; STREAM_LISTENER_KEY = http2Connection.newKey(); propertyKeyMap = Maps.newConcurrentMap(); }
Http2FrameCodec(Http2ConnectionEncoder encoder, Http2ConnectionDecoder decoder, Http2Settings initialSettings) { super(decoder, encoder, initialSettings); decoder.frameListener(new FrameListener()); connection().addListener(new ConnectionListener()); connection().remote().flowController().listener(new Http2RemoteFlowControllerListener()); streamKey = connection().newKey(); upgradeKey = connection().newKey(); initialFlowControlWindowSize = initialSettings.initialWindowSize(); }
Http2FrameCodec(Http2ConnectionEncoder encoder, Http2ConnectionDecoder decoder, Http2Settings initialSettings) { super(decoder, encoder, initialSettings); decoder.frameListener(new FrameListener()); connection().addListener(new ConnectionListener()); connection().remote().flowController().listener(new Http2RemoteFlowControllerListener()); streamKey = connection().newKey(); upgradeKey = connection().newKey(); initialFlowControlWindowSize = initialSettings.initialWindowSize(); }
Http2FrameCodec(Http2ConnectionEncoder encoder, Http2ConnectionDecoder decoder, Http2Settings initialSettings) { super(decoder, encoder, initialSettings); decoder.frameListener(new FrameListener()); connection().addListener(new ConnectionListener()); connection().remote().flowController().listener(new Http2RemoteFlowControllerListener()); streamKey = connection().newKey(); upgradeKey = connection().newKey(); initialFlowControlWindowSize = initialSettings.initialWindowSize(); }