public final class ProtocolConversion extends Object
Modifier and Type | Method and Description |
---|---|
static EventIdType.EventId.Builder |
createEventIdBuilder(EventId id)
Creates a build for the serialization of an
EventId , filled
with the contents of the given id. |
static void |
fillNotificationHeader(NotificationType.Notification.Builder notificationBuilder,
Event event,
String wireSchema)
Fills the notification header in a builder instance.
|
static Event |
fromNotification(NotificationType.Notification notification)
Build event from RSB Notification.
|
static Event |
fromNotification(NotificationType.Notification notification,
ByteBuffer serializedData,
ConverterSelectionStrategy<ByteBuffer> converters)
Builds an
Event instance from a
NotificationType.Notification and a
ByteBuffer containing the event payload. |
static WireContents<ByteBuffer> |
serializeEventData(Event event,
ConverterSelectionStrategy<ByteBuffer> converters)
Serializes the payload contained in an
Event instance using a
specified ConverterSelectionStrategy . |
public static EventIdType.EventId.Builder createEventIdBuilder(EventId id)
EventId
, filled
with the contents of the given id.id
- the id to serializepublic static void fillNotificationHeader(NotificationType.Notification.Builder notificationBuilder, Event event, String wireSchema)
notificationBuilder
- the builder where fields should be filledevent
- the event to serialize and to greb the data for the
notification header fromwireSchema
- the wire shema of the serialized datapublic static WireContents<ByteBuffer> serializeEventData(Event event, ConverterSelectionStrategy<ByteBuffer> converters) throws ConversionException
Event
instance using a
specified ConverterSelectionStrategy
.event
- event containing the data to serializeconverters
- the converters to useConversionException
- error converting, e.g. no converter available or wrong classpublic static Event fromNotification(NotificationType.Notification notification)
notification
- NotificationType.Notification
instance
to deserializeEvent
instancepublic static Event fromNotification(NotificationType.Notification notification, ByteBuffer serializedData, ConverterSelectionStrategy<ByteBuffer> converters) throws ConversionException
Event
instance from a
NotificationType.Notification
and a
ByteBuffer
containing the event payload. This includes the
deserialization of the payload using a specified converter strategy.notification
- the notification with the event meta dataserializedData
- the serialized dataconverters
- converter strategy to use for deserializing the dataConversionException
- unable to deserialize the data with the specified converter
stategyCopyright © 2018 CoR-Lab. All rights reserved.