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>
public final class EncodingService extends SimpleDecoratingHttpService
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 Type Method Description static EncodingServiceBuilder
builder()
Returns a newEncodingServiceBuilder
.static Function<? super HttpService,EncodingService>
newDecorator()
Returns a newHttpService
decorator.HttpResponse
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
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
-
Method Details
-
builder
Returns a newEncodingServiceBuilder
. -
newDecorator
Returns a newHttpService
decorator. -
serve
Description copied from interface:Service
Serves an incomingRequest
.
-