Updated Frame inheritance.
This commit is contained in:
parent
b38bae36f1
commit
e0474108d0
|
@ -28,6 +28,7 @@ public class DataFrame extends Frame
|
||||||
|
|
||||||
public DataFrame(int streamId, ByteBuffer data, boolean endStream)
|
public DataFrame(int streamId, ByteBuffer data, boolean endStream)
|
||||||
{
|
{
|
||||||
|
super(FrameType.DATA);
|
||||||
this.streamId = streamId;
|
this.streamId = streamId;
|
||||||
this.data = data;
|
this.data = data;
|
||||||
this.endStream = endStream;
|
this.endStream = endStream;
|
||||||
|
|
|
@ -22,4 +22,16 @@ public abstract class Frame
|
||||||
{
|
{
|
||||||
public static final int HEADER_LENGTH = 8;
|
public static final int HEADER_LENGTH = 8;
|
||||||
public static final int MAX_LENGTH = 0x3F_FF;
|
public static final int MAX_LENGTH = 0x3F_FF;
|
||||||
|
|
||||||
|
private FrameType type;
|
||||||
|
|
||||||
|
protected Frame(FrameType type)
|
||||||
|
{
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FrameType getType()
|
||||||
|
{
|
||||||
|
return type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
package org.eclipse.jetty.http2.frames;
|
package org.eclipse.jetty.http2.frames;
|
||||||
|
|
||||||
public class GoAwayFrame
|
public class GoAwayFrame extends Frame
|
||||||
{
|
{
|
||||||
private final int lastStreamId;
|
private final int lastStreamId;
|
||||||
private final int error;
|
private final int error;
|
||||||
|
@ -26,6 +26,7 @@ public class GoAwayFrame
|
||||||
|
|
||||||
public GoAwayFrame(int lastStreamId, int error, byte[] payload)
|
public GoAwayFrame(int lastStreamId, int error, byte[] payload)
|
||||||
{
|
{
|
||||||
|
super(FrameType.GO_AWAY);
|
||||||
this.lastStreamId = lastStreamId;
|
this.lastStreamId = lastStreamId;
|
||||||
this.error = error;
|
this.error = error;
|
||||||
this.payload = payload;
|
this.payload = payload;
|
||||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.http2.frames;
|
||||||
|
|
||||||
import org.eclipse.jetty.http2.hpack.MetaData;
|
import org.eclipse.jetty.http2.hpack.MetaData;
|
||||||
|
|
||||||
public class HeadersFrame
|
public class HeadersFrame extends Frame
|
||||||
{
|
{
|
||||||
private final int streamId;
|
private final int streamId;
|
||||||
private final MetaData metaData;
|
private final MetaData metaData;
|
||||||
|
@ -29,6 +29,7 @@ public class HeadersFrame
|
||||||
|
|
||||||
public HeadersFrame(int streamId, MetaData metaData, PriorityFrame priority, boolean endStream)
|
public HeadersFrame(int streamId, MetaData metaData, PriorityFrame priority, boolean endStream)
|
||||||
{
|
{
|
||||||
|
super(FrameType.HEADERS);
|
||||||
this.streamId = streamId;
|
this.streamId = streamId;
|
||||||
this.metaData = metaData;
|
this.metaData = metaData;
|
||||||
this.priority = priority;
|
this.priority = priority;
|
||||||
|
|
|
@ -18,13 +18,14 @@
|
||||||
|
|
||||||
package org.eclipse.jetty.http2.frames;
|
package org.eclipse.jetty.http2.frames;
|
||||||
|
|
||||||
public class PingFrame
|
public class PingFrame extends Frame
|
||||||
{
|
{
|
||||||
private final byte[] payload;
|
private final byte[] payload;
|
||||||
private final boolean reply;
|
private final boolean reply;
|
||||||
|
|
||||||
public PingFrame(byte[] payload, boolean reply)
|
public PingFrame(byte[] payload, boolean reply)
|
||||||
{
|
{
|
||||||
|
super(FrameType.PING);
|
||||||
this.payload = payload;
|
this.payload = payload;
|
||||||
this.reply = reply;
|
this.reply = reply;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
package org.eclipse.jetty.http2.frames;
|
package org.eclipse.jetty.http2.frames;
|
||||||
|
|
||||||
public class PriorityFrame
|
public class PriorityFrame extends Frame
|
||||||
{
|
{
|
||||||
private final int streamId;
|
private final int streamId;
|
||||||
private final int dependentStreamId;
|
private final int dependentStreamId;
|
||||||
|
@ -27,6 +27,7 @@ public class PriorityFrame
|
||||||
|
|
||||||
public PriorityFrame(int streamId, int dependentStreamId, int weight, boolean exclusive)
|
public PriorityFrame(int streamId, int dependentStreamId, int weight, boolean exclusive)
|
||||||
{
|
{
|
||||||
|
super(FrameType.PRIORITY);
|
||||||
this.streamId = streamId;
|
this.streamId = streamId;
|
||||||
this.dependentStreamId = dependentStreamId;
|
this.dependentStreamId = dependentStreamId;
|
||||||
this.weight = weight;
|
this.weight = weight;
|
||||||
|
|
|
@ -18,13 +18,14 @@
|
||||||
|
|
||||||
package org.eclipse.jetty.http2.frames;
|
package org.eclipse.jetty.http2.frames;
|
||||||
|
|
||||||
public class ResetFrame
|
public class ResetFrame extends Frame
|
||||||
{
|
{
|
||||||
private final int streamId;
|
private final int streamId;
|
||||||
private final int error;
|
private final int error;
|
||||||
|
|
||||||
public ResetFrame(int streamId, int error)
|
public ResetFrame(int streamId, int error)
|
||||||
{
|
{
|
||||||
|
super(FrameType.RST_STREAM);
|
||||||
this.streamId = streamId;
|
this.streamId = streamId;
|
||||||
this.error = error;
|
this.error = error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,13 +20,14 @@ package org.eclipse.jetty.http2.frames;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class SettingsFrame
|
public class SettingsFrame extends Frame
|
||||||
{
|
{
|
||||||
private final Map<Integer, Integer> settings;
|
private final Map<Integer, Integer> settings;
|
||||||
private final boolean reply;
|
private final boolean reply;
|
||||||
|
|
||||||
public SettingsFrame(Map<Integer, Integer> settings, boolean reply)
|
public SettingsFrame(Map<Integer, Integer> settings, boolean reply)
|
||||||
{
|
{
|
||||||
|
super(FrameType.SETTINGS);
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.reply = reply;
|
this.reply = reply;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,13 +18,14 @@
|
||||||
|
|
||||||
package org.eclipse.jetty.http2.frames;
|
package org.eclipse.jetty.http2.frames;
|
||||||
|
|
||||||
public class WindowUpdateFrame
|
public class WindowUpdateFrame extends Frame
|
||||||
{
|
{
|
||||||
private final int streamId;
|
private final int streamId;
|
||||||
private final int windowDelta;
|
private final int windowDelta;
|
||||||
|
|
||||||
public WindowUpdateFrame(int streamId, int windowDelta)
|
public WindowUpdateFrame(int streamId, int windowDelta)
|
||||||
{
|
{
|
||||||
|
super(FrameType.WINDOW_UPDATE);
|
||||||
this.streamId = streamId;
|
this.streamId = streamId;
|
||||||
this.windowDelta = windowDelta;
|
this.windowDelta = windowDelta;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue