All Packages Class Hierarchy This Package Previous Next Index
Class org.w3c.jigsaw.filters.TEFilter
java.lang.Object
|
+----org.w3c.tools.resources.AttributeHolder
|
+----org.w3c.tools.resources.Resource
|
+----org.w3c.tools.resources.FramedResource
|
+----org.w3c.tools.resources.ResourceFrame
|
+----org.w3c.tools.resources.ResourceFilter
|
+----org.w3c.jigsaw.filters.TEFilter
- public class TEFilter
- extends ResourceFilter
This filter will compress the content of replies using GZIP or whatever
encoding scheme requested in the TE: header of the request.
Compression is done on the fly. This assumes that you're really
on a slow link, where you have lots of CPU, but not much bandwidth.
A nifty usage for that filter, is to plug it on top of a
org.w3c.jigsaw.proxy.ProxyFrame
, in which case it
will encode the data when it flies out of the proxy.
-
ATTR_MIME_TYPES
- Attribute index - List of MIME type that we can compress
-
types
- The set of MIME types we are allowed to compress.
-
TEFilter()
-
-
doEncoding(HttpAcceptEncoding, Reply)
-
-
getCompressibilityFactor(Reply)
-
-
getMimeTypes()
- Get the set of MIME types to match:
-
outgoingFilter(RequestInterface, ReplyInterface)
-
-
setValue(int, Object)
- Catch the setting of mime types to compress.
ATTR_MIME_TYPES
protected static int ATTR_MIME_TYPES
- Attribute index - List of MIME type that we can compress
types
protected MimeType types[]
- The set of MIME types we are allowed to compress.
TEFilter
public TEFilter()
setValue
public void setValue(int idx,
Object value)
- Catch the setting of mime types to compress.
- Parameters:
- idx - The attribute being set.
- val - The new attribute value.
- Overrides:
- setValue in class ResourceFrame
getMimeTypes
public synchronized MimeType[] getMimeTypes()
- Get the set of MIME types to match:
- Returns:
- An array of MimeType instances.
getCompressibilityFactor
protected double getCompressibilityFactor(Reply reply)
doEncoding
protected void doEncoding(HttpAcceptEncoding enc,
Reply reply)
outgoingFilter
public ReplyInterface outgoingFilter(RequestInterface req,
ReplyInterface rep) throws ProtocolException
- Parameters:
- request - The original request.
- reply - It's original reply.
- Returns:
- A Reply instance, or null if processing
should continue normally.
- Throws: ProtocolException
- If processing should be interrupted,
because an abnormal situation occured.
- Overrides:
- outgoingFilter in class ResourceFilter
All Packages Class Hierarchy This Package Previous Next Index