Class HandshakeResult.Accepted
java.lang.Object
com.soklet.HandshakeResult.Accepted
- All Implemented Interfaces:
HandshakeResult
- Enclosing interface:
HandshakeResult
@ThreadSafe
public static final class HandshakeResult.Accepted
extends Object
implements HandshakeResult
Type which indicates a successful Server-Sent Event handshake.
A default, no-customization-permitted instance can be acquired via HandshakeResult.accept() and a builder which enables customization can be acquired via builder().
Full documentation is available at https://www.soklet.com/docs/server-sent-events#accepting-handshakes.
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder used to construct instances ofHandshakeResult.Accepted.Nested classes/interfaces inherited from interface HandshakeResult
HandshakeResult.Accepted, HandshakeResult.Rejected -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Vends a builder for an instance that indicates a successful handshake.booleanReturns the client context, if specified, for this accepted Server-Sent Event handshake.Returns the client initialization function, if specified, for this accepted Server-Sent Event handshake.Returns the cookies explicitly specified when this handshake was accepted (which may be different from the finalized map of headers sent to the client).Returns the headers explicitly specified when this handshake was accepted (which may be different from the finalized map of headers sent to the client).inthashCode()toString()
-
Method Details
-
builder
Vends a builder for an instance that indicates a successful handshake.The builder supports specifying optional response headers, cookies, and a post-handshake client initialization hook, which is useful to "catch up" in a
Last-Event-IDhandshake scenario.- Returns:
- a builder for an instance that indicates a successful handshake
-
getHeaders
Returns the headers explicitly specified when this handshake was accepted (which may be different from the finalized map of headers sent to the client).- Returns:
- the headers explicitly specified when this handshake was accepted
-
getCookies
Returns the cookies explicitly specified when this handshake was accepted (which may be different from the finalized map of headers sent to the client).- Returns:
- the cookies explicitly specified when this handshake was accepted
-
getClientContext
Returns the client context, if specified, for this accepted Server-Sent Event handshake.Useful for "targeted" broadcasts via
ServerSentEventBroadcaster.broadcastEvent(Function, Function).- Returns:
- the client context, or
Optional.empty()if none was specified
-
getClientInitializer
Returns the client initialization function, if specified, for this accepted Server-Sent Event handshake.- Returns:
- the client initialization function, or
Optional.empty()if none was specified
-
toString
-
equals
-
hashCode
-