public class StatelessContextSerializer
extends java.lang.Object
StatelessRatingContext and
StatelessPreRatingContext.
Objects are serialized (unserialized) to (from) byte arrays. What is done with these byte arrays is the reponsibility of the integration code.
The format of the byte arrays is:
Adler32 class.
In case of compressed data, the used algorithm is the ZLIB compression
provided by Deflater and
Inflater.
| Modifier and Type | Field and Description |
|---|---|
static byte |
COMPRESSED
Flag for compressed data
|
static byte |
NOT_COMPRESSED
Flag for not compressed data
|
static byte |
VERSION
Flag indicating the version
|
| Modifier and Type | Method and Description |
|---|---|
static StatelessContextSerializer |
getInstance()
Returns the singleton instance for this class.
|
StatelessPreRatingContext |
readStatelessPreRatingContext(byte[] bytes)
Unserializes a byte array to a StatelessPreRatingContext.
|
StatelessRatingContext |
readStatelessRatingContext(byte[] bytes)
Unserializes a byte array to a StatelessRatingContext.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
byte[] |
writeStatelessPreRatingContext(StatelessPreRatingContext preRatingContext,
boolean compress)
Serializes the given StatelessPreRatingContext into a new allocated
byte array.
|
byte[] |
writeStatelessRatingContext(StatelessRatingContext ratingContext,
boolean compress)
Serializes the given StatelessRatingContext into a new allocated byte
array.
|
public static final byte VERSION
public static final byte NOT_COMPRESSED
public static final byte COMPRESSED
public static StatelessContextSerializer getInstance()
public byte[] writeStatelessRatingContext(StatelessRatingContext ratingContext, boolean compress) throws StatelessContextSerializationException
ratingContext - The StatelessRatingContext to serializecompress - The flag to indicate whether serialized data should be compressed ot notStatelessContextSerializationExceptionpublic StatelessRatingContext readStatelessRatingContext(byte[] bytes) throws StatelessContextSerializationException
bytes - The bytes to unserializeStatelessContextSerializationExceptionpublic byte[] writeStatelessPreRatingContext(StatelessPreRatingContext preRatingContext, boolean compress) throws StatelessContextSerializationException
preRatingContext - The StatelessPreRatingContext to serializecompress - The flag to indicate whether serialized data should be compressed ot notStatelessContextSerializationExceptionpublic StatelessPreRatingContext readStatelessPreRatingContext(byte[] bytes) throws StatelessContextSerializationException
bytes - The bytes to unserializeStatelessContextSerializationExceptionpublic java.lang.String toString()
toString in class java.lang.Object