irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_server_properties.hpp
Go to the documentation of this file.
1 /*
2  * irods_server_properties.hpp
3  *
4  * Created on: Jan 15, 2014
5  * Author: adt
6  */
7 
8 #ifndef IRODS_SERVER_PROPERTIES_HPP_
9 #define IRODS_SERVER_PROPERTIES_HPP_
10 
11 
12 #include "irods_exception.hpp"
13 #include "irods_error.hpp"
16 #include "irods_exception.hpp"
17 
18 #include <boost/format.hpp>
19 #include <boost/any.hpp>
20 #include <map>
21 
22 namespace irods {
23 
25  const std::string STRICT_ACL_KW( "strict_acls" );
26 
28  const std::string AGENT_CONN_KW( "agent_conn" );
29 
31  const std::string AGENT_KEY_KW( "agent_key" );
32 
34  const std::string RE_PID_KW( "rule_engine_process_id" );
35 
37  const std::string XMSG_PID_KW( "x_message_process_id" );
38 
40  const std::string CLIENT_USER_NAME_KW( "client_user_name" );
41 
43  const std::string CLIENT_USER_ZONE_KW( "client_user_zone" );
44 
46  const std::string CLIENT_USER_PRIV_KW( "client_user_priv" );
47 
49  const std::string PROXY_USER_NAME_KW( "proxy_user_name" );
50 
52  const std::string PROXY_USER_ZONE_KW( "proxy_user_zone" );
53 
55  const std::string PROXY_USER_PRIV_KW( "proxy_user_priv" );
56 
57  const std::string SERVER_CONFIG_FILE( "server_config.json" );
58 
60  public:
61 
65  static server_properties& instance();
66 
70  void capture();
71 
75  void capture_json( const std::string& );
76 
77  template< typename T >
78  T& get_property( const std::string& _key ) {
79  return config_props_.get< T >( _key );
80  }
81 
82  template< typename T>
84  return config_props_.get<T>( _keys );
85  }
86 
87  template< typename T >
88  T& set_property( const std::string& _key, const T& _val ) {
89  return config_props_.set< T >( _key, _val );
90  }
91 
92  template< typename T>
93  T& set_property( const configuration_parser::key_path_t& _keys, const T& _val ) {
94  return config_props_.set<T>( _keys, _val );
95  }
96 
97  template<typename T>
98  T remove( const std::string& _key ) {
99  return config_props_.remove<T>( _key );
100  }
101 
102  void remove( const std::string& _key );
103 
104  private:
105  // Disable constructors
108  void operator=( server_properties const& );
109 
114 
115  }; // class server_properties
116 
117  template< typename T >
118  T& get_server_property( const std::string& _prop ) {
120  }
121 
122  template< typename T >
123  T& set_server_property( const std::string& _prop, const T& _val ) {
124  return irods::server_properties::instance().set_property<T>(_prop, _val);
125  }
126 
127  template< typename T >
130  }
131 
132  template< typename T >
133  T& set_server_property( const configuration_parser::key_path_t& _prop, const T& _val ) {
134  return server_properties::instance().set_property<T>(_prop, _val);
135  }
136 
137  template< typename T >
138  T delete_server_property( const std::string& _prop ) {
139  return server_properties::instance().remove(_prop);
140  }
141 
142  void delete_server_property( const std::string& _prop );
143 
144  template< typename T >
145  T& get_advanced_setting( const std::string& _prop ) {
146  return irods::get_server_property<T>(configuration_parser::key_path_t{CFG_ADVANCED_SETTINGS_KW, _prop});
147  } // get_advanced_setting
148 
149 } // namespace irods
150 
151 #endif /* IRODS_SERVER_PROPERTIES_HPP_ */
irods::CLIENT_USER_PRIV_KW
const std::string CLIENT_USER_PRIV_KW("client_user_priv")
irods::delete_server_property
T delete_server_property(const std::string &_prop)
Definition: irods_server_properties.hpp:138
irods::get_server_property
T & get_server_property(const std::string &_prop)
Definition: irods_server_properties.hpp:118
irods::server_properties::server_properties
server_properties(server_properties const &)
irods::server_properties
Definition: irods_server_properties.hpp:59
irods_configuration_keywords.hpp
irods::server_properties::set_property
T & set_property(const configuration_parser::key_path_t &_keys, const T &_val)
Definition: irods_server_properties.hpp:93
irods::CLIENT_USER_NAME_KW
const std::string CLIENT_USER_NAME_KW("client_user_name")
irods::AGENT_CONN_KW
const std::string AGENT_CONN_KW("agent_conn")
irods::RE_PID_KW
const std::string RE_PID_KW("rule_engine_process_id")
irods::configuration_parser::remove
T remove(const std::string &_key)
Definition: irods_configuration_parser.hpp:119
irods::PROXY_USER_NAME_KW
const std::string PROXY_USER_NAME_KW("proxy_user_name")
irods_exception.hpp
irods::configuration_parser::get
T & get(const std::string &_key)
Definition: irods_configuration_parser.hpp:76
irods::server_properties::get_property
T & get_property(const configuration_parser::key_path_t &_keys)
Definition: irods_server_properties.hpp:83
irods::XMSG_PID_KW
const std::string XMSG_PID_KW("x_message_process_id")
irods::server_properties::config_props_
configuration_parser config_props_
Definition: irods_server_properties.hpp:113
irods::AGENT_KEY_KW
const std::string AGENT_KEY_KW("agent_key")
irods::server_properties::operator=
void operator=(server_properties const &)
irods::configuration_parser::set
T & set(const std::string &_key, const T &_val)
Definition: irods_configuration_parser.hpp:38
irods::CLIENT_USER_ZONE_KW
const std::string CLIENT_USER_ZONE_KW("client_user_zone")
irods::CFG_ADVANCED_SETTINGS_KW
const std::string CFG_ADVANCED_SETTINGS_KW("advanced_settings")
irods
Definition: apiHandler.hpp:35
irods::SERVER_CONFIG_FILE
const std::string SERVER_CONFIG_FILE("server_config.json")
irods::set_server_property
T & set_server_property(const std::string &_prop, const T &_val)
Definition: irods_server_properties.hpp:123
irods::STRICT_ACL_KW
const std::string STRICT_ACL_KW("strict_acls")
irods::configuration_parser
Definition: irods_configuration_parser.hpp:20
irods::get_advanced_setting
T & get_advanced_setting(const std::string &_prop)
Definition: irods_server_properties.hpp:145
irods::server_properties::server_properties
server_properties()
Definition: irods_server_properties.cpp:35
irods::configuration_parser::key_path_t
std::vector< std::string > key_path_t
Definition: irods_configuration_parser.hpp:22
irods::server_properties::instance
static server_properties & instance()
Definition: irods_server_properties.cpp:30
irods::server_properties::remove
T remove(const std::string &_key)
Definition: irods_server_properties.hpp:98
irods::server_properties::set_property
T & set_property(const std::string &_key, const T &_val)
Definition: irods_server_properties.hpp:88
irods_configuration_parser.hpp
irods_error.hpp
irods::server_properties::capture
void capture()
Definition: irods_server_properties.cpp:39
irods::server_properties::get_property
T & get_property(const std::string &_key)
Definition: irods_server_properties.hpp:78
irods::PROXY_USER_PRIV_KW
const std::string PROXY_USER_PRIV_KW("proxy_user_priv")
irods::server_properties::capture_json
void capture_json(const std::string &)
Definition: irods_server_properties.cpp:58
irods::PROXY_USER_ZONE_KW
const std::string PROXY_USER_ZONE_KW("proxy_user_zone")