hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
command_service_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef TORII_COMMAND_SERVICE_IMPL_HPP
7 #define TORII_COMMAND_SERVICE_IMPL_HPP
8 
10 
11 #include "ametsuchi/storage.hpp"
13 #include "cache/cache.hpp"
14 #include "cryptography/hash.hpp"
16 #include "logger/logger_fwd.hpp"
18 #include "torii/status_bus.hpp"
19 
20 namespace iroha::torii {
25  public:
26  // TODO: 2019-03-13 @muratovv fix with abstract cache type IR-397
29  std::shared_ptr<shared_model::interface::TransactionResponse>,
31 
42  std::shared_ptr<iroha::torii::TransactionProcessor> tx_processor,
43  std::shared_ptr<iroha::torii::StatusBus> status_bus,
44  std::shared_ptr<shared_model::interface::TxStatusFactory>
45  status_factory,
46  std::shared_ptr<iroha::torii::CommandServiceImpl::CacheType> cache,
47  std::shared_ptr<iroha::ametsuchi::TxPresenceCache> tx_presence_cache,
48  logger::LoggerPtr log);
49 
54  CommandServiceImpl(const CommandServiceImpl &) = delete;
56 
58  std::shared_ptr<shared_model::interface::TransactionBatch> batch)
59  override;
60 
61  std::shared_ptr<shared_model::interface::TransactionResponse> getStatus(
62  const shared_model::crypto::Hash &request) override;
63 
65  std::shared_ptr<shared_model::interface::TransactionResponse> response)
66  override;
67 
68  private:
74  void pushStatus(
75  const std::string &who,
76  std::shared_ptr<shared_model::interface::TransactionResponse> response);
77 
83  void processBatch(
84  std::shared_ptr<shared_model::interface::TransactionBatch> batch);
85 
86  std::shared_ptr<iroha::torii::TransactionProcessor> tx_processor_;
87  std::shared_ptr<iroha::torii::StatusBus> status_bus_;
88  std::shared_ptr<CacheType> cache_;
89  std::shared_ptr<shared_model::interface::TxStatusFactory> status_factory_;
90  std::shared_ptr<iroha::ametsuchi::TxPresenceCache> tx_presence_cache_;
91 
92  logger::LoggerPtr log_;
93  };
94 
95 } // namespace iroha::torii
96 
97 #endif // TORII_COMMAND_SERVICE_IMPL_HPP
Definition: hash.hpp:18
CommandServiceImpl & operator=(const CommandServiceImpl &)=delete
void handleTransactionBatch(std::shared_ptr< shared_model::interface::TransactionBatch > batch) override
Definition: command_service_impl.cpp:33
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
std::shared_ptr< shared_model::interface::TransactionResponse > getStatus(const shared_model::crypto::Hash &request) override
Definition: command_service_impl.cpp:39
Definition: application.hpp:79
void processTransactionResponse(std::shared_ptr< shared_model::interface::TransactionResponse > response) override
Definition: command_service_impl.cpp:77
Definition: command_service.hpp:22
Definition: command_service_impl.hpp:24
Definition: cache.hpp:28
Definition: hash.hpp:23
CommandServiceImpl(std::shared_ptr< iroha::torii::TransactionProcessor > tx_processor, std::shared_ptr< iroha::torii::StatusBus > status_bus, std::shared_ptr< shared_model::interface::TxStatusFactory > status_factory, std::shared_ptr< iroha::torii::CommandServiceImpl::CacheType > cache, std::shared_ptr< iroha::ametsuchi::TxPresenceCache > tx_presence_cache, logger::LoggerPtr log)
Definition: command_service_impl.cpp:19