Class WebSocketClient

    • Constructor Detail

      • WebSocketClient

        public WebSocketClient()
        Deprecated.
        Instantiate a WebSocketClient with defaults.
      • WebSocketClient

        public WebSocketClient​(HttpClient httpClient)
        Deprecated.
        Instantiate a WebSocketClient using provided HttpClient.
        Parameters:
        httpClient - the HttpClient to use for WebSocketClient.
      • WebSocketClient

        public WebSocketClient​(HttpClient httpClient,
                               DecoratedObjectFactory decoratedObjectFactory)
        Deprecated.
        Instantiate a WebSocketClient using HttpClient for defaults
        Parameters:
        httpClient - the HttpClient that underlying WebSocket client uses
        decoratedObjectFactory - the DecoratedObjectFactory for all client instantiated classes
      • WebSocketClient

        @Deprecated
        public WebSocketClient​(java.util.concurrent.Executor executor)
        Deprecated.
        Create a new WebSocketClient
        Parameters:
        executor - the executor to use on the internal HttpClient
      • WebSocketClient

        @Deprecated
        public WebSocketClient​(SslContextFactory sslContextFactory,
                               java.util.concurrent.Executor executor)
        Deprecated.
        Create a new WebSocketClient
        Parameters:
        sslContextFactory - ssl context factory to use on the internal HttpClient
        executor - the executor to use on the internal HttpClient
      • WebSocketClient

        @Deprecated
        public WebSocketClient​(WebSocketContainerScope scope)
        Deprecated.
        Create WebSocketClient other Container Scope, to allow sharing of internal features like Executor, ByteBufferPool, SSLContextFactory, etc.
        Parameters:
        scope - the Container Scope
      • WebSocketClient

        @Deprecated
        public WebSocketClient​(SslContextFactory sslContextFactory,
                               java.util.concurrent.Executor executor,
                               ByteBufferPool bufferPool)
        Deprecated.
        Create WebSocketClient using sharing instances of SSLContextFactory Executor, and ByteBufferPool
        Parameters:
        sslContextFactory - shared SSL ContextFactory
        executor - shared Executor
        bufferPool - shared ByteBufferPool
      • WebSocketClient

        public WebSocketClient​(WebSocketContainerScope scope,
                               EventDriverFactory eventDriverFactory,
                               SessionFactory sessionFactory,
                               HttpClient httpClient)
        Deprecated.
        Create WebSocketClient based on pre-existing Container Scope, to allow sharing of internal features like Executor, ByteBufferPool, SSLContextFactory, etc.
        Parameters:
        scope - the Container Scope
        eventDriverFactory - the EventDriver Factory to use
        sessionFactory - the SessionFactory to use
        httpClient - the httpClient to use
    • Method Detail

      • connect

        public java.util.concurrent.Future<Session> connect​(java.lang.Object websocket,
                                                            java.net.URI toUri)
                                                     throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • connect

        public java.util.concurrent.Future<Session> connect​(java.lang.Object websocket,
                                                            java.net.URI toUri,
                                                            ClientUpgradeRequest request)
                                                     throws java.io.IOException
        Deprecated.
        Connect to remote websocket endpoint
        Parameters:
        websocket - the websocket object
        toUri - the websocket uri to connect to
        request - the upgrade request information
        Returns:
        the future for the session, available on success of connect
        Throws:
        java.io.IOException - if unable to connect
      • connect

        public java.util.concurrent.Future<Session> connect​(java.lang.Object websocket,
                                                            java.net.URI toUri,
                                                            ClientUpgradeRequest request,
                                                            UpgradeListener upgradeListener)
                                                     throws java.io.IOException
        Deprecated.
        Connect to remote websocket endpoint
        Parameters:
        websocket - the websocket object
        toUri - the websocket uri to connect to
        request - the upgrade request information
        upgradeListener - the upgrade listener
        Returns:
        the future for the session, available on success of connect
        Throws:
        java.io.IOException - if unable to connect
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Deprecated.
        Description copied from interface: WebSocketContainerScope

        The ClassLoader used to load classes for the WebSocketSession.

        By default this will be the ContextClassLoader at the time this method is called. However this will be overridden by the WebSocketClient to use the ContextClassLoader at the time it was created, this is because the client uses its own ThreadPool so the WebSocketSessions may be created when the ContextClassLoader is not set.

        Specified by:
        getClassLoader in interface WebSocketContainerScope
        Returns:
        the classloader.
      • setEventDriverFactory

        public void setEventDriverFactory​(EventDriverFactory eventDriverFactory)
        Deprecated.
      • setSessionFactory

        public void setSessionFactory​(SessionFactory sessionFactory)
        Deprecated.
      • isDispatchIO

        @Deprecated
        public boolean isDispatchIO()
        Deprecated.
      • getAsyncWriteTimeout

        @Deprecated
        public long getAsyncWriteTimeout()
        Deprecated.
        Return the number of milliseconds for a timeout of an attempted write operation.
        Returns:
        number of milliseconds for timeout of an attempted write operation
      • getBindAddress

        public java.net.SocketAddress getBindAddress()
        Deprecated.
      • getConnectionManager

        @Deprecated
        public ConnectionManager getConnectionManager()
        Deprecated.
      • getConnectTimeout

        public long getConnectTimeout()
        Deprecated.
      • getCookieStore

        public java.net.CookieStore getCookieStore()
        Deprecated.
      • getExtensionFactory

        public ExtensionFactory getExtensionFactory()
        Deprecated.
      • getMasker

        @Deprecated
        public Masker getMasker()
        Deprecated.
        not used, no replacement
        Returns:
        a RandomMasker instance
      • getMaxBinaryMessageBufferSize

        public int getMaxBinaryMessageBufferSize()
        Deprecated.
        Get the maximum size for buffering of a binary message.
        Returns:
        the maximum size of a binary message buffer.
      • getMaxBinaryMessageSize

        public long getMaxBinaryMessageSize()
        Deprecated.
        Get the maximum size for a binary message.
        Returns:
        the maximum size of a binary message.
      • getMaxIdleTimeout

        public long getMaxIdleTimeout()
        Deprecated.
        Get the max idle timeout for new connections.
        Returns:
        the max idle timeout in milliseconds for new connections.
      • getMaxTextMessageBufferSize

        public int getMaxTextMessageBufferSize()
        Deprecated.
        Get the maximum size for buffering of a text message.
        Returns:
        the maximum size of a text message buffer.
      • getMaxTextMessageSize

        public long getMaxTextMessageSize()
        Deprecated.
        Get the maximum size for a text message.
        Returns:
        the maximum size of a text message.
      • getOpenSessions

        public java.util.Set<WebSocketSession> getOpenSessions()
        Deprecated.
      • getScheduler

        public Scheduler getScheduler()
        Deprecated.
      • getSessionFactory

        public SessionFactory getSessionFactory()
        Deprecated.
      • setAsyncWriteTimeout

        public void setAsyncWriteTimeout​(long ms)
        Deprecated.
      • setBindAddress

        public void setBindAddress​(java.net.SocketAddress bindAddress)
        Deprecated.
        Sets the Bind Address on the internal HttpClient.
        Parameters:
        bindAddress - the local bind address for the internal HttpClient
      • setBufferPool

        public void setBufferPool​(ByteBufferPool bufferPool)
        Deprecated.
        Set's the Bind Address on the internal HttpClient.
        Parameters:
        bufferPool - The buffer pool
      • setConnectTimeout

        public void setConnectTimeout​(long ms)
        Deprecated.
        Set the timeout for connecting to the remote server on the internal HttpClient
        Parameters:
        ms - the timeout in milliseconds
      • setCookieStore

        public void setCookieStore​(java.net.CookieStore cookieStore)
        Deprecated.
        Set the CookieStore to use on the internal HttpClient
        Parameters:
        cookieStore - The cookie store
      • setDaemon

        @Deprecated
        public void setDaemon​(boolean daemon)
        Deprecated.
        not used, configure threading in HttpClient instead
        Parameters:
        daemon - do nothing
      • setDispatchIO

        @Deprecated
        public void setDispatchIO​(boolean dispatchIO)
        Deprecated.
        no longer used, this has no replacement
        Parameters:
        dispatchIO - true to have IO operations be dispatched to Executor
      • setExecutor

        public void setExecutor​(java.util.concurrent.Executor executor)
        Deprecated.
        Sets the Executor in use on the internal HttpClient
        Parameters:
        executor - The executor to use
      • setMasker

        @Deprecated
        public void setMasker​(Masker masker)
        Deprecated.
        not used, no replacement
        Parameters:
        masker - does nothing
      • setMaxBinaryMessageBufferSize

        public void setMaxBinaryMessageBufferSize​(int max)
        Deprecated.
      • setMaxIdleTimeout

        public void setMaxIdleTimeout​(long ms)
        Deprecated.
        Set the max idle timeout for new connections.

        Existing connections will not have their max idle timeout adjusted.

        Parameters:
        ms - the timeout in milliseconds
      • setMaxTextMessageBufferSize

        public void setMaxTextMessageBufferSize​(int max)
        Deprecated.
      • getHttpClient

        public HttpClient getHttpClient()
        Deprecated.
        Get the internal HttpClient.

        Note: this can result in a LinkageError if used within a WebApp that runs on a server that also has HttpClient on the server classpath.

        Returns:
        the internal HttpClient
      • setStopAtShutdown

        public void setStopAtShutdown​(boolean stop)
        Deprecated.
        Set JVM shutdown behavior.
        Parameters:
        stop - If true, this client instance will be explicitly stopped when the JVM is shutdown. Otherwise the application is responsible for maintaining the WebSocketClient lifecycle.
        See Also:
        Runtime.addShutdownHook(Thread), ShutdownThread
      • isStopAtShutdown

        public boolean isStopAtShutdown()
        Deprecated.
      • equals

        public boolean equals​(java.lang.Object o)
        Deprecated.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class java.lang.Object