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

public Class ExtensionStack

extends Object
implements IncomingFrames, OutgoingFrames, Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.websocket.core.OutgoingFrames, org.eclipse.jetty.websocket.core.IncomingFrames
Annotations
@ManagedObject:Extension Stack
Imports
java.io.IOException, java.util.ArrayList, .Collections, .List, .ListIterator, java.util.stream.Collectors, org.eclipse.jetty.http.BadMessageException, org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.websocket.core.exception.WebSocketException, org.eclipse.jetty.websocket.core.util.DemandChain, org.slf4j.Logger, .LoggerFactory

Represents the stack of Extensions.

Field Summary

Modifier and TypeField and Description
private final Behavior
private final WebSocketComponents
private DemandChain
private List<Extension>
private IncomingFrames
private DemandChain
private static final Logger
private OutgoingFrames
private final Extension[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public String
public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

public String
dumpSelf()

Overrides default org.eclipse.jetty.util.component.Dumpable.dumpSelf.

The description of this/self found in the dump.

public List<Extension>
public List<ExtensionConfig>

Returns:

list of negotiated extensions
getNegotiatedExtensions
()

Get the list of negotiated extensions, each entry being a full "name; params" extension configuration

public IncomingFrames
public OutgoingFrames
public Extension
public Extension
public Extension
public boolean
public void
initialize(IncomingFrames incoming, OutgoingFrames outgoing, CoreSession coreSession)

public boolean
public boolean
public boolean
public void
negotiate(List<ExtensionConfig>
the configurations being requested by the client
offeredConfigs
,
List<ExtensionConfig>
the configurations accepted by the server
negotiatedConfigs
)

Perform the extension negotiation.

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

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

Process the incoming frame.

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
)

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

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

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

behaviorback to summary
private final Behavior behavior
componentsback to summary
private final WebSocketComponents components
demandChainback to summary
private DemandChain demandChain
extensionsback to summary
private List<Extension> extensions
incomingback to summary
private IncomingFrames incoming
lastDemandback to summary
private DemandChain lastDemand
LOGback to summary
private static final Logger LOG
outgoingback to summary
private OutgoingFrames outgoing
rsvClaimsback to summary
private final Extension[] rsvClaims

Constructor Detail

ExtensionStackback to summary
public ExtensionStack(WebSocketComponents components, Behavior behavior)

Method Detail

closeback to summary
public void close()
demandback to summary
public void demand()
dumpback to summary
public String dump()

Overrides default org.eclipse.jetty.util.component.Dumpable.dump.

Annotations
@Override
dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.

Parameters
out:Appendable

The appendable to dump to

indent:String

The indent to apply after any new lines.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
dumpSelfback to summary
public String dumpSelf()

Overrides default org.eclipse.jetty.util.component.Dumpable.dumpSelf.

Doc from org.eclipse.jetty.util.component.Dumpable.dumpSelf.

The description of this/self found in the dump. Allows for alternative representation of Object other then .toString() where the long form output of toString() is represented in a cleaner way within the dump infrastructure.

Returns:String

the representation of self

Annotations
@Override
getExtensionsback to summary
public List<Extension> getExtensions()
Annotations
@ManagedAttribute
name:Extension List
readonly:true
getNegotiatedExtensionsback to summary
public List<ExtensionConfig> getNegotiatedExtensions()

Get the list of negotiated extensions, each entry being a full "name; params" extension configuration

Returns:List<ExtensionConfig>

list of negotiated extensions

getNextIncomingback to summary
public IncomingFrames getNextIncoming()
Annotations
@ManagedAttribute
name:Next Incoming Frames Handler
readonly:true
getNextOutgoingback to summary
public OutgoingFrames getNextOutgoing()
Annotations
@ManagedAttribute
name:Next Outgoing Frames Handler
readonly:true
getRsv1Userback to summary
public Extension getRsv1User()
getRsv2Userback to summary
public Extension getRsv2User()
getRsv3Userback to summary
public Extension getRsv3User()
hasNegotiatedExtensionsback to summary
public boolean hasNegotiatedExtensions()
initializeback to summary
public void initialize(IncomingFrames incoming, OutgoingFrames outgoing, CoreSession coreSession)
isRsv1Usedback to summary
public boolean isRsv1Used()
isRsv2Usedback to summary
public boolean isRsv2Used()
isRsv3Usedback to summary
public boolean isRsv3Used()
negotiateback to summary
public void negotiate(List<ExtensionConfig> offeredConfigs, List<ExtensionConfig> negotiatedConfigs)

Perform the extension negotiation.

For the list of negotiated extensions, use getNegotiatedExtensions()

Parameters
offeredConfigs:List<ExtensionConfig>

the configurations being requested by the client

negotiatedConfigs:List<ExtensionConfig>

the configurations accepted by the server

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

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
sendFrameback to summary
public void sendFrame(Frame frame, Callback callback, boolean batch)

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
setLastDemandback to summary
public void setLastDemand(DemandChain lastDemand)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override