29 #include "aossl/core/include/buffers.h" 30 #include "aossl/core/include/kv_store_interface.h" 32 #include "aossl/consul/include/consul_interface.h" 33 #include "aossl/uuid/include/uuid_interface.h" 35 #include "aossl/commandline/include/factory_cli.h" 36 #include "aossl/properties/include/factory_props.h" 37 #include "aossl/consul/include/factory_consul.h" 38 #include "aossl/uuid/include/factory_uuid.h" 40 #include "aossl/vault/include/vault_interface.h" 41 #include "aossl/vault/include/factory_vault.h" 43 #ifndef AOSSL_PROFILE_INCLUDE_APP_PROFILE_H_ 44 #define AOSSL_PROFILE_INCLUDE_APP_PROFILE_H_ 57 VaultComponentFactory vault_factory;
58 VaultInterface *vault =
nullptr;
63 std::string application_name;
64 std::string profile_name;
75 std::string prof_name) {
78 application_name.assign(app_name);
79 profile_name.assign(prof_name);
90 std::string app_name, std::string prof_name) {
93 application_name.assign(app_name);
94 profile_name.assign(prof_name);
100 application_name.assign(app_name);
101 profile_name.assign(prof_name);
105 if (cli) {
delete cli;}
106 if (cfile) {
delete cfile;}
107 if (consul) {
delete consul;}
108 if (uuid) {
delete uuid;}
139 inline void set_consul_address(std::string caddr,
int tout, std::string ssl_cert, std::string acl_token) {
149 int tout, std::string& cert,
int auth_type, std::string& un, std::string& pw) {
154 vault = vault_factory.get_vault_interface(vaddr, secrets_path, 5, cert, auth_type, un, pw);
159 int tout,
int auth_type, std::string& un, std::string& pw) {
164 vault = vault_factory.get_vault_interface(vaddr, secrets_path, 5, auth_type, un, pw);
197 #endif // AOSSL_PROFILE_INCLUDE_APP_PROFILE_H_ KeyValueStore * get_properties_reader_interface(std::string filename)
Get a Properties File Interface Instance.
Definition: factory_props.h:50
std::string get_profile_name()
Get the Profile Name.
Definition: app_profile.h:186
Application Session which manages configuration elements.
Definition: app_profile.h:52
UUID Admin.
Definition: uuid_interface.h:40
The UUID Service Component Factory.
Definition: factory_uuid.h:39
void set_consul_address(std::string caddr, int tout, std::string ssl_cert)
Set the address of the consul agent.
Definition: app_profile.h:130
ApplicationProfile(int argc, char *argv[], std::string app_name, std::string prof_name)
Create a new Application Session with Command Line Arguments.
Definition: app_profile.h:74
void set_app_name(std::string name)
Get the Application Name.
Definition: app_profile.h:189
VaultInterface * get_vault()
Get the Vault Interface.
Definition: app_profile.h:177
KeyValueStoreInterface * get_cli()
Get the Command Line Interface.
Definition: app_profile.h:168
std::string get_app_name()
Get the Application Name.
Definition: app_profile.h:183
KeyValueStore * get_command_line_interface(int argc, char *argv[])
Get the Command Line Interface instance.
Definition: factory_cli.h:50
void set_profile_name(std::string prof)
Get the Profile Name.
Definition: app_profile.h:192
The Consul Administrator, who handles configuration & service discovery.
Definition: consul_interface.h:115
ApplicationProfile(const std::vector< std::string > &args)
Create a new Application Session with Command Line Arguments.
Definition: app_profile.h:83
void set_consul_address(std::string caddr)
Set the address of the consul agent.
Definition: app_profile.h:121
UuidInterface * get_uuid_interface()
Get the UUID Interface instance.
Definition: factory_uuid.h:48
void set_vault_address(std::string &vaddr, std::string &secrets_path, int tout, int auth_type, std::string &un, std::string &pw)
Update the Vault connectivity information.
Definition: app_profile.h:158
The Consul Service Component Factory.
Definition: factory_consul.h:44
void set_vault_address(std::string &vaddr, std::string &secrets_path, int tout, std::string &cert, int auth_type, std::string &un, std::string &pw)
Update the Vault connectivity information.
Definition: app_profile.h:148
UuidInterface * get_uuid()
Get the UUID Interface.
Definition: app_profile.h:180
ApplicationProfile(const std::vector< std::string > &args, std::string app_name, std::string prof_name)
Create a new Application Session with Command Line Arguments.
Definition: app_profile.h:89
Key Value Store.
Definition: kv_store_interface.h:38
ApplicationProfile(int argc, char *argv[])
Create a new Application Session with Command Line Arguments.
Definition: app_profile.h:68
ConsulInterface * get_consul()
Get the Consul Interface.
Definition: app_profile.h:174
KeyValueStoreInterface * get_props()
Get the Properties File Reader.
Definition: app_profile.h:171
ConsulInterface * get_consul_interface(std::string caddr)
Get a Consul Interface instance.
Definition: factory_consul.h:53
The Property File Reader Service Component Factory.
Definition: factory_props.h:40
The Command Line Interpreter Service Component Factory.
Definition: factory_cli.h:41
void set_property_file(std::string &filename)
Set the location of the properties file.
Definition: app_profile.h:112
ApplicationProfile(std::string app_name, std::string prof_name)
Create a new Application Session without any Command Line Arguments.
Definition: app_profile.h:98
void set_consul_address(std::string caddr, int tout, std::string ssl_cert, std::string acl_token)
Set the address of the consul agent.
Definition: app_profile.h:139