Class SseServer.Builder
java.lang.Object
com.soklet.SseServer.Builder
- Enclosing interface:
SseServer
Builder used to construct a standard implementation of
SseServer.
This class is intended for use by a single thread.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbroadcasterCacheCapacity(@Nullable Integer broadcasterCacheCapacity) build()concurrentConnectionLimit(@Nullable Integer concurrentConnectionLimit) connectionQueueCapacity(@Nullable Integer connectionQueueCapacity) heartbeatInterval(@Nullable Duration heartbeatInterval) idGenerator(@Nullable IdGenerator<?> idGenerator) maximumHeaderCount(@Nullable Integer maximumHeaderCount) Sets the maximum number of HTTP header fields accepted in one SSE handshake.maximumRequestSizeInBytes(@Nullable Integer maximumRequestSizeInBytes) Sets the maximum accepted SSE handshake request size in bytes.maximumRequestTargetLengthInBytes(@Nullable Integer maximumRequestTargetLengthInBytes) Sets the maximum SSE handshake request-target length accepted in bytes.requestHandlerConcurrency(@Nullable Integer requestHandlerConcurrency) requestHandlerExecutorServiceSupplier(@Nullable Supplier<ExecutorService> requestHandlerExecutorServiceSupplier) requestHandlerQueueCapacity(@Nullable Integer requestHandlerQueueCapacity) requestHandlerTimeout(@Nullable Duration requestHandlerTimeout) requestHeaderTimeout(@Nullable Duration requestHeaderTimeout) Sets the maximum duration for reading the SSE handshake request line and headers.requestReadBufferSizeInBytes(@Nullable Integer requestReadBufferSizeInBytes) resourcePathCacheCapacity(@Nullable Integer resourcePathCacheCapacity) shutdownTimeout(@Nullable Duration shutdownTimeout) verifyConnectionOnceEstablished(@Nullable Boolean verifyConnectionOnceEstablished) writeTimeout(@Nullable Duration writeTimeout)
-
Method Details
-
port
-
host
-
requestHeaderTimeout
Sets the maximum duration for reading the SSE handshake request line and headers.If this value is not specified, Soklet uses the server default.
- Parameters:
requestHeaderTimeout- the request header timeout, ornullfor the default- Returns:
- this builder
-
requestHandlerTimeout
-
requestHandlerConcurrency
public @NonNull SseServer.Builder requestHandlerConcurrency(@Nullable Integer requestHandlerConcurrency) -
requestHandlerQueueCapacity
public @NonNull SseServer.Builder requestHandlerQueueCapacity(@Nullable Integer requestHandlerQueueCapacity) -
writeTimeout
-
shutdownTimeout
-
heartbeatInterval
-
maximumRequestSizeInBytes
public @NonNull SseServer.Builder maximumRequestSizeInBytes(@Nullable Integer maximumRequestSizeInBytes) Sets the maximum accepted SSE handshake request size in bytes.This limit applies to the whole received handshake request, including request line and headers. Established SSE stream writes are governed by the write timeout and connection queue capacity settings instead.
- Parameters:
maximumRequestSizeInBytes- the maximum handshake request size, ornullfor the default- Returns:
- this builder
-
maximumHeaderCount
Sets the maximum number of HTTP header fields accepted in one SSE handshake.- Parameters:
maximumHeaderCount- the maximum header count, ornullfor the default- Returns:
- this builder
-
maximumRequestTargetLengthInBytes
public @NonNull SseServer.Builder maximumRequestTargetLengthInBytes(@Nullable Integer maximumRequestTargetLengthInBytes) Sets the maximum SSE handshake request-target length accepted in bytes.- Parameters:
maximumRequestTargetLengthInBytes- the maximum request-target length, ornullfor the default- Returns:
- this builder
-
requestReadBufferSizeInBytes
public @NonNull SseServer.Builder requestReadBufferSizeInBytes(@Nullable Integer requestReadBufferSizeInBytes) -
requestHandlerExecutorServiceSupplier
public @NonNull SseServer.Builder requestHandlerExecutorServiceSupplier(@Nullable Supplier<ExecutorService> requestHandlerExecutorServiceSupplier) -
concurrentConnectionLimit
public @NonNull SseServer.Builder concurrentConnectionLimit(@Nullable Integer concurrentConnectionLimit) -
broadcasterCacheCapacity
public @NonNull SseServer.Builder broadcasterCacheCapacity(@Nullable Integer broadcasterCacheCapacity) -
resourcePathCacheCapacity
public @NonNull SseServer.Builder resourcePathCacheCapacity(@Nullable Integer resourcePathCacheCapacity) -
connectionQueueCapacity
public @NonNull SseServer.Builder connectionQueueCapacity(@Nullable Integer connectionQueueCapacity) -
verifyConnectionOnceEstablished
public @NonNull SseServer.Builder verifyConnectionOnceEstablished(@Nullable Boolean verifyConnectionOnceEstablished) -
idGenerator
-
build
-