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_oracle_object.cpp
Go to the documentation of this file.
1 // =-=-=-=-=-=-=-
2 // irods includes
5 
6 namespace irods {
7 
8 // =-=-=-=-=-=-=-
9 // public - ctor
11 
12  } // ctor
13 
14 // =-=-=-=-=-=-=-
15 // public - cctor
17  const oracle_object& _rhs ) :
18  database_object( _rhs ) {
19 
20 
21  } // cctor
22 
23 // =-=-=-=-=-=-=-
24 // public - dtor
26  } // dtor
27 
28 // =-=-=-=-=-=-=-
29 // public - assignment operator
31  const oracle_object& ) {
32 
33  return *this;
34 
35  } // operator=
36 
37 // =-=-=-=-=-=-=-
38 // public - equivalence operator
40  const oracle_object& ) const {
41  return false;
42 
43  } // operator==
44 
45 // =-=-=-=-=-=-=-
46 // plugin resolution operation
48  const std::string& _interface,
49  plugin_ptr& _ptr ) {
50  // =-=-=-=-=-=-=-
51  // check the interface type and error out if it
52  // isnt a database interface
53  if ( DATABASE_INTERFACE != _interface ) {
54  std::stringstream msg;
55  msg << "oracle_object does not support a [";
56  msg << _interface;
57  msg << "] plugin interface";
58  return ERROR( SYS_INVALID_INPUT_PARAM, msg.str() );
59 
60  }
61 
62  // =-=-=-=-=-=-=-
63  // ask the database manager for a oracle resource
64  database_ptr db_ptr;
65  error ret = db_mgr.resolve( ORACLE_DATABASE_PLUGIN, db_ptr );
66  if ( !ret.ok() ) {
67  // =-=-=-=-=-=-=-
68  // attempt to load the plugin, in this case the type,
69  // instance name, key etc are all tcp as there is only
70  // the need for one instance of a tcp object, etc.
71  std::string empty_context( "" );
72  ret = db_mgr.init_from_type(
76  empty_context,
77  db_ptr );
78  if ( !ret.ok() ) {
79  return PASS( ret );
80 
81  }
82  else {
83  // =-=-=-=-=-=-=-
84  // upcast for out variable
85  _ptr = boost::dynamic_pointer_cast< plugin_base >( db_ptr );
86  return SUCCESS();
87 
88  }
89 
90  } // if !ok
91 
92  // =-=-=-=-=-=-=-
93  // upcast for out variable
94  _ptr = boost::dynamic_pointer_cast< plugin_base >( db_ptr );
95 
96  return SUCCESS();
97 
98  } // resolve
99 
100 // =-=-=-=-=-=-=-
101 // public - get rule engine kvp
103  rule_engine_vars_t& ) {
104 
105  //addKeyVal( &_kvp, SOCKET_HANDLE_KW, ss.str().c_str() );
106 
107  return SUCCESS();
108 
109  } // get_re_vars
110 
111 }; // namespace irods
112 
113 
114 
irods::plugin_ptr
boost::shared_ptr< plugin_base > plugin_ptr
Definition: irods_first_class_object.hpp:18
irods::ORACLE_DATABASE_PLUGIN
const std::string ORACLE_DATABASE_PLUGIN("oracle")
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
irods::database_manager::resolve
error resolve(std::string, database_ptr &)
Definition: irods_database_manager.cpp:32
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
irods::oracle_object::oracle_object
oracle_object()
Definition: irods_oracle_object.cpp:10
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods::db_mgr
database_manager db_mgr
Definition: irods_database_manager.cpp:9
irods_database_manager.hpp
irods
Definition: apiHandler.hpp:35
irods::DATABASE_INTERFACE
const std::string DATABASE_INTERFACE("irods_database_interface")
irods::oracle_object::operator=
virtual oracle_object & operator=(const oracle_object &)
Definition: irods_oracle_object.cpp:30
irods::database_manager::init_from_type
error init_from_type(const std::string &, const std::string &, const std::string &, const std::string &, database_ptr &)
Definition: irods_database_manager.cpp:83
irods::oracle_object::get_re_vars
virtual error get_re_vars(rule_engine_vars_t &)
Definition: irods_oracle_object.cpp:102
irods::oracle_object
Definition: irods_oracle_object.hpp:20
irods::oracle_object::resolve
virtual error resolve(const std::string &, plugin_ptr &)
Definition: irods_oracle_object.cpp:47
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
irods::error
Definition: irods_error.hpp:23
irods::database_ptr
boost::shared_ptr< database > database_ptr
Definition: irods_database_types.hpp:21
irods::database_object
Definition: irods_database_object.hpp:19
irods_oracle_object.hpp
irods::oracle_object::operator==
virtual bool operator==(const oracle_object &_rhs) const
Definition: irods_oracle_object.cpp:39
irods::oracle_object::~oracle_object
virtual ~oracle_object()
Definition: irods_oracle_object.cpp:25
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
irods::rule_engine_vars_t
std::map< std::string, std::string > rule_engine_vars_t
Definition: irods_first_class_object.hpp:20