@ParametersAreNonnullByDefault public interface MessageReader extends StructuredMessageReader, CloudEventReader
| Modifier and Type | Method and Description |
|---|---|
Encoding |
getEncoding() |
<V extends CloudEventWriter<R>,R> |
read(CloudEventWriterFactory<V,R> writerFactory)
Visit the message as binary encoded event using the provided visitor factory.
|
<T> T |
read(StructuredMessageWriter<T> visitor)
Visit the message as structured encoded event using the provided visitor
|
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.
|
default CloudEvent |
toEvent()
Translate this message into a
CloudEvent representation. |
default <BV extends CloudEventWriter<R>,R> |
visit(MessageWriter<BV,R> visitor)
Visit the event using a
MessageWriter. |
from, from<V extends CloudEventWriter<R>,R> R read(CloudEventWriterFactory<V,R> writerFactory) throws CloudEventRWException, IllegalStateException
read in interface CloudEventReaderwriterFactory - 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.void readAttributes(CloudEventAttributesWriter writer) throws CloudEventRWException, IllegalStateException
readAttributes in interface CloudEventReaderwriter - Attributes visitorCloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message is not in binary encoding.void readExtensions(CloudEventExtensionsWriter visitor) throws CloudEventRWException, IllegalStateException
readExtensions in interface CloudEventReadervisitor - Extensions visitorCloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message is not in binary encoding.<T> T read(StructuredMessageWriter<T> visitor) throws CloudEventRWException, IllegalStateException
read in interface StructuredMessageReadervisitor - Structured Message visitorCloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message is not in structured encoding.Encoding getEncoding()
default <BV extends CloudEventWriter<R>,R> R visit(MessageWriter<BV,R> visitor) throws CloudEventRWException, IllegalStateException
MessageWriter. This method allows to transcode an event from one transport to another without
converting it to CloudEvent. The resulting encoding will be the same as the original encoding.visitor - the MessageVisitor accepting this MessageCloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message has an unknown encoding.default CloudEvent toEvent() throws CloudEventRWException, IllegalStateException
CloudEvent representation.toEvent in interface StructuredMessageReaderCloudEvent with the contents of this message.CloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message has an unknown encoding.Copyright © 2020. All rights reserved.