HK - Header key typeHV - Header value typepublic abstract class BaseGenericBinaryMessageReaderImpl<HK,HV> extends BaseBinaryMessageReader
MessageReader, providing common logic to most protocol bindings
which supports both Binary and Structured mode.
Content-type is handled separately using a key not prefixed with CloudEvents header prefix.| Modifier | Constructor and Description |
|---|---|
protected |
BaseGenericBinaryMessageReaderImpl(SpecVersion version,
byte[] body) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
forEachHeader(BiConsumer<HK,HV> fn) |
protected abstract boolean |
isCloudEventsHeader(HK key) |
protected abstract boolean |
isContentTypeHeader(HK key) |
<T extends CloudEventWriter<V>,V> |
read(CloudEventWriterFactory<T,V> writerFactory)
Visit the message as binary encoded event using the provided visitor factory.
|
void |
readAttributes(CloudEventAttributesWriter writer)
Visit the message attributes as binary encoded event using the provided visitor.
|
void |
readExtensions(CloudEventExtensionsWriter visitor)
Visit the message extensions as binary encoded event using the provided visitor.
|
protected abstract String |
toCloudEventsKey(HK key) |
protected abstract String |
toCloudEventsValue(HV value) |
getEncoding, readclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoEvent, visitfrom, fromprotected BaseGenericBinaryMessageReaderImpl(SpecVersion version, byte[] body)
public <T extends CloudEventWriter<V>,V> V read(CloudEventWriterFactory<T,V> writerFactory) throws CloudEventRWException, IllegalStateException
MessageReaderwriterFactory - a factory that generates a visitor starting from the SpecVersion of the eventCloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message is not in binary encoding.public void readAttributes(CloudEventAttributesWriter writer) throws RuntimeException
MessageReaderwriter - Attributes visitorRuntimeExceptionpublic void readExtensions(CloudEventExtensionsWriter visitor) throws RuntimeException
MessageReadervisitor - Extensions visitorRuntimeExceptionprotected abstract boolean isContentTypeHeader(HK key)
protected abstract boolean isCloudEventsHeader(HK key)
protected abstract void forEachHeader(BiConsumer<HK,HV> fn)
Copyright © 2020. All rights reserved.