Class Generator
- java.lang.Object
-
- org.eclipse.jetty.websocket.common.Generator
-
@Deprecated(since="2021-05-27") public class Generator extends java.lang.Object
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Generating a frame in WebSocket land.0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-------+-+-------------+-------------------------------+ |F|R|R|R| opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16/64) | |N|V|V|V| |S| | (if payload len==126/127) | | |1|2|3| |K| | | +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + | Extended payload length continued, if payload len == 127 | + - - - - - - - - - - - - - - - +-------------------------------+ | |Masking-key, if MASK set to 1 | +-------------------------------+-------------------------------+ | Masking-key (continued) | Payload Data | +-------------------------------- - - - - - - - - - - - - - - - + : Payload Data continued ... : + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | Payload Data continued ... | +---------------------------------------------------------------+
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_HEADER_LENGTH
Deprecated.The overhead (maximum) for a framing header.
-
Constructor Summary
Constructors Constructor Description Generator(WebSocketPolicy policy, ByteBufferPool bufferPool)
Deprecated.Construct Generator with provided policy and bufferPoolGenerator(WebSocketPolicy policy, ByteBufferPool bufferPool, boolean validating)
Deprecated.Construct Generator with provided policy and bufferPoolGenerator(WebSocketPolicy policy, ByteBufferPool bufferPool, boolean validating, boolean readOnly)
Deprecated.Construct Generator with provided policy and bufferPool
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
assertFrameValid(Frame frame)
Deprecated.void
configureFromExtensions(java.util.List<? extends Extension> exts)
Deprecated.java.nio.ByteBuffer
generateHeaderBytes(Frame frame)
Deprecated.void
generateHeaderBytes(Frame frame, java.nio.ByteBuffer buffer)
Deprecated.void
generateWholeFrame(Frame frame, java.nio.ByteBuffer buf)
Deprecated.Generate the whole frame (header + payload copy) into a single ByteBuffer.ByteBufferPool
getBufferPool()
Deprecated.boolean
isRsv1InUse()
Deprecated.boolean
isRsv2InUse()
Deprecated.boolean
isRsv3InUse()
Deprecated.void
setRsv1InUse(boolean rsv1InUse)
Deprecated.void
setRsv2InUse(boolean rsv2InUse)
Deprecated.void
setRsv3InUse(boolean rsv3InUse)
Deprecated.java.lang.String
toString()
Deprecated.
-
-
-
Field Detail
-
MAX_HEADER_LENGTH
public static final int MAX_HEADER_LENGTH
Deprecated.The overhead (maximum) for a framing header. Assuming a maximum sized payload with masking key.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Generator
public Generator(WebSocketPolicy policy, ByteBufferPool bufferPool)
Deprecated.Construct Generator with provided policy and bufferPool- Parameters:
policy
- the policy to usebufferPool
- the buffer pool to use
-
Generator
public Generator(WebSocketPolicy policy, ByteBufferPool bufferPool, boolean validating)
Deprecated.Construct Generator with provided policy and bufferPool- Parameters:
policy
- the policy to usebufferPool
- the buffer pool to usevalidating
- true to enable RFC frame validation
-
Generator
public Generator(WebSocketPolicy policy, ByteBufferPool bufferPool, boolean validating, boolean readOnly)
Deprecated.Construct Generator with provided policy and bufferPool- Parameters:
policy
- the policy to usebufferPool
- the buffer pool to usevalidating
- true to enable RFC frame validationreadOnly
- true if generator is to treat frames as read-only and not modify them. Useful for debugging purposes, but not generally for runtime use.
-
-
Method Detail
-
assertFrameValid
public void assertFrameValid(Frame frame)
Deprecated.
-
configureFromExtensions
public void configureFromExtensions(java.util.List<? extends Extension> exts)
Deprecated.
-
generateHeaderBytes
public java.nio.ByteBuffer generateHeaderBytes(Frame frame)
Deprecated.
-
generateHeaderBytes
public void generateHeaderBytes(Frame frame, java.nio.ByteBuffer buffer)
Deprecated.
-
generateWholeFrame
public void generateWholeFrame(Frame frame, java.nio.ByteBuffer buf)
Deprecated.Generate the whole frame (header + payload copy) into a single ByteBuffer.Note: This is slow, moves lots of memory around. Only use this if you must (such as in unit testing).
- Parameters:
frame
- the frame to generatebuf
- the buffer to output the generated frame to
-
getBufferPool
public ByteBufferPool getBufferPool()
Deprecated.
-
setRsv1InUse
public void setRsv1InUse(boolean rsv1InUse)
Deprecated.
-
setRsv2InUse
public void setRsv2InUse(boolean rsv2InUse)
Deprecated.
-
setRsv3InUse
public void setRsv3InUse(boolean rsv3InUse)
Deprecated.
-
isRsv1InUse
public boolean isRsv1InUse()
Deprecated.
-
isRsv2InUse
public boolean isRsv2InUse()
Deprecated.
-
isRsv3InUse
public boolean isRsv3InUse()
Deprecated.
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
-