org.szegedi.spring.web.jsflow.codec
Class CompressionCodec

java.lang.Object
  extended by org.szegedi.spring.web.jsflow.codec.CompressionCodec
All Implemented Interfaces:
BinaryStateCodec

public class CompressionCodec
extends java.lang.Object
implements BinaryStateCodec

A codec that will compress the serialized flowstate upon encoding and decompress it upon decoding. In particular useful as part of a CompositeCodec, in front of a ConfidentialityCodec, as compression improves the security of the encryption.

Version:
$Id: CompressionCodec.java 70 2007-04-02 08:34:26Z szegedia $
Author:
Attila Szegedi

Constructor Summary
CompressionCodec()
           
 
Method Summary
 OneWayCodec createDecoder()
          Create a one-way single-threaded, nonshared codec instance able to decode a state as received from the client or from an upstream codec.
 OneWayCodec createEncoder()
          Create a one-way single-threaded, nonshared codec instance able to encode a state as should be sent to a client or a downstream codec.
 void setCompressionLevel(int compressionLevel)
          Sets the compression level - see Deflater compression level constants.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompressionCodec

public CompressionCodec()
Method Detail

setCompressionLevel

public void setCompressionLevel(int compressionLevel)
Sets the compression level - see Deflater compression level constants.

Parameters:
compressionLevel - a compression level. Defaults to Deflater.DEFAULT_COMPRESSION.

createDecoder

public OneWayCodec createDecoder()
                          throws java.lang.Exception
Description copied from interface: BinaryStateCodec
Create a one-way single-threaded, nonshared codec instance able to decode a state as received from the client or from an upstream codec.

Specified by:
createDecoder in interface BinaryStateCodec
Returns:
the codec for decoding
Throws:
java.lang.Exception

createEncoder

public OneWayCodec createEncoder()
                          throws java.lang.Exception
Description copied from interface: BinaryStateCodec
Create a one-way single-threaded, nonshared codec instance able to encode a state as should be sent to a client or a downstream codec.

Specified by:
createEncoder in interface BinaryStateCodec
Returns:
the codec for encoding
Throws:
java.lang.Exception