Top Description Inners Fields Constructors Methods
io.undertow.server.handlers.encoding

public Class EncodingHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
io.undertow.Handlers, io.undertow.server.HandlerWrapper, .HttpHandler, .HttpServerExchange, io.undertow.server.handlers.ResponseCodeHandler, io.undertow.server.handlers.builder.HandlerBuilder, java.util.Collections, .Map, .Set

Handler that serves as the basis for content encoding implementations.

Encoding handlers are added as delegates to this handler, with a specified server side priority.

If a request comes in with no q value then then server will pick the handler with the highest priority as the encoding to use, otherwise the q value will be used to determine the correct handler.

If no handler matches then the identity encoding is assumed. If the identity encoding has been specifically disallowed due to a q value of 0 then the handler will set the response code 406 (Not Acceptable) and return.

Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final ContentEncodingRepository
private volatile HttpHandler
private volatile HttpHandler

Constructor Summary

AccessConstructor and Description
public
EncodingHandler(final HttpHandler next, ContentEncodingRepository contentEncodingRepository)

public
EncodingHandler(ContentEncodingRepository contentEncodingRepository)

Method Summary

Modifier and TypeMethod and Description
public HttpHandler
public HttpHandler
public void
handleRequest(final HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

public EncodingHandler
setNext(final HttpHandler next)

public EncodingHandler
setNoEncodingHandler(HttpHandler noEncodingHandler)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

contentEncodingRepositoryback to summary
private final ContentEncodingRepository contentEncodingRepository
nextback to summary
private volatile HttpHandler next
noEncodingHandlerback to summary
private volatile HttpHandler noEncodingHandler

Constructor Detail

EncodingHandlerback to summary
public EncodingHandler(final HttpHandler next, ContentEncodingRepository contentEncodingRepository)
EncodingHandlerback to summary
public EncodingHandler(ContentEncodingRepository contentEncodingRepository)

Method Detail

getNextback to summary
public HttpHandler getNext()
getNoEncodingHandlerback to summary
public HttpHandler getNoEncodingHandler()
handleRequestback to summary
public void handleRequest(final HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
setNextback to summary
public EncodingHandler setNext(final HttpHandler next)
setNoEncodingHandlerback to summary
public EncodingHandler setNoEncodingHandler(HttpHandler noEncodingHandler)
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
io.undertow.server.handlers.encoding back to summary

public Class EncodingHandler.Builder

extends Object
implements HandlerBuilder
Class Inheritance
All Implemented Interfaces
io.undertow.server.handlers.builder.HandlerBuilder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public HandlerWrapper
build(Map<String, Object>
The handler config
config
)

Implements io.undertow.server.handlers.builder.HandlerBuilder.build.

Creates the handler

public String
public String
name()

Implements io.undertow.server.handlers.builder.HandlerBuilder.name.

The string representation of the handler name.

public Map<String, Class<?>>
parameters()

Implements io.undertow.server.handlers.builder.HandlerBuilder.parameters.

Returns a map of parameters and their types.

public Set<String>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public HandlerWrapper build(Map<String, Object> config)

Implements io.undertow.server.handlers.builder.HandlerBuilder.build.

Doc from io.undertow.server.handlers.builder.HandlerBuilder.build.

Creates the handler

Parameters
config:Map<String, Object>

The handler config

Returns:HandlerWrapper

The new predicate

Annotations
@Override
defaultParameterback to summary
public String defaultParameter()

Implements io.undertow.server.handlers.builder.HandlerBuilder.defaultParameter.

Returns:String

Doc from io.undertow.server.handlers.builder.HandlerBuilder.defaultParameter.

The default parameter name, or null if it does not have a default parameter

Annotations
@Override
nameback to summary
public String name()

Implements io.undertow.server.handlers.builder.HandlerBuilder.name.

Doc from io.undertow.server.handlers.builder.HandlerBuilder.name.

The string representation of the handler name.

Returns:String

The handler name

Annotations
@Override
parametersback to summary
public Map<String, Class<?>> parameters()

Implements io.undertow.server.handlers.builder.HandlerBuilder.parameters.

Doc from io.undertow.server.handlers.builder.HandlerBuilder.parameters.

Returns a map of parameters and their types.

Annotations
@Override
requiredParametersback to summary
public Set<String> requiredParameters()

Implements io.undertow.server.handlers.builder.HandlerBuilder.requiredParameters.

Returns:Set<String>

Doc from io.undertow.server.handlers.builder.HandlerBuilder.requiredParameters.

The required parameters

Annotations
@Override