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
ConstructorsConstructorDescriptionHttp2ServerFilter(Http2Configuration configuration) Create a newHttp2ServerFilterusing 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.booleanThe flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload.protected voidonHttpHeadersParsed(HttpHeader httpHeader, FilterChainContext ctx) protected voidonPrefaceReceived(Http2Session http2Session) protected voidprocessCompleteHeader(Http2Session http2Session, FilterChainContext context, HeaderBlockHead firstHeaderFrame) The method is called once complete HTTP header block arrives onHttp2Session.protected voidprocessOutgoingHttpHeader(FilterChainContext ctx, Http2Session http2Session, HttpHeader httpHeader, HttpPacket entireHttpPacket) voidsetAllowPayloadForUndefinedHttpMethods(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, setLocalMaxFramePayloadSizeMethods inherited from class org.glassfish.grizzly.http.HttpBaseFilter
bindMethods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, handleConnect, onAdded, onFilterChainChanged, onRemoved, toString
-
Constructor Details
-
Http2ServerFilter
Create a newHttp2ServerFilterusing 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:BaseFilterExecute a unit of processing work to be performed, when server channel has accepted the client connection. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleAcceptin interfaceFilter- Overrides:
handleAcceptin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleClose
Description copied from class:BaseFilterExecute a unit of processing work to be performed, when connection has been closed. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleClosein interfaceFilter- Overrides:
handleClosein classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleRead
Description copied from class:BaseFilterExecute a unit of processing work to be performed, when channel will become available for reading. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleReadin interfaceFilter- Overrides:
handleReadin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleEvent
Description copied from class:BaseFilterHandle custom event associated with theConnection. ThisFiltermay either complete the required processing and returnStopAction, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returningInvokeAction.- Specified by:
handleEventin interfaceFilter- Overrides:
handleEventin classHttp2BaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
onPrefaceReceived
- Overrides:
onPrefaceReceivedin classHttp2BaseFilter
-
processCompleteHeader
protected void processCompleteHeader(Http2Session http2Session, FilterChainContext context, HeaderBlockHead firstHeaderFrame) throws IOException Description copied from class:Http2BaseFilterThe method is called once complete HTTP header block arrives onHttp2Session.- Specified by:
processCompleteHeaderin classHttp2BaseFilter- Parameters:
http2Session- theHttp2Sessionassociated with this header.context- the currentFilterChainContextfirstHeaderFrame- the firstHeaderBlockHeadfrom the firstHeadersFramereceived.- Throws:
IOException- if an error occurs when dealing with the event.
-
onHttpHeadersParsed
- Overrides:
onHttpHeadersParsedin classHttp2BaseFilter
-
processOutgoingHttpHeader
protected void processOutgoingHttpHeader(FilterChainContext ctx, Http2Session http2Session, HttpHeader httpHeader, HttpPacket entireHttpPacket) throws IOException - Specified by:
processOutgoingHttpHeaderin classHttp2BaseFilter- Parameters:
ctx- the currentFilterChainContexthttp2Session- theHttp2Sessionassociated with thisHttpHeaderhttpHeader- the out-goingHttpHeaderentireHttpPacket- the completeHttpPacket- Throws:
IOException- if an error occurs sending the packet
-