Class CoinsphStreamingService
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.coinsph.CoinsphStreamingService
-
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
ConstructorsConstructorDescriptionCoinsphStreamingService(CoinsphStreamingExchange exchange, StreamingExchangeConfiguration config) Constructor for User Data Streaming Service.CoinsphStreamingService(String apiUrl, CoinsphAccountServiceRaw accountServiceRaw, boolean isPrivateService) Constructor for Public Streaming Service. -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Completableconnect()io.reactivex.rxjava3.core.CompletableGets the API URL for this service.protected StringgetChannelNameFromMessage(com.fasterxml.jackson.databind.JsonNode message) getSubscribeMessage(String channelName, Object... args) getSubscriptionUniqueId(String channelName, Object... args) getUnsubscribeMessage(String channelName, Object... args) protected io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandlerprotected voidhandleMessage(com.fasterxml.jackson.databind.JsonNode message) booleanio.reactivex.rxjava3.core.Observable<com.fasterxml.jackson.databind.JsonNode> subscribeChannel(String channelName, Object... args) Methods inherited from class info.bitrich.xchangestream.service.netty.JsonNettyStreamingService
messageHandler, processArrayMessageSeparately, sendObjectMessageMethods inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService
getChannel, getCustomHeaders, getWebSocketClientHandler, handleChannelError, handleChannelMessage, handleError, handleIdle, isSocketOpen, openConnection, resubscribeChannels, sendMessage, setAcceptAllCertificates, setAutoReconnect, setEnableLoggingHandler, setLoggingHandlerLevel, setSocksProxyHost, setSocksProxyPort, subscribeConnectionState, subscribeConnectionSuccess, subscribeDisconnect, subscribeIdle, subscribeReconnectFailure, useCompressedMessagesMethods inherited from class info.bitrich.xchangestream.service.ConnectableService
setBeforeConnectionHandler
-
Constructor Details
-
CoinsphStreamingService
public CoinsphStreamingService(CoinsphStreamingExchange exchange, StreamingExchangeConfiguration config) throws IOException Constructor for User Data Streaming Service. Obtains a listenKey and constructs the full WebSocket URI before initializing the superclass.- Parameters:
exchange- The CoinsphStreamingExchange instance.config- The streaming configuration.- Throws:
IOException- if listenKey cannot be obtained.
-
CoinsphStreamingService
public CoinsphStreamingService(String apiUrl, CoinsphAccountServiceRaw accountServiceRaw, boolean isPrivateService) Constructor for Public Streaming Service.- Parameters:
apiUrl- The WebSocket API URL.accountServiceRaw- Not used for public streams, can be null.isPrivateService- Flag to indicate if this is a private service.
-
-
Method Details
-
getApiUrl
Gets the API URL for this service. -
connect
public io.reactivex.rxjava3.core.Completable connect()- Overrides:
connectin classConnectableService
-
getChannelNameFromMessage
protected String getChannelNameFromMessage(com.fasterxml.jackson.databind.JsonNode message) throws IOException - Specified by:
getChannelNameFromMessagein classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>- Throws:
IOException
-
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>
-
handleMessage
protected void handleMessage(com.fasterxml.jackson.databind.JsonNode message) - Overrides:
handleMessagein classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-
subscribeChannel
public io.reactivex.rxjava3.core.Observable<com.fasterxml.jackson.databind.JsonNode> subscribeChannel(String channelName, Object... args) - Overrides:
subscribeChannelin classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-
isConnecting
public boolean isConnecting() -
disconnect
public io.reactivex.rxjava3.core.Completable disconnect()- Overrides:
disconnectin classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-
getSubscriptionUniqueId
- Overrides:
getSubscriptionUniqueIdin classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-