forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
transport_socket_config_impl.h
75 lines (68 loc) · 3.12 KB
/
transport_socket_config_impl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#pragma once
#include "envoy/server/transport_socket_config.h"
#include "envoy/stats/scope.h"
namespace Envoy {
namespace Server {
namespace Configuration {
/**
* Implementation of TransportSocketFactoryContext.
*/
class TransportSocketFactoryContextImpl : public TransportSocketFactoryContext {
public:
TransportSocketFactoryContextImpl(Server::Admin& admin, Ssl::ContextManager& context_manager,
Stats::Scope& stats_scope, Upstream::ClusterManager& cm,
const LocalInfo::LocalInfo& local_info,
Event::Dispatcher& dispatcher, Stats::Store& stats,
Singleton::Manager& singleton_manager,
ThreadLocal::SlotAllocator& tls,
ProtobufMessage::ValidationVisitor& validation_visitor,
Api::Api& api, const Server::Options& options)
: admin_(admin), context_manager_(context_manager), stats_scope_(stats_scope),
cluster_manager_(cm), local_info_(local_info), dispatcher_(dispatcher), stats_(stats),
singleton_manager_(singleton_manager), tls_(tls), validation_visitor_(validation_visitor),
api_(api), options_(options) {}
/**
* Pass an init manager to register dynamic secret provider.
* @param init_manager instance of init manager.
*/
void setInitManager(Init::Manager& init_manager) { init_manager_ = &init_manager; }
// TransportSocketFactoryContext
Server::Admin& admin() override { return admin_; }
Ssl::ContextManager& sslContextManager() override { return context_manager_; }
Stats::Scope& scope() override { return stats_scope_; }
Secret::SecretManager& secretManager() override {
return cluster_manager_.clusterManagerFactory().secretManager();
}
Upstream::ClusterManager& clusterManager() override { return cluster_manager_; }
const LocalInfo::LocalInfo& localInfo() const override { return local_info_; }
Event::Dispatcher& mainThreadDispatcher() override { return dispatcher_; }
Stats::Store& stats() override { return stats_; }
Init::Manager& initManager() override {
ASSERT(init_manager_ != nullptr);
return *init_manager_;
}
Singleton::Manager& singletonManager() override { return singleton_manager_; }
ThreadLocal::SlotAllocator& threadLocal() override { return tls_; }
ProtobufMessage::ValidationVisitor& messageValidationVisitor() override {
return validation_visitor_;
}
Api::Api& api() override { return api_; }
const Server::Options& options() override { return options_; }
private:
Server::Admin& admin_;
Ssl::ContextManager& context_manager_;
Stats::Scope& stats_scope_;
Upstream::ClusterManager& cluster_manager_;
const LocalInfo::LocalInfo& local_info_;
Event::Dispatcher& dispatcher_;
Stats::Store& stats_;
Singleton::Manager& singleton_manager_;
ThreadLocal::SlotAllocator& tls_;
Init::Manager* init_manager_{};
ProtobufMessage::ValidationVisitor& validation_visitor_;
Api::Api& api_;
const Server::Options& options_;
};
} // namespace Configuration
} // namespace Server
} // namespace Envoy