public class WebsocketUserStream extends WebsocketStream<net.quedex.api.user.UserMessageReceiver> implements UserStream
UserStream.BatchmessageReceiver, webSocketClient| Constructor and Description |
|---|
WebsocketUserStream(Config config) |
WebsocketUserStream(java.lang.String streamUrl,
long accountId,
int nonceGroup,
BcPublicKey qdxPublicKey,
BcPrivateKey userPrivateKey) |
| Modifier and Type | Method and Description |
|---|---|
UserStream.Batch |
batch()
Returns an object (not thread-safe) which may be used fluently to send a batch of
OrderSpecs to the
exchange. |
void |
batch(java.util.List<? extends OrderSpec> batch)
Sends the given list of
OrderSpecs to the exchange. |
void |
cancelOrder(OrderCancelSpec orderCancelSpec)
Sends the given
OrderCancelSpec to the exchange. |
void |
executeInternalTransfer(InternalTransfer internalTransfer) |
void |
modifyOrder(OrderModificationSpec orderModificationSpec)
Sends the given
OrderModificationSpec to the exchange. |
void |
placeOrder(LimitOrderSpec limitOrderSpec)
Sends the given
LimitOrderSpec to the exchange. |
void |
registerAccountStateListener(AccountStateListener accountStateListener) |
void |
registerInternalTransferListener(InternalTransferListener listener) |
void |
registerOpenPositionListener(OpenPositionListener openPositionListener) |
void |
registerOrderListener(OrderListener orderListener) |
void |
registerStreamFailureListener(StreamFailureListener streamFailureListener) |
void |
start() |
void |
stop() |
void |
subscribeListeners()
Subscribes previously registered listeners.
|
public WebsocketUserStream(java.lang.String streamUrl,
long accountId,
int nonceGroup,
BcPublicKey qdxPublicKey,
BcPrivateKey userPrivateKey)
public WebsocketUserStream(Config config)
public void registerStreamFailureListener(StreamFailureListener streamFailureListener)
registerStreamFailureListener in interface UserStreamregisterStreamFailureListener in class WebsocketStream<net.quedex.api.user.UserMessageReceiver>public void start()
throws CommunicationException
start in interface UserStreamstart in class WebsocketStream<net.quedex.api.user.UserMessageReceiver>CommunicationExceptionpublic void registerOrderListener(OrderListener orderListener)
registerOrderListener in interface UserStreampublic void registerOpenPositionListener(OpenPositionListener openPositionListener)
registerOpenPositionListener in interface UserStreampublic void registerAccountStateListener(AccountStateListener accountStateListener)
registerAccountStateListener in interface UserStreampublic void registerInternalTransferListener(InternalTransferListener listener)
registerInternalTransferListener in interface UserStreampublic void subscribeListeners()
UserStreamOrderPlaced item for each pending order OpenPosition item for each opened position AccountState
The first received AccountState marks the end of the welcome package and may be used to detect the end
of initialisation.
subscribeListeners in interface UserStreampublic void placeOrder(LimitOrderSpec limitOrderSpec)
UserStreamLimitOrderSpec to the exchange. This method is asynchronous - the fact that it returned
does not guarantee that the command has been received nor processed by the exchange.placeOrder in interface UserStreampublic void cancelOrder(OrderCancelSpec orderCancelSpec)
UserStreamOrderCancelSpec to the exchange. This method is asynchronous - the fact that it returned
does not guarantee that the command has been received nor processed by the exchange.cancelOrder in interface UserStreampublic void modifyOrder(OrderModificationSpec orderModificationSpec)
UserStreamOrderModificationSpec to the exchange. This method is asynchronous - the fact that it
returned does not guarantee that the command has been received nor processed by the exchange.modifyOrder in interface UserStreampublic UserStream.Batch batch()
UserStreamOrderSpecs to the
exchange. Calling UserStream.Batch.send() sends batched OrderSpecs to the exchange. This method is
asynchronous - the fact that it returned does not guarantee that the commands have been received nor processed by
the exchange.batch in interface UserStreampublic void batch(java.util.List<? extends OrderSpec> batch)
UserStreamOrderSpecs to the exchange. This method is asynchronous - the fact that it
returned does not guarantee that the commands have been received nor processed by the exchange.batch in interface UserStreampublic void executeInternalTransfer(InternalTransfer internalTransfer)
executeInternalTransfer in interface UserStreampublic void stop()
throws CommunicationException
stop in interface UserStreamstop in class WebsocketStream<net.quedex.api.user.UserMessageReceiver>CommunicationException