Top Description Fields Constructors Methods
org.glassfish.tyrus.core.frame

public Class CloseFrame

extends TyrusFrame
Class Inheritance
Imports
java.nio.Buffer, .ByteBuffer, .CharBuffer, java.nio.charset.Charset, .CharsetDecoder, .CoderResult, jakarta.websocket.CloseReason, org.glassfish.tyrus.core.CloseReasons, .ProtocolException, .StrictUtf8, .TyrusWebSocket, .Utf8DecodingException, .Utils

Close frame representation.
Author
Pavel Bucek

Field Summary

Modifier and TypeField and Description
private final CloseReason
private static final byte[]

Constructor Summary

AccessConstructor and Description
public
CloseFrame(Frame
original (close) frame.
frame
)

Constructor.

public
CloseFrame(CloseReason
close reason used to construct close frame.
closeReason
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public CloseReason

Returns:

close reason.
getCloseReason
()

Get close reason.

private static byte[]
getPayload(int closeCode, String closeReason)

public void
respond(TyrusWebSocket
socket on which the appropriate action will be performed.
socket
)

Implements abstract org.glassfish.tyrus.core.frame.TyrusFrame.respond.

Execution part of frame processing.

private String
utf8Decode(byte[] data)

Inherited from org.glassfish.tyrus.core.frame.TyrusFrame:
getFrameTypewrap

Field Detail

closeReasonback to summary
private final CloseReason closeReason
EMPTY_BYTESback to summary
private static final byte[] EMPTY_BYTES

Constructor Detail

CloseFrameback to summary
public CloseFrame(Frame frame)

Constructor.

Parameters
frame:Frame

original (close) frame.

CloseFrameback to summary
public CloseFrame(CloseReason closeReason)

Constructor.

Parameters
closeReason:CloseReason

close reason used to construct close frame.

Method Detail

getCloseReasonback to summary
public CloseReason getCloseReason()

Get close reason.

Returns:CloseReason

close reason.

getPayloadback to summary
private static byte[] getPayload(int closeCode, String closeReason)
respondback to summary
public void respond(TyrusWebSocket socket)

Implements abstract org.glassfish.tyrus.core.frame.TyrusFrame.respond.

Doc from org.glassfish.tyrus.core.frame.TyrusFrame.respond.

Execution part of frame processing.

Parameters
socket:TyrusWebSocket

socket on which the appropriate action will be performed.

Annotations
@Override
utf8Decodeback to summary
private String utf8Decode(byte[] data)