Class NettyStreamingService<T>

    • Constructor Detail

      • NettyStreamingService

        public NettyStreamingService​(String apiUrl)
      • NettyStreamingService

        public NettyStreamingService​(String apiUrl,
                                     int maxFramePayloadLength)
      • NettyStreamingService

        public NettyStreamingService​(String apiUrl,
                                     int maxFramePayloadLength,
                                     Duration connectionTimeout,
                                     Duration retryDuration)
      • NettyStreamingService

        public NettyStreamingService​(String apiUrl,
                                     int maxFramePayloadLength,
                                     Duration connectionTimeout,
                                     Duration retryDuration,
                                     int idleTimeoutSeconds)
    • Method Detail

      • getCustomHeaders

        protected io.netty.handler.codec.http.DefaultHttpHeaders getCustomHeaders()
      • disconnect

        public io.reactivex.Completable disconnect()
      • getSubscriptionUniqueId

        public String getSubscriptionUniqueId​(String channelName,
                                              Object... args)
      • messageHandler

        public abstract void messageHandler​(String message)
        Handler that receives incoming messages.
        Parameters:
        message - Content of the message from the server.
      • sendMessage

        public void sendMessage​(String message)
      • subscribeReconnectFailure

        public io.reactivex.Observable<Throwable> subscribeReconnectFailure()
      • subscribeConnectionSuccess

        public io.reactivex.Observable<Object> subscribeConnectionSuccess()
      • subscribeDisconnect

        public io.reactivex.Observable<Object> subscribeDisconnect()
      • subscribeChannel

        public io.reactivex.Observable<T> subscribeChannel​(String channelName,
                                                           Object... args)
      • resubscribeChannels

        public void resubscribeChannels()
      • getChannel

        protected String getChannel​(T message)
      • handleMessage

        protected void handleMessage​(T message)
      • handleError

        protected void handleError​(T message,
                                   Throwable t)
      • handleIdle

        protected void handleIdle​(io.netty.channel.ChannelHandlerContext ctx)
      • subscribeIdle

        public io.reactivex.Observable<Object> subscribeIdle()
        Observable which fires if the websocket is deemed idle, only fired if idleTimeoutSeconds != 0.
      • handleChannelMessage

        protected void handleChannelMessage​(String channel,
                                            T message)
      • handleChannelError

        protected void handleChannelError​(String channel,
                                          Throwable t)
      • getWebSocketClientExtensionHandler

        protected io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler getWebSocketClientExtensionHandler()
      • isSocketOpen

        public boolean isSocketOpen()
      • useCompressedMessages

        public void useCompressedMessages​(boolean compressedMessages)
      • setAcceptAllCertificates

        public void setAcceptAllCertificates​(boolean acceptAllCertificates)
      • setEnableLoggingHandler

        public void setEnableLoggingHandler​(boolean enableLoggingHandler)
      • setLoggingHandlerLevel

        public void setLoggingHandlerLevel​(io.netty.handler.logging.LogLevel loggingHandlerLevel)
      • setSocksProxyHost

        public void setSocksProxyHost​(String socksProxyHost)
      • setSocksProxyPort

        public void setSocksProxyPort​(Integer socksProxyPort)
      • setAutoReconnect

        public void setAutoReconnect​(boolean autoReconnect)