Class CryptoComStreamingService
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.cryptocom.CryptoComStreamingService
- Direct Known Subclasses:
CryptoComPrivateStreamingService
Handles the Crypto.com Exchange v1 WebSocket envelope shared by the public market-data feed and
the private user feed:
{"id","method","params":{"channels":[...]}} subscribe/unsubscribe
requests, {"id","method","code","result":{"channel","subscription","data":[...]}} push
messages, and the public/heartbeat / public/respond-heartbeat keepalive that the
server requires every ~30 seconds or it closes the connection.-
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
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> List<T> extractData(com.fasterxml.jackson.databind.JsonNode envelope, Class<T> elementType) Converts theresult.dataarray of a push message envelope, caching the list type.protected StringgetChannelNameFromMessage(com.fasterxml.jackson.databind.JsonNode message) getSubscribeMessage(String channelName, Object... args) getUnsubscribeMessage(String channelName, Object... args) protected voidhandleMessage(com.fasterxml.jackson.databind.JsonNode message) protected longMethods inherited from class info.bitrich.xchangestream.service.netty.JsonNettyStreamingService
messageHandler, processArrayMessageSeparately, sendObjectMessageMethods inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService
disconnect, getChannel, getCustomHeaders, getSubscriptionUniqueId, getWebSocketClientExtensionHandler, getWebSocketClientHandler, handleChannelError, handleChannelMessage, handleError, handleIdle, isSocketOpen, openConnection, resubscribeChannels, sendMessage, setAcceptAllCertificates, setAutoReconnect, setEnableLoggingHandler, setLoggingHandlerLevel, setSocksProxyHost, setSocksProxyPort, subscribeChannel, subscribeConnectionState, subscribeConnectionSuccess, subscribeDisconnect, subscribeIdle, subscribeReconnectFailure, useCompressedMessagesMethods inherited from class info.bitrich.xchangestream.service.ConnectableService
connect, setBeforeConnectionHandler
-
Constructor Details
-
CryptoComStreamingService
-
-
Method Details
-
nextRequestId
protected long nextRequestId() -
getSubscribeMessage
- Specified by:
getSubscribeMessagein classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>- Throws:
IOException
-
getUnsubscribeMessage
- Specified by:
getUnsubscribeMessagein classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>- Throws:
IOException
-
getChannelNameFromMessage
protected String getChannelNameFromMessage(com.fasterxml.jackson.databind.JsonNode message) throws IOException - Specified by:
getChannelNameFromMessagein classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>- Throws:
IOException
-
extractData
public <T> List<T> extractData(com.fasterxml.jackson.databind.JsonNode envelope, Class<T> elementType) Converts theresult.dataarray of a push message envelope, caching the list type. -
handleMessage
protected void handleMessage(com.fasterxml.jackson.databind.JsonNode message) - Overrides:
handleMessagein classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-