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 EncodingServiceBuilderbuilder()Returns a newEncodingServiceBuilder.exchangeType(RoutingContext routingContext) static Function<? super HttpService,EncodingService> Returns a newHttpServicedecorator.serve(ServiceRequestContext ctx, HttpRequest req) Serves an incomingRequest.Methods inherited from class com.linecorp.armeria.server.DecoratingService
serviceAdded, shouldCachePathMethods inherited from class com.linecorp.armeria.common.util.AbstractUnwrappable
as, toString, unwrap, unwrapAllMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.linecorp.armeria.server.HttpService
decorate, decorateMethods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, shouldCachePath, unwrapMethods inherited from interface com.linecorp.armeria.common.util.Unwrappable
equalsIgnoreWrapper, unwrapAll
-
Method Details
-
builder
Returns a newEncodingServiceBuilder. -
newDecorator
Returns a newHttpServicedecorator. -
exchangeType
Description copied from interface:HttpServiceDetermines anExchangeTypefor thisHttpServicefrom the givenRoutingContext. By default,ExchangeType.BIDI_STREAMINGis set.Note that an
HttpRequestwill be aggregated before serving theHttpServiceifExchangeType.UNARYorExchangeType.RESPONSE_STREAMINGis set.- Specified by:
exchangeTypein interfaceHttpService- Overrides:
exchangeTypein classSimpleDecoratingHttpService
-
serve
Description copied from interface:ServiceServes an incomingRequest.
-