Class EncodingService
java.lang.Object
com.linecorp.armeria.common.util.AbstractUnwrappable<Service<T_I,T_O>>
com.linecorp.armeria.server.DecoratingService<I,O,I,O>
com.linecorp.armeria.server.SimpleDecoratingService<HttpRequest,HttpResponse>
com.linecorp.armeria.server.SimpleDecoratingHttpService
com.linecorp.armeria.server.encoding.EncodingService
- All Implemented Interfaces:
Unwrappable
,HttpService
,Service<HttpRequest,
HttpResponse>
Decorates an
HttpService
to apply HTTP encoding (e.g., gzip) to an HttpService
.
HTTP encoding will be applied if:
- the client specifies it
- the response content type is encodable
- the request headers are acceptable
- the response either has no fixed content length or the length is larger than 1KB
-
Method Summary
Modifier and TypeMethodDescriptionstatic EncodingServiceBuilder
builder()
Returns a newEncodingServiceBuilder
.exchangeType
(RoutingContext routingContext) static Function<? super HttpService,
EncodingService> Returns a newHttpService
decorator.serve
(ServiceRequestContext ctx, HttpRequest req) Serves an incomingRequest
.Methods inherited from class com.linecorp.armeria.server.DecoratingService
serviceAdded, shouldCachePath
Methods inherited from class com.linecorp.armeria.common.util.AbstractUnwrappable
as, toString, unwrap, unwrapAll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.linecorp.armeria.server.HttpService
decorate, decorate
Methods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, shouldCachePath, unwrap
Methods inherited from interface com.linecorp.armeria.common.util.Unwrappable
equalsIgnoreWrapper, unwrapAll
-
Method Details
-
builder
Returns a newEncodingServiceBuilder
. -
newDecorator
Returns a newHttpService
decorator. -
exchangeType
Description copied from interface:HttpService
Determines anExchangeType
for thisHttpService
from the givenRoutingContext
. By default,ExchangeType.BIDI_STREAMING
is set.Note that an
HttpRequest
will be aggregated before serving theHttpService
ifExchangeType.UNARY
orExchangeType.RESPONSE_STREAMING
is set.- Specified by:
exchangeType
in interfaceHttpService
- Overrides:
exchangeType
in classSimpleDecoratingHttpService
-
serve
Description copied from interface:Service
Serves an incomingRequest
.
-