public class MemoryHistoryStorage extends HistoryStorage
SynchronizationListener.HealthStatus| Constructor and Description |
|---|
MemoryHistoryStorage(String accountId)
Constructs the in-memory history store instance with default parameters
|
MemoryHistoryStorage(String accountId,
String application)
Constructs the in-memory history store instance
|
| Modifier and Type | Method and Description |
|---|---|
List<MetatraderDeal> |
getDeals()
Returns all deals stored in history storage
|
List<MetatraderOrder> |
getHistoryOrders()
Returns all history orders stored in history storage
|
CompletableFuture<IsoTime> |
getLastDealTime(Integer instanceIndex)
Returns the time of the last history deal record stored in the history storage
|
Map<Integer,Long> |
getLastDealTimeByInstanceIndex()
Returns times of last deals by instance indices
|
CompletableFuture<IsoTime> |
getLastHistoryOrderTime(Integer instanceIndex)
Returns the time of the last history order record stored in the history storage
|
Map<Integer,Long> |
getLastHistoryOrderTimeByInstanceIndex()
Returns times of last history orders by instance indices
|
CompletableFuture<Void> |
loadData()
Loads history data from the file manager
|
CompletableFuture<Void> |
loadDataFromDisk()
Loads history data from the file manager.
|
CompletableFuture<Void> |
onDealAdded(int instanceIndex,
MetatraderDeal newDeal)
Invoked when a new MetaTrader history deal is added
|
CompletableFuture<Void> |
onHistoryOrderAdded(int instanceIndex,
MetatraderOrder historyOrder)
Invoked when a new MetaTrader history order is added
|
void |
reset()
Resets the storage
|
CompletableFuture<Void> |
updateDiskStorage()
Saves unsaved history items to disk storage.
|
CompletableFuture<Void> |
updateStorage()
Saves unsaved history items to storage
|
getLastDealTime, getLastHistoryOrderTime, isDealSynchronizationFinished, isOrderSynchronizationFinished, onConnected, onDealSynchronizationFinished, onOrderSynchronizationFinishedonAccountInformationUpdated, onBrokerConnectionStatusChanged, onDisconnected, onHealthStatus, onOrderCompleted, onOrdersReplaced, onOrderUpdated, onPositionRemoved, onPositionsReplaced, onPositionUpdated, onSymbolPricesUpdated, onSymbolPriceUpdated, onSymbolSpecificationUpdated, onSynchronizationStartedpublic MemoryHistoryStorage(String accountId)
accountId - account idpublic List<MetatraderDeal> getDeals()
HistoryStoragegetDeals in class HistoryStoragepublic List<MetatraderOrder> getHistoryOrders()
HistoryStoragegetHistoryOrders in class HistoryStoragepublic Map<Integer,Long> getLastDealTimeByInstanceIndex()
HistoryStoragegetLastDealTimeByInstanceIndex in class HistoryStoragepublic Map<Integer,Long> getLastHistoryOrderTimeByInstanceIndex()
HistoryStoragegetLastHistoryOrderTimeByInstanceIndex in class HistoryStoragepublic void reset()
HistoryStoragereset in class HistoryStoragepublic CompletableFuture<Void> loadData()
HistoryStorageloadData in class HistoryStoragepublic CompletableFuture<Void> loadDataFromDisk()
loadData().public CompletableFuture<Void> updateStorage()
HistoryStorageupdateStorage in class HistoryStoragepublic CompletableFuture<Void> updateDiskStorage()
updateStorage().public CompletableFuture<IsoTime> getLastHistoryOrderTime(Integer instanceIndex)
HistoryStoragegetLastHistoryOrderTime in class HistoryStorageinstanceIndex - index of an account instance connected, or nullpublic CompletableFuture<IsoTime> getLastDealTime(Integer instanceIndex)
HistoryStoragegetLastDealTime in class HistoryStorageinstanceIndex - index of an account instance connected, or nullpublic CompletableFuture<Void> onHistoryOrderAdded(int instanceIndex, MetatraderOrder historyOrder)
SynchronizationListeneronHistoryOrderAdded in class HistoryStorageinstanceIndex - index of an account instance connectedhistoryOrder - new MetaTrader history orderpublic CompletableFuture<Void> onDealAdded(int instanceIndex, MetatraderDeal newDeal)
SynchronizationListeneronDealAdded in class HistoryStorageinstanceIndex - index of an account instance connectednewDeal - new MetaTrader history dealCopyright © 2021. All rights reserved.