Interface HistoryFlavorCodec
-
public interface HistoryFlavorCodec
A HistoryFlavorCodec knows how to encode and decode a certain history flavor in binary and potentially several text formats.It will be used to import and export data from the store and forward system, and the binary encoding will be used to store the the data cache.
Versioning If a codec changes over time, new instances should be registered for each version. On export or new data, the latest version will be used, but on decode the correct version will be retrieved.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
HistoryFlavorCodec.TextFormat
-
Field Summary
Fields Modifier and Type Field Description static HistoryFlavorCodec.TextFormat
CSV
static HistoryFlavorCodec.TextFormat
JSON
static HistoryFlavorCodec.TextFormat
XML
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HistoricalData
decode(byte[] bytes)
HistoricalData
decodeText(java.io.Reader r, HistoryFlavorCodec.TextFormat fmt)
byte[]
encode(HistoricalData data)
void
encodeText(java.io.Writer w, HistoricalData data, HistoryFlavorCodec.TextFormat fmt)
java.util.List<HistoryFlavorCodec.TextFormat>
getSupportedTextFormats()
int
version()
Returns the version of this codec instance.
-
-
-
Field Detail
-
XML
static final HistoryFlavorCodec.TextFormat XML
-
CSV
static final HistoryFlavorCodec.TextFormat CSV
-
JSON
static final HistoryFlavorCodec.TextFormat JSON
-
-
Method Detail
-
version
int version()
Returns the version of this codec instance.
-
encode
byte[] encode(HistoricalData data)
-
decode
HistoricalData decode(byte[] bytes)
-
getSupportedTextFormats
java.util.List<HistoryFlavorCodec.TextFormat> getSupportedTextFormats()
-
encodeText
void encodeText(java.io.Writer w, HistoricalData data, HistoryFlavorCodec.TextFormat fmt) throws java.io.IOException
- Throws:
java.io.IOException
-
decodeText
HistoricalData decodeText(java.io.Reader r, HistoryFlavorCodec.TextFormat fmt) throws java.io.IOException
- Throws:
java.io.IOException
-
-