/** * Creates a new decorator that supports the protocols specified in {@code allowedSerializationFormats} and * defaults to the specified {@code 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 {@link SerializationFormat#mediaType()}. * * @param defaultSerializationFormat the default serialization format to use when not specified by the * client * @param otherAllowedSerializationFormats other serialization formats that should be supported by this * service in addition to the default */ public static Function<Service<RpcRequest, RpcResponse>, THttpService> newDecorator( SerializationFormat defaultSerializationFormat, Iterable<SerializationFormat> otherAllowedSerializationFormats) { final SerializationFormat[] allowedSerializationFormatArray = newAllowedSerializationFormats( defaultSerializationFormat, otherAllowedSerializationFormats); return delegate -> new THttpService(delegate, allowedSerializationFormatArray); }
/** * Creates a new decorator that supports all thrift protocols and defaults to the specified * {@code 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 {@link SerializationFormat#mediaType()}. * * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static Function<Service<RpcRequest, RpcResponse>, THttpService> newDecorator( SerializationFormat defaultSerializationFormat) { final SerializationFormat[] allowedSerializationFormatArray = newAllowedSerializationFormats( defaultSerializationFormat, ThriftSerializationFormats.values()); return delegate -> new THttpService(delegate, allowedSerializationFormatArray); }
/** * Creates a new multiplexed {@link THttpService} with the specified service implementations, supporting * the protocols specified in {@code allowedSerializationFormats} and defaulting to the specified * {@code defaultSerializationFormat} when the client doesn't specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * @param implementations a {@link Map} whose key is service name and value is the implementation of * {@code *.Iface} or {@code *.AsyncIface} service interface generated by * the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client * @param otherAllowedSerializationFormats other serialization formats that should be supported by this * service in addition to the default */ public static THttpService ofFormats( Map<String, ?> implementations, SerializationFormat defaultSerializationFormat, Iterable<SerializationFormat> otherAllowedSerializationFormats) { return new THttpService(ThriftCallService.of(implementations), newAllowedSerializationFormats(defaultSerializationFormat, otherAllowedSerializationFormats)); }
/** * Creates a new {@link THttpService} with the specified service implementation, supporting the protocols * specified in {@code allowedSerializationFormats} and defaulting to the specified * {@code defaultSerializationFormat} when the client doesn't specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * @param implementation an implementation of {@code *.Iface} or {@code *.AsyncIface} service interface * generated by the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client * @param otherAllowedSerializationFormats other serialization formats that should be supported by this * service in addition to the default */ public static THttpService ofFormats( Object implementation, SerializationFormat defaultSerializationFormat, Iterable<SerializationFormat> otherAllowedSerializationFormats) { return new THttpService(ThriftCallService.of(implementation), newAllowedSerializationFormats(defaultSerializationFormat, otherAllowedSerializationFormats)); }
/** * Creates a new multiplexed {@link THttpService} with the specified service implementations, supporting * all thrift protocols and defaulting to the specified {@code defaultSerializationFormat} when the client * doesn't specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * * @param implementations a {@link Map} whose key is service name and value is the implementation of * {@code *.Iface} or {@code *.AsyncIface} service interface generated by * the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static THttpService of(Map<String, ?> implementations, SerializationFormat defaultSerializationFormat) { return new THttpService(ThriftCallService.of(implementations), newAllowedSerializationFormats(defaultSerializationFormat, ThriftSerializationFormats.values())); }
/** * Creates a new {@link THttpService} with the specified service implementation, supporting all thrift * protocols and defaulting to the specified {@code defaultSerializationFormat} when the client doesn't * specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * * @param implementation an implementation of {@code *.Iface} or {@code *.AsyncIface} service interface * generated by the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static THttpService of(Object implementation, SerializationFormat defaultSerializationFormat) { return new THttpService(ThriftCallService.of(implementation), newAllowedSerializationFormats(defaultSerializationFormat, ThriftSerializationFormats.values())); }
/** * Creates a new decorator that supports the protocols specified in {@code allowedSerializationFormats} and * defaults to the specified {@code 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 {@link SerializationFormat#mediaType()}. * * @param defaultSerializationFormat the default serialization format to use when not specified by the * client * @param otherAllowedSerializationFormats other serialization formats that should be supported by this * service in addition to the default */ public static Function<Service<RpcRequest, RpcResponse>, THttpService> newDecorator( SerializationFormat defaultSerializationFormat, Iterable<SerializationFormat> otherAllowedSerializationFormats) { final SerializationFormat[] allowedSerializationFormatArray = newAllowedSerializationFormats( defaultSerializationFormat, otherAllowedSerializationFormats); return delegate -> new THttpService(delegate, allowedSerializationFormatArray); }
/** * Creates a new decorator that supports the protocols specified in {@code allowedSerializationFormats} and * defaults to the specified {@code 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 {@link SerializationFormat#mediaType()}. * * @param defaultSerializationFormat the default serialization format to use when not specified by the * client * @param otherAllowedSerializationFormats other serialization formats that should be supported by this * service in addition to the default */ public static Function<Service<RpcRequest, RpcResponse>, THttpService> newDecorator( SerializationFormat defaultSerializationFormat, Iterable<SerializationFormat> otherAllowedSerializationFormats) { final SerializationFormat[] allowedSerializationFormatArray = newAllowedSerializationFormats( defaultSerializationFormat, otherAllowedSerializationFormats); return delegate -> new THttpService(delegate, allowedSerializationFormatArray); }
/** * Creates a new decorator that supports the protocols specified in {@code allowedSerializationFormats} and * defaults to the specified {@code 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 {@link SerializationFormat#mediaType()}. * * @param defaultSerializationFormat the default serialization format to use when not specified by the * client * @param otherAllowedSerializationFormats other serialization formats that should be supported by this * service in addition to the default */ public static Function<Service<RpcRequest, RpcResponse>, THttpService> newDecorator( SerializationFormat defaultSerializationFormat, Iterable<SerializationFormat> otherAllowedSerializationFormats) { final SerializationFormat[] allowedSerializationFormatArray = newAllowedSerializationFormats( defaultSerializationFormat, otherAllowedSerializationFormats); return delegate -> new THttpService(delegate, allowedSerializationFormatArray); }
/** * Creates a new decorator that supports all thrift protocols and defaults to the specified * {@code 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 {@link SerializationFormat#mediaType()}. * * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static Function<Service<RpcRequest, RpcResponse>, THttpService> newDecorator( SerializationFormat defaultSerializationFormat) { final SerializationFormat[] allowedSerializationFormatArray = newAllowedSerializationFormats( defaultSerializationFormat, ThriftSerializationFormats.values()); return delegate -> new THttpService(delegate, allowedSerializationFormatArray); }
/** * Creates a new decorator that supports all thrift protocols and defaults to the specified * {@code 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 {@link SerializationFormat#mediaType()}. * * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static Function<Service<RpcRequest, RpcResponse>, THttpService> newDecorator( SerializationFormat defaultSerializationFormat) { final SerializationFormat[] allowedSerializationFormatArray = newAllowedSerializationFormats( defaultSerializationFormat, ThriftSerializationFormats.values()); return delegate -> new THttpService(delegate, allowedSerializationFormatArray); }
/** * Creates a new decorator that supports all thrift protocols and defaults to the specified * {@code 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 {@link SerializationFormat#mediaType()}. * * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static Function<Service<RpcRequest, RpcResponse>, THttpService> newDecorator( SerializationFormat defaultSerializationFormat) { final SerializationFormat[] allowedSerializationFormatArray = newAllowedSerializationFormats( defaultSerializationFormat, ThriftSerializationFormats.values()); return delegate -> new THttpService(delegate, allowedSerializationFormatArray); }
/** * Creates a new {@link THttpService} with the specified service implementation, supporting the protocols * specified in {@code allowedSerializationFormats} and defaulting to the specified * {@code defaultSerializationFormat} when the client doesn't specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * @param implementation an implementation of {@code *.Iface} or {@code *.AsyncIface} service interface * generated by the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client * @param otherAllowedSerializationFormats other serialization formats that should be supported by this * service in addition to the default */ public static THttpService ofFormats( Object implementation, SerializationFormat defaultSerializationFormat, Iterable<SerializationFormat> otherAllowedSerializationFormats) { return new THttpService(ThriftCallService.of(implementation), newAllowedSerializationFormats(defaultSerializationFormat, otherAllowedSerializationFormats)); }
/** * Creates a new {@link THttpService} with the specified service implementation, supporting the protocols * specified in {@code allowedSerializationFormats} and defaulting to the specified * {@code defaultSerializationFormat} when the client doesn't specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * @param implementation an implementation of {@code *.Iface} or {@code *.AsyncIface} service interface * generated by the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client * @param otherAllowedSerializationFormats other serialization formats that should be supported by this * service in addition to the default */ public static THttpService ofFormats( Object implementation, SerializationFormat defaultSerializationFormat, Iterable<SerializationFormat> otherAllowedSerializationFormats) { return new THttpService(ThriftCallService.of(implementation), newAllowedSerializationFormats(defaultSerializationFormat, otherAllowedSerializationFormats)); }
/** * Creates a new {@link THttpService} with the specified service implementation, supporting all thrift * protocols and defaulting to the specified {@code defaultSerializationFormat} when the client doesn't * specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * * @param implementation an implementation of {@code *.Iface} or {@code *.AsyncIface} service interface * generated by the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static THttpService of(Object implementation, SerializationFormat defaultSerializationFormat) { return new THttpService(ThriftCallService.of(implementation), newAllowedSerializationFormats(defaultSerializationFormat, ThriftSerializationFormats.values())); }
/** * Creates a new {@link THttpService} with the specified service implementation, supporting all thrift * protocols and defaulting to the specified {@code defaultSerializationFormat} when the client doesn't * specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * * @param implementation an implementation of {@code *.Iface} or {@code *.AsyncIface} service interface * generated by the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static THttpService of(Object implementation, SerializationFormat defaultSerializationFormat) { return new THttpService(ThriftCallService.of(implementation), newAllowedSerializationFormats(defaultSerializationFormat, ThriftSerializationFormats.values())); }
/** * Creates a new multiplexed {@link THttpService} with the specified service implementations, supporting * all thrift protocols and defaulting to the specified {@code defaultSerializationFormat} when the client * doesn't specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * * @param implementations a {@link Map} whose key is service name and value is the implementation of * {@code *.Iface} or {@code *.AsyncIface} service interface generated by * the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static THttpService of(Map<String, ?> implementations, SerializationFormat defaultSerializationFormat) { return new THttpService(ThriftCallService.of(implementations), newAllowedSerializationFormats(defaultSerializationFormat, ThriftSerializationFormats.values())); }
/** * Creates a new multiplexed {@link THttpService} with the specified service implementations, supporting * all thrift protocols and defaulting to the specified {@code defaultSerializationFormat} when the client * doesn't specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * * @param implementations a {@link Map} whose key is service name and value is the implementation of * {@code *.Iface} or {@code *.AsyncIface} service interface generated by * the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static THttpService of(Map<String, ?> implementations, SerializationFormat defaultSerializationFormat) { return new THttpService(ThriftCallService.of(implementations), newAllowedSerializationFormats(defaultSerializationFormat, ThriftSerializationFormats.values())); }
/** * Creates a new {@link THttpService} with the specified service implementation, supporting all thrift * protocols and defaulting to the specified {@code defaultSerializationFormat} when the client doesn't * specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * * @param implementation an implementation of {@code *.Iface} or {@code *.AsyncIface} service interface * generated by the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static THttpService of(Object implementation, SerializationFormat defaultSerializationFormat) { return new THttpService(ThriftCallService.of(implementation), newAllowedSerializationFormats(defaultSerializationFormat, ThriftSerializationFormats.values())); }
/** * Creates a new multiplexed {@link THttpService} with the specified service implementations, supporting * all thrift protocols and defaulting to the specified {@code defaultSerializationFormat} when the client * doesn't specify one. * * <p>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 {@link SerializationFormat#mediaType()}. * * * @param implementations a {@link Map} whose key is service name and value is the implementation of * {@code *.Iface} or {@code *.AsyncIface} service interface generated by * the Apache Thrift compiler * @param defaultSerializationFormat the default serialization format to use when not specified by the * client */ public static THttpService of(Map<String, ?> implementations, SerializationFormat defaultSerializationFormat) { return new THttpService(ThriftCallService.of(implementations), newAllowedSerializationFormats(defaultSerializationFormat, ThriftSerializationFormats.values())); }