/** * Creates a PING frame with the given {@code long} {@code value} as payload. * * @param value the value to use as a payload for this PING frame * @param reply whether this PING frame is a reply */ public PingFrame(long value, boolean reply) { this(toBytes(value), reply); }
@Override public String toString() { return frame.toString(); } }
private DataEntry(DataFrame frame, IStream stream, Callback callback) { super(frame, stream, callback); // We don't do any padding, so the flow control length is // always the data remaining. This simplifies the handling // of data frames that cannot be completely written due to // the flow control window exhausting, since in that case // we would have to count the padding only once. dataRemaining = frame.remaining(); }
private void generatePriority(ByteBuffer header, PriorityFrame priority) { if (priority != null) { priorityGenerator.generatePriorityBody(header, priority.getStreamId(), priority.getParentStreamId(), priority.getWeight(), priority.isExclusive()); } } }
private void onHeaders(int parentStreamId, int weight, boolean exclusive, MetaData metaData) { PriorityFrame priorityFrame = null; if (hasFlag(Flags.PRIORITY)) priorityFrame = new PriorityFrame(getStreamId(), parentStreamId, weight, exclusive); HeadersFrame frame = new HeadersFrame(getStreamId(), metaData, priorityFrame, isEndStream()); notifyHeaders(frame); }
@Override public int generate(ByteBufferPool.Lease lease, Frame frame) { SettingsFrame settingsFrame = (SettingsFrame)frame; return generateSettings(lease, settingsFrame.getSettings(), settingsFrame.isReply()); }
@Override public String toString() { return String.format("%s,%d/%s/%s/%s", super.toString(), lastStreamId, ErrorCode.toString(error, null), tryConvertPayload(), closeState); } }
private boolean onReset(int error) { ResetFrame frame = new ResetFrame(getStreamId(), error); reset(); notifyReset(frame); return true; }
public long getPayloadAsLong() { return toLong(payload); }
private void complete() { frames(null, Callback.NOOP, newGoAwayFrame(CloseState.CLOSED, ErrorCode.NO_ERROR.code, null), new DisconnectFrame()); } }
private boolean onPriority(int parentStreamId, int weight, boolean exclusive) { PriorityFrame frame = new PriorityFrame(getStreamId(), parentStreamId, weight, exclusive); reset(); notifyPriority(frame); return true; }
private void onHeaders(int parentStreamId, int weight, boolean exclusive, MetaData metaData) { PriorityFrame priorityFrame = null; if (hasFlag(Flags.PRIORITY)) priorityFrame = new PriorityFrame(getStreamId(), parentStreamId, weight, exclusive); HeadersFrame frame = new HeadersFrame(getStreamId(), metaData, priorityFrame, isEndStream()); notifyHeaders(frame); }
@Override public String toString() { return String.format("%s,%d/%s/%s/%s", super.toString(), lastStreamId, ErrorCode.toString(error, null), tryConvertPayload(), closeState); } }
@Override public String toString() { return frame.toString(); } }
/** * Creates a PING frame with the given {@code long} {@code value} as payload. * * @param value the value to use as a payload for this PING frame * @param reply whether this PING frame is a reply */ public PingFrame(long value, boolean reply) { this(toBytes(value), reply); }
private DataEntry(DataFrame frame, IStream stream, Callback callback) { super(frame, stream, callback); // We don't do any padding, so the flow control length is // always the data remaining. This simplifies the handling // of data frames that cannot be completely written due to // the flow control window exhausting, since in that case // we would have to count the padding only once. dataRemaining = frame.remaining(); }
public long getPayloadAsLong() { return toLong(payload); }
@Override public String toString() { return String.format("%s#%d/#%d{weight=%d,exclusive=%b}", super.toString(), streamId, parentStreamId, weight, exclusive); } }