Package org.eclipse.jetty.http2.hpack
Class HpackEncoder
- java.lang.Object
-
- org.eclipse.jetty.http2.hpack.HpackEncoder
-
public class HpackEncoder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private HpackContext
_context
private boolean
_debug
private int
_headerListSize
private boolean
_maxDynamicTableSizeSent
private int
_maxHeaderListSize
private int
_maxTableCapacity
private int
_tableCapacity
private boolean
_validateEncoding
private static java.util.EnumMap<org.eclipse.jetty.http.HttpMethod,org.eclipse.jetty.http.PreEncodedHttpField>
C_METHODS
private static org.eclipse.jetty.http.PreEncodedHttpField
C_SCHEME_HTTP
private static org.eclipse.jetty.http.PreEncodedHttpField
C_SCHEME_HTTPS
(package private) static java.util.EnumSet<org.eclipse.jetty.http.HttpHeader>
DO_NOT_HUFFMAN
(package private) static java.util.EnumSet<org.eclipse.jetty.http.HttpHeader>
DO_NOT_INDEX
private static java.util.EnumSet<org.eclipse.jetty.http.HttpHeader>
IGNORED_HEADERS
private static org.eclipse.jetty.util.log.Logger
LOG
(package private) static java.util.EnumSet<org.eclipse.jetty.http.HttpHeader>
NEVER_INDEX
private static org.eclipse.jetty.http.HttpField[]
STATUSES
private static org.eclipse.jetty.http.PreEncodedHttpField
TE_TRAILERS
-
Constructor Summary
Constructors Constructor Description HpackEncoder()
HpackEncoder(int localMaxDynamicTableSize)
Deprecated.HpackEncoder(int localMaxDynamicTableSize, int remoteMaxDynamicTableSize)
Deprecated.HpackEncoder(int localMaxDynamicTableSize, int remoteMaxDynamicTableSize, int maxHeaderListSize)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
encode(java.nio.ByteBuffer buffer, org.eclipse.jetty.http.HttpField field)
void
encode(java.nio.ByteBuffer buffer, org.eclipse.jetty.http.MetaData metadata)
void
encodeMaxDynamicTableSize(java.nio.ByteBuffer buffer, int maxTableSize)
private void
encodeName(java.nio.ByteBuffer buffer, byte mask, int bits, java.lang.String name, HpackContext.Entry entry)
(package private) static void
encodeValue(java.nio.ByteBuffer buffer, boolean huffman, java.lang.String value)
HpackContext
getHpackContext()
int
getMaxHeaderListSize()
int
getMaxTableCapacity()
int
getTableCapacity()
boolean
isValidateEncoding()
void
setLocalMaxDynamicTableSize(int maxTableSizeLimit)
Deprecated.void
setMaxHeaderListSize(int maxHeaderListSize)
void
setMaxTableCapacity(int maxTableSizeLimit)
Sets the limit for the capacity of the dynamic header table.void
setRemoteMaxDynamicTableSize(int maxTableSize)
Deprecated.void
setTableCapacity(int tableCapacity)
Sets the capacity of the dynamic header table.void
setValidateEncoding(boolean validateEncoding)
-
-
-
Field Detail
-
LOG
private static final org.eclipse.jetty.util.log.Logger LOG
-
STATUSES
private static final org.eclipse.jetty.http.HttpField[] STATUSES
-
DO_NOT_HUFFMAN
static final java.util.EnumSet<org.eclipse.jetty.http.HttpHeader> DO_NOT_HUFFMAN
-
DO_NOT_INDEX
static final java.util.EnumSet<org.eclipse.jetty.http.HttpHeader> DO_NOT_INDEX
-
NEVER_INDEX
static final java.util.EnumSet<org.eclipse.jetty.http.HttpHeader> NEVER_INDEX
-
IGNORED_HEADERS
private static final java.util.EnumSet<org.eclipse.jetty.http.HttpHeader> IGNORED_HEADERS
-
TE_TRAILERS
private static final org.eclipse.jetty.http.PreEncodedHttpField TE_TRAILERS
-
C_SCHEME_HTTP
private static final org.eclipse.jetty.http.PreEncodedHttpField C_SCHEME_HTTP
-
C_SCHEME_HTTPS
private static final org.eclipse.jetty.http.PreEncodedHttpField C_SCHEME_HTTPS
-
C_METHODS
private static final java.util.EnumMap<org.eclipse.jetty.http.HttpMethod,org.eclipse.jetty.http.PreEncodedHttpField> C_METHODS
-
_context
private final HpackContext _context
-
_debug
private final boolean _debug
-
_maxTableCapacity
private int _maxTableCapacity
-
_tableCapacity
private int _tableCapacity
-
_maxHeaderListSize
private int _maxHeaderListSize
-
_headerListSize
private int _headerListSize
-
_validateEncoding
private boolean _validateEncoding
-
_maxDynamicTableSizeSent
private boolean _maxDynamicTableSizeSent
-
-
Constructor Detail
-
HpackEncoder
@Deprecated public HpackEncoder(int localMaxDynamicTableSize)
Deprecated.
-
HpackEncoder
@Deprecated public HpackEncoder(int localMaxDynamicTableSize, int remoteMaxDynamicTableSize)
Deprecated.
-
HpackEncoder
@Deprecated public HpackEncoder(int localMaxDynamicTableSize, int remoteMaxDynamicTableSize, int maxHeaderListSize)
Deprecated.
-
HpackEncoder
public HpackEncoder()
-
-
Method Detail
-
getMaxTableCapacity
public int getMaxTableCapacity()
-
setMaxTableCapacity
public void setMaxTableCapacity(int maxTableSizeLimit)
Sets the limit for the capacity of the dynamic header table.
This value is set by the remote peer via the
SETTINGS_HEADER_TABLE_SIZE
setting.- Parameters:
maxTableSizeLimit
- the limit for capacity of the dynamic header table
-
getTableCapacity
public int getTableCapacity()
-
setTableCapacity
public void setTableCapacity(int tableCapacity)
Sets the capacity of the dynamic header table.
The value of the capacity may be changed from
0
up togetMaxTableCapacity()
. An HPACK instruction with the new capacity value will be sent to the decoder when the next call toencode(ByteBuffer, MetaData)
is made.- Parameters:
tableCapacity
- the capacity of the dynamic header table
-
getMaxHeaderListSize
public int getMaxHeaderListSize()
-
setMaxHeaderListSize
public void setMaxHeaderListSize(int maxHeaderListSize)
-
getHpackContext
public HpackContext getHpackContext()
-
setRemoteMaxDynamicTableSize
@Deprecated public void setRemoteMaxDynamicTableSize(int maxTableSize)
Deprecated.
-
setLocalMaxDynamicTableSize
@Deprecated public void setLocalMaxDynamicTableSize(int maxTableSizeLimit)
Deprecated.
-
isValidateEncoding
public boolean isValidateEncoding()
-
setValidateEncoding
public void setValidateEncoding(boolean validateEncoding)
-
encode
public void encode(java.nio.ByteBuffer buffer, org.eclipse.jetty.http.MetaData metadata) throws HpackException
- Throws:
HpackException
-
encodeMaxDynamicTableSize
public void encodeMaxDynamicTableSize(java.nio.ByteBuffer buffer, int maxTableSize)
-
encode
public void encode(java.nio.ByteBuffer buffer, org.eclipse.jetty.http.HttpField field)
-
encodeName
private void encodeName(java.nio.ByteBuffer buffer, byte mask, int bits, java.lang.String name, HpackContext.Entry entry)
-
encodeValue
static void encodeValue(java.nio.ByteBuffer buffer, boolean huffman, java.lang.String value)
-
-