Package io.quarkus.websockets.next
Interface OpenConnections
- All Superinterfaces:
Iterable<WebSocketConnection>
- All Known Implementing Classes:
ConnectionManager
@Experimental("This API is experimental and may change in the future")
public interface OpenConnections
extends Iterable<WebSocketConnection>
Provides convenient access to all open connections.
Quarkus provides a built-in CDI bean with the Singleton scope that implements this interface.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<WebSocketConnection>findByConnectionId(String connectionId) Returns the open connection with the given id.default Collection<WebSocketConnection>findByEndpointId(String endpointId) Returns an immutable snapshot of all open connections for the given endpoint id.default Collection<WebSocketConnection>listAll()Returns an immutable snapshot of all open connections at the given time.stream()Returns the stream of all open connections at the given time.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
listAll
Returns an immutable snapshot of all open connections at the given time.- Returns:
- an immutable collection of all open connections
-
findByEndpointId
Returns an immutable snapshot of all open connections for the given endpoint id.- Parameters:
endpointId-- Returns:
- an immutable collection of all open connections for the given endpoint id
- See Also:
-
findByConnectionId
Returns the open connection with the given id.- Parameters:
connectionId-- Returns:
- the open connection or empty
Optionalif no open connection with the given id exists - See Also:
-
stream
Stream<WebSocketConnection> stream()Returns the stream of all open connections at the given time.- Returns:
- the stream of open connections
-