Package org.glassfish.grizzly.http2
Class Http2ServerFilter
java.lang.Object
org.glassfish.grizzly.filterchain.BaseFilter
org.glassfish.grizzly.http.HttpBaseFilter
org.glassfish.grizzly.http2.Http2BaseFilter
org.glassfish.grizzly.http2.Http2ServerFilter
- All Implemented Interfaces:
Filter
- Author:
- oleksiys
-
Field Summary
Fields inherited from class org.glassfish.grizzly.http2.Http2BaseFilter
FIXED_LENGTH_ENCODING, threadPool
-
Constructor Summary
ConstructorDescriptionHttp2ServerFilter
(Http2Configuration configuration) Create a newHttp2ServerFilter
using the specifiedHttp2Configuration
. -
Method Summary
Modifier and TypeMethodDescriptionExecute a unit of processing work to be performed, when server channel has accepted the client connection.Execute a unit of processing work to be performed, when connection has been closed.handleEvent
(FilterChainContext ctx, FilterChainEvent event) Handle custom event associated with theConnection
.Execute a unit of processing work to be performed, when channel will become available for reading.boolean
The flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload.protected void
onHttpHeadersParsed
(HttpHeader httpHeader, FilterChainContext ctx) protected void
onPrefaceReceived
(Http2Session http2Session) protected void
processCompleteHeader
(Http2Session http2Session, FilterChainContext context, HeaderBlockHead firstHeaderFrame) The method is called once complete HTTP header block arrives onHttp2Session
.protected void
processOutgoingHttpHeader
(FilterChainContext ctx, Http2Session http2Session, HttpHeader httpHeader, HttpPacket entireHttpPacket) void
setAllowPayloadForUndefinedHttpMethods
(boolean allowPayloadForUndefinedHttpMethods) The flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload.Methods inherited from class org.glassfish.grizzly.http2.Http2BaseFilter
checkRequestHeadersOnUpgrade, checkResponseHeadersOnUpgrade, createHttp2Session, getConfiguration, getHttp2UpgradeSettings, getLocalMaxFramePayloadSize, handleWrite, ignoreFrameForStreamId, isHttp2UpgradingVersion, obtainHttp2Session, onHttpContentEncoded, onHttpContentError, onHttpContentParsed, onHttpHeaderError, onHttpHeaderParsed, onHttpHeadersEncoded, onHttpPacketParsed, onInitialLineEncoded, onInitialLineParsed, prepareOutgoingRequest, processFrames, setLocalMaxFramePayloadSize
Methods inherited from class org.glassfish.grizzly.http.HttpBaseFilter
bind
Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, handleConnect, onAdded, onFilterChainChanged, onRemoved, toString
-
Constructor Details
-
Http2ServerFilter
Create a newHttp2ServerFilter
using the specifiedHttp2Configuration
. Configuration may be changed post-construction by callingHttp2BaseFilter.getConfiguration()
.
-
-
Method Details
-
isAllowPayloadForUndefinedHttpMethods
public boolean isAllowPayloadForUndefinedHttpMethods()The flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload.Known "undefined" methods are: GET, HEAD, DELETE.
- Returns:
- true if "undefined" methods support payload, or false otherwise
-
setAllowPayloadForUndefinedHttpMethods
public void setAllowPayloadForUndefinedHttpMethods(boolean allowPayloadForUndefinedHttpMethods) The flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload.Known "undefined" methods are: GET, HEAD, DELETE.
- Parameters:
allowPayloadForUndefinedHttpMethods
- true if "undefined" methods support payload, or false otherwise
-
handleAccept
Description copied from class:BaseFilter
Execute a unit of processing work to be performed, when server channel has accepted the client connection. ThisFilter
may either complete the required processing and return false, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returning true.- Specified by:
handleAccept
in interfaceFilter
- Overrides:
handleAccept
in classBaseFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
handleClose
Description copied from class:BaseFilter
Execute a unit of processing work to be performed, when connection has been closed. ThisFilter
may either complete the required processing and return false, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returning true.- Specified by:
handleClose
in interfaceFilter
- Overrides:
handleClose
in classBaseFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
handleRead
Description copied from class:BaseFilter
Execute a unit of processing work to be performed, when channel will become available for reading. ThisFilter
may either complete the required processing and return false, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returning true.- Specified by:
handleRead
in interfaceFilter
- Overrides:
handleRead
in classBaseFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
handleEvent
Description copied from class:BaseFilter
Handle custom event associated with theConnection
. ThisFilter
may either complete the required processing and returnStopAction
, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returningInvokeAction
.- Specified by:
handleEvent
in interfaceFilter
- Overrides:
handleEvent
in classHttp2BaseFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
onPrefaceReceived
- Overrides:
onPrefaceReceived
in classHttp2BaseFilter
-
processCompleteHeader
protected void processCompleteHeader(Http2Session http2Session, FilterChainContext context, HeaderBlockHead firstHeaderFrame) throws IOException Description copied from class:Http2BaseFilter
The method is called once complete HTTP header block arrives onHttp2Session
.- Specified by:
processCompleteHeader
in classHttp2BaseFilter
- Parameters:
http2Session
- theHttp2Session
associated with this header.context
- the currentFilterChainContext
firstHeaderFrame
- the firstHeaderBlockHead
from the firstHeadersFrame
received.- Throws:
IOException
- if an error occurs when dealing with the event.
-
onHttpHeadersParsed
- Overrides:
onHttpHeadersParsed
in classHttp2BaseFilter
-
processOutgoingHttpHeader
protected void processOutgoingHttpHeader(FilterChainContext ctx, Http2Session http2Session, HttpHeader httpHeader, HttpPacket entireHttpPacket) throws IOException - Specified by:
processOutgoingHttpHeader
in classHttp2BaseFilter
- Parameters:
ctx
- the currentFilterChainContext
http2Session
- theHttp2Session
associated with thisHttpHeader
httpHeader
- the out-goingHttpHeader
entireHttpPacket
- the completeHttpPacket
- Throws:
IOException
- if an error occurs sending the packet
-