public final class THttpService
extends com.linecorp.armeria.server.AbstractHttpService
Service that handles a Thrift call.ThriftProtocolFactories| Modifier and Type | Method and Description |
|---|---|
Set<com.linecorp.armeria.common.SerializationFormat> |
allowedSerializationFormats()
Returns the allowed serialization formats of this service.
|
com.linecorp.armeria.common.SerializationFormat |
defaultSerializationFormat()
Returns the default serialization format of this service.
|
protected void |
doPost(com.linecorp.armeria.server.ServiceRequestContext ctx,
com.linecorp.armeria.common.HttpRequest req,
com.linecorp.armeria.common.HttpResponseWriter res) |
Map<String,ThriftServiceEntry> |
entries()
Returns the information about the Thrift services being served.
|
static Function<com.linecorp.armeria.server.Service<com.linecorp.armeria.common.RpcRequest,com.linecorp.armeria.common.RpcResponse>,THttpService> |
newDecorator()
Creates a new decorator that supports all thrift protocols and defaults to
TBinary protocol when the client doesn't specify one. |
static Function<com.linecorp.armeria.server.Service<com.linecorp.armeria.common.RpcRequest,com.linecorp.armeria.common.RpcResponse>,THttpService> |
newDecorator(com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat)
Creates a new decorator that supports all thrift protocols and defaults to the specified
defaultSerializationFormat when the client doesn't specify one. |
static Function<com.linecorp.armeria.server.Service<com.linecorp.armeria.common.RpcRequest,com.linecorp.armeria.common.RpcResponse>,THttpService> |
newDecorator(com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat,
Iterable<com.linecorp.armeria.common.SerializationFormat> otherAllowedSerializationFormats)
Creates a new decorator that supports the protocols specified in
allowedSerializationFormats and
defaults to the specified defaultSerializationFormat when the client doesn't specify one. |
static Function<com.linecorp.armeria.server.Service<com.linecorp.armeria.common.RpcRequest,com.linecorp.armeria.common.RpcResponse>,THttpService> |
newDecorator(com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat,
com.linecorp.armeria.common.SerializationFormat... otherAllowedSerializationFormats)
Creates a new decorator that supports only the formats specified and defaults to the specified
defaultSerializationFormat when the client doesn't specify one. |
static THttpService |
of(Map<String,?> implementations)
Creates a new multiplexed
THttpService with the specified service implementations, supporting
all thrift protocols and defaulting to TBinary protocol when
the client doesn't specify one. |
static THttpService |
of(Map<String,?> implementations,
com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat)
Creates a new multiplexed
THttpService with the specified service implementations, supporting
all thrift protocols and defaulting to the specified defaultSerializationFormat when the client
doesn't specify one. |
static THttpService |
of(Object implementation)
Creates a new
THttpService with the specified service implementation, supporting all thrift
protocols and defaulting to TBinary protocol when the client
doesn't specify one. |
static THttpService |
of(Object implementation,
com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat)
Creates a new
THttpService with the specified service implementation, supporting all thrift
protocols and defaulting to the specified defaultSerializationFormat when the client doesn't
specify one. |
static THttpService |
ofFormats(Map<String,?> implementations,
com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat,
Iterable<com.linecorp.armeria.common.SerializationFormat> otherAllowedSerializationFormats)
Creates a new multiplexed
THttpService with the specified service implementations, supporting
the protocols specified in allowedSerializationFormats and defaulting to the specified
defaultSerializationFormat when the client doesn't specify one. |
static THttpService |
ofFormats(Map<String,?> implementations,
com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat,
com.linecorp.armeria.common.SerializationFormat... otherAllowedSerializationFormats)
Creates a new multiplexed
THttpService with the specified service implementations, supporting
only the formats specified and defaulting to the specified defaultSerializationFormat when the
client doesn't specify one. |
static THttpService |
ofFormats(Object implementation,
com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat,
Iterable<com.linecorp.armeria.common.SerializationFormat> otherAllowedSerializationFormats)
Creates a new
THttpService with the specified service implementation, supporting the protocols
specified in allowedSerializationFormats and defaulting to the specified
defaultSerializationFormat when the client doesn't specify one. |
static THttpService |
ofFormats(Object implementation,
com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat,
com.linecorp.armeria.common.SerializationFormat... otherAllowedSerializationFormats)
Creates a new
THttpService with the specified service implementation, supporting only the
formats specified and defaulting to the specified defaultSerializationFormat when the client
doesn't specify one. |
doDelete, doGet, doHead, doOptions, doPatch, doPut, doTrace, servepublic static THttpService of(Object implementation)
THttpService with the specified service implementation, supporting all thrift
protocols and defaulting to TBinary protocol when the client
doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session
protocol and setting the Content-Type header to the appropriate SerializationFormat.mediaType().
implementation - an implementation of *.Iface or *.AsyncIface service interface
generated by the Apache Thrift compilerpublic static THttpService of(Map<String,?> implementations)
THttpService with the specified service implementations, supporting
all thrift protocols and defaulting to TBinary protocol when
the client doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session
protocol and setting the Content-Type header to the appropriate SerializationFormat.mediaType().
implementations - a Map whose key is service name and value is the implementation of
*.Iface or *.AsyncIface service interface generated by
the Apache Thrift compilerpublic static THttpService of(Object implementation, com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat)
THttpService with the specified service implementation, supporting all thrift
protocols and defaulting to the specified defaultSerializationFormat when the client doesn't
specify one.
Currently, the only way to specify a serialization format is by using the HTTP session
protocol and setting the Content-Type header to the appropriate SerializationFormat.mediaType().
implementation - an implementation of *.Iface or *.AsyncIface service interface
generated by the Apache Thrift compilerdefaultSerializationFormat - the default serialization format to use when not specified by the
clientpublic static THttpService of(Map<String,?> implementations, com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat)
THttpService with the specified service implementations, supporting
all thrift protocols and defaulting to the specified defaultSerializationFormat when the client
doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session
protocol and setting the Content-Type header to the appropriate SerializationFormat.mediaType().
implementations - a Map whose key is service name and value is the implementation of
*.Iface or *.AsyncIface service interface generated by
the Apache Thrift compilerdefaultSerializationFormat - the default serialization format to use when not specified by the
clientpublic static THttpService ofFormats(Object implementation, com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat, com.linecorp.armeria.common.SerializationFormat... otherAllowedSerializationFormats)
THttpService with the specified service implementation, supporting only the
formats specified and defaulting to the specified defaultSerializationFormat when the client
doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session protocol and
setting the Content-Type header to the appropriate SerializationFormat.mediaType().
implementation - an implementation of *.Iface or *.AsyncIface service interface
generated by the Apache Thrift compilerdefaultSerializationFormat - the default serialization format to use when not specified by the
clientotherAllowedSerializationFormats - other serialization formats that should be supported by this
service in addition to the defaultpublic static THttpService ofFormats(Map<String,?> implementations, com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat, com.linecorp.armeria.common.SerializationFormat... otherAllowedSerializationFormats)
THttpService with the specified service implementations, supporting
only the formats specified and defaulting to the specified defaultSerializationFormat when the
client doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session protocol and
setting the Content-Type header to the appropriate SerializationFormat.mediaType().
implementations - a Map whose key is service name and value is the implementation of
*.Iface or *.AsyncIface service interface generated by
the Apache Thrift compilerdefaultSerializationFormat - the default serialization format to use when not specified by the
clientotherAllowedSerializationFormats - other serialization formats that should be supported by this
service in addition to the defaultpublic static THttpService ofFormats(Object implementation, com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat, Iterable<com.linecorp.armeria.common.SerializationFormat> otherAllowedSerializationFormats)
THttpService with the specified service implementation, supporting the protocols
specified in allowedSerializationFormats and defaulting to the specified
defaultSerializationFormat when the client doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session protocol and
setting the Content-Type header to the appropriate SerializationFormat.mediaType().
implementation - an implementation of *.Iface or *.AsyncIface service interface
generated by the Apache Thrift compilerdefaultSerializationFormat - the default serialization format to use when not specified by the
clientotherAllowedSerializationFormats - other serialization formats that should be supported by this
service in addition to the defaultpublic static THttpService ofFormats(Map<String,?> implementations, com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat, Iterable<com.linecorp.armeria.common.SerializationFormat> otherAllowedSerializationFormats)
THttpService with the specified service implementations, supporting
the protocols specified in allowedSerializationFormats and defaulting to the specified
defaultSerializationFormat when the client doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session protocol and
setting the Content-Type header to the appropriate SerializationFormat.mediaType().
implementations - a Map whose key is service name and value is the implementation of
*.Iface or *.AsyncIface service interface generated by
the Apache Thrift compilerdefaultSerializationFormat - the default serialization format to use when not specified by the
clientotherAllowedSerializationFormats - other serialization formats that should be supported by this
service in addition to the defaultpublic static Function<com.linecorp.armeria.server.Service<com.linecorp.armeria.common.RpcRequest,com.linecorp.armeria.common.RpcResponse>,THttpService> newDecorator()
TBinary protocol when the client doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session
protocol and setting the Content-Type header to the appropriate SerializationFormat.mediaType().
public static Function<com.linecorp.armeria.server.Service<com.linecorp.armeria.common.RpcRequest,com.linecorp.armeria.common.RpcResponse>,THttpService> newDecorator(com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat)
defaultSerializationFormat when the client doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session
protocol and setting the Content-Type header to the appropriate SerializationFormat.mediaType().defaultSerializationFormat - the default serialization format to use when not specified by the
clientpublic static Function<com.linecorp.armeria.server.Service<com.linecorp.armeria.common.RpcRequest,com.linecorp.armeria.common.RpcResponse>,THttpService> newDecorator(com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat, com.linecorp.armeria.common.SerializationFormat... otherAllowedSerializationFormats)
defaultSerializationFormat when the client doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session protocol and
setting the Content-Type header to the appropriate SerializationFormat.mediaType().defaultSerializationFormat - the default serialization format to use when not specified by the
clientotherAllowedSerializationFormats - other serialization formats that should be supported by this
service in addition to the defaultpublic static Function<com.linecorp.armeria.server.Service<com.linecorp.armeria.common.RpcRequest,com.linecorp.armeria.common.RpcResponse>,THttpService> newDecorator(com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat, Iterable<com.linecorp.armeria.common.SerializationFormat> otherAllowedSerializationFormats)
allowedSerializationFormats and
defaults to the specified defaultSerializationFormat when the client doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session protocol and
setting the Content-Type header to the appropriate SerializationFormat.mediaType().defaultSerializationFormat - the default serialization format to use when not specified by the
clientotherAllowedSerializationFormats - other serialization formats that should be supported by this
service in addition to the defaultpublic Map<String,ThriftServiceEntry> entries()
Map whose key is a service name, which could be an empty string if this service
is not multiplexedpublic Set<com.linecorp.armeria.common.SerializationFormat> allowedSerializationFormats()
public com.linecorp.armeria.common.SerializationFormat defaultSerializationFormat()
protected void doPost(com.linecorp.armeria.server.ServiceRequestContext ctx,
com.linecorp.armeria.common.HttpRequest req,
com.linecorp.armeria.common.HttpResponseWriter res)
doPost in class com.linecorp.armeria.server.AbstractHttpService© Copyright 2015–2017 LINE Corporation. All rights reserved.