Class CoinbaseProStreamingService
java.lang.Object
info.bitrich.xchangestream.service.ConnectableService
info.bitrich.xchangestream.service.netty.NettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
info.bitrich.xchangestream.service.netty.JsonNettyStreamingService
info.bitrich.xchangestream.coinbasepro.CoinbaseProStreamingService
-
Nested Class Summary
Nested classes/interfaces inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService
NettyStreamingService.NettyWebSocketClientHandler, NettyStreamingService.Subscription -
Field Summary
Fields inherited from class info.bitrich.xchangestream.service.netty.JsonNettyStreamingService
objectMapperFields inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService
channels, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_IDLE_TIMEOUT, DEFAULT_RETRY_DURATION, uriFields inherited from class info.bitrich.xchangestream.service.ConnectableService
BEFORE_CONNECTION_HANDLER -
Constructor Summary
ConstructorsConstructorDescriptionCoinbaseProStreamingService(String apiUrl, int maxFramePayloadLength, Duration connectionTimeout, Duration retryDuration, int idleTimeoutSeconds, Supplier<CoinbaseProWebsocketAuthData> authData, CoinbaseProOrderBookMode orderBookMode) CoinbaseProStreamingService(String apiUrl, Supplier<CoinbaseProWebsocketAuthData> authData, CoinbaseProOrderBookMode orderBookMode) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetChannelNameFromMessage(com.fasterxml.jackson.databind.JsonNode message) io.reactivex.rxjava3.core.Observable<CoinbaseProWebSocketTransaction>getRawWebSocketTransactions(CurrencyPair currencyPair, boolean filterChannelName) Subscribes to web socket transactions related to the specified currency, in their raw format.getSubscribeMessage(String channelName, Object... args) getSubscriptionUniqueId(String channelName, Object... args) getUnsubscribeMessage(String channelName, Object... args) protected io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandlerprotected WebSocketClientHandlergetWebSocketClientHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, WebSocketClientHandler.WebSocketMessageHandler handler) protected voidhandleChannelMessage(String channel, com.fasterxml.jackson.databind.JsonNode message) voidsetChannelInactiveHandler(WebSocketClientHandler.WebSocketMessageHandler channelInactiveHandler) io.reactivex.rxjava3.core.Observable<com.fasterxml.jackson.databind.JsonNode>subscribeChannel(String channelName, Object... args) Subscribes to the provided channel name, maintains a cache of subscriptions, in order not to subscribe more than once to the same channel.voidsubscribeMultipleCurrencyPairs(ProductSubscription... products) Methods inherited from class info.bitrich.xchangestream.service.netty.JsonNettyStreamingService
messageHandler, processArrayMessageSeparately, sendObjectMessageMethods inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService
disconnect, getChannel, getCustomHeaders, handleChannelError, handleError, handleIdle, handleMessage, isSocketOpen, openConnection, resubscribeChannels, sendMessage, setAcceptAllCertificates, setAutoReconnect, setEnableLoggingHandler, setLoggingHandlerLevel, setSocksProxyHost, setSocksProxyPort, subscribeConnectionState, subscribeConnectionSuccess, subscribeDisconnect, subscribeIdle, subscribeReconnectFailure, useCompressedMessagesMethods inherited from class info.bitrich.xchangestream.service.ConnectableService
connect, setBeforeConnectionHandler
-
Constructor Details
-
CoinbaseProStreamingService
public CoinbaseProStreamingService(String apiUrl, Supplier<CoinbaseProWebsocketAuthData> authData, CoinbaseProOrderBookMode orderBookMode) -
CoinbaseProStreamingService
public CoinbaseProStreamingService(String apiUrl, int maxFramePayloadLength, Duration connectionTimeout, Duration retryDuration, int idleTimeoutSeconds, Supplier<CoinbaseProWebsocketAuthData> authData, CoinbaseProOrderBookMode orderBookMode)
-
-
Method Details
-
getProduct
-
getSubscriptionUniqueId
- Overrides:
getSubscriptionUniqueIdin classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-
subscribeChannel
public io.reactivex.rxjava3.core.Observable<com.fasterxml.jackson.databind.JsonNode> subscribeChannel(String channelName, Object... args) Subscribes to the provided channel name, maintains a cache of subscriptions, in order not to subscribe more than once to the same channel.- Overrides:
subscribeChannelin classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>- Parameters:
channelName- the name of the requested channel.- Returns:
- an Observable of json objects coming from the exchange.
-
getRawWebSocketTransactions
public io.reactivex.rxjava3.core.Observable<CoinbaseProWebSocketTransaction> getRawWebSocketTransactions(CurrencyPair currencyPair, boolean filterChannelName) Subscribes to web socket transactions related to the specified currency, in their raw format.- Parameters:
currencyPair- The currency pair.- Returns:
- The stream.
-
getChannelNameFromMessage
- Specified by:
getChannelNameFromMessagein classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-
getSubscribeMessage
- Specified by:
getSubscribeMessagein classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>- Throws:
IOException
-
getUnsubscribeMessage
- Specified by:
getUnsubscribeMessagein classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>- Throws:
IOException
-
getWebSocketClientExtensionHandler
protected io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler getWebSocketClientExtensionHandler()- Overrides:
getWebSocketClientExtensionHandlerin classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-
getWebSocketClientHandler
protected WebSocketClientHandler getWebSocketClientHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, WebSocketClientHandler.WebSocketMessageHandler handler) - Overrides:
getWebSocketClientHandlerin classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-
setChannelInactiveHandler
public void setChannelInactiveHandler(WebSocketClientHandler.WebSocketMessageHandler channelInactiveHandler) -
subscribeMultipleCurrencyPairs
-
handleChannelMessage
protected void handleChannelMessage(String channel, com.fasterxml.jackson.databind.JsonNode message) - Overrides:
handleChannelMessagein classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-