Class SseEventSourceImpl.SourceBuilder
- java.lang.Object
-
- jakarta.ws.rs.sse.SseEventSource.Builder
-
- org.jboss.resteasy.plugins.providers.sse.client.SseEventSourceImpl.SourceBuilder
-
- Enclosing class:
- SseEventSourceImpl
public static class SseEventSourceImpl.SourceBuilder extends SseEventSource.Builder
-
-
Field Summary
-
Fields inherited from class jakarta.ws.rs.sse.SseEventSource.Builder
JAXRS_DEFAULT_SSE_BUILDER_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description SourceBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SseEventSource.BuilderalwaysReconnect(boolean alwaysReconnect)SseEventSourcebuild()Build new SSE event source pointing at a SSE streamingweb target.SseEventSource.Builderexecutor(ScheduledExecutorService executor)SseEventSource.Buildernamed(String name)SseEventSource.BuilderreconnectingEvery(long delay, TimeUnit unit)Set the initial reconnect delay to be used by the event source.SseEventSource.Buildertarget(WebTarget target)Set the SSE streaming endpoint.
-
-
-
Method Detail
-
named
public SseEventSource.Builder named(String name)
-
build
public SseEventSource build()
Description copied from class:SseEventSource.BuilderBuild new SSE event source pointing at a SSE streamingweb target.The returned event source is ready, but not
connectedto the SSE endpoint. It is expected that you will manually invoke itsSseEventSource.open()method once you are ready to start receiving SSE events. In case you want to build an event source instance that is already connected to the SSE endpoint, use the event source builderSseEventSource.open()method instead.Once the event source is open, the incoming events are processed by the event source in an asynchronous task that runs in an internal single-threaded
scheduled executor service.- Specified by:
buildin classSseEventSource.Builder- Returns:
- new event source instance, ready to be connected to the SSE endpoint.
- See Also:
SseEventSource.open()
-
target
public SseEventSource.Builder target(WebTarget target)
Description copied from class:SseEventSource.BuilderSet the SSE streaming endpoint.- Specified by:
targetin classSseEventSource.Builder- Parameters:
target- SSE streaming endpoint. Must not benull.- Returns:
- updated event source builder instance.
-
reconnectingEvery
public SseEventSource.Builder reconnectingEvery(long delay, TimeUnit unit)
Description copied from class:SseEventSource.BuilderSet the initial reconnect delay to be used by the event source.Note that this value may be later overridden by the SSE endpoint using either a
retrySSE event field orHTTP 503 + "Retry-After"mechanism as described in theSseEventSourcejavadoc.- Specified by:
reconnectingEveryin classSseEventSource.Builder- Parameters:
delay- the default time to wait before attempting to recover from a connection loss.unit- time unit of the reconnect delay parameter.- Returns:
- updated event source builder instance.
-
executor
public SseEventSource.Builder executor(ScheduledExecutorService executor)
-
alwaysReconnect
public SseEventSource.Builder alwaysReconnect(boolean alwaysReconnect)
-
-