Package org.mockserver.mock.breakpoint
Class PausedStreamFrame
java.lang.Object
org.mockserver.mock.breakpoint.PausedStreamFrame
Represents a single streaming frame that has been paused at a breakpoint,
awaiting external resolution via the control-plane REST API or an automatic timeout.
The held frame's bytes are captured as a byte[] copy at park time — the
original Netty ByteBuf is NOT retained here. Instead, the caller retains the
ByteBuf, and the decision callback tells the caller what to do with it (write, replace,
drop, etc.). This avoids the complexity of holding a refcounted ByteBuf across threads
and timeouts.
Thread-safety: the decisionFuture is a CompletableFuture which is
thread-safe. Fields are immutable after construction.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDirection of the paused frame relative to MockServer. -
Constructor Summary
ConstructorsConstructorDescriptionPausedStreamFrame(String frameId, String streamId, int sequenceNumber, byte[] capturedBytes, String requestMethod, String requestPath) Creates a paused frame with the default OUTBOUND direction (backward compatible).PausedStreamFrame(String frameId, String streamId, int sequenceNumber, byte[] capturedBytes, String requestMethod, String requestPath, PausedStreamFrame.Direction direction) Creates a paused frame with an explicit direction.PausedStreamFrame(String frameId, String streamId, int sequenceNumber, byte[] capturedBytes, String requestMethod, String requestPath, PausedStreamFrame.Direction direction, Long requestTimestamp) Creates a paused frame with an explicit direction and request timestamp. -
Method Summary
Modifier and TypeMethodDescriptionlongAge in milliseconds since this frame was paused.byte[]A copy of the frame's payload bytes at the time it was parked.longThe future that the relay loop awaits.The direction of this frame: OUTBOUND (server-to-client) or INBOUND (client-to-server).Unique id for this frame within the stream breakpoint registry.The request method of the original forwarded request (for context/logging).The request path of the original forwarded request (for context/logging).The epoch-millis timestamp at which MockServer first received the originating request.int0-based sequence number within the stream.The stream id (correlation id) this frame belongs to.
-
Constructor Details
-
PausedStreamFrame
public PausedStreamFrame(String frameId, String streamId, int sequenceNumber, byte[] capturedBytes, String requestMethod, String requestPath) Creates a paused frame with the default OUTBOUND direction (backward compatible). -
PausedStreamFrame
public PausedStreamFrame(String frameId, String streamId, int sequenceNumber, byte[] capturedBytes, String requestMethod, String requestPath, PausedStreamFrame.Direction direction) Creates a paused frame with an explicit direction. -
PausedStreamFrame
public PausedStreamFrame(String frameId, String streamId, int sequenceNumber, byte[] capturedBytes, String requestMethod, String requestPath, PausedStreamFrame.Direction direction, Long requestTimestamp) Creates a paused frame with an explicit direction and request timestamp.
-
-
Method Details
-
getFrameId
Unique id for this frame within the stream breakpoint registry. -
getStreamId
The stream id (correlation id) this frame belongs to. Multiple frames from the same forwarded response share the same stream id. -
getSequenceNumber
public int getSequenceNumber()0-based sequence number within the stream. Frames MUST be resumed in order. -
getCapturedBytes
public byte[] getCapturedBytes()A copy of the frame's payload bytes at the time it was parked. -
getDecisionFuture
The future that the relay loop awaits. Completing this future resumes frame processing. -
getCreatedAtMillis
public long getCreatedAtMillis() -
ageMillis
public long ageMillis()Age in milliseconds since this frame was paused. -
getRequestMethod
The request method of the original forwarded request (for context/logging). -
getRequestPath
The request path of the original forwarded request (for context/logging). -
getDirection
The direction of this frame: OUTBOUND (server-to-client) or INBOUND (client-to-server). -
getRequestTimestamp
The epoch-millis timestamp at which MockServer first received the originating request. May benullfor backward compatibility.
-