Interface IWSConnector
- All Superinterfaces:
org.eclipse.net4j.util.collection.Closeable, IChannelMultiplexer, IConnector, org.eclipse.net4j.util.container.IContainer<IChannel>, ILocationAware, org.eclipse.net4j.util.event.INotifier, org.eclipse.net4j.util.properties.IPropertiesContainer, org.eclipse.net4j.util.security.IUserAware
A client-side
IConnector that carries Net4j traffic over a WebSocket connection.
The connector owns Net4j framing, channel multiplexing, scheduling, and the lifetime of the
MessageConnector.IMessageConnection bound to it. A provider selected by the connector factory owns the
WebSocket handshake and transport-specific I/O, and reports complete Net4j frames through that
message connection. A WebSocket message is therefore not itself a Net4j channel buffer: the
provider must assemble or emit complete Net4j frames as required by MessageConnector.IMessageConnection.
- Author:
- Eike Stepper
- No Implement
- This interface is not intended to be implemented by clients.
- No Extend
- This interface is not intended to be extended by clients.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
org.eclipse.net4j.util.container.IContainer.Modifiable<E>, org.eclipse.net4j.util.container.IContainer.Persistable<E>, org.eclipse.net4j.util.container.IContainer.Persistence<E>Nested classes/interfaces inherited from interface ILocationAware
ILocationAware.LocationNested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe HTTP header that identifies the target Net4j acceptor during a WebSocket handshake.static final StringPrefix used in a WebSocket path segment to identify the target acceptor.Fields inherited from interface IChannelMultiplexer
DEFAULT_OPEN_CHANNEL_TIMEOUT, NO_CHANNEL_TIMEOUTFields inherited from interface IConnector
NO_TIMEOUT -
Method Summary
Modifier and TypeMethodDescriptionReturns the named server acceptor selected by this connector.Returns the cookies configured for the provider's WebSocket handshake.Returns the message-connection provider selected for this connector.Returns the base service URI used for the WebSocket handshake.voidSupplies the asynchronous message connection created by a WebSocket client provider.Methods inherited from interface org.eclipse.net4j.util.collection.Closeable
close, isClosedMethods inherited from interface IChannelMultiplexer
getChannels, getOpenChannelTimeout, openChannel, openChannel, openChannel, setOpenChannelTimeoutMethods inherited from interface IConnector
connect, connect, connectAsync, getState, getURL, isConnected, waitForConnectionMethods inherited from interface org.eclipse.net4j.util.container.IContainer
getElements, isEmptyMethods inherited from interface ILocationAware
getLocation, isClient, isServerMethods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListenerMethods inherited from interface org.eclipse.net4j.util.properties.IPropertiesContainer
propertiesMethods inherited from interface org.eclipse.net4j.util.security.IUserAware
getUserID
-
Field Details
-
ACCEPTOR_NAME_PREFIX
Prefix used in a WebSocket path segment to identify the target acceptor.- See Also:
-
ACCEPTOR_HEADER_NAME
The HTTP header that identifies the target Net4j acceptor during a WebSocket handshake.- Since:
- 2.0
- See Also:
-
-
Method Details
-
getServiceURI
URI getServiceURI()Returns the base service URI used for the WebSocket handshake.- Returns:
- the service URI, including the
wsorwssscheme
-
getAcceptorName
String getAcceptorName()Returns the named server acceptor selected by this connector.- Returns:
- the acceptor route name
-
getProviderType
String getProviderType()Returns the message-connection provider selected for this connector.- Returns:
- the factory type in the
org.eclipse.net4j.messageConnectionsproduct group - Since:
- 2.0
-
getCookies
List<HttpCookie> getCookies()Returns the cookies configured for the provider's WebSocket handshake. The returned list is unmodifiable, but itsHttpCookieelements are mutable.- Returns:
- an unmodifiable list of handshake cookies
- Since:
- 2.0
-
setMessageConnection
Supplies the asynchronous message connection created by a WebSocket client provider. Providers must call this before activating the connector;MessageConnectorowns subsequent message framing, scheduling, control-channel processing, and buffer lifecycle management.- Parameters:
connection- the provider-owned transport connection to bind- Since:
- 2.0
-