ServerSentEvents and also plain
Objects which is the same as an ServerSentEvent with data only.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final Decoder | |
| private final StringDecoder | |
| private static final ResolvableType |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ServerSentEventHttpMessageReader(Decoder<?> decoder)
Constructor with JSON |
| Modifier and Type | Method and Description |
|---|---|
| private Object | buildEvent(List<String> lines, ResolvableType valueType, boolean shouldWrap, Map<String, Object> hints)
|
| public boolean | canRead(ResolvableType
the type of object to check elementType, MediaType the media type for the read (possibly mediaType)null)Implements org. Whether the given object type is supported by this reader. |
| private Object | |
| public Decoder | |
| public int | |
| public List | getReadableMediaTypes()
Implements org. Return the list of media types supported by this reader. |
| private boolean | |
| public Flux | read(ResolvableType
the type of objects in the stream which must have been
previously checked via elementType, ReactiveHttpInputMessage canRead(ResolvableType, MediaType)the message to read from message, Map<String, Object> additional information about how to read and decode the input hints)Implements org. Read from the input message and decode to a stream of objects. |
| public Mono | readMono(ResolvableType
the type of objects in the stream which must have been
previously checked via elementType, ReactiveHttpInputMessage canRead(ResolvableType, MediaType)the message to read from message, Map<String, Object> additional information about how to read and decode the input hints)Implements org. Read from the input message and decode to a single object. |
| public void | setMaxInMemorySize(int
the max number of bytes to buffer, or -1 for unlimited byteCount)Configure a limit on the maximum number of bytes per SSE event which are buffered before the event is parsed. |
| decoder | back to summary |
|---|---|
| private final Decoder<?> decoder
| |
| lineDecoder | back to summary |
|---|---|
| private final StringDecoder lineDecoder | |
| STRING_TYPE | back to summary |
|---|---|
| private static final ResolvableType STRING_TYPE | |
| ServerSentEventHttpMessageReader | back to summary |
|---|---|
| public ServerSentEventHttpMessageReader() Constructor without a | |
| ServerSentEventHttpMessageReader | back to summary |
|---|---|
| public ServerSentEventHttpMessageReader(Decoder<?> decoder) Constructor with JSON | |
| buildEvent | back to summary |
|---|---|
private Object buildEvent(List<String> lines, ResolvableType valueType, boolean shouldWrap, Map<String, Object> hints)
| |
| canRead | back to summary |
|---|---|
| public boolean canRead(ResolvableType elementType, MediaType mediaType) Implements org. Doc from org. Whether the given object type is supported by this reader.
| |
| decodeData | back to summary |
|---|---|
private Object decodeData(StringBuilder data, ResolvableType dataType, Map<String, Object> hints)
| |
| getDecoder | back to summary |
|---|---|
| public Decoder Return the configured
| |
| getMaxInMemorySize | back to summary |
|---|---|
| public int getMaxInMemorySize() Return the
| |
| getReadableMediaTypes | back to summary |
|---|---|
| public List Implements org. Doc from org. Return the list of media types supported by this reader. The list may not
apply to every possible target element type and calls to this method
should typically be guarded via | |
| isServerSentEvent | back to summary |
|---|---|
| private boolean isServerSentEvent(ResolvableType elementType) | |
| read | back to summary |
|---|---|
| public Flux Implements org. Doc from org. Read from the input message and decode to a stream of objects.
| |
| readMono | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Read from the input message and decode to a single object.
| |
| setMaxInMemorySize | back to summary |
|---|---|
| public void setMaxInMemorySize(int byteCount) Configure a limit on the maximum number of bytes per SSE event which are buffered before the event is parsed. Note that the By default this is set to 256K.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void |
| accumulated | back to summary |
|---|---|
| private int accumulated | |
| LimitTracker | back to summary |
|---|---|
| private LimitTracker() | |
| afterLineParsed | back to summary |
|---|---|
| public void afterLineParsed(String line) | |
| raiseLimitException | back to summary |
|---|---|
| private void raiseLimitException() | |