1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package io.netty.handler.codec.http2;
16
17 import io.netty.buffer.ByteBuf;
18 import io.netty.channel.ChannelFuture;
19 import io.netty.channel.ChannelHandlerContext;
20 import io.netty.channel.ChannelPromise;
21 import io.netty.util.internal.UnstableApi;
22
23 import static io.netty.util.internal.ObjectUtil.checkNotNull;
24
25
26
27
28 @UnstableApi
29 public class DecoratingHttp2FrameWriter implements Http2FrameWriter {
30 private final Http2FrameWriter delegate;
31
32 public DecoratingHttp2FrameWriter(Http2FrameWriter delegate) {
33 this.delegate = checkNotNull(delegate, "delegate");
34 }
35
36 @Override
37 public ChannelFuture writeData(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding,
38 boolean endStream, ChannelPromise promise) {
39 return delegate.writeData(ctx, streamId, data, padding, endStream, promise);
40 }
41
42 @Override
43 public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding,
44 boolean endStream, ChannelPromise promise) {
45 return delegate.writeHeaders(ctx, streamId, headers, padding, endStream, promise);
46 }
47
48 @Override
49 public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers,
50 int streamDependency, short weight, boolean exclusive, int padding,
51 boolean endStream, ChannelPromise promise) {
52 return delegate
53 .writeHeaders(ctx, streamId, headers, streamDependency, weight, exclusive, padding, endStream, promise);
54 }
55
56 @Override
57 public ChannelFuture writePriority(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight,
58 boolean exclusive, ChannelPromise promise) {
59 return delegate.writePriority(ctx, streamId, streamDependency, weight, exclusive, promise);
60 }
61
62 @Override
63 public ChannelFuture writeRstStream(ChannelHandlerContext ctx, int streamId, long errorCode,
64 ChannelPromise promise) {
65 return delegate.writeRstStream(ctx, streamId, errorCode, promise);
66 }
67
68 @Override
69 public ChannelFuture writeSettings(ChannelHandlerContext ctx, Http2Settings settings, ChannelPromise promise) {
70 return delegate.writeSettings(ctx, settings, promise);
71 }
72
73 @Override
74 public ChannelFuture writeSettingsAck(ChannelHandlerContext ctx, ChannelPromise promise) {
75 return delegate.writeSettingsAck(ctx, promise);
76 }
77
78 @Override
79 public ChannelFuture writePing(ChannelHandlerContext ctx, boolean ack, long data, ChannelPromise promise) {
80 return delegate.writePing(ctx, ack, data, promise);
81 }
82
83 @Override
84 public ChannelFuture writePushPromise(ChannelHandlerContext ctx, int streamId, int promisedStreamId,
85 Http2Headers headers, int padding, ChannelPromise promise) {
86 return delegate.writePushPromise(ctx, streamId, promisedStreamId, headers, padding, promise);
87 }
88
89 @Override
90 public ChannelFuture writeGoAway(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData,
91 ChannelPromise promise) {
92 return delegate.writeGoAway(ctx, lastStreamId, errorCode, debugData, promise);
93 }
94
95 @Override
96 public ChannelFuture writeWindowUpdate(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement,
97 ChannelPromise promise) {
98 return delegate.writeWindowUpdate(ctx, streamId, windowSizeIncrement, promise);
99 }
100
101 @Override
102 public ChannelFuture writeFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags,
103 ByteBuf payload, ChannelPromise promise) {
104 return delegate.writeFrame(ctx, frameType, streamId, flags, payload, promise);
105 }
106
107 @Override
108 public Configuration configuration() {
109 return delegate.configuration();
110 }
111
112 @Override
113 public void close() {
114 delegate.close();
115 }
116 }