Class LiveFeedAdapter<MarketDataFormat>
java.lang.Object
com.neovisionaries.ws.client.WebSocketAdapter
net.finmath.smartcontract.valuation.marketdata.generators.legacy.LiveFeedAdapter<MarketDataFormat>
- Type Parameters:
MarketDataFormat
- the format of the output data
- All Implemented Interfaces:
com.neovisionaries.ws.client.WebSocketListener
- Direct Known Subclasses:
ReactiveMarketDataUpdater
public abstract class LiveFeedAdapter<MarketDataFormat>
extends com.neovisionaries.ws.client.WebSocketAdapter
Class to be implemented by adapters that emit market data in a reactive manner.
- Author:
- Luca Bressan
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract io.reactivex.rxjava3.core.Observable
<MarketDataFormat> Get the reactive source as an observable stream.abstract void
closeStreamsAndLogoff
(com.neovisionaries.ws.client.WebSocket webSocket) Requests that the remote data source closes all channels and logs off the user from the server.abstract void
writeDataset
(String writeDir, MarketDataFormat outputDataset, boolean isOvernightFixing) Serializes a dataset to a file.Methods inherited from class com.neovisionaries.ws.client.WebSocketAdapter
handleCallbackError, onBinaryFrame, onBinaryMessage, onCloseFrame, onConnected, onConnectError, onContinuationFrame, onDisconnected, onError, onFrame, onFrameError, onFrameSent, onFrameUnsent, onMessageDecompressionError, onMessageError, onPingFrame, onPongFrame, onSendError, onSendingFrame, onSendingHandshake, onStateChanged, onTextFrame, onTextMessage, onTextMessage, onTextMessageError, onThreadCreated, onThreadStarted, onThreadStopping, onUnexpectedError
-
Constructor Details
-
LiveFeedAdapter
public LiveFeedAdapter()
-
-
Method Details
-
closeStreamsAndLogoff
public abstract void closeStreamsAndLogoff(com.neovisionaries.ws.client.WebSocket webSocket) Requests that the remote data source closes all channels and logs off the user from the server.- Parameters:
webSocket
- the Websocket onto which the request must be sent. Implementation of adapters with local sources should be able to handle a null parameter.
-
asObservable
Get the reactive source as an observable stream.- Returns:
- the observable stream.
-
writeDataset
public abstract void writeDataset(String writeDir, MarketDataFormat outputDataset, boolean isOvernightFixing) throws IOException Serializes a dataset to a file.- Parameters:
writeDir
- the target folder for the serialization file.outputDataset
- the dataset to be serialized.isOvernightFixing
- must be set to true if the date for overnight fixings should be rolled during serialization. Adapters implementing this class that perform rolling at the emission level should ignore this parameter.- Throws:
IOException
- if the write operation fails.
-