Class GzipHttpOutputInterceptor
java.lang.Object
org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor
- All Implemented Interfaces:
HttpOutput.Interceptor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBufferprivate final intprivate final HttpChannelprivate final CRC32private Deflaterprivate final GzipFactoryprivate final HttpOutput.Interceptorprivate final AtomicReference<GzipHttpOutputInterceptor.GZState> private final booleanprivate final HttpFieldprivate static final byte[]static Loggerstatic final HttpFieldstatic final HttpField -
Constructor Summary
ConstructorsConstructorDescriptionGzipHttpOutputInterceptor(GzipFactory factory, HttpField vary, int bufferSize, HttpChannel channel, HttpOutput.Interceptor next, boolean syncFlush) GzipHttpOutputInterceptor(GzipFactory factory, HttpField vary, HttpChannel channel, HttpOutput.Interceptor next, boolean syncFlush) GzipHttpOutputInterceptor(GzipFactory factory, HttpChannel channel, HttpOutput.Interceptor next, boolean syncFlush) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprotected voidcommit(ByteBuffer content, boolean complete, Callback callback) private Stringprivate voidgzip(ByteBuffer content, boolean complete, Callback callback) booleanbooleanvoidvoidvoidwrite(ByteBuffer content, boolean complete, Callback callback) Write content.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jetty.server.HttpOutput.Interceptor
resetBuffer
-
Field Details
-
LOG
-
GZIP_HEADER
private static final byte[] GZIP_HEADER -
VARY_ACCEPT_ENCODING_USER_AGENT
-
VARY_ACCEPT_ENCODING
-
_state
-
_crc
-
_factory
-
_interceptor
-
_channel
-
_vary
-
_bufferSize
private final int _bufferSize -
_syncFlush
private final boolean _syncFlush -
_deflater
-
_buffer
-
-
Constructor Details
-
GzipHttpOutputInterceptor
public GzipHttpOutputInterceptor(GzipFactory factory, HttpChannel channel, HttpOutput.Interceptor next, boolean syncFlush) -
GzipHttpOutputInterceptor
public GzipHttpOutputInterceptor(GzipFactory factory, HttpField vary, HttpChannel channel, HttpOutput.Interceptor next, boolean syncFlush) -
GzipHttpOutputInterceptor
public GzipHttpOutputInterceptor(GzipFactory factory, HttpField vary, int bufferSize, HttpChannel channel, HttpOutput.Interceptor next, boolean syncFlush)
-
-
Method Details
-
getNextInterceptor
- Specified by:
getNextInterceptorin interfaceHttpOutput.Interceptor- Returns:
- The next Interceptor in the chain or null if this is the last Interceptor in the chain.
-
isOptimizedForDirectBuffers
public boolean isOptimizedForDirectBuffers()- Specified by:
isOptimizedForDirectBuffersin interfaceHttpOutput.Interceptor- Returns:
- True if the Interceptor is optimized to receive direct
ByteBuffers in theHttpOutput.Interceptor.write(ByteBuffer, boolean, Callback)method. If false is returned, then passing direct buffers may cause inefficiencies.
-
write
Description copied from interface:HttpOutput.InterceptorWrite content. The response is committed by the first call to write and is closed by a call with last == true. Empty content buffers may be passed to force a commit or close.- Specified by:
writein interfaceHttpOutput.Interceptor- Parameters:
content- The content to be written or an empty buffer.complete- True if this is the last call to writecallback- The callback to use to indicateCallback.succeeded()orCallback.failed(Throwable).
-
addTrailer
private void addTrailer() -
gzip
-
commit
-
etagGzip
-
noCompression
public void noCompression() -
noCompressionIfPossible
public void noCompressionIfPossible() -
mightCompress
public boolean mightCompress()
-