public interface UserStream
batch() methods and should be used whenever possible. The data exchanged on the
stream has the form of PGP-encrypted messages - all the encryption/decryption and serialization/deserialization is
handled by the implementations and the interaction with the stream is based on Java objects.
The stream gives some guarantees about the order of received events useful for state initialisation - see
documentation of subscribeListeners().
To handle all errors properly, always registerStreamFailureListener(net.quedex.api.common.StreamFailureListener) before start()ing the stream.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
UserStream.Batch |
| 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.
|
void registerStreamFailureListener(StreamFailureListener streamFailureListener)
void start()
throws CommunicationException
CommunicationExceptionvoid registerOrderListener(OrderListener orderListener)
void registerOpenPositionListener(OpenPositionListener openPositionListener)
void registerAccountStateListener(AccountStateListener accountStateListener)
void registerInternalTransferListener(InternalTransferListener listener)
void subscribeListeners()
OrderPlaced 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.
void placeOrder(LimitOrderSpec limitOrderSpec)
LimitOrderSpec 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.void cancelOrder(OrderCancelSpec orderCancelSpec)
OrderCancelSpec 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.void modifyOrder(OrderModificationSpec orderModificationSpec)
OrderModificationSpec 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.UserStream.Batch batch()
OrderSpecs 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.void batch(java.util.List<? extends OrderSpec> batch)
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.void executeInternalTransfer(InternalTransfer internalTransfer)
void stop() throws CommunicationException
CommunicationException