8 #define DRIPLINE_API_EXPORTS 12 #include "application.hh" 16 using scarab::param_node;
18 LOGGER(
dlog,
"agent_config" );
27 scarab::path t_auth_default_path;
28 #ifdef DRIPLINE_AUTH_FILE 30 LTRACE(
dlog,
"Have a default auth path provided at build time: <" << TOSTRING( DRIPLINE_AUTH_FILE ) <<
">" );
31 t_auth_default_path = scarab::expand_path( TOSTRING( DRIPLINE_AUTH_FILE ) );
33 if( ! a_auth_file.empty() )
35 LTRACE(
dlog,
"Have a default auth path provided at runtime: <" << a_auth_file <<
">" );
36 t_auth_default_path = scarab::expand_path( a_auth_file );
39 if ( ! t_auth_default_path.empty() && boost::filesystem::exists( t_auth_default_path ) )
41 LDEBUG(
dlog,
"default auth file found, setting that as initial value: " << t_auth_default_path.string() );
42 add(
"auth-file", t_auth_default_path.string() );
46 if( t_auth_default_path.empty() )
48 LDEBUG(
dlog,
"No default auth file present; will not be set in dripline_config" );
52 LDEBUG(
dlog,
"Default auth path <" << t_auth_default_path.string() <<
"> does not exist; will not be set in dripline_config" );
55 add(
"requests-exchange",
"requests" );
56 add(
"alerts-exchange",
"alerts" );
58 add(
"loop-timeout-ms", 1000 );
59 add(
"message-wait-ms", 1000 );
60 add(
"heartbeat-routing-key",
"heartbeat" );
61 add(
"heartbeat-interval-s", 60 );
77 an_app.add_config_option< std::string >(
"-b,--broker",
"dripline.broker",
"Set the dripline broker address" );
78 an_app.add_config_option<
unsigned >(
"-p,--port",
"dripline.broker-port",
"Set the port for communication with the dripline broker" );
79 an_app.add_config_option< std::string >(
"--auth-file",
"dripline.auth-file",
"Set the authentication file path" );
80 an_app.add_config_option< std::string >(
"--requests-exchange",
"dripline.requests-exchange",
"Set the name of the requests exchange" );
81 an_app.add_config_option< std::string >(
"--alerts-exchange",
"dripline.alerts-exchange",
"Set the name of the alerts exchange" );
82 an_app.add_config_option<
unsigned >(
"--max-payload",
"dripline.max-payload-size",
"Set the maximum payload size (in bytes)" );
83 an_app.add_config_option<
unsigned >(
"--loop-timeout-ms" "dripline.loop-timeout-ms",
"Set the timeout for thread loops in ms" );
84 an_app.add_config_option<
unsigned >(
"--message-wait-ms" "dripline.message-wait-ms",
"Set the time to wait for a full multi-part message in ms" );
85 an_app.add_config_option< std::string >(
"--heartbeat-routing-key",
"dripline.heartbeat-routing-key",
"Set the first token of heartbeat routing keys: [token].[origin]" );
86 an_app.add_config_option<
unsigned >(
"--heartbeat-interval-s",
"dripline.heartbeat-interval-s",
"Set the interval between heartbeats in s" );
static scarab::logger dlog("agent_config")
static scarab::logger dlog("agent")
dripline_config(const std::string &a_auth_file="")
virtual ~dripline_config()
void add_dripline_options(scarab::main_app &an_app)
Add basic AMQP options to an app object.
#define DL_MAX_PAYLOAD_SIZE