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

public interface IWSConnector extends IConnector
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.
  • Field Details

    • ACCEPTOR_NAME_PREFIX

      static final String ACCEPTOR_NAME_PREFIX
      Prefix used in a WebSocket path segment to identify the target acceptor.
      See Also:
    • ACCEPTOR_HEADER_NAME

      static final String 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 ws or wss scheme
    • 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.messageConnections product group
      Since:
      2.0
    • getCookies

      List<HttpCookie> getCookies()
      Returns the cookies configured for the provider's WebSocket handshake. The returned list is unmodifiable, but its HttpCookie elements are mutable.
      Returns:
      an unmodifiable list of handshake cookies
      Since:
      2.0
    • setMessageConnection

      void setMessageConnection(MessageConnector.IMessageConnection connection)
      Supplies the asynchronous message connection created by a WebSocket client provider. Providers must call this before activating the connector; MessageConnector owns subsequent message framing, scheduling, control-channel processing, and buffer lifecycle management.
      Parameters:
      connection - the provider-owned transport connection to bind
      Since:
      2.0