Package org.glassfish.tyrus.core.frame
Class TextFrame
- java.lang.Object
-
- org.glassfish.tyrus.core.frame.Frame
-
- org.glassfish.tyrus.core.frame.TyrusFrame
-
- org.glassfish.tyrus.core.frame.TextFrame
-
public class TextFrame extends TyrusFrame
Text frame representation.- Author:
- Pavel Bucek
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.glassfish.tyrus.core.frame.TyrusFrame
TyrusFrame.FrameType
-
Nested classes/interfaces inherited from class org.glassfish.tyrus.core.frame.Frame
Frame.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBuffer
getRemainder()
Remainder after UTF-8 decoding.java.lang.String
getTextPayload()
Get text payload.void
respond(TyrusWebSocket socket)
Execution part of frame processing.java.lang.String
toString()
-
Methods inherited from class org.glassfish.tyrus.core.frame.TyrusFrame
getFrameType, wrap
-
Methods inherited from class org.glassfish.tyrus.core.frame.Frame
builder, builder, getMaskingKey, getOpcode, getPayloadData, getPayloadLength, isControlFrame, isFin, isMask, isRsv1, isRsv2, isRsv3
-
-
-
-
Constructor Detail
-
TextFrame
public TextFrame(Frame frame, java.nio.ByteBuffer remainder)
Constructor.- Parameters:
frame
- original (text) frame.remainder
- UTF-8 decoding remainder from previously processed frame.
-
TextFrame
public TextFrame(Frame frame, java.nio.ByteBuffer remainder, boolean continuation)
Constructor.- Parameters:
frame
- original (text) frame.remainder
- UTF-8 decoding remainder from previously processed frame.continuation
-true
when this frame is continuation frame,false
otherwise.
-
TextFrame
public TextFrame(java.lang.String message, boolean continuation, boolean fin)
Constructor.- Parameters:
message
- text message (will be encoded using strict UTF-8 encoding).continuation
-true
when this frame is continuation frame,false
otherwise.fin
-true
when this frame is last in current partial message batch. Standard (non-continuous) frames have this bit set totrue
.
-
-
Method Detail
-
getTextPayload
public java.lang.String getTextPayload()
Get text payload.- Returns:
- text payload.
-
getRemainder
public java.nio.ByteBuffer getRemainder()
Remainder after UTF-8 decoding.This might be removed in the future, if encoding part will be separated from text frame impl.
- Returns:
- UTF-8 decoding remainder. Used internally to decoding next incoming frame.
-
respond
public void respond(TyrusWebSocket socket)
Description copied from class:TyrusFrame
Execution part of frame processing.- Specified by:
respond
in classTyrusFrame
- Parameters:
socket
- socket on which the appropriate action will be performed.
-
-