diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/DataFrame.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/DataFrame.java index 9badd6fe9eb..e9e84cdc3dd 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/DataFrame.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/DataFrame.java @@ -28,6 +28,7 @@ public class DataFrame extends Frame public DataFrame(int streamId, ByteBuffer data, boolean endStream) { + super(FrameType.DATA); this.streamId = streamId; this.data = data; this.endStream = endStream; diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/Frame.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/Frame.java index 0d3bf269ab5..7a58eb21841 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/Frame.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/Frame.java @@ -22,4 +22,16 @@ public abstract class Frame { public static final int HEADER_LENGTH = 8; public static final int MAX_LENGTH = 0x3F_FF; + + private FrameType type; + + protected Frame(FrameType type) + { + this.type = type; + } + + public FrameType getType() + { + return type; + } } diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/GoAwayFrame.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/GoAwayFrame.java index d17d357de36..6615c0f6589 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/GoAwayFrame.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/GoAwayFrame.java @@ -18,7 +18,7 @@ package org.eclipse.jetty.http2.frames; -public class GoAwayFrame +public class GoAwayFrame extends Frame { private final int lastStreamId; private final int error; @@ -26,6 +26,7 @@ public class GoAwayFrame public GoAwayFrame(int lastStreamId, int error, byte[] payload) { + super(FrameType.GO_AWAY); this.lastStreamId = lastStreamId; this.error = error; this.payload = payload; diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/HeadersFrame.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/HeadersFrame.java index eef67a45e64..dfb81246a4f 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/HeadersFrame.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/HeadersFrame.java @@ -20,7 +20,7 @@ package org.eclipse.jetty.http2.frames; import org.eclipse.jetty.http2.hpack.MetaData; -public class HeadersFrame +public class HeadersFrame extends Frame { private final int streamId; private final MetaData metaData; @@ -29,6 +29,7 @@ public class HeadersFrame public HeadersFrame(int streamId, MetaData metaData, PriorityFrame priority, boolean endStream) { + super(FrameType.HEADERS); this.streamId = streamId; this.metaData = metaData; this.priority = priority; diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/PingFrame.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/PingFrame.java index 575f63f0251..b56643cd4e4 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/PingFrame.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/PingFrame.java @@ -18,13 +18,14 @@ package org.eclipse.jetty.http2.frames; -public class PingFrame +public class PingFrame extends Frame { private final byte[] payload; private final boolean reply; public PingFrame(byte[] payload, boolean reply) { + super(FrameType.PING); this.payload = payload; this.reply = reply; } diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/PriorityFrame.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/PriorityFrame.java index e82a3c4be02..a8718874812 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/PriorityFrame.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/PriorityFrame.java @@ -18,7 +18,7 @@ package org.eclipse.jetty.http2.frames; -public class PriorityFrame +public class PriorityFrame extends Frame { private final int streamId; private final int dependentStreamId; @@ -27,6 +27,7 @@ public class PriorityFrame public PriorityFrame(int streamId, int dependentStreamId, int weight, boolean exclusive) { + super(FrameType.PRIORITY); this.streamId = streamId; this.dependentStreamId = dependentStreamId; this.weight = weight; diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/ResetFrame.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/ResetFrame.java index 3fa1343dfec..55595e99f14 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/ResetFrame.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/ResetFrame.java @@ -18,13 +18,14 @@ package org.eclipse.jetty.http2.frames; -public class ResetFrame +public class ResetFrame extends Frame { private final int streamId; private final int error; public ResetFrame(int streamId, int error) { + super(FrameType.RST_STREAM); this.streamId = streamId; this.error = error; } diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/SettingsFrame.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/SettingsFrame.java index 5fe64b0a863..38cf1278771 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/SettingsFrame.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/SettingsFrame.java @@ -20,13 +20,14 @@ package org.eclipse.jetty.http2.frames; import java.util.Map; -public class SettingsFrame +public class SettingsFrame extends Frame { private final Map settings; private final boolean reply; public SettingsFrame(Map settings, boolean reply) { + super(FrameType.SETTINGS); this.settings = settings; this.reply = reply; } diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/WindowUpdateFrame.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/WindowUpdateFrame.java index 0ed4ac35dbe..ee0837ddc60 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/WindowUpdateFrame.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/frames/WindowUpdateFrame.java @@ -18,13 +18,14 @@ package org.eclipse.jetty.http2.frames; -public class WindowUpdateFrame +public class WindowUpdateFrame extends Frame { private final int streamId; private final int windowDelta; public WindowUpdateFrame(int streamId, int windowDelta) { + super(FrameType.WINDOW_UPDATE); this.streamId = streamId; this.windowDelta = windowDelta; }