@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/492") public final class DecompressorRegistry extends Object
| Modifier and Type | Method and Description |
|---|---|
static Set<String> |
getAdvertisedMessageEncodings()
Provides a list of all message encodings that have decompressors available and should be
advertised.
|
static Set<String> |
getKnownMessageEncodings()
Provides a list of all message encodings that have decompressors available.
|
static Decompressor |
lookupDecompressor(String messageEncoding)
Returns a decompressor for the given message encoding, or
null if none has been
registered. |
static void |
register(Decompressor d,
boolean advertised)
Registers a decompressor for both decompression and message encoding negotiation.
|
public static void register(Decompressor d, boolean advertised)
d - The decompressor to registeradvertised - If true, the message encoding will be listed in the Accept-Encoding header.IllegalArgumentException - if another compressor by the same name is already registered.public static Set<String> getKnownMessageEncodings()
@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/492") public static Set<String> getAdvertisedMessageEncodings()
@Nullable public static Decompressor lookupDecompressor(String messageEncoding)
null if none has been
registered.
This ignores whether the compressor is advertised. According to the spec, if we know how to process this encoding, we attempt to, regardless of whether or not it is part of the encodings sent to the remote host.