// // Copyright (c) ZeroC, Inc. All rights reserved. // #ifndef ICEGRID_NODE_SESSION_H #define ICEGRID_NODE_SESSION_H #include #include namespace IceGrid { class Database; class TraceLevels; class NodeSessionI : public NodeSession { public: static std::shared_ptr create(const std::shared_ptr&, const std::shared_ptr&, const std::shared_ptr&, std::chrono::seconds, const LoadInfo&); void keepAlive(LoadInfo, const Ice::Current&) override; void setReplicaObserver(std::shared_ptr, const Ice::Current&) override; int getTimeout(const Ice::Current&) const override; std::shared_ptr getObserver(const Ice::Current&) const override; void loadServersAsync(std::function, std::function, const Ice::Current&) const override; Ice::StringSeq getServers(const Ice::Current&) const override; void waitForApplicationUpdateAsync(std::string, int, std::function, std::function, const Ice::Current&) const override; void destroy(const Ice::Current&) override; std::chrono::steady_clock::time_point timestamp() const; void shutdown(); const std::shared_ptr& getNode() const; const std::shared_ptr& getInfo() const; const LoadInfo& getLoadInfo() const; std::shared_ptr getProxy() const; bool isDestroyed() const; private: NodeSessionI(const std::shared_ptr&, const std::shared_ptr&, const std::shared_ptr&, std::chrono::seconds, const LoadInfo&); void destroyImpl(bool); const std::shared_ptr _database; const std::shared_ptr _traceLevels; const std::string _name; const std::shared_ptr _node; const std::shared_ptr _info; const std::chrono::seconds _timeout; std::shared_ptr _proxy; std::shared_ptr _replicaObserver; std::chrono::steady_clock::time_point _timestamp; LoadInfo _load; bool _destroy; mutable std::mutex _mutex; }; }; #endif