1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package io.netty.handler.codec.http2;
16
17 import static io.netty.util.internal.ObjectUtil.checkNotNull;
18 import io.netty.buffer.ByteBuf;
19 import io.netty.channel.ChannelHandlerContext;
20
21
22
23
24 public class Http2FrameListenerDecorator implements Http2FrameListener {
25 protected final Http2FrameListener listener;
26
27 public Http2FrameListenerDecorator(Http2FrameListener listener) {
28 this.listener = checkNotNull(listener, "listener");
29 }
30
31 @Override
32 public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream)
33 throws Http2Exception {
34 return listener.onDataRead(ctx, streamId, data, padding, endOfStream);
35 }
36
37 @Override
38 public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding,
39 boolean endStream) throws Http2Exception {
40 listener.onHeadersRead(ctx, streamId, headers, padding, endStream);
41 }
42
43 @Override
44 public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency,
45 short weight, boolean exclusive, int padding, boolean endStream) throws Http2Exception {
46 listener.onHeadersRead(ctx, streamId, headers, streamDependency, weight, exclusive, padding, endStream);
47 }
48
49 @Override
50 public void onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight,
51 boolean exclusive) throws Http2Exception {
52 listener.onPriorityRead(ctx, streamId, streamDependency, weight, exclusive);
53 }
54
55 @Override
56 public void onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) throws Http2Exception {
57 listener.onRstStreamRead(ctx, streamId, errorCode);
58 }
59
60 @Override
61 public void onSettingsAckRead(ChannelHandlerContext ctx) throws Http2Exception {
62 listener.onSettingsAckRead(ctx);
63 }
64
65 @Override
66 public void onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings) throws Http2Exception {
67 listener.onSettingsRead(ctx, settings);
68 }
69
70 @Override
71 public void onPingRead(ChannelHandlerContext ctx, long data) throws Http2Exception {
72 listener.onPingRead(ctx, data);
73 }
74
75 @Override
76 public void onPingAckRead(ChannelHandlerContext ctx, long data) throws Http2Exception {
77 listener.onPingAckRead(ctx, data);
78 }
79
80 @Override
81 public void onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers,
82 int padding) throws Http2Exception {
83 listener.onPushPromiseRead(ctx, streamId, promisedStreamId, headers, padding);
84 }
85
86 @Override
87 public void onGoAwayRead(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData)
88 throws Http2Exception {
89 listener.onGoAwayRead(ctx, lastStreamId, errorCode, debugData);
90 }
91
92 @Override
93 public void onWindowUpdateRead(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement)
94 throws Http2Exception {
95 listener.onWindowUpdateRead(ctx, streamId, windowSizeIncrement);
96 }
97
98 @Override
99 public void onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags,
100 ByteBuf payload) throws Http2Exception {
101 listener.onUnknownFrame(ctx, frameType, streamId, flags, payload);
102 }
103 }