Package org.openmuc.framework.parser.spi
Interface ParserService
-
public interface ParserServiceThe ParserService provides methods to serialize and deserialize OpenMUC records.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Recorddeserialize(byte[] byteArray, ChannelSettings channelSettings)Deserializes a given JSON-String as byte array toRecord.byte[]serialize(java.util.List<LoggingRecord> openMucRecords)Serializes a list of LogRecordContainers.byte[]serialize(LoggingRecord openMucRecord)Serializes a given java datatype to byte array.
-
-
-
Method Detail
-
serialize
byte[] serialize(LoggingRecord openMucRecord) throws SerializationException
Serializes a given java datatype to byte array. The needed datatype depends on the concrete implementation of this service.- Parameters:
openMucRecord- logging record for serializing- Returns:
- serialized record as byte array
- Throws:
SerializationException- when something goes wrong while serializing
-
serialize
byte[] serialize(java.util.List<LoggingRecord> openMucRecords) throws SerializationException
Serializes a list of LogRecordContainers.- Parameters:
openMucRecords- list of logging records for serializing- Returns:
- serialized records as byte array
- Throws:
SerializationException- when something goes wrong while serializing
-
deserialize
Record deserialize(byte[] byteArray, ChannelSettings channelSettings)
Deserializes a given JSON-String as byte array toRecord. The format of the byte array depends on the concrete implementation of this service.- Parameters:
byteArray- received JSON-StringchannelSettings- defines the channelSettings, to define encapsulated values of e.g. a received JSON-StringChannelSettings- Returns:
- deserialized instance of
Record
-
-