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.cpp
Go to the documentation of this file.
1 /*
2  * irods_server_properties.cpp
3  *
4  * Created on: Jan 15, 2014
5  * Author: adt
6  */
7 
10 
11 #include "rods.h"
12 #include "rodsConnect.h"
13 #include "irods_log.hpp"
14 #include "irods_exception.hpp"
15 #include "irods_lookup_table.hpp"
16 
17 #include <string>
18 #include <sstream>
19 #include <algorithm>
20 
21 #include <boost/filesystem.hpp>
22 namespace fs = boost::filesystem;
23 
24 #define BUF_LEN 500
25 
26 //Singleton
27 
28 namespace irods {
29 
31  static server_properties singleton;
32  return singleton;
33  }
34 
36  capture();
37  } // ctor
38 
40  // if a json version exists, then attempt to capture
41  // that
42  std::string svr_cfg;
44  "server_config.json",
45  svr_cfg );
46  capture_json( svr_cfg );
47 
48  std::string db_cfg;
50  "database_config.json",
51  db_cfg );
52  if ( ret.ok() ) {
53  capture_json( db_cfg );
54  }
55 
56  } // capture
57 
59  const std::string& _fn ) {
60  error ret = config_props_.load( _fn );
61  if ( !ret.ok() ) {
62  THROW( ret.code(), ret.result() );
63  }
64 
65  } // capture_json
66 
67  void server_properties::remove( const std::string& _key ) {
68  config_props_.remove( _key );
69  }
70 
71  void delete_server_property( const std::string& _prop ) {
73  } // delete_server_property
74 
75 } // namespace irods
76 
77 
irods::delete_server_property
T delete_server_property(const std::string &_prop)
Definition: irods_server_properties.hpp:138
irods::server_properties
Definition: irods_server_properties.hpp:59
irods::get_full_path_for_config_file
error get_full_path_for_config_file(const std::string &, std::string &)
Definition: irods_get_full_path_for_config_file.cpp:20
irods_server_properties.hpp
THROW
#define THROW(_code, _msg)
Definition: irods_exception.hpp:68
irods_get_full_path_for_config_file.hpp
irods::configuration_parser::remove
T remove(const std::string &_key)
Definition: irods_configuration_parser.hpp:119
irods_exception.hpp
irods::server_properties::config_props_
configuration_parser config_props_
Definition: irods_server_properties.hpp:113
rodsConnect.h
irods::error::code
long long code() const
Definition: irods_error.cpp:194
irods
Definition: apiHandler.hpp:35
irods::configuration_parser::load
error load(const std::string &)
Definition: irods_configuration_parser.cpp:72
irods::server_properties::server_properties
server_properties()
Definition: irods_server_properties.cpp:35
irods::error
Definition: irods_error.hpp:23
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::capture
void capture()
Definition: irods_server_properties.cpp:39
irods::server_properties::capture_json
void capture_json(const std::string &)
Definition: irods_server_properties.cpp:58
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
irods::error::result
std::string result() const
Definition: irods_error.cpp:201
rods.h
irods_log.hpp
irods_lookup_table.hpp