ClientEngine implementation.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | TyrusClientEngine.
Called when response is received from the server. |
| private static enum | TyrusClientEngine.
State controls flow in |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private volatile TyrusClientEngine. | |
| private volatile Handshake | |
| private final URI | |
| private final DebugContext | |
| public static final int | DEFAULT_INCOMING_BUFFER_SIZE
Default incoming buffer size for client container. |
| private static final int | |
| private static final Version | |
| private final TyrusEndpointWrapper | |
| private final TyrusClientEngine. | |
| private static final Logger | |
| private final boolean | |
| private final Map | |
| private final ProtocolHandler | |
| private final Boolean | |
| private volatile URI | |
| private final int | |
| private final Set | |
| private volatile ClientEngine. | |
| private static final ClientEngine. | |
| private static final ClientEngine. |
| Access | Constructor and Description |
|---|---|
| pack-priv | TyrusClientEngine(TyrusEndpointWrapper
wrapped client endpoint. endpointWrapper, TyrusClientEngine.used for reporting back the outcome of handshake. listener,ClientHandshakeListener#onSessionCreated(jakarta. is invoked if
handshake is completed and provided Session is open and ready to be
returned from WebSocketContainer#connectToServer(Class,
jakarta. (and alternatives) call.passed container properties, see properties, URI *
..to which the client is connecting. connectToServerUriParam, DebugContext debug context. debugContext)Create |
| Modifier and Type | Method and Description |
|---|---|
| public UpgradeRequest | createUpgradeRequest(ClientEngine.
handshake timeout handler. timeoutHandlerTimeoutHandler#handleTimeout() is invoked if processResponse(UpgradeResponse, Writer, Connection. is not called within
handshake timeout.Implements org. Create upgrade request and register |
| public ClientEngine. | Returns: timeout handler instance ornull when not present.Get |
| private ClientEngine. | |
| private ClientEngine. | |
| private ClientEngine. | handleSwitchProtocol(UpgradeResponse upgradeResponse, Writer writer, Connection.
|
| private void | |
| public void | processError(Throwable
encountered error. t)Implements org. Process error. |
| public ClientEngine. | processResponse(final UpgradeResponse
response to be processed. upgradeResponse, final Writer used for sending dataframes from client endpoint. writer, final Connection.will be called when connection is closed, will be set as listener of returned closeListenerConnection.Implements org. Process handshake and return |
| private ClientEngine. | Returns: client upgrade info withClientUpgradeStatus#SUCCESS status.upgrade response received from client container. upgradeResponse, final Writer writer instance to be used for sending websocket frames. writer, final Connection.client container connection listener. closeListenerProcess upgrade response. |
| BUFFER_STEP_SIZE | back to summary |
|---|---|
| private static final int BUFFER_STEP_SIZE | |
| clientEngineState | back to summary |
|---|---|
| private volatile TyrusClientEngine. | |
| clientHandShake | back to summary |
|---|---|
| private volatile Handshake clientHandShake | |
| connectToServerUriParam | back to summary |
|---|---|
| private final URI connectToServerUriParam | |
| debugContext | back to summary |
|---|---|
| private final DebugContext debugContext | |
| DEFAULT_INCOMING_BUFFER_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_INCOMING_BUFFER_SIZE Default incoming buffer size for client container. | |
| DEFAULT_REDIRECT_THRESHOLD | back to summary |
|---|---|
| private static final int DEFAULT_REDIRECT_THRESHOLD | |
| DEFAULT_VERSION | back to summary |
|---|---|
| private static final Version DEFAULT_VERSION | |
| endpointWrapper | back to summary |
|---|---|
| private final TyrusEndpointWrapper endpointWrapper | |
| listener | back to summary |
|---|---|
| private final TyrusClientEngine. | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| logUpgradeMessages | back to summary |
|---|---|
| private final boolean logUpgradeMessages | |
| properties | back to summary |
|---|---|
| private final Map<String, Object> properties | |
| protocolHandler | back to summary |
|---|---|
| private final ProtocolHandler protocolHandler | |
| redirectEnabled | back to summary |
|---|---|
| private final Boolean redirectEnabled | |
| redirectLocation | back to summary |
|---|---|
| private volatile URI redirectLocation | |
| redirectThreshold | back to summary |
|---|---|
| private final int redirectThreshold | |
| redirectUriHistory | back to summary |
|---|---|
| private final Set<URI> redirectUriHistory | |
| timeoutHandler | back to summary |
|---|---|
| private volatile ClientEngine. | |
| UPGRADE_INFO_ANOTHER_REQUEST_REQUIRED | back to summary |
|---|---|
| private static final ClientEngine. | |
| UPGRADE_INFO_FAILED | back to summary |
|---|---|
| private static final ClientEngine. | |
| TyrusClientEngine | back to summary |
|---|---|
| pack-priv TyrusClientEngine(TyrusEndpointWrapper endpointWrapper, TyrusClientEngine. Create
| |
| createUpgradeRequest | back to summary |
|---|---|
| public UpgradeRequest createUpgradeRequest(ClientEngine. Implements org. Doc from org. Create upgrade request and register
| |
| getTimeoutHandler | back to summary |
|---|---|
| public ClientEngine. Get
| |
| handleAuth | back to summary |
|---|---|
| private ClientEngine. | |
| handleRedirect | back to summary |
|---|---|
| private ClientEngine. | |
| handleSwitchProtocol | back to summary |
|---|---|
| private ClientEngine. | |
| logUpgradeRequest | back to summary |
|---|---|
| private void logUpgradeRequest(UpgradeRequest upgradeRequest) | |
| processError | back to summary |
|---|---|
| public void processError(Throwable t) Implements org. Doc from org. Process error.
This method can be called any time when client encounters an error which cannot be handled in the container
before | |
| processResponse | back to summary |
|---|---|
| public ClientEngine. Implements org. Doc from org. Process handshake and return
| |
| processUpgradeResponse | back to summary |
|---|---|
| private ClientEngine. Process upgrade response. This method should be called only when the response HTTP status code is
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | onSessionCreated(Session
opened client session. session)Invoked when handshake is completed and provided |
| onError | back to summary |
|---|---|
| public void onError(Throwable exception) Called when an error is found in handshake response.
| |
| onSessionCreated | back to summary |
|---|---|
| public void onSessionCreated(Session session) Invoked when handshake is completed and provided
| |
processResponse(UpgradeResponse, Writer, Connection.CloseListener)
and depends on upgrade response status code and previous state.
| Modifier and Type | Field and Description |
|---|---|
| public static final TyrusClientEngine. | AUTH_REQUIRED
Authentication required. |
| public static final TyrusClientEngine. | AUTH_UPGRADE_REQUEST_CREATED
Upgrade request with Authorization header has been created. |
| private volatile Authenticator | |
| public static final TyrusClientEngine. | FAILED
Handshake failed (final state). |
| public static final TyrusClientEngine. | INIT
Initial state. |
| public static final TyrusClientEngine. | REDIRECT_REQUIRED
Upgrade request must be redirected. |
| public static final TyrusClientEngine. | SUCCESS
Handshake succeeded (final state). |
| public static final TyrusClientEngine. | UPGRADE_REQUEST_CREATED
Upgrade request has been created. |
| private volatile String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Authenticator | |
| pack-priv String | |
| pack-priv void | |
| pack-priv void | |
| public static TyrusClientEngine. | |
| public static TyrusClientEngine. |
| AUTH_REQUIRED | back to summary |
|---|---|
| public static final TyrusClientEngine. Authentication required.
Set in | |
| AUTH_UPGRADE_REQUEST_CREATED | back to summary |
|---|---|
| public static final TyrusClientEngine. Upgrade request with Authorization header has been created. | |
| authenticator | back to summary |
|---|---|
| private volatile Authenticator authenticator | |
| FAILED | back to summary |
|---|---|
| public static final TyrusClientEngine. Handshake failed (final state). | |
| INIT | back to summary |
|---|---|
| public static final TyrusClientEngine. Initial state. | |
| REDIRECT_REQUIRED | back to summary |
|---|---|
| public static final TyrusClientEngine. Upgrade request must be redirected.
Set in | |
| SUCCESS | back to summary |
|---|---|
| public static final TyrusClientEngine. Handshake succeeded (final state). | |
| UPGRADE_REQUEST_CREATED | back to summary |
|---|---|
| public static final TyrusClientEngine. Upgrade request has been created. | |
| wwwAuthenticateHeader | back to summary |
|---|---|
| private volatile String wwwAuthenticateHeader | |
| TyrusClientEngineState | back to summary |
|---|---|
| private TyrusClientEngineState() | |
| getAuthenticator | back to summary |
|---|---|
| pack-priv Authenticator getAuthenticator() | |
| getWwwAuthenticateHeader | back to summary |
|---|---|
| pack-priv String getWwwAuthenticateHeader() | |
| setAuthenticator | back to summary |
|---|---|
| pack-priv void setAuthenticator(Authenticator authenticator) | |
| setWwwAuthenticateHeader | back to summary |
|---|---|
| pack-priv void setWwwAuthenticateHeader(String wwwAuthenticateHeader) | |
| valueOf | back to summary |
|---|---|
| public static TyrusClientEngine. | |
| values | back to summary |
|---|---|
| public static TyrusClientEngine. | |
| Modifier and Type | Field and Description |
|---|---|
| private ByteBuffer | |
| private final ExtendedExtension. | |
| private final ProtocolHandler | |
| private final int | |
| private final List | |
| private final TyrusWebSocket |
| Access | Constructor and Description |
|---|---|
| pack-priv | TyrusReadHandler(final ProtocolHandler protocolHandler, final TyrusWebSocket socket, int incomingBufferSize, List<Extension> negotiatedExtensions, ExtendedExtension.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | handle(ByteBuffer
websocket data of a connection. data)Implements org. A transport reads websocket data and invokes this method to handover websocket data for a connection to tyrus runtime. |
| buffer | back to summary |
|---|---|
| private ByteBuffer buffer | |
| extensionContext | back to summary |
|---|---|
| private final ExtendedExtension. | |
| handler | back to summary |
|---|---|
| private final ProtocolHandler handler | |
| incomingBufferSize | back to summary |
|---|---|
| private final int incomingBufferSize | |
| negotiatedExtensions | back to summary |
|---|---|
| private final List<Extension> negotiatedExtensions | |
| socket | back to summary |
|---|---|
| private final TyrusWebSocket socket | |
| TyrusReadHandler | back to summary |
|---|---|
| pack-priv TyrusReadHandler(final ProtocolHandler protocolHandler, final TyrusWebSocket socket, int incomingBufferSize, List<Extension> negotiatedExtensions, ExtendedExtension. | |
| handle | back to summary |
|---|---|
| public void handle(ByteBuffer data) Implements org. Doc from org. A transport reads websocket data and invokes this method to handover websocket data for a connection to tyrus runtime. The runtime consumes as much data as possible from the byte buffer. If there is some remaining data in the buffer, transport needs pass those bytes in more call (along with more data) in the same byte buffer or in a newer byte buffer.
| |