Top Description Inners Fields Constructors Methods
io.grpc

public final Class DecompressorRegistry

extends Object
Class Inheritance
Annotations
@ExperimentalApi:https://github.com/grpc/grpc-java/issues/1704
@ThreadSafe
Static Imports
com.google.common.base.Preconditions.checkArgument, .Preconditions.checkNotNull

Encloses classes related to the compression and decompression of messages.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
DecompressorRegistry.DecompressorInfo

Information about a decompressor.

Field Summary

Modifier and TypeField and Description
pack-priv static final Joiner
private final byte[]
private final Map<String, DecompressorRegistry.DecompressorInfo>
private static final DecompressorRegistry

Constructor Summary

AccessConstructor and Description
private
private

Method Summary

Modifier and TypeMethod and Description
public static DecompressorRegistry
public Set<String>
getAdvertisedMessageEncodings()

Provides a list of all message encodings that have decompressors available and should be advertised.

public static DecompressorRegistry
public Set<String>
getKnownMessageEncodings()

Provides a list of all message encodings that have decompressors available.

pack-priv byte[]
public Decompressor
lookupDecompressor(String messageEncoding)

Returns a decompressor for the given message encoding, or null if none has been registered.

public DecompressorRegistry
with(Decompressor
The decompressor to register
d
,
boolean
If true, the message encoding will be listed in the Accept-Encoding header.
advertised
)

Registers a decompressor for both decompression and message encoding negotiation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ACCEPT_ENCODING_JOINERback to summary
pack-priv static final Joiner ACCEPT_ENCODING_JOINER
advertisedDecompressorsback to summary
private final byte[] advertisedDecompressors
decompressorsback to summary
private final Map<String, DecompressorRegistry.DecompressorInfo> decompressors
DEFAULT_INSTANCEback to summary
private static final DecompressorRegistry DEFAULT_INSTANCE

Constructor Detail

DecompressorRegistryback to summary
private DecompressorRegistry(Decompressor d, boolean advertised, DecompressorRegistry parent)
DecompressorRegistryback to summary
private DecompressorRegistry()

Method Detail

emptyInstanceback to summary
public static DecompressorRegistry emptyInstance()
getAdvertisedMessageEncodingsback to summary
public Set<String> getAdvertisedMessageEncodings()

Provides a list of all message encodings that have decompressors available and should be advertised.

The specification doesn't say anything about ordering, or preference, so the returned codes can be arbitrary.

Annotations
@ExperimentalApi:https://github.com/grpc/grpc-java/issues/1704
getDefaultInstanceback to summary
public static DecompressorRegistry getDefaultInstance()
getKnownMessageEncodingsback to summary
public Set<String> getKnownMessageEncodings()

Provides a list of all message encodings that have decompressors available.

getRawAdvertisedMessageEncodingsback to summary
pack-priv byte[] getRawAdvertisedMessageEncodings()
lookupDecompressorback to summary
public Decompressor lookupDecompressor(String messageEncoding)

Returns a decompressor for the given message encoding, or 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.

Annotations
@Nullable
withback to summary
public DecompressorRegistry with(Decompressor d, boolean advertised)

Registers a decompressor for both decompression and message encoding negotiation. Returns a new registry.

Parameters
d:Decompressor

The decompressor to register

advertised:boolean

If true, the message encoding will be listed in the Accept-Encoding header.

io.grpc back to summary

private final Class DecompressorRegistry.DecompressorInfo

extends Object
Class Inheritance

Information about a decompressor.

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
pack-priv final Decompressor

Constructor Summary

AccessConstructor and Description
pack-priv
DecompressorInfo(Decompressor decompressor, boolean advertised)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

advertisedback to summary
pack-priv final boolean advertised
decompressorback to summary
pack-priv final Decompressor decompressor

Constructor Detail

DecompressorInfoback to summary
pack-priv DecompressorInfo(Decompressor decompressor, boolean advertised)