Package org.glassfish.grizzly.spdy
Class SpdySession
java.lang.Object
org.glassfish.grizzly.spdy.SpdySession
- Direct Known Subclasses:
SpdySession3,SpdySession31
The SPDY Session abstraction.
- Author:
- oleksiys
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classfinal classfinal class -
Constructor Summary
ConstructorsConstructorDescriptionSpdySession(org.glassfish.grizzly.Connection<?> connection, boolean isServer, SpdyHandlerFilter handlerFilter) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbind(org.glassfish.grizzly.Connection connection, SpdySession spdySession) static SpdySessionget(org.glassfish.grizzly.Connection connection) intorg.glassfish.grizzly.ConnectionintintintReturns the maximum number of concurrent streams allowed for this session by our side.intorg.glassfish.grizzly.memory.MemoryManagerintprotected SessionOutputSinkintReturns the maximum number of concurrent streams allowed for this session by peer.intgetStream(int streamId) abstract SpdyVersionvoidgoAway(int statusCode) If the session is still open - closes it and sends GOAWAY frame to a peer, otherwise if the session was already closed - does nothing.booleanisServer()protected abstract SessionOutputSinkprotected SpdyStreamnewStream(org.glassfish.grizzly.http.HttpRequestPacket spdyRequest, int streamId, int associatedToStreamId, int priority, int slot, boolean isUnidirectional) openStream(org.glassfish.grizzly.http.HttpRequestPacket spdyRequest, int streamId, int associatedToStreamId, int priority, int slot, boolean isUnidirectional, boolean fin) Method is not thread-safe, it is expected that it will be called withingetNewClientStreamLock()lock scope.protected abstract voidsendWindowUpdate(int delta) voidsetDeflaterCompressionLevel(int deflaterCompressionLevel) voidsetLocalConnectionWindowSize(int localConnectionWindowSize) voidsetLocalMaxConcurrentStreams(int localMaxConcurrentStreams) Sets the default maximum number of concurrent streams allowed for this session by our side.voidsetLocalStreamWindowSize(int localStreamWindowSize)
-
Constructor Details
-
SpdySession
public SpdySession(org.glassfish.grizzly.Connection<?> connection, boolean isServer, SpdyHandlerFilter handlerFilter)
-
-
Method Details
-
get
-
bind
-
getVersion
-
newOutputSink
-
sendWindowUpdate
protected abstract void sendWindowUpdate(int delta) -
newStream
protected SpdyStream newStream(org.glassfish.grizzly.http.HttpRequestPacket spdyRequest, int streamId, int associatedToStreamId, int priority, int slot, boolean isUnidirectional) -
getLocalStreamWindowSize
public int getLocalStreamWindowSize() -
setLocalStreamWindowSize
public void setLocalStreamWindowSize(int localStreamWindowSize) -
getPeerStreamWindowSize
public int getPeerStreamWindowSize() -
getLocalConnectionWindowSize
public int getLocalConnectionWindowSize() -
setLocalConnectionWindowSize
public void setLocalConnectionWindowSize(int localConnectionWindowSize) -
getAvailablePeerConnectionWindowSize
public int getAvailablePeerConnectionWindowSize() -
getLocalMaxConcurrentStreams
public int getLocalMaxConcurrentStreams()Returns the maximum number of concurrent streams allowed for this session by our side. -
setLocalMaxConcurrentStreams
public void setLocalMaxConcurrentStreams(int localMaxConcurrentStreams) Sets the default maximum number of concurrent streams allowed for this session by our side. -
getPeerMaxConcurrentStreams
public int getPeerMaxConcurrentStreams()Returns the maximum number of concurrent streams allowed for this session by peer. -
getNextLocalStreamId
public int getNextLocalStreamId() -
getStreamBuilder
-
getConnection
public org.glassfish.grizzly.Connection getConnection() -
getMemoryManager
public org.glassfish.grizzly.memory.MemoryManager getMemoryManager() -
isServer
public boolean isServer() -
getStream
-
getOutputSink
-
goAway
public void goAway(int statusCode) If the session is still open - closes it and sends GOAWAY frame to a peer, otherwise if the session was already closed - does nothing.- Parameters:
statusCode- GOAWAY status code.
-
getDeflaterCompressionLevel
public int getDeflaterCompressionLevel() -
setDeflaterCompressionLevel
public void setDeflaterCompressionLevel(int deflaterCompressionLevel) -
getNewClientStreamLock
-
openStream
public SpdyStream openStream(org.glassfish.grizzly.http.HttpRequestPacket spdyRequest, int streamId, int associatedToStreamId, int priority, int slot, boolean isUnidirectional, boolean fin) throws SpdyStreamException Method is not thread-safe, it is expected that it will be called withingetNewClientStreamLock()lock scope. The caller code is responsible for obtaining and releasing the mentionedgetNewClientStreamLock()lock.- Throws:
SpdyStreamException
-