Package io.quarkus.websockets.next
Interface HttpUpgradeCheck
- All Known Implementing Classes:
SecurityHttpUpgradeCheck
public interface HttpUpgradeCheck
A check that controls which requests are allowed to upgrade the HTTP connection to a WebSocket connection.
CDI beans implementing this interface are invoked on every request.
The CDI beans implementing `HttpUpgradeCheck` interface can be either `@ApplicationScoped`, `@Singleton`
or `@Dependent` beans, but never the `@RequestScoped` beans.
The checks are called orderly according to a bean priority. When no priority is declared (for example with the `@jakarta.annotation.Priority` annotation), default priority is used. If one of the checks rejects the upgrade, remaining checks are not called.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic final record -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanDetermines WebSocket endpoints this check is applied to.io.smallrye.mutiny.Uni<HttpUpgradeCheck.CheckResult>This method inspects HTTP Upgrade context and either allows or denies upgrade to a WebSocket connection.
-
Method Details
-
perform
io.smallrye.mutiny.Uni<HttpUpgradeCheck.CheckResult> perform(HttpUpgradeCheck.HttpUpgradeContext context) This method inspects HTTP Upgrade context and either allows or denies upgrade to a WebSocket connection.- Parameters:
context-HttpUpgradeCheck.HttpUpgradeContext- Returns:
- check result; must never be null
-
appliesTo
Determines WebSocket endpoints this check is applied to.- Parameters:
endpointId- WebSocket endpoint id, @seeWebSocket.endpointId()for more information- Returns:
- true if this check should be applied on a WebSocket endpoint with given id
-