public abstract class HistoryStorage extends SynchronizationListener
SynchronizationListener.HealthStatus| Constructor and Description |
|---|
HistoryStorage() |
| Modifier and Type | Method and Description |
|---|---|
abstract CompletableFuture<Void> |
clear()
Clears the storage and deletes persistent data
|
abstract List<MetatraderDeal> |
getDeals()
Returns all deals stored in history storage
|
abstract List<MetatraderOrder> |
getHistoryOrders()
Returns all history orders stored in history storage
|
CompletableFuture<IsoTime> |
getLastDealTime()
Returns the time of the last history deal record stored in the history storage
|
abstract CompletableFuture<IsoTime> |
getLastDealTime(Integer instanceIndex)
Returns the time of the last history deal record stored in the history storage
|
abstract Map<Integer,Long> |
getLastDealTimeByInstanceIndex()
Returns times of last deals by instance indices
|
CompletableFuture<IsoTime> |
getLastHistoryOrderTime()
Returns the time of the last history order record stored in the history storage
|
abstract CompletableFuture<IsoTime> |
getLastHistoryOrderTime(Integer instanceIndex)
Returns the time of the last history order record stored in the history storage
|
abstract Map<Integer,Long> |
getLastHistoryOrderTimeByInstanceIndex()
Returns times of last history orders by instance indices
|
abstract CompletableFuture<Void> |
initialize()
Initializes the storage and loads required data from a persistent storage
|
boolean |
isDealSynchronizationFinished()
Returns flag indicating whether deal history synchronization have finished
|
boolean |
isOrderSynchronizationFinished()
Returns flag indicating whether order history synchronization have finished
|
abstract CompletableFuture<Void> |
loadData()
Loads history data from the file manager
|
CompletableFuture<Void> |
onConnected(int instanceIndex,
int replicas)
Invoked when connection to MetaTrader terminal established
|
abstract CompletableFuture<Void> |
onDealAdded(int instanceIndex,
MetatraderDeal deal)
Invoked when a new MetaTrader history deal is added
|
CompletableFuture<Void> |
onDealSynchronizationFinished(int instanceIndex,
String synchronizationId)
Invoked when a synchronization of history deals on a MetaTrader account have finished
|
abstract CompletableFuture<Void> |
onHistoryOrderAdded(int instanceIndex,
MetatraderOrder historyOrder)
Invoked when a new MetaTrader history order is added
|
CompletableFuture<Void> |
onOrderSynchronizationFinished(int instanceIndex,
String synchronizationId)
Invoked when a synchronization of history orders on a MetaTrader account have finished
|
abstract CompletableFuture<Void> |
updateStorage()
Saves unsaved history items to storage
|
onAccountInformationUpdated, onBrokerConnectionStatusChanged, onDisconnected, onHealthStatus, onOrderCompleted, onOrdersReplaced, onOrderUpdated, onPositionRemoved, onPositionsReplaced, onPositionUpdated, onSymbolPricesUpdated, onSymbolPriceUpdated, onSymbolSpecificationUpdated, onSynchronizationStartedpublic abstract CompletableFuture<Void> initialize()
public abstract List<MetatraderDeal> getDeals()
public abstract List<MetatraderOrder> getHistoryOrders()
public abstract Map<Integer,Long> getLastDealTimeByInstanceIndex()
public abstract Map<Integer,Long> getLastHistoryOrderTimeByInstanceIndex()
public abstract CompletableFuture<Void> loadData()
public abstract CompletableFuture<Void> updateStorage()
public boolean isOrderSynchronizationFinished()
public boolean isDealSynchronizationFinished()
public abstract CompletableFuture<Void> clear()
public CompletableFuture<IsoTime> getLastHistoryOrderTime()
public abstract CompletableFuture<IsoTime> getLastHistoryOrderTime(Integer instanceIndex)
instanceIndex - index of an account instance connected, or nullpublic CompletableFuture<IsoTime> getLastDealTime()
public abstract CompletableFuture<IsoTime> getLastDealTime(Integer instanceIndex)
instanceIndex - index of an account instance connected, or nullpublic abstract CompletableFuture<Void> onHistoryOrderAdded(int instanceIndex, MetatraderOrder historyOrder)
SynchronizationListeneronHistoryOrderAdded in class SynchronizationListenerinstanceIndex - index of an account instance connectedhistoryOrder - new MetaTrader history orderpublic abstract CompletableFuture<Void> onDealAdded(int instanceIndex, MetatraderDeal deal)
SynchronizationListeneronDealAdded in class SynchronizationListenerinstanceIndex - index of an account instance connecteddeal - new MetaTrader history dealpublic CompletableFuture<Void> onDealSynchronizationFinished(int instanceIndex, String synchronizationId)
SynchronizationListeneronDealSynchronizationFinished in class SynchronizationListenerinstanceIndex - index of an account instance connectedsynchronizationId - synchronization request idpublic CompletableFuture<Void> onOrderSynchronizationFinished(int instanceIndex, String synchronizationId)
SynchronizationListeneronOrderSynchronizationFinished in class SynchronizationListenerinstanceIndex - index of an account instance connectedsynchronizationId - synchronization request idpublic CompletableFuture<Void> onConnected(int instanceIndex, int replicas)
SynchronizationListeneronConnected in class SynchronizationListenerinstanceIndex - index of an account instance connectedreplicas - number of account replicas launchedCopyright © 2021. All rights reserved.