Top Fields Constructors Methods
org.eclipse.jetty.websocket.core.internal

public Class ValidationExtension

extends AbstractExtension
Class Inheritance
Imports
java.io.IOException, java.util.Map, org.eclipse.jetty.util.Callback, org.eclipse.jetty.websocket.core.AbstractExtension, .ExtensionConfig, .Frame, .WebSocketComponents, org.eclipse.jetty.websocket.core.exception.BadPayloadException, .ProtocolException, org.eclipse.jetty.websocket.core.util.FrameValidation, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private byte
private byte
private boolean
private FrameSequence
private NullAppendable
private static final Logger
private boolean
private FrameSequence
private NullAppendable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getName()

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.getName.

Implements org.eclipse.jetty.websocket.core.Extension.getName.

The Sec-WebSocket-Extensions name for this extension.

public void
public void
onFrame(Frame
the frame to process.
frame
,
Callback
the read completion.
callback
)

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.onFrame.

Implements org.eclipse.jetty.websocket.core.IncomingFrames.onFrame.

Process the incoming frame.

public byte
recordLastOpCode(Frame frame, byte prevOpcode)

public void
sendFrame(Frame
the frame to eventually write to the network layer.
frame
,
Callback
the callback to notify when the frame is written.
callback
,
boolean
the batch mode requested by the sender.
batch
)

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.sendFrame.

Implements org.eclipse.jetty.websocket.core.OutgoingFrames.sendFrame.

A frame, and optional callback, intended for the network layer.

private void
validateUTF8(Frame frame, NullAppendable appendable, byte continuedOpCode)

Inherited from org.eclipse.jetty.websocket.core.AbstractExtension:
getByteBufferPoolgetConfiggetConfigurationgetCoreSessiongetDeflaterPoolgetInflaterPoolgetNextIncominggetNextOutgoingisRsv1UserisRsv2UserisRsv3UsernextIncomingFramenextOutgoingFramesetCoreSessionsetNextIncomingFramessetNextOutgoingFramestoString

Field Detail

continuedInOpCodeback to summary
private byte continuedInOpCode
continuedOutOpCodeback to summary
private byte continuedOutOpCode
incomingFrameValidationback to summary
private boolean incomingFrameValidation
incomingSequenceback to summary
private FrameSequence incomingSequence
incomingUtf8Validationback to summary
private NullAppendable incomingUtf8Validation
LOGback to summary
private static final Logger LOG
outgoingFrameValidationback to summary
private boolean outgoingFrameValidation
outgoingSequenceback to summary
private FrameSequence outgoingSequence
outgoingUtf8Validationback to summary
private NullAppendable outgoingUtf8Validation

Constructor Detail

ValidationExtensionback to summary
public ValidationExtension()

Method Detail

getNameback to summary
public String getName()

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.getName.

Implements org.eclipse.jetty.websocket.core.Extension.getName.

Doc from org.eclipse.jetty.websocket.core.Extension.getName.

The Sec-WebSocket-Extensions name for this extension.

Also known as the extension-token per Section 9.1. Negotiating Extensions.

Returns:String

the name of the extension

Annotations
@Override
initback to summary
public void init(ExtensionConfig config, WebSocketComponents components)

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.init.

Implements org.eclipse.jetty.websocket.core.Extension.init.

Annotations
@Override
onFrameback to summary
public void onFrame(Frame frame, Callback callback)

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.onFrame.

Implements org.eclipse.jetty.websocket.core.IncomingFrames.onFrame.

Doc from org.eclipse.jetty.websocket.core.IncomingFrames.onFrame.

Process the incoming frame.

Note

if you need to hang onto any information from the frame, be sure to copy it, as the information contained in the Frame will be released and/or reused by the implementation.

Failure of the callback will propagate the failure back to the CoreSession to fail the connection and attempt to send a close Frame if one has not been sent.

Parameters
frame:Frame

the frame to process.

callback:Callback

the read completion.

Annotations
@Override
recordLastOpCodeback to summary
public byte recordLastOpCode(Frame frame, byte prevOpcode) throws ProtocolException
sendFrameback to summary
public void sendFrame(Frame frame, Callback callback, boolean batch)

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.sendFrame.

Implements org.eclipse.jetty.websocket.core.OutgoingFrames.sendFrame.

Doc from org.eclipse.jetty.websocket.core.OutgoingFrames.sendFrame.

A frame, and optional callback, intended for the network layer.

Note

the frame can undergo many transformations in the various layers and extensions present in the implementation.

If you are implementing a mutation, you are obliged to handle the incoming Callback appropriately.

Parameters
frame:Frame

the frame to eventually write to the network layer.

callback:Callback

the callback to notify when the frame is written.

batch:boolean

the batch mode requested by the sender.

Annotations
@Override
validateUTF8back to summary
private void validateUTF8(Frame frame, NullAppendable appendable, byte continuedOpCode) throws IOException