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)  

icatHighLevelRoutines.cpp
Go to the documentation of this file.
1 
4 
17 // =-=-=-=-=-=-=-
18 // irods includes
20 #include "icatStructs.hpp"
21 #include "irods_error.hpp"
27 
28 // =-=-=-=-=-=-=-
29 // stl includes
30 #include <string>
31 #include <iostream>
32 #include <sstream>
33 #include <vector>
34 #include <boost/regex.hpp>
35 
36 // =-=-=-=-=-=-=-
37 // debug flag used across all icat fcns
38 int logSQL = 0;
41 int logSQL_CML = 0;
42 int auditEnabled = 0;
43 
44 // =-=-=-=-=-=-=-
45 // holds the flavor of the catalog for the
46 // lifetime of the agent
47 static std::string database_plugin_type;
48 
49 // =-=-=-=-=-=-=-
50 //
52  const char* _mode ) {
53  // =-=-=-=-=-=-=-
54  // run tolower on mode
55  std::string mode( _mode );
57  mode.begin(),
58  mode.end(),
59  mode.begin(),
60  ::tolower );
61 
62  // =-=-=-=-=-=-=-
63  // if mode contains 'sql' then turn SQL logging on
64  if ( mode.find( "sql" ) != std::string::npos ) {
65  logSQL = 1;
66  logSQLGenQuery = 1;//chlDebugGenQuery( 1 );
67  logSQLGenUpdate = 1;//chlDebugGenUpdate( 1 );
68  logSQL_CML = 2;
69  auditEnabled = 1;//cmlDebug( 2 );
70  }
71  else {
72  logSQL = 0;
73  logSQLGenQuery = 1;//chlDebugGenQuery( 0 );
74  logSQLGenUpdate = 1;//chlDebugGenUpdate( 0 );
75  logSQL_CML = 0;
76  auditEnabled = 0;//cmlDebug( 0 );
77  }
78 
79  return 0;
80 
81 } // chlDebug
82 
86 int chlOpen() {
87 // // =-=-=-=-=-=-=-
88 // // check incoming params
89 // if ( !_cfg ) {
90 // rodsLog(
91 // LOG_ERROR,
92 // "null config parameter" );
93 // return SYS_INVALID_INPUT_PARAM;
94 // }
95 
96  // =-=-=-=-=-=-=-
97  // cache the database type for subsequent calls
98  try {
99  const auto database_plugin_map = irods::get_server_property<const std::unordered_map<std::string, boost::any>>(std::vector<std::string>{irods::CFG_PLUGIN_CONFIGURATION_KW, irods::PLUGIN_TYPE_DATABASE});
100  if ( database_plugin_map.size() != 1 ) {
101  rodsLog( LOG_ERROR, "Database plugin map must contain exactly one plugin object" );
103  }
104  database_plugin_type = database_plugin_map.begin()->first;
105  } catch ( const irods::exception& e ) {
106  irods::log(e);
107  return e.code();
108  }
109 
110  // =-=-=-=-=-=-=-
111  // call factory for database object
112  irods::database_object_ptr db_obj_ptr;
115  db_obj_ptr );
116  if ( !ret.ok() ) {
117  irods::log( PASS( ret ) );
118  return ret.code();
119  }
120 
121  // =-=-=-=-=-=-=-
122  // resolve a plugin for that object
123  irods::plugin_ptr db_plug_ptr;
124  ret = db_obj_ptr->resolve(
126  db_plug_ptr );
127  if ( !ret.ok() ) {
128  irods::log(
129  PASSMSG(
130  "failed to resolve database interface",
131  ret ) );
132  return ret.code();
133  }
134 
135  // =-=-=-=-=-=-=-
136  // cast plugin and object to db and fco for call
137  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
138  irods::first_class_object > ( db_obj_ptr );
139  irods::database_ptr db = boost::dynamic_pointer_cast <
140  irods::database > ( db_plug_ptr );
141  // =-=-=-=-=-=-=-
142  // call the operation on the plugin
143  ret = db->call( 0,
145  ptr );
146 
147  // =-=-=-=-=-=-=-
148  // call the start operation, as it may have opinions
149  // if it fails, close the connection and error out
150  ret = db->start_operation();
151  if ( !ret.ok() ) {
152  irods::log( PASS( ret ) );
153  chlClose();
154  return PLUGIN_ERROR;
155  }
156 
157  return ret.code();
158 
159 } // chlOpen
160 
164 int chlClose() {
165  // =-=-=-=-=-=-=-
166  // call factory for database object
167  irods::database_object_ptr db_obj_ptr;
170  db_obj_ptr );
171  if ( !ret.ok() ) {
172  irods::log( PASS( ret ) );
173  return ret.code();
174  }
175 
176  // =-=-=-=-=-=-=-
177  // resolve a plugin for that object
178  irods::plugin_ptr db_plug_ptr;
179  ret = db_obj_ptr->resolve(
181  db_plug_ptr );
182  if ( !ret.ok() ) {
183  irods::log(
184  PASSMSG(
185  "failed to resolve database interface",
186  ret ) );
187  return ret.code();
188  }
189 
190  // =-=-=-=-=-=-=-
191  // cast plugin and object to db and fco for call
192  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
193  irods::first_class_object > ( db_obj_ptr );
194  irods::database_ptr db = boost::dynamic_pointer_cast <
195  irods::database > ( db_plug_ptr );
196 
197  // =-=-=-=-=-=-=-
198  // call the stop operation, as it may have opinions
199  irods::error ret2 = db->stop_operation();
200  if ( !ret2.ok() ) {
201  irods::log( PASS( ret2 ) );
202  return PLUGIN_ERROR;
203  }
204 
205  // =-=-=-=-=-=-=-
206  // call the close operation on the plugin
207  ret = db->call( 0,
209  ptr );
210 
211 
212  return ret.code();
213 
214 } // chlClose
215 
216 // =-=-=-=-=-=-=-
217 //This is used by the icatGeneralUpdate.c functions to get the icss
218 //structure. icatGeneralUpdate.c and this (icatHighLevelRoutine.c)
219 //are actually one module but in two separate source files (as they
220 //got larger) so this is a 'glue' that binds them together. So this
221 //is mostly an 'internal' function too.
223  icatSessionStruct** _icss ) {
224  // =-=-=-=-=-=-=-
225  // call factory for database object
226  irods::database_object_ptr db_obj_ptr;
229  db_obj_ptr );
230  if ( !ret.ok() ) {
231  irods::log( PASS( ret ) );
232  return ret.code();
233  }
234 
235  // =-=-=-=-=-=-=-
236  // resolve a plugin for that object
237  irods::plugin_ptr db_plug_ptr;
238  ret = db_obj_ptr->resolve(
240  db_plug_ptr );
241  if ( !ret.ok() ) {
242  irods::log(
243  PASSMSG(
244  "failed to resolve database interface",
245  ret ) );
246  return ret.code();
247  }
248 
249  // =-=-=-=-=-=-=-
250  // cast plugin and object to db and fco for call
251  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
252  irods::first_class_object > ( db_obj_ptr );
253  irods::database_ptr db = boost::dynamic_pointer_cast <
254  irods::database > ( db_plug_ptr );
255 
256  // =-=-=-=-=-=-=-
257  // call the operation on the plugin
258  ret = db->call< icatSessionStruct** >( 0,
260  ptr,
261  _icss );
262 
263  return ret.code();
264 
265 } // chlGetRcs
266 
267 // =-=-=-=-=-=-=-
268 // External function to return the local zone name.
269 // Used by icatGeneralQuery.c
271  std::string& _zone ) {
272  // =-=-=-=-=-=-=-
273  // call factory for database object
274  irods::database_object_ptr db_obj_ptr;
277  db_obj_ptr );
278  if ( !ret.ok() ) {
279  irods::log( PASS( ret ) );
280  return ret.code();
281  }
282 
283  // =-=-=-=-=-=-=-
284  // resolve a plugin for that object
285  irods::plugin_ptr db_plug_ptr;
286  ret = db_obj_ptr->resolve(
288  db_plug_ptr );
289  if ( !ret.ok() ) {
290  irods::log(
291  PASSMSG(
292  "failed to resolve database interface",
293  ret ) );
294  return ret.code();
295  }
296 
297  // =-=-=-=-=-=-=-
298  // cast plugin and object to db and fco for call
299  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
300  irods::first_class_object > ( db_obj_ptr );
301  irods::database_ptr db = boost::dynamic_pointer_cast <
302  irods::database > ( db_plug_ptr );
303 
304  // =-=-=-=-=-=-=-
305  // call the get local zone operation on the plugin
306  ret = db->call <
307  std::string* > ( 0,
309  ptr,
310  &_zone );
311 
312  return ret.code();
313 
314 } // chlGetLocalZone
315 
316 // =-=-=-=-=-=-=-
317 //
319  rsComm_t* _comm,
320  char* _type,
321  char* _name,
322  char* _access ) {
323  // =-=-=-=-=-=-=-
324  // call factory for database object
325  irods::database_object_ptr db_obj_ptr;
328  db_obj_ptr );
329  if ( !ret.ok() ) {
330  irods::log( PASS( ret ) );
331  return ret.code();
332  }
333 
334  // =-=-=-=-=-=-=-
335  // resolve a plugin for that object
336  irods::plugin_ptr db_plug_ptr;
337  ret = db_obj_ptr->resolve(
339  db_plug_ptr );
340  if ( !ret.ok() ) {
341  irods::log(
342  PASSMSG(
343  "failed to resolve database interface",
344  ret ) );
345  return ret.code();
346  }
347 
348  // =-=-=-=-=-=-=-
349  // cast plugin and object to db and fco for call
350  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
351  irods::first_class_object > ( db_obj_ptr );
352  irods::database_ptr db = boost::dynamic_pointer_cast <
353  irods::database > ( db_plug_ptr );
354 
355  // =-=-=-=-=-=-=-
356  // call the get local zone operation on the plugin
357  ret = db->call <
358  const char*,
359  const char*,
360  const char* > (
361  _comm,
363  ptr,
364  _type,
365  _name,
366  _access );
367 
368  return ret.code();
369 
370 } // chlCheckAndGetObjectID
371 
375  rsComm_t* _comm,
376  const std::string& _resc,
377  int _delta ) {
378  // =-=-=-=-=-=-=-
379  // call factory for database object
380  irods::database_object_ptr db_obj_ptr;
383  db_obj_ptr );
384  if ( !ret.ok() ) {
385  irods::log( PASS( ret ) );
386  return ret.code();
387  }
388 
389  // =-=-=-=-=-=-=-
390  // resolve a plugin for that object
391  irods::plugin_ptr db_plug_ptr;
392  ret = db_obj_ptr->resolve(
394  db_plug_ptr );
395  if ( !ret.ok() ) {
396  irods::log(
397  PASSMSG(
398  "failed to resolve database interface",
399  ret ) );
400  return ret.code();
401  }
402 
403  // =-=-=-=-=-=-=-
404  // cast plugin and object to db and fco for call
405  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
406  irods::first_class_object > ( db_obj_ptr );
407  irods::database_ptr db = boost::dynamic_pointer_cast <
408  irods::database > ( db_plug_ptr );
409 
410  // =-=-=-=-=-=-=-
411  // call the operation on the plugin
412  ret = db->call <
413  const std::string*,
414  int > (
415  _comm,
417  ptr,
418  &_resc,
419  _delta );
420 
421  return ret.code();
422 
423 } // chlUpdateRescObjCount
424 
425 // =-=-=-=-=-=-=-
426 // chlModDataObjMeta - Modify the metadata of an existing data object.
427 // Input - rsComm_t *rsComm - the server handle
428 // dataObjInfo_t *dataObjInfo - contains info about this copy of
429 // a data object.
430 // keyValPair_t *regParam - the keyword/value pair of items to be
431 // modified. Valid keywords are given in char *dataObjCond[] in rcGlobal.h.
432 // If the keyword ALL_REPL_STATUS_KW is used
433 // the replStatus of the copy specified by dataObjInfo
434 // is marked NEWLY_CREATED_COPY and all other copies are
435 // be marked OLD_COPY.
437  rsComm_t* _comm,
438  dataObjInfo_t* _data_obj_info,
439  keyValPair_t* _reg_param ) {
440  // =-=-=-=-=-=-=-
441  // call factory for database object
442  irods::database_object_ptr db_obj_ptr;
445  db_obj_ptr );
446  if ( !ret.ok() ) {
447  irods::log( PASS( ret ) );
448  return ret.code();
449  }
450 
451  // =-=-=-=-=-=-=-
452  // resolve a plugin for that object
453  irods::plugin_ptr db_plug_ptr;
454  ret = db_obj_ptr->resolve(
456  db_plug_ptr );
457  if ( !ret.ok() ) {
458  irods::log(
459  PASSMSG(
460  "failed to resolve database interface",
461  ret ) );
462  return ret.code();
463  }
464 
465  // =-=-=-=-=-=-=-
466  // cast plugin and object to db and fco for call
467  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
468  irods::first_class_object > ( db_obj_ptr );
469  irods::database_ptr db = boost::dynamic_pointer_cast <
470  irods::database > ( db_plug_ptr );
471 
472  // =-=-=-=-=-=-=-
473  // call the operation on the plugin
474  ret = db->call <
475  dataObjInfo_t*,
476  keyValPair_t* > (
477  _comm,
479  ptr,
480  _data_obj_info,
481  _reg_param );
482 
483  return ret.code();
484 
485 } // chlModDataObjMeta
486 
487 // =-=-=-=-=-=-=-
488 // chlRegDataObj - Register a new iRODS file (data object)
489 // Input - rsComm_t *rsComm - the server handle
490 // dataObjInfo_t *dataObjInfo - contains info about the data object.
492  rsComm_t* _comm,
493  dataObjInfo_t* _data_obj_info ) {
494  // =-=-=-=-=-=-=-
495  // call factory for database object
496  irods::database_object_ptr db_obj_ptr;
499  db_obj_ptr );
500  if ( !ret.ok() ) {
501  irods::log( PASS( ret ) );
502  return ret.code();
503  }
504 
505  // =-=-=-=-=-=-=-
506  // resolve a plugin for that object
507  irods::plugin_ptr db_plug_ptr;
508  ret = db_obj_ptr->resolve(
510  db_plug_ptr );
511  if ( !ret.ok() ) {
512  irods::log(
513  PASSMSG(
514  "failed to resolve database interface",
515  ret ) );
516  return ret.code();
517  }
518 
519  // =-=-=-=-=-=-=-
520  // cast plugin and object to db and fco for call
521  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
522  irods::first_class_object > ( db_obj_ptr );
523  irods::database_ptr db = boost::dynamic_pointer_cast <
524  irods::database > ( db_plug_ptr );
525 
526  // =-=-=-=-=-=-=-
527  // call the operation on the plugin
528  ret = db->call <
529  dataObjInfo_t* > (
530  _comm,
532  ptr,
533  _data_obj_info );
534 
535  return ret.code();
536 
537 } // chlRegDataObj
538 
539 // =-=-=-=-=-=-=-
540 // chlRegReplica - Register a new iRODS replica file (data object)
541 // Input - rsComm_t *rsComm - the server handle
542 // srcDataObjInfo and dstDataObjInfo each contain information
543 // about the object.
544 // The src dataId and replNum are used in a query, a few fields are updated
545 // from dstDataObjInfo, and a new row inserted.
547  rsComm_t* _comm,
548  dataObjInfo_t* _src_data_obj_info,
549  dataObjInfo_t* _dst_data_obj_info,
550  keyValPair_t* _cond_input ) {
551  // =-=-=-=-=-=-=-
552  // call factory for database object
553  irods::database_object_ptr db_obj_ptr;
556  db_obj_ptr );
557  if ( !ret.ok() ) {
558  irods::log( PASS( ret ) );
559  return ret.code();
560  }
561 
562  // =-=-=-=-=-=-=-
563  // resolve a plugin for that object
564  irods::plugin_ptr db_plug_ptr;
565  ret = db_obj_ptr->resolve(
567  db_plug_ptr );
568  if ( !ret.ok() ) {
569  irods::log(
570  PASSMSG(
571  "failed to resolve database interface",
572  ret ) );
573  return ret.code();
574  }
575 
576  // =-=-=-=-=-=-=-
577  // cast plugin and object to db and fco for call
578  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
579  irods::first_class_object > ( db_obj_ptr );
580  irods::database_ptr db = boost::dynamic_pointer_cast <
581  irods::database > ( db_plug_ptr );
582 
583  // =-=-=-=-=-=-=-
584  // call the operation on the plugin
585  ret = db->call <
586  dataObjInfo_t*,
587  dataObjInfo_t*,
588  keyValPair_t* > (
589  _comm,
591  ptr,
592  _src_data_obj_info,
593  _dst_data_obj_info,
594  _cond_input );
595 
596  return ret.code();
597 
598 } // chlRegReplica
599 
606  rsComm_t* _comm,
607  dataObjInfo_t* _data_obj_info,
608  keyValPair_t* _cond_input ) {
609  // =-=-=-=-=-=-=-
610  // call factory for database object
611  irods::database_object_ptr db_obj_ptr;
614  db_obj_ptr );
615  if ( !ret.ok() ) {
616  irods::log( PASS( ret ) );
617  return ret.code();
618  }
619 
620  // =-=-=-=-=-=-=-
621  // resolve a plugin for that object
622  irods::plugin_ptr db_plug_ptr;
623  ret = db_obj_ptr->resolve(
625  db_plug_ptr );
626  if ( !ret.ok() ) {
627  irods::log(
628  PASSMSG(
629  "failed to resolve database interface",
630  ret ) );
631  return ret.code();
632  }
633 
634  // =-=-=-=-=-=-=-
635  // cast plugin and object to db and fco for call
636  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
637  irods::first_class_object > ( db_obj_ptr );
638  irods::database_ptr db = boost::dynamic_pointer_cast <
639  irods::database > ( db_plug_ptr );
640 
641  // =-=-=-=-=-=-=-
642  // call the operation on the plugin
643  ret = db->call <
644  dataObjInfo_t*,
645  keyValPair_t* > (
646  _comm,
648  ptr,
649  _data_obj_info,
650  _cond_input );
651 
652  return ret.code();
653 
654 } // chlUnregDataObj
655 
656 // =-=-=-=-=-=-=-
657 // chlRegRuleExec - Register a new iRODS delayed rule execution object
658 // Input - rsComm_t *rsComm - the server handle
659 // ruleExecSubmitInp_t *ruleExecSubmitInp - contains info about the
660 // delayed rule.
662  rsComm_t* _comm,
663  ruleExecSubmitInp_t* _re_sub_inp ) {
664  // =-=-=-=-=-=-=-
665  // call factory for database object
666  irods::database_object_ptr db_obj_ptr;
669  db_obj_ptr );
670  if ( !ret.ok() ) {
671  irods::log( PASS( ret ) );
672  return ret.code();
673  }
674 
675  // =-=-=-=-=-=-=-
676  // resolve a plugin for that object
677  irods::plugin_ptr db_plug_ptr;
678  ret = db_obj_ptr->resolve(
680  db_plug_ptr );
681  if ( !ret.ok() ) {
682  irods::log(
683  PASSMSG(
684  "failed to resolve database interface",
685  ret ) );
686  return ret.code();
687  }
688 
689  // =-=-=-=-=-=-=-
690  // cast plugin and object to db and fco for call
691  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
692  irods::first_class_object > ( db_obj_ptr );
693  irods::database_ptr db = boost::dynamic_pointer_cast <
694  irods::database > ( db_plug_ptr );
695 
696  // =-=-=-=-=-=-=-
697  // call the operation on the plugin
698  ret = db->call <
700  _comm,
702  ptr,
703  _re_sub_inp );
704 
705  return ret.code();
706 
707 } // chlRegRuleExec
708 
709 // =-=-=-=-=-=-=-
710 // chlModRuleExec - Modify the metadata of an existing (delayed)
711 // Rule Execution object.
712 // Input - rsComm_t *rsComm - the server handle
713 // char *ruleExecId - the id of the object to change
714 // keyValPair_t *regParam - the keyword/value pair of items to be
715 // modified.
717  rsComm_t* _comm,
718  const char* _re_id,
719  keyValPair_t* _reg_param ) {
720  // =-=-=-=-=-=-=-
721  // call factory for database object
722  irods::database_object_ptr db_obj_ptr;
725  db_obj_ptr );
726  if ( !ret.ok() ) {
727  irods::log( PASS( ret ) );
728  return ret.code();
729  }
730 
731  // =-=-=-=-=-=-=-
732  // resolve a plugin for that object
733  irods::plugin_ptr db_plug_ptr;
734  ret = db_obj_ptr->resolve(
736  db_plug_ptr );
737  if ( !ret.ok() ) {
738  irods::log(
739  PASSMSG(
740  "failed to resolve database interface",
741  ret ) );
742  return ret.code();
743  }
744 
745  // =-=-=-=-=-=-=-
746  // cast plugin and object to db and fco for call
747  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
748  irods::first_class_object > ( db_obj_ptr );
749  irods::database_ptr db = boost::dynamic_pointer_cast <
750  irods::database > ( db_plug_ptr );
751 
752  // =-=-=-=-=-=-=-
753  // call the operation on the plugin
754  ret = db->call <
755  const char*,
756  keyValPair_t* > (
757  _comm,
759  ptr,
760  _re_id,
761  _reg_param );
762 
763  return ret.code();
764 
765 } // chlModRuleExec
766 
767 // =-=-=-=-=-=-=-
768 // delete a delayed rule execution entry
770  rsComm_t* _comm,
771  const char* _re_id ) {
772  // =-=-=-=-=-=-=-
773  // call factory for database object
774  irods::database_object_ptr db_obj_ptr;
777  db_obj_ptr );
778  if ( !ret.ok() ) {
779  irods::log( PASS( ret ) );
780  return ret.code();
781  }
782 
783  // =-=-=-=-=-=-=-
784  // resolve a plugin for that object
785  irods::plugin_ptr db_plug_ptr;
786  ret = db_obj_ptr->resolve(
788  db_plug_ptr );
789  if ( !ret.ok() ) {
790  irods::log(
791  PASSMSG(
792  "failed to resolve database interface",
793  ret ) );
794  return ret.code();
795  }
796 
797  // =-=-=-=-=-=-=-
798  // cast plugin and object to db and fco for call
799  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
800  irods::first_class_object > ( db_obj_ptr );
801  irods::database_ptr db = boost::dynamic_pointer_cast <
802  irods::database > ( db_plug_ptr );
803 
804  // =-=-=-=-=-=-=-
805  // call the operation on the plugin
806  ret = db->call <
807  const char* > (
808  _comm,
810  ptr,
811  _re_id );
812 
813  return ret.code();
814 
815 } // chlDelRuleExec
816 
820  rsComm_t* _comm,
821  std::map<std::string, std::string>& _resc_input ) {
822  // =-=-=-=-=-=-=-
823  // call factory for database object
824  irods::database_object_ptr db_obj_ptr;
827  db_obj_ptr );
828  if ( !ret.ok() ) {
829  irods::log( PASS( ret ) );
830  return ret.code();
831  }
832 
833  // =-=-=-=-=-=-=-
834  // resolve a plugin for that object
835  irods::plugin_ptr db_plug_ptr;
836  ret = db_obj_ptr->resolve(
838  db_plug_ptr );
839  if ( !ret.ok() ) {
840  irods::log(
841  PASSMSG(
842  "failed to resolve database interface",
843  ret ) );
844  return ret.code();
845  }
846 
847  // =-=-=-=-=-=-=-
848  // cast plugin and object to db and fco for call
849  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
850  irods::first_class_object > ( db_obj_ptr );
851  irods::database_ptr db = boost::dynamic_pointer_cast <
852  irods::database > ( db_plug_ptr );
853 
854  // =-=-=-=-=-=-=-
855  // call the operation on the plugin
856  ret = db->call <
857  std::map<std::string, std::string>* > (
858  _comm,
860  ptr,
861  &_resc_input );
862 
863  if(!ret.ok()) {
864  irods::log(PASS(ret));
865  }
866 
867  return ret.code();
868 
869 } // chlAddChildResc
870 
871 
872 /* register a Resource */
874  rsComm_t* _comm,
875  std::map<std::string, std::string>& _resc_input ) {
876  // =-=-=-=-=-=-=-
877  // call factory for database object
878  irods::database_object_ptr db_obj_ptr;
881  db_obj_ptr );
882  if ( !ret.ok() ) {
883  irods::log( PASS( ret ) );
884  return ret.code();
885  }
886 
887  // =-=-=-=-=-=-=-
888  // resolve a plugin for that object
889  irods::plugin_ptr db_plug_ptr;
890  ret = db_obj_ptr->resolve(
892  db_plug_ptr );
893  if ( !ret.ok() ) {
894  irods::log(
895  PASSMSG(
896  "failed to resolve database interface",
897  ret ) );
898  return ret.code();
899  }
900 
901  // =-=-=-=-=-=-=-
902  // cast plugin and object to db and fco for call
903  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
904  irods::first_class_object > ( db_obj_ptr );
905  irods::database_ptr db = boost::dynamic_pointer_cast <
906  irods::database > ( db_plug_ptr );
907 
908  // =-=-=-=-=-=-=-
909  // call the operation on the plugin
910  ret = db->call <
911  std::map<std::string, std::string>* > (
912  _comm,
914  ptr,
915  &_resc_input );
916 
917  return ret.code();
918 
919 } // chlRegResc
920 
924  rsComm_t* _comm,
925  std::map<std::string, std::string>& _resc_input ) {
926  // =-=-=-=-=-=-=-
927  // call factory for database object
928  irods::database_object_ptr db_obj_ptr;
931  db_obj_ptr );
932  if ( !ret.ok() ) {
933  irods::log( PASS( ret ) );
934  return ret.code();
935  }
936 
937  // =-=-=-=-=-=-=-
938  // resolve a plugin for that object
939  irods::plugin_ptr db_plug_ptr;
940  ret = db_obj_ptr->resolve(
942  db_plug_ptr );
943  if ( !ret.ok() ) {
944  irods::log(
945  PASSMSG(
946  "failed to resolve database interface",
947  ret ) );
948  return ret.code();
949  }
950 
951  // =-=-=-=-=-=-=-
952  // cast plugin and object to db and fco for call
953  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
954  irods::first_class_object > ( db_obj_ptr );
955  irods::database_ptr db = boost::dynamic_pointer_cast <
956  irods::database > ( db_plug_ptr );
957 
958  // =-=-=-=-=-=-=-
959  // call the operation on the plugin
960  ret = db->call <
961  std::map<std::string, std::string>* > (
962  _comm,
964  ptr,
965  &_resc_input );
966 
967  if(!ret.ok()) {
968  irods::log(PASS(ret));
969  }
970 
971  return ret.code();
972 
973 } // chlDelChildResc
974 
975 // =-=-=-=-=-=-=-
976 // delete a Resource
978  rsComm_t* _comm,
979  const std::string& _resc_name,
980  int _dry_run ) {
981  // =-=-=-=-=-=-=-
982  // call factory for database object
983  irods::database_object_ptr db_obj_ptr;
986  db_obj_ptr );
987  if ( !ret.ok() ) {
988  irods::log( PASS( ret ) );
989  return ret.code();
990  }
991 
992  // =-=-=-=-=-=-=-
993  // resolve a plugin for that object
994  irods::plugin_ptr db_plug_ptr;
995  ret = db_obj_ptr->resolve(
997  db_plug_ptr );
998  if ( !ret.ok() ) {
999  irods::log(
1000  PASSMSG(
1001  "failed to resolve database interface",
1002  ret ) );
1003  return ret.code();
1004  }
1005 
1006  // =-=-=-=-=-=-=-
1007  // cast plugin and object to db and fco for call
1008  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1009  irods::first_class_object > ( db_obj_ptr );
1010  irods::database_ptr db = boost::dynamic_pointer_cast <
1011  irods::database > ( db_plug_ptr );
1012 
1013  // =-=-=-=-=-=-=-
1014  // call the operation on the plugin
1015  ret = db->call <
1016  const char*,
1017  int > (
1018  _comm,
1020  ptr,
1021  _resc_name.c_str(),
1022  _dry_run );
1023 
1024  return ret.code();
1025 
1026 } // chlDelResc
1027 
1028 // =-=-=-=-=-=-=-
1029 // Issue a rollback command.
1030 //
1031 // If we don't do a commit, the updates will not be saved in the
1032 // database but will still exist during the current connection. Since
1033 // iadmin connects once and then can issue multiple commands there are
1034 // situations where we need to rollback.
1035 //
1036 // For example, if the user's zone is wrong the code will first remove the
1037 // home collection and then fail when removing the user and we need to
1038 // rollback or the next attempt will show the collection as missing.
1040  rsComm_t* _comm ) {
1041  // =-=-=-=-=-=-=-
1042  // call factory for database object
1043  irods::database_object_ptr db_obj_ptr;
1046  db_obj_ptr );
1047  if ( !ret.ok() ) {
1048  irods::log( PASS( ret ) );
1049  return ret.code();
1050  }
1051 
1052  // =-=-=-=-=-=-=-
1053  // resolve a plugin for that object
1054  irods::plugin_ptr db_plug_ptr;
1055  ret = db_obj_ptr->resolve(
1057  db_plug_ptr );
1058  if ( !ret.ok() ) {
1059  irods::log(
1060  PASSMSG(
1061  "failed to resolve database interface",
1062  ret ) );
1063  return ret.code();
1064  }
1065 
1066  // =-=-=-=-=-=-=-
1067  // cast plugin and object to db and fco for call
1068  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1069  irods::first_class_object > ( db_obj_ptr );
1070  irods::database_ptr db = boost::dynamic_pointer_cast <
1071  irods::database > ( db_plug_ptr );
1072 
1073  // =-=-=-=-=-=-=-
1074  // call the operation on the plugin
1075  ret = db->call(
1076  _comm,
1078  ptr );
1079 
1080  return ret.code();
1081 
1082 } // chlRollback
1083 
1084 // =-=-=-=-=-=-=-
1085 // Issue a commit command.
1086 // This is called to commit changes to the database.
1087 // Some of the chl functions also commit changes upon success but some
1088 // do not, having the caller (microservice, perhaps) either commit or
1089 // rollback.
1091  rsComm_t* _comm ) {
1092  // =-=-=-=-=-=-=-
1093  // call factory for database object
1094  irods::database_object_ptr db_obj_ptr;
1097  db_obj_ptr );
1098  if ( !ret.ok() ) {
1099  irods::log( PASS( ret ) );
1100  return ret.code();
1101  }
1102 
1103  // =-=-=-=-=-=-=-
1104  // resolve a plugin for that object
1105  irods::plugin_ptr db_plug_ptr;
1106  ret = db_obj_ptr->resolve(
1108  db_plug_ptr );
1109  if ( !ret.ok() ) {
1110  irods::log(
1111  PASSMSG(
1112  "failed to resolve database interface",
1113  ret ) );
1114  return ret.code();
1115  }
1116 
1117  // =-=-=-=-=-=-=-
1118  // cast plugin and object to db and fco for call
1119  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1120  irods::first_class_object > ( db_obj_ptr );
1121  irods::database_ptr db = boost::dynamic_pointer_cast <
1122  irods::database > ( db_plug_ptr );
1123 
1124  // =-=-=-=-=-=-=-
1125  // call the operation on the plugin
1126  ret = db->call(
1127  _comm,
1129  ptr );
1130 
1131  return ret.code();
1132 
1133 } // chlCommit
1134 
1135 // =-=-=-=-=-=-=-
1136 // Delete a User, Rule Engine version
1138  rsComm_t* _comm,
1139  userInfo_t* _user_info ) {
1140  // =-=-=-=-=-=-=-
1141  // call factory for database object
1142  irods::database_object_ptr db_obj_ptr;
1145  db_obj_ptr );
1146  if ( !ret.ok() ) {
1147  irods::log( PASS( ret ) );
1148  return ret.code();
1149  }
1150 
1151  // =-=-=-=-=-=-=-
1152  // resolve a plugin for that object
1153  irods::plugin_ptr db_plug_ptr;
1154  ret = db_obj_ptr->resolve(
1156  db_plug_ptr );
1157  if ( !ret.ok() ) {
1158  irods::log(
1159  PASSMSG(
1160  "failed to resolve database interface",
1161  ret ) );
1162  return ret.code();
1163  }
1164 
1165  // =-=-=-=-=-=-=-
1166  // cast plugin and object to db and fco for call
1167  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1168  irods::first_class_object > ( db_obj_ptr );
1169  irods::database_ptr db = boost::dynamic_pointer_cast <
1170  irods::database > ( db_plug_ptr );
1171 
1172  // =-=-=-=-=-=-=-
1173  // call the operation on the plugin
1174  ret = db->call <
1175  userInfo_t* > (
1176  _comm,
1178  ptr,
1179  _user_info );
1180 
1181  return ret.code();
1182 
1183 } // chlDelUserRE
1184 
1185 // =-=-=-=-=-=-=-
1186 // Register a Collection by the admin.
1187 // There are cases where the irods admin needs to create collections,
1188 // for a new user, for example; thus the create user rule/microservices
1189 // make use of this.
1191  rsComm_t* _comm,
1192  collInfo_t* _coll_info ) {
1193  // =-=-=-=-=-=-=-
1194  // call factory for database object
1195  irods::database_object_ptr db_obj_ptr;
1198  db_obj_ptr );
1199  if ( !ret.ok() ) {
1200  irods::log( PASS( ret ) );
1201  return ret.code();
1202  }
1203 
1204  // =-=-=-=-=-=-=-
1205  // resolve a plugin for that object
1206  irods::plugin_ptr db_plug_ptr;
1207  ret = db_obj_ptr->resolve(
1209  db_plug_ptr );
1210  if ( !ret.ok() ) {
1211  irods::log(
1212  PASSMSG(
1213  "failed to resolve database interface",
1214  ret ) );
1215  return ret.code();
1216  }
1217 
1218  // =-=-=-=-=-=-=-
1219  // cast plugin and object to db and fco for call
1220  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1221  irods::first_class_object > ( db_obj_ptr );
1222  irods::database_ptr db = boost::dynamic_pointer_cast <
1223  irods::database > ( db_plug_ptr );
1224 
1225  // =-=-=-=-=-=-=-
1226  // call the operation on the plugin
1227  ret = db->call <
1228  collInfo_t* > (
1229  _comm,
1231  ptr,
1232  _coll_info );
1233 
1234  return ret.code();
1235 
1236 } // chlRegCollByAdmin
1237 
1238 // =-=-=-=-=-=-=-
1239 // chlRegColl - register a collection
1240 // Input -
1241 // rcComm_t *conn - The client connection handle.
1242 // collInfo_t *collInfo - generic coll input. Relevant items are:
1243 // collName - the collection to be registered, and optionally
1244 // collType, collInfo1 and/or collInfo2.
1245 // We may need a kevValPair_t sometime, but currently not used.
1247  rsComm_t* _comm,
1248  collInfo_t* _coll_info ) {
1249  // =-=-=-=-=-=-=-
1250  // call factory for database object
1251  irods::database_object_ptr db_obj_ptr;
1254  db_obj_ptr );
1255  if ( !ret.ok() ) {
1256  irods::log( PASS( ret ) );
1257  return ret.code();
1258  }
1259 
1260  // =-=-=-=-=-=-=-
1261  // resolve a plugin for that object
1262  irods::plugin_ptr db_plug_ptr;
1263  ret = db_obj_ptr->resolve(
1265  db_plug_ptr );
1266  if ( !ret.ok() ) {
1267  irods::log(
1268  PASSMSG(
1269  "failed to resolve database interface",
1270  ret ) );
1271  return ret.code();
1272  }
1273 
1274  // =-=-=-=-=-=-=-
1275  // cast plugin and object to db and fco for call
1276  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1277  irods::first_class_object > ( db_obj_ptr );
1278  irods::database_ptr db = boost::dynamic_pointer_cast <
1279  irods::database > ( db_plug_ptr );
1280 
1281  // =-=-=-=-=-=-=-
1282  // call the operation on the plugin
1283  ret = db->call <
1284  collInfo_t* > (
1285  _comm,
1287  ptr,
1288  _coll_info );
1289 
1290  return ret.code();
1291 
1292 } // chlRegColl
1293 
1294 // =-=-=-=-=-=-=-
1295 // chlModColl - modify attributes of a collection
1296 // Input -
1297 // rcComm_t *conn - The client connection handle.
1298 // collInfo_t *collInfo - generic coll input. Relevant items are:
1299 // collName - the collection to be updated, and one or more of:
1300 // collType, collInfo1 and/or collInfo2.
1301 // We may need a kevValPair_t sometime, but currently not used.
1303  rsComm_t* _comm,
1304  collInfo_t* _coll_info ) {
1305  // =-=-=-=-=-=-=-
1306  // call factory for database object
1307  irods::database_object_ptr db_obj_ptr;
1310  db_obj_ptr );
1311  if ( !ret.ok() ) {
1312  irods::log( PASS( ret ) );
1313  return ret.code();
1314  }
1315 
1316  // =-=-=-=-=-=-=-
1317  // resolve a plugin for that object
1318  irods::plugin_ptr db_plug_ptr;
1319  ret = db_obj_ptr->resolve(
1321  db_plug_ptr );
1322  if ( !ret.ok() ) {
1323  irods::log(
1324  PASSMSG(
1325  "failed to resolve database interface",
1326  ret ) );
1327  return ret.code();
1328  }
1329 
1330  // =-=-=-=-=-=-=-
1331  // cast plugin and object to db and fco for call
1332  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1333  irods::first_class_object > ( db_obj_ptr );
1334  irods::database_ptr db = boost::dynamic_pointer_cast <
1335  irods::database > ( db_plug_ptr );
1336 
1337  // =-=-=-=-=-=-=-
1338  // call the operation on the plugin
1339  ret = db->call <
1340  collInfo_t* > (
1341  _comm,
1343  ptr,
1344  _coll_info );
1345 
1346  return ret.code();
1347 
1348 } // chlModColl
1349 
1350 // =-=-=-=-=-=-=-
1351 // register a Zone
1353  rsComm_t* _comm,
1354  const char* _zone_name,
1355  const char* _zone_type,
1356  const char* _zone_conn_info,
1357  const char* _zone_comment ) {
1358  // =-=-=-=-=-=-=-
1359  // call factory for database object
1360  irods::database_object_ptr db_obj_ptr;
1363  db_obj_ptr );
1364  if ( !ret.ok() ) {
1365  irods::log( PASS( ret ) );
1366  return ret.code();
1367  }
1368 
1369  // =-=-=-=-=-=-=-
1370  // resolve a plugin for that object
1371  irods::plugin_ptr db_plug_ptr;
1372  ret = db_obj_ptr->resolve(
1374  db_plug_ptr );
1375  if ( !ret.ok() ) {
1376  irods::log(
1377  PASSMSG(
1378  "failed to resolve database interface",
1379  ret ) );
1380  return ret.code();
1381  }
1382 
1383  // =-=-=-=-=-=-=-
1384  // cast plugin and object to db and fco for call
1385  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1386  irods::first_class_object > ( db_obj_ptr );
1387  irods::database_ptr db = boost::dynamic_pointer_cast <
1388  irods::database > ( db_plug_ptr );
1389 
1390  // =-=-=-=-=-=-=-
1391  // call the operation on the plugin
1392  ret = db->call <
1393  const char*,
1394  const char*,
1395  const char*,
1396  const char* > (
1397  _comm,
1399  ptr,
1400  _zone_name,
1401  _zone_type,
1402  _zone_conn_info,
1403  _zone_comment );
1404 
1405  return ret.code();
1406 
1407 } // chlRegZone
1408 
1409 // =-=-=-=-=-=-=-
1410 // Modify a Zone (certain fields)
1412  rsComm_t* _comm,
1413  const char* _zone_name,
1414  const char* _option,
1415  const char* _option_value ) {
1416  // =-=-=-=-=-=-=-
1417  // call factory for database object
1418  irods::database_object_ptr db_obj_ptr;
1421  db_obj_ptr );
1422  if ( !ret.ok() ) {
1423  irods::log( PASS( ret ) );
1424  return ret.code();
1425  }
1426 
1427  // =-=-=-=-=-=-=-
1428  // resolve a plugin for that object
1429  irods::plugin_ptr db_plug_ptr;
1430  ret = db_obj_ptr->resolve(
1432  db_plug_ptr );
1433  if ( !ret.ok() ) {
1434  irods::log(
1435  PASSMSG(
1436  "failed to resolve database interface",
1437  ret ) );
1438  return ret.code();
1439  }
1440 
1441  // =-=-=-=-=-=-=-
1442  // cast plugin and object to db and fco for call
1443  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1444  irods::first_class_object > ( db_obj_ptr );
1445  irods::database_ptr db = boost::dynamic_pointer_cast <
1446  irods::database > ( db_plug_ptr );
1447 
1448  // =-=-=-=-=-=-=-
1449  // call the operation on the plugin
1450  ret = db->call <
1451  const char*,
1452  const char*,
1453  const char* > (
1454  _comm,
1456  ptr,
1457  _zone_name,
1458  _option,
1459  _option_value );
1460 
1461  return ret.code();
1462 
1463 } // chlModZone
1464 
1465 // =-=-=-=-=-=-=-
1466 // rename a collection
1468  rsComm_t* _comm,
1469  const char* _old_coll,
1470  const char* _new_coll ) {
1471  // =-=-=-=-=-=-=-
1472  // call factory for database object
1473  irods::database_object_ptr db_obj_ptr;
1476  db_obj_ptr );
1477  if ( !ret.ok() ) {
1478  irods::log( PASS( ret ) );
1479  return ret.code();
1480  }
1481 
1482  // =-=-=-=-=-=-=-
1483  // resolve a plugin for that object
1484  irods::plugin_ptr db_plug_ptr;
1485  ret = db_obj_ptr->resolve(
1487  db_plug_ptr );
1488  if ( !ret.ok() ) {
1489  irods::log(
1490  PASSMSG(
1491  "failed to resolve database interface",
1492  ret ) );
1493  return ret.code();
1494  }
1495 
1496  // =-=-=-=-=-=-=-
1497  // cast plugin and object to db and fco for call
1498  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1499  irods::first_class_object > ( db_obj_ptr );
1500  irods::database_ptr db = boost::dynamic_pointer_cast <
1501  irods::database > ( db_plug_ptr );
1502 
1503  // =-=-=-=-=-=-=-
1504  // call the operation on the plugin
1505  ret = db->call <
1506  const char*,
1507  const char* > (
1508  _comm,
1510  ptr,
1511  _old_coll,
1512  _new_coll );
1513 
1514  return ret.code();
1515 
1516 } // chlRenameColl
1517 
1518 // =-=-=-=-=-=-=-
1519 // Modify a Zone Collection ACL
1521  rsComm_t* _comm,
1522  const char* _access_level,
1523  const char* _user_name,
1524  const char* _path_name ) {
1525  // =-=-=-=-=-=-=-
1526  // call factory for database object
1527  irods::database_object_ptr db_obj_ptr;
1530  db_obj_ptr );
1531  if ( !ret.ok() ) {
1532  irods::log( PASS( ret ) );
1533  return ret.code();
1534  }
1535 
1536  // =-=-=-=-=-=-=-
1537  // resolve a plugin for that object
1538  irods::plugin_ptr db_plug_ptr;
1539  ret = db_obj_ptr->resolve(
1541  db_plug_ptr );
1542  if ( !ret.ok() ) {
1543  irods::log(
1544  PASSMSG(
1545  "failed to resolve database interface",
1546  ret ) );
1547  return ret.code();
1548  }
1549 
1550  // =-=-=-=-=-=-=-
1551  // cast plugin and object to db and fco for call
1552  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1553  irods::first_class_object > ( db_obj_ptr );
1554  irods::database_ptr db = boost::dynamic_pointer_cast <
1555  irods::database > ( db_plug_ptr );
1556 
1557  // =-=-=-=-=-=-=-
1558  // call the operation on the plugin
1559  ret = db->call <
1560  const char*,
1561  const char*,
1562  const char* > (
1563  _comm,
1565  ptr,
1566  _access_level,
1567  _user_name,
1568  _path_name );
1569 
1570  return ret.code();
1571 
1572 } // chlModZoneCollAcl
1573 
1574 // =-=-=-=-=-=-=-
1575 // rename the local zone
1577  rsComm_t* _comm,
1578  const char* _old_zone,
1579  const char* _new_zone ) {
1580  // =-=-=-=-=-=-=-
1581  // call factory for database object
1582  irods::database_object_ptr db_obj_ptr;
1585  db_obj_ptr );
1586  if ( !ret.ok() ) {
1587  irods::log( PASS( ret ) );
1588  return ret.code();
1589  }
1590 
1591  // =-=-=-=-=-=-=-
1592  // resolve a plugin for that object
1593  irods::plugin_ptr db_plug_ptr;
1594  ret = db_obj_ptr->resolve(
1596  db_plug_ptr );
1597  if ( !ret.ok() ) {
1598  irods::log(
1599  PASSMSG(
1600  "failed to resolve database interface",
1601  ret ) );
1602  return ret.code();
1603  }
1604 
1605  // =-=-=-=-=-=-=-
1606  // cast plugin and object to db and fco for call
1607  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1608  irods::first_class_object > ( db_obj_ptr );
1609  irods::database_ptr db = boost::dynamic_pointer_cast <
1610  irods::database > ( db_plug_ptr );
1611 
1612  // =-=-=-=-=-=-=-
1613  // call the operation on the plugin
1614  ret = db->call <
1615  const char*,
1616  const char* > (
1617  _comm,
1619  ptr,
1620  _old_zone,
1621  _new_zone );
1622 
1623  return ret.code();
1624 
1625 } // chlRenameLocalZone
1626 
1627 /* delete a Zone */
1629  rsComm_t* _comm,
1630  const char* _zone_name ) {
1631  // =-=-=-=-=-=-=-
1632  // call factory for database object
1633  irods::database_object_ptr db_obj_ptr;
1636  db_obj_ptr );
1637  if ( !ret.ok() ) {
1638  irods::log( PASS( ret ) );
1639  return ret.code();
1640  }
1641 
1642  // =-=-=-=-=-=-=-
1643  // resolve a plugin for that object
1644  irods::plugin_ptr db_plug_ptr;
1645  ret = db_obj_ptr->resolve(
1647  db_plug_ptr );
1648  if ( !ret.ok() ) {
1649  irods::log(
1650  PASSMSG(
1651  "failed to resolve database interface",
1652  ret ) );
1653  return ret.code();
1654  }
1655 
1656  // =-=-=-=-=-=-=-
1657  // cast plugin and object to db and fco for call
1658  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1659  irods::first_class_object > ( db_obj_ptr );
1660  irods::database_ptr db = boost::dynamic_pointer_cast <
1661  irods::database > ( db_plug_ptr );
1662 
1663  // =-=-=-=-=-=-=-
1664  // call the operation on the plugin
1665  ret = db->call <
1666  const char* > (
1667  _comm,
1669  ptr,
1670  _zone_name );
1671 
1672  return ret.code();
1673 
1674 } // chlDelZone
1675 
1676 
1677 // =-=-=-=-=-=-=-
1678 // Simple query
1679 
1680 // This is used in cases where it is easier to do a straight-forward
1681 // SQL query rather than go thru the generalQuery interface. This is
1682 // used this in the iadmin.c interface as it was easier for me (Wayne)
1683 // to work in SQL for admin type ops as I'm thinking in terms of
1684 // tables and columns and SQL anyway.
1685 
1686 // For improved security, this is available only to admin users and
1687 // the code checks that the input sql is one of the allowed forms.
1688 
1689 // input: sql, up to for optional arguments (bind variables),
1690 // and requested format, max text to return (maxOutBuf)
1691 // output: text (outBuf) or error return
1692 // input/output: control: on input if 0 request is starting,
1693 // returned non-zero if more rows
1694 // are available (and then it is the statement number);
1695 // on input if positive it is the statement number (+1) that is being
1696 // continued.
1697 // format 1: column-name : column value, and with CR after each column
1698 // format 2: column headings CR, rows and col values with CR
1700  rsComm_t* _comm,
1701  const char* _sql,
1702  const char* _arg1,
1703  const char* _arg2,
1704  const char* _arg3,
1705  const char* _arg4,
1706  int _format,
1707  int* _control,
1708  char* _out_buf,
1709  int _max_out_buf ) {
1710  // =-=-=-=-=-=-=-
1711  // call factory for database object
1712  irods::database_object_ptr db_obj_ptr;
1715  db_obj_ptr );
1716  if ( !ret.ok() ) {
1717  irods::log( PASS( ret ) );
1718  return ret.code();
1719  }
1720 
1721  // =-=-=-=-=-=-=-
1722  // resolve a plugin for that object
1723  irods::plugin_ptr db_plug_ptr;
1724  ret = db_obj_ptr->resolve(
1726  db_plug_ptr );
1727  if ( !ret.ok() ) {
1728  irods::log(
1729  PASSMSG(
1730  "failed to resolve database interface",
1731  ret ) );
1732  return ret.code();
1733  }
1734 
1735  // =-=-=-=-=-=-=-
1736  // cast plugin and object to db and fco for call
1737  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1738  irods::first_class_object > ( db_obj_ptr );
1739  irods::database_ptr db = boost::dynamic_pointer_cast <
1740  irods::database > ( db_plug_ptr );
1741 
1742  // =-=-=-=-=-=-=-
1743  // call the operation on the plugin
1744  ret = db->call <
1745  const char*,
1746  const char*,
1747  const char*,
1748  const char*,
1749  const char*,
1750  int,
1751  int*,
1752  char*,
1753  int > (
1754  _comm,
1756  ptr,
1757  _sql,
1758  _arg1,
1759  _arg2,
1760  _arg3,
1761  _arg4,
1762  _format,
1763  _control,
1764  _out_buf,
1765  _max_out_buf );
1766 
1767  return ret.code();
1768 
1769 } // chlSimpleQuery
1770 
1771 // =-=-=-=-=-=-=-
1772 // Delete a Collection by Administrator,
1773 // if it is empty.
1775  rsComm_t* _comm,
1776  collInfo_t* _coll_info ) {
1777  // =-=-=-=-=-=-=-
1778  // call factory for database object
1779  irods::database_object_ptr db_obj_ptr;
1782  db_obj_ptr );
1783  if ( !ret.ok() ) {
1784  irods::log( PASS( ret ) );
1785  return ret.code();
1786  }
1787 
1788  // =-=-=-=-=-=-=-
1789  // resolve a plugin for that object
1790  irods::plugin_ptr db_plug_ptr;
1791  ret = db_obj_ptr->resolve(
1793  db_plug_ptr );
1794  if ( !ret.ok() ) {
1795  irods::log(
1796  PASSMSG(
1797  "failed to resolve database interface",
1798  ret ) );
1799  return ret.code();
1800  }
1801 
1802  // =-=-=-=-=-=-=-
1803  // cast plugin and object to db and fco for call
1804  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1805  irods::first_class_object > ( db_obj_ptr );
1806  irods::database_ptr db = boost::dynamic_pointer_cast <
1807  irods::database > ( db_plug_ptr );
1808 
1809  // =-=-=-=-=-=-=-
1810  // call the operation on the plugin
1811  ret = db->call <
1812  collInfo_t* > (
1813  _comm,
1815  ptr,
1816  _coll_info );
1817 
1818  return ret.code();
1819 
1820 } // chlDelCollByAdmin
1821 
1822 // =-=-=-=-=-=-=-
1823 // Delete a Collection
1825  rsComm_t* _comm,
1826  collInfo_t* _coll_info ) {
1827  // =-=-=-=-=-=-=-
1828  // call factory for database object
1829  irods::database_object_ptr db_obj_ptr;
1832  db_obj_ptr );
1833  if ( !ret.ok() ) {
1834  irods::log( PASS( ret ) );
1835  return ret.code();
1836  }
1837 
1838  // =-=-=-=-=-=-=-
1839  // resolve a plugin for that object
1840  irods::plugin_ptr db_plug_ptr;
1841  ret = db_obj_ptr->resolve(
1843  db_plug_ptr );
1844  if ( !ret.ok() ) {
1845  irods::log(
1846  PASSMSG(
1847  "failed to resolve database interface",
1848  ret ) );
1849  return ret.code();
1850  }
1851 
1852  // =-=-=-=-=-=-=-
1853  // cast plugin and object to db and fco for call
1854  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1855  irods::first_class_object > ( db_obj_ptr );
1856  irods::database_ptr db = boost::dynamic_pointer_cast <
1857  irods::database > ( db_plug_ptr );
1858 
1859  // =-=-=-=-=-=-=-
1860  // call the operation on the plugin
1861  ret = db->call <
1862  collInfo_t* > (
1863  _comm,
1865  ptr,
1866  _coll_info );
1867 
1868  return ret.code();
1869 
1870 } // chlDelColl
1871 
1872 /* Check an authentication response.
1873 
1874  Input is the challange, response, and username; the response is checked
1875  and if OK the userPrivLevel is set. Temporary-one-time passwords are
1876  also checked and possibly removed.
1877 
1878  The clientPrivLevel is the privilege level for the client in
1879  the rsComm structure; this is used by servers when setting the
1880  authFlag.
1881 
1882  Called from rsAuthCheck.
1883 */
1885  rsComm_t* _comm,
1886  const char* _scheme,
1887  const char* _challenge,
1888  const char* _response,
1889  const char* _user_name,
1890  int* _user_priv_level,
1891  int* _client_priv_level ) {
1892  // =-=-=-=-=-=-=-
1893  // call factory for database object
1894  irods::database_object_ptr db_obj_ptr;
1896  if ( !ret.ok() ) {
1897  irods::log( PASS( ret ) );
1898  return ret.code();
1899  }
1900 
1901  // =-=-=-=-=-=-=-
1902  // resolve a plugin for that object
1903  irods::plugin_ptr db_plug_ptr;
1904  ret = db_obj_ptr->resolve( irods::DATABASE_INTERFACE, db_plug_ptr );
1905  if ( !ret.ok() ) {
1906  irods::log( PASSMSG( "failed to resolve database interface", ret ) );
1907  return ret.code();
1908  }
1909 
1910  // =-=-=-=-=-=-=-
1911  // cast plugin and object to db and fco for call
1912  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <irods::first_class_object > ( db_obj_ptr );
1913  irods::database_ptr db = boost::dynamic_pointer_cast <irods::database > ( db_plug_ptr );
1914 
1915  // =-=-=-=-=-=-=-
1916  // call the operation on the plugin
1917  ret = db->call < const char*, const char*, const char*, const char*, int*, int* > ( _comm, irods::DATABASE_OP_CHECK_AUTH, ptr, _scheme, _challenge, _response,
1918  _user_name, _user_priv_level, _client_priv_level );
1919 
1920  return ret.code();
1921 
1922 } // chlCheckAuth
1923 
1924 // =-=-=-=-=-=-=-
1925 // Generate a temporary, one-time password.
1926 // Input is the username from the rsComm structure and an optional otherUser.
1927 // Output is the pattern, that when hashed with the client user's password,
1928 // becomes the temporary password. The temp password is also stored
1929 // in the database.
1930 
1931 // Called from rsGetTempPassword and rsGetTempPasswordForOther.
1932 
1933 // If otherUser is non-blank, then create a password for the
1934 // specified user, and the caller must be a local admin.
1936  rsComm_t* _comm,
1937  char* _pw_value_to_hash,
1938  const char* _other_user ) {
1939  // =-=-=-=-=-=-=-
1940  // call factory for database object
1941  irods::database_object_ptr db_obj_ptr;
1944  db_obj_ptr );
1945  if ( !ret.ok() ) {
1946  irods::log( PASS( ret ) );
1947  return ret.code();
1948  }
1949 
1950  // =-=-=-=-=-=-=-
1951  // resolve a plugin for that object
1952  irods::plugin_ptr db_plug_ptr;
1953  ret = db_obj_ptr->resolve(
1955  db_plug_ptr );
1956  if ( !ret.ok() ) {
1957  irods::log(
1958  PASSMSG(
1959  "failed to resolve database interface",
1960  ret ) );
1961  return ret.code();
1962  }
1963 
1964  // =-=-=-=-=-=-=-
1965  // cast plugin and object to db and fco for call
1966  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
1967  irods::first_class_object > ( db_obj_ptr );
1968  irods::database_ptr db = boost::dynamic_pointer_cast <
1969  irods::database > ( db_plug_ptr );
1970 
1971  // =-=-=-=-=-=-=-
1972  // call the operation on the plugin
1973  ret = db->call <
1974  char*,
1975  const char* > (
1976  _comm,
1978  ptr,
1979  _pw_value_to_hash,
1980  _other_user );
1981 
1982  return ret.code();
1983 
1984 } // chlMakeTempPw
1985 
1986 int
1988  rsComm_t* _comm,
1989  int _ttl,
1990  char* _pw_value_to_hash ) {
1991  // =-=-=-=-=-=-=-
1992  // call factory for database object
1993  irods::database_object_ptr db_obj_ptr;
1996  db_obj_ptr );
1997  if ( !ret.ok() ) {
1998  irods::log( PASS( ret ) );
1999  return ret.code();
2000  }
2001 
2002  // =-=-=-=-=-=-=-
2003  // resolve a plugin for that object
2004  irods::plugin_ptr db_plug_ptr;
2005  ret = db_obj_ptr->resolve(
2007  db_plug_ptr );
2008  if ( !ret.ok() ) {
2009  irods::log(
2010  PASSMSG(
2011  "failed to resolve database interface",
2012  ret ) );
2013  return ret.code();
2014  }
2015 
2016  // =-=-=-=-=-=-=-
2017  // cast plugin and object to db and fco for call
2018  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2019  irods::first_class_object > ( db_obj_ptr );
2020  irods::database_ptr db = boost::dynamic_pointer_cast <
2021  irods::database > ( db_plug_ptr );
2022 
2023  // =-=-=-=-=-=-=-
2024  // call the operation on the plugin
2025  ret = db->call <
2026  int,
2027  char* > (
2028  _comm,
2030  ptr,
2031  _ttl,
2032  _pw_value_to_hash );
2033 
2034  return ret.code();
2035 
2036 } // chlMakeLimitedPw
2037 
2038 
2039 // =-=-=-=-=-=-=-
2040 // Add or update passwords for use in the PAM authentication mode.
2041 // User has been PAM-authenticated when this is called.
2042 // This function adds a irods password valid for a few days and returns that.
2043 // If one already exists, the expire time is updated, and it's value is returned.
2044 // Passwords created are pseudo-random strings, unrelated to the PAM password.
2045 // If testTime is non-null, use that as the create-time, as a testing aid.
2047  rsComm_t* _comm,
2048  const char* _user_name,
2049  int _ttl,
2050  const char* _test_time,
2051  char** _irods_password ) {
2052  // =-=-=-=-=-=-=-
2053  // call factory for database object
2054  irods::database_object_ptr db_obj_ptr;
2057  db_obj_ptr );
2058  if ( !ret.ok() ) {
2059  irods::log( PASS( ret ) );
2060  return ret.code();
2061  }
2062 
2063  // =-=-=-=-=-=-=-
2064  // resolve a plugin for that object
2065  irods::plugin_ptr db_plug_ptr;
2066  ret = db_obj_ptr->resolve(
2068  db_plug_ptr );
2069  if ( !ret.ok() ) {
2070  irods::log(
2071  PASSMSG(
2072  "failed to resolve database interface",
2073  ret ) );
2074  return ret.code();
2075  }
2076 
2077  // =-=-=-=-=-=-=-
2078  // cast plugin and object to db and fco for call
2079  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2080  irods::first_class_object > ( db_obj_ptr );
2081  irods::database_ptr db = boost::dynamic_pointer_cast <
2082  irods::database > ( db_plug_ptr );
2083 
2084  // =-=-=-=-=-=-=-
2085  // call the operation on the plugin
2086  ret = db->call <
2087  const char*,
2088  int,
2089  const char*,
2090  char** > (
2091  _comm,
2093  ptr,
2094  _user_name,
2095  _ttl,
2096  _test_time,
2097  _irods_password );
2098 
2099  return ret.code();
2100 
2101 } // chlUpdateIrodsPamPassword
2102 
2103 // =-=-=-=-=-=-=-
2104 // Admin Only Fcn -- Modify an existing user
2105 // Called from rsGeneralAdmin which is used by iadmin
2107  rsComm_t* _comm,
2108  const char* _user_name,
2109  const char* _option,
2110  const char* _new_value ) {
2111  // =-=-=-=-=-=-=-
2112  // call factory for database object
2113  irods::database_object_ptr db_obj_ptr;
2116  db_obj_ptr );
2117  if ( !ret.ok() ) {
2118  irods::log( PASS( ret ) );
2119  return ret.code();
2120  }
2121 
2122  // =-=-=-=-=-=-=-
2123  // resolve a plugin for that object
2124  irods::plugin_ptr db_plug_ptr;
2125  ret = db_obj_ptr->resolve(
2127  db_plug_ptr );
2128  if ( !ret.ok() ) {
2129  irods::log(
2130  PASSMSG(
2131  "failed to resolve database interface",
2132  ret ) );
2133  return ret.code();
2134  }
2135 
2136  // =-=-=-=-=-=-=-
2137  // cast plugin and object to db and fco for call
2138  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2139  irods::first_class_object > ( db_obj_ptr );
2140  irods::database_ptr db = boost::dynamic_pointer_cast <
2141  irods::database > ( db_plug_ptr );
2142 
2143  // =-=-=-=-=-=-=-
2144  // call the operation on the plugin
2145  ret = db->call <
2146  const char*,
2147  const char*,
2148  const char* > (
2149  _comm,
2151  ptr,
2152  _user_name,
2153  _option,
2154  _new_value );
2155 
2156  return ret.code();
2157 
2158 } // chlModUser
2159 
2160 // =-=-=-=-=-=-=-
2161 // Modify an existing group (membership).
2162 // Groups are also users in the schema, so chlModUser can also
2163 // modify other group attibutes. */
2165  rsComm_t* _comm,
2166  const char* _group_name,
2167  const char* _option,
2168  const char* _user_name,
2169  const char* _user_zone ) {
2170  // =-=-=-=-=-=-=-
2171  // call factory for database object
2172  irods::database_object_ptr db_obj_ptr;
2175  db_obj_ptr );
2176  if ( !ret.ok() ) {
2177  irods::log( PASS( ret ) );
2178  return ret.code();
2179  }
2180 
2181  // =-=-=-=-=-=-=-
2182  // resolve a plugin for that object
2183  irods::plugin_ptr db_plug_ptr;
2184  ret = db_obj_ptr->resolve(
2186  db_plug_ptr );
2187  if ( !ret.ok() ) {
2188  irods::log(
2189  PASSMSG(
2190  "failed to resolve database interface",
2191  ret ) );
2192  return ret.code();
2193  }
2194 
2195  // =-=-=-=-=-=-=-
2196  // cast plugin and object to db and fco for call
2197  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2198  irods::first_class_object > ( db_obj_ptr );
2199  irods::database_ptr db = boost::dynamic_pointer_cast <
2200  irods::database > ( db_plug_ptr );
2201 
2202  // =-=-=-=-=-=-=-
2203  // call the operation on the plugin
2204  ret = db->call <
2205  const char*,
2206  const char*,
2207  const char*,
2208  const char* > (
2209  _comm,
2211  ptr,
2212  _group_name,
2213  _option,
2214  _user_name,
2215  _user_zone );
2216 
2217  return ret.code();
2218 
2219 } // chlModGroup
2220 
2221 // =-=-=-=-=-=-=-
2222 // Modify a Resource (certain fields)
2224  rsComm_t* _comm,
2225  const char* _resc_name,
2226  const char* _option,
2227  const char* _option_value ) {
2228  // =-=-=-=-=-=-=-
2229  // call factory for database object
2230  irods::database_object_ptr db_obj_ptr;
2233  db_obj_ptr );
2234  if ( !ret.ok() ) {
2235  irods::log( PASS( ret ) );
2236  return ret.code();
2237  }
2238 
2239  // =-=-=-=-=-=-=-
2240  // resolve a plugin for that object
2241  irods::plugin_ptr db_plug_ptr;
2242  ret = db_obj_ptr->resolve(
2244  db_plug_ptr );
2245  if ( !ret.ok() ) {
2246  irods::log(
2247  PASSMSG(
2248  "failed to resolve database interface",
2249  ret ) );
2250  return ret.code();
2251  }
2252 
2253  // =-=-=-=-=-=-=-
2254  // cast plugin and object to db and fco for call
2255  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2256  irods::first_class_object > ( db_obj_ptr );
2257  irods::database_ptr db = boost::dynamic_pointer_cast <
2258  irods::database > ( db_plug_ptr );
2259 
2260  // =-=-=-=-=-=-=-
2261  // call the operation on the plugin
2262  ret = db->call <
2263  const char*,
2264  const char*,
2265  const char* > (
2266  _comm,
2268  ptr,
2269  _resc_name,
2270  _option,
2271  _option_value );
2272 
2273  return ret.code();
2274 
2275 } // chlModResc
2276 
2277 // =-=-=-=-=-=-=-
2278 // Modify a Resource Data Paths
2280  rsComm_t* _comm,
2281  const char* _resc_name,
2282  const char* _old_path,
2283  const char* _new_path,
2284  const char* _user_name ) {
2285  // =-=-=-=-=-=-=-
2286  // call factory for database object
2287  irods::database_object_ptr db_obj_ptr;
2290  db_obj_ptr );
2291  if ( !ret.ok() ) {
2292  irods::log( PASS( ret ) );
2293  return ret.code();
2294  }
2295 
2296  // =-=-=-=-=-=-=-
2297  // resolve a plugin for that object
2298  irods::plugin_ptr db_plug_ptr;
2299  ret = db_obj_ptr->resolve(
2301  db_plug_ptr );
2302  if ( !ret.ok() ) {
2303  irods::log(
2304  PASSMSG(
2305  "failed to resolve database interface",
2306  ret ) );
2307  return ret.code();
2308  }
2309 
2310  // =-=-=-=-=-=-=-
2311  // cast plugin and object to db and fco for call
2312  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2313  irods::first_class_object > ( db_obj_ptr );
2314  irods::database_ptr db = boost::dynamic_pointer_cast <
2315  irods::database > ( db_plug_ptr );
2316 
2317  // =-=-=-=-=-=-=-
2318  // call the operation on the plugin
2319  ret = db->call <
2320  const char*,
2321  const char*,
2322  const char*,
2323  const char* > (
2324  _comm,
2326  ptr,
2327  _resc_name,
2328  _old_path,
2329  _new_path,
2330  _user_name );
2331 
2332  return ret.code();
2333 
2334 
2335 } // chlModRescDataPaths
2336 
2337 // =-=-=-=-=-=-=-
2338 // Add or substract to the resource free_space
2340  rsComm_t* _comm,
2341  const char* _resc_name,
2342  int _update_value ) {
2343  // =-=-=-=-=-=-=-
2344  // call factory for database object
2345  irods::database_object_ptr db_obj_ptr;
2348  db_obj_ptr );
2349  if ( !ret.ok() ) {
2350  irods::log( PASS( ret ) );
2351  return ret.code();
2352  }
2353 
2354  // =-=-=-=-=-=-=-
2355  // resolve a plugin for that object
2356  irods::plugin_ptr db_plug_ptr;
2357  ret = db_obj_ptr->resolve(
2359  db_plug_ptr );
2360  if ( !ret.ok() ) {
2361  irods::log(
2362  PASSMSG(
2363  "failed to resolve database interface",
2364  ret ) );
2365  return ret.code();
2366  }
2367 
2368  // =-=-=-=-=-=-=-
2369  // cast plugin and object to db and fco for call
2370  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2371  irods::first_class_object > ( db_obj_ptr );
2372  irods::database_ptr db = boost::dynamic_pointer_cast <
2373  irods::database > ( db_plug_ptr );
2374 
2375  // =-=-=-=-=-=-=-
2376  // call the operation on the plugin
2377  ret = db->call <
2378  const char*,
2379  int > (
2380  _comm,
2382  ptr,
2383  _resc_name,
2384  _update_value );
2385 
2386  return ret.code();
2387 
2388 } // chlModRescFreeSpace
2389 
2390 // =-=-=-=-=-=-=-
2391 // Register a User, RuleEngine version
2393  rsComm_t* _comm,
2394  userInfo_t* _user_info ) {
2395  // =-=-=-=-=-=-=-
2396  // call factory for database object
2397  irods::database_object_ptr db_obj_ptr;
2400  db_obj_ptr );
2401  if ( !ret.ok() ) {
2402  irods::log( PASS( ret ) );
2403  return ret.code();
2404  }
2405 
2406  // =-=-=-=-=-=-=-
2407  // resolve a plugin for that object
2408  irods::plugin_ptr db_plug_ptr;
2409  ret = db_obj_ptr->resolve(
2411  db_plug_ptr );
2412  if ( !ret.ok() ) {
2413  irods::log(
2414  PASSMSG(
2415  "failed to resolve database interface",
2416  ret ) );
2417  return ret.code();
2418  }
2419 
2420  // =-=-=-=-=-=-=-
2421  // cast plugin and object to db and fco for call
2422  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2423  irods::first_class_object > ( db_obj_ptr );
2424  irods::database_ptr db = boost::dynamic_pointer_cast <
2425  irods::database > ( db_plug_ptr );
2426 
2427  // =-=-=-=-=-=-=-
2428  // call the operation on the plugin
2429  ret = db->call <
2430  userInfo_t* > (
2431  _comm,
2433  ptr,
2434  _user_info );
2435 
2436  return ret.code();
2437 
2438 } // chlRegUserRE
2439 
2440 // =-=-=-=-=-=-=-
2441 // JMC - backport 4836
2442 /* Add or modify an Attribute-Value pair metadata item of an object*/
2444  rsComm_t* _comm,
2445  const char* _type,
2446  const char* _name,
2447  const char* _attribute,
2448  const char* _new_value,
2449  const char* _new_unit ) {
2450  // =-=-=-=-=-=-=-
2451  // call factory for database object
2452  irods::database_object_ptr db_obj_ptr;
2455  db_obj_ptr );
2456  if ( !ret.ok() ) {
2457  irods::log( PASS( ret ) );
2458  return ret.code();
2459  }
2460 
2461  // =-=-=-=-=-=-=-
2462  // resolve a plugin for that object
2463  irods::plugin_ptr db_plug_ptr;
2464  ret = db_obj_ptr->resolve(
2466  db_plug_ptr );
2467  if ( !ret.ok() ) {
2468  irods::log(
2469  PASSMSG(
2470  "failed to resolve database interface",
2471  ret ) );
2472  return ret.code();
2473  }
2474 
2475  // =-=-=-=-=-=-=-
2476  // cast plugin and object to db and fco for call
2477  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2478  irods::first_class_object > ( db_obj_ptr );
2479  irods::database_ptr db = boost::dynamic_pointer_cast <
2480  irods::database > ( db_plug_ptr );
2481 
2482  // =-=-=-=-=-=-=-
2483  // call the operation on the plugin
2484  ret = db->call <
2485  const char*,
2486  const char*,
2487  const char*,
2488  const char*,
2489  const char* > (
2490  _comm,
2492  ptr,
2493  _type,
2494  _name,
2495  _attribute,
2496  _new_value,
2497  _new_unit );
2498 
2499  return ret.code();
2500 
2501 } // chlSetAVUMetadata
2502 
2503 // =-=-=-=-=-=-=-
2504 // Add an Attribute-Value [Units] pair/triple metadata item to one or
2505 // more data objects. This is the Wildcard version, where the
2506 // collection/data-object name can match multiple objects).
2507 
2508 // The return value is error code (negative) or the number of objects
2509 // to which the AVU was associated.
2511  rsComm_t* _comm,
2512  int _admin_mode,
2513  const char* _type,
2514  const char* _name,
2515  const char* _attribute,
2516  const char* _value,
2517  const char* _units ) {
2518  // =-=-=-=-=-=-=-
2519  // call factory for database object
2520  irods::database_object_ptr db_obj_ptr;
2523  db_obj_ptr );
2524  if ( !ret.ok() ) {
2525  irods::log( PASS( ret ) );
2526  return ret.code();
2527  }
2528 
2529  // =-=-=-=-=-=-=-
2530  // resolve a plugin for that object
2531  irods::plugin_ptr db_plug_ptr;
2532  ret = db_obj_ptr->resolve(
2534  db_plug_ptr );
2535  if ( !ret.ok() ) {
2536  irods::log(
2537  PASSMSG(
2538  "failed to resolve database interface",
2539  ret ) );
2540  return ret.code();
2541  }
2542 
2543  // =-=-=-=-=-=-=-
2544  // cast plugin and object to db and fco for call
2545  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2546  irods::first_class_object > ( db_obj_ptr );
2547  irods::database_ptr db = boost::dynamic_pointer_cast <
2548  irods::database > ( db_plug_ptr );
2549 
2550  // =-=-=-=-=-=-=-
2551  // call the operation on the plugin
2552  ret = db->call <
2553  int,
2554  const char*,
2555  const char*,
2556  const char*,
2557  const char*,
2558  const char* > (
2559  _comm,
2561  ptr,
2562  _admin_mode,
2563  _type,
2564  _name,
2565  _attribute,
2566  _value,
2567  _units );
2568 
2569  return ret.code();
2570 
2571 } // chlAddAVUMetadataWild
2572 
2573 // =-=-=-=-=-=-=-
2574 // Add an Attribute-Value [Units] pair/triple metadata item to an object
2576  rsComm_t* _comm,
2577  int _admin_mode,
2578  const char* _type,
2579  const char* _name,
2580  const char* _attribute,
2581  const char* _value,
2582  const char* _units ) {
2583  // =-=-=-=-=-=-=-
2584  // call factory for database object
2585  irods::database_object_ptr db_obj_ptr;
2588  db_obj_ptr );
2589  if ( !ret.ok() ) {
2590  irods::log( PASS( ret ) );
2591  return ret.code();
2592  }
2593 
2594  // =-=-=-=-=-=-=-
2595  // resolve a plugin for that object
2596  irods::plugin_ptr db_plug_ptr;
2597  ret = db_obj_ptr->resolve(
2599  db_plug_ptr );
2600  if ( !ret.ok() ) {
2601  irods::log(
2602  PASSMSG(
2603  "failed to resolve database interface",
2604  ret ) );
2605  return ret.code();
2606  }
2607 
2608  // =-=-=-=-=-=-=-
2609  // cast plugin and object to db and fco for call
2610  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2611  irods::first_class_object > ( db_obj_ptr );
2612  irods::database_ptr db = boost::dynamic_pointer_cast <
2613  irods::database > ( db_plug_ptr );
2614 
2615  // =-=-=-=-=-=-=-
2616  // call the operation on the plugin
2617  ret = db->call <
2618  int,
2619  const char*,
2620  const char*,
2621  const char*,
2622  const char*,
2623  const char* > (
2624  _comm,
2626  ptr,
2627  _admin_mode,
2628  _type,
2629  _name,
2630  _attribute,
2631  _value,
2632  _units );
2633 
2634  return ret.code();
2635 
2636 } // chlAddAVUMetadata
2637 
2638 /* Modify an Attribute-Value [Units] pair/triple metadata item of an object*/
2640  rsComm_t* _comm,
2641  const char* _type,
2642  const char* _name,
2643  const char* _attribute,
2644  const char* _value,
2645  const char* _unitsOrArg0,
2646  const char* _arg1,
2647  const char* _arg2,
2648  const char* _arg3 ) {
2649  // =-=-=-=-=-=-=-
2650  // call factory for database object
2651  irods::database_object_ptr db_obj_ptr;
2654  db_obj_ptr );
2655  if ( !ret.ok() ) {
2656  irods::log( PASS( ret ) );
2657  return ret.code();
2658  }
2659 
2660  // =-=-=-=-=-=-=-
2661  // resolve a plugin for that object
2662  irods::plugin_ptr db_plug_ptr;
2663  ret = db_obj_ptr->resolve(
2665  db_plug_ptr );
2666  if ( !ret.ok() ) {
2667  irods::log(
2668  PASSMSG(
2669  "failed to resolve database interface",
2670  ret ) );
2671  return ret.code();
2672  }
2673 
2674  // =-=-=-=-=-=-=-
2675  // cast plugin and object to db and fco for call
2676  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2677  irods::first_class_object > ( db_obj_ptr );
2678  irods::database_ptr db = boost::dynamic_pointer_cast <
2679  irods::database > ( db_plug_ptr );
2680 
2681  // =-=-=-=-=-=-=-
2682  // call the operation on the plugin
2683  ret = db->call <
2684  const char*,
2685  const char*,
2686  const char*,
2687  const char*,
2688  const char*,
2689  const char*,
2690  const char*,
2691  const char* > (
2692  _comm,
2694  ptr,
2695  _type,
2696  _name,
2697  _attribute,
2698  _value,
2699  _unitsOrArg0,
2700  _arg1,
2701  _arg2,
2702  _arg3 );
2703 
2704  return ret.code();
2705 
2706 } // chlModAVUMetadata
2707 
2708 /* Delete an Attribute-Value [Units] pair/triple metadata item from an object*/
2709 /* option is 0: normal, 1: use wildcards, 2: input is id not type,name,units */
2710 /* noCommit: if 1: skip the commit (only used by chlModAVUMetadata) */
2712  rsComm_t* _comm,
2713  int _option,
2714  const char* _type,
2715  const char* _name,
2716  const char* _attribute,
2717  const char* _value,
2718  const char* _units,
2719  int _nocommit ) {
2720  // =-=-=-=-=-=-=-
2721  // call factory for database object
2722  irods::database_object_ptr db_obj_ptr;
2725  db_obj_ptr );
2726  if ( !ret.ok() ) {
2727  irods::log( PASS( ret ) );
2728  return ret.code();
2729  }
2730 
2731  // =-=-=-=-=-=-=-
2732  // resolve a plugin for that object
2733  irods::plugin_ptr db_plug_ptr;
2734  ret = db_obj_ptr->resolve(
2736  db_plug_ptr );
2737  if ( !ret.ok() ) {
2738  irods::log(
2739  PASSMSG(
2740  "failed to resolve database interface",
2741  ret ) );
2742  return ret.code();
2743  }
2744 
2745  // =-=-=-=-=-=-=-
2746  // cast plugin and object to db and fco for call
2747  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2748  irods::first_class_object > ( db_obj_ptr );
2749  irods::database_ptr db = boost::dynamic_pointer_cast <
2750  irods::database > ( db_plug_ptr );
2751 
2752  // =-=-=-=-=-=-=-
2753  // call the operation on the plugin
2754  ret = db->call <
2755  int,
2756  const char*,
2757  const char*,
2758  const char*,
2759  const char*,
2760  const char*,
2761  int > (
2762  _comm,
2764  ptr,
2765  _option,
2766  _type,
2767  _name,
2768  _attribute,
2769  _value,
2770  _units,
2771  _nocommit );
2772 
2773  return ret.code();
2774 
2775 } // chlDeleteAVUMetadata
2776 
2777 // =-=-=-=-=-=-=-
2778 // Copy an Attribute-Value [Units] pair/triple from one object to another
2780  rsComm_t* _comm,
2781  const char* _type1,
2782  const char* _type2,
2783  const char* _name1,
2784  const char* _name2 ) {
2785  // =-=-=-=-=-=-=-
2786  // call factory for database object
2787  irods::database_object_ptr db_obj_ptr;
2790  db_obj_ptr );
2791  if ( !ret.ok() ) {
2792  irods::log( PASS( ret ) );
2793  return ret.code();
2794  }
2795 
2796  // =-=-=-=-=-=-=-
2797  // resolve a plugin for that object
2798  irods::plugin_ptr db_plug_ptr;
2799  ret = db_obj_ptr->resolve(
2801  db_plug_ptr );
2802  if ( !ret.ok() ) {
2803  irods::log(
2804  PASSMSG(
2805  "failed to resolve database interface",
2806  ret ) );
2807  return ret.code();
2808  }
2809 
2810  // =-=-=-=-=-=-=-
2811  // cast plugin and object to db and fco for call
2812  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2813  irods::first_class_object > ( db_obj_ptr );
2814  irods::database_ptr db = boost::dynamic_pointer_cast <
2815  irods::database > ( db_plug_ptr );
2816 
2817  // =-=-=-=-=-=-=-
2818  // call the operation on the plugin
2819  ret = db->call <
2820  const char*,
2821  const char*,
2822  const char*,
2823  const char* > (
2824  _comm,
2826  ptr,
2827  _type1,
2828  _type2,
2829  _name1,
2830  _name2 );
2831 
2832  return ret.code();
2833 
2834 } // chlCopyAVUMetadata
2835 
2837  rsComm_t* _comm,
2838  int _recursive_flag,
2839  char* _access_level,
2840  char* _user_name,
2841  char* _zone,
2842  char* _resc_name ) {
2843  // =-=-=-=-=-=-=-
2844  // call factory for database object
2845  irods::database_object_ptr db_obj_ptr;
2848  db_obj_ptr );
2849  if ( !ret.ok() ) {
2850  irods::log( PASS( ret ) );
2851  return ret.code();
2852  }
2853 
2854  // =-=-=-=-=-=-=-
2855  // resolve a plugin for that object
2856  irods::plugin_ptr db_plug_ptr;
2857  ret = db_obj_ptr->resolve(
2859  db_plug_ptr );
2860  if ( !ret.ok() ) {
2861  irods::log(
2862  PASSMSG(
2863  "failed to resolve database interface",
2864  ret ) );
2865  return ret.code();
2866  }
2867 
2868  // =-=-=-=-=-=-=-
2869  // cast plugin and object to db and fco for call
2870  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2871  irods::first_class_object > ( db_obj_ptr );
2872  irods::database_ptr db = boost::dynamic_pointer_cast <
2873  irods::database > ( db_plug_ptr );
2874 
2875  // =-=-=-=-=-=-=-
2876  // call the operation on the plugin
2877  ret = db->call <
2878  int,
2879  const char*,
2880  const char*,
2881  const char*,
2882  const char* > (
2883  _comm,
2885  ptr,
2886  _recursive_flag,
2887  _access_level,
2888  _user_name,
2889  _zone,
2890  _resc_name );
2891 
2892  return ret.code();
2893 
2894 } // chlModAccessControlResc
2895 
2896 // =-=-=-=-=-=-=-
2897 // chlModAccessControl - Modify the Access Control information
2898 // of an existing dataObj or collection.
2899 // "n" (null or none) used to remove access.
2901  rsComm_t* _comm,
2902  int _recursive_flag,
2903  const char* _access_level,
2904  const char* _user_name,
2905  const char* _zone,
2906  const char* _path_name ) {
2907  // =-=-=-=-=-=-=-
2908  // call factory for database object
2909  irods::database_object_ptr db_obj_ptr;
2912  db_obj_ptr );
2913  if ( !ret.ok() ) {
2914  irods::log( PASS( ret ) );
2915  return ret.code();
2916  }
2917 
2918  // =-=-=-=-=-=-=-
2919  // resolve a plugin for that object
2920  irods::plugin_ptr db_plug_ptr;
2921  ret = db_obj_ptr->resolve(
2923  db_plug_ptr );
2924  if ( !ret.ok() ) {
2925  irods::log(
2926  PASSMSG(
2927  "failed to resolve database interface",
2928  ret ) );
2929  return ret.code();
2930  }
2931 
2932  // =-=-=-=-=-=-=-
2933  // cast plugin and object to db and fco for call
2934  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2935  irods::first_class_object > ( db_obj_ptr );
2936  irods::database_ptr db = boost::dynamic_pointer_cast <
2937  irods::database > ( db_plug_ptr );
2938 
2939  // =-=-=-=-=-=-=-
2940  // call the operation on the plugin
2941  ret = db->call <
2942  int,
2943  const char*,
2944  const char*,
2945  const char*,
2946  const char* > (
2947  _comm,
2949  ptr,
2950  _recursive_flag,
2951  _access_level,
2952  _user_name,
2953  _zone,
2954  _path_name );
2955 
2956  return ret.code();
2957 
2958 } // chlModAccessControl
2959 
2960 // =-=-=-=-=-=-=-
2961 // chlRenameObject - Rename a dataObject or collection.
2963  rsComm_t* _comm,
2964  rodsLong_t _obj_id,
2965  const char* _new_name ) {
2966  // =-=-=-=-=-=-=-
2967  // call factory for database object
2968  irods::database_object_ptr db_obj_ptr;
2971  db_obj_ptr );
2972  if ( !ret.ok() ) {
2973  irods::log( PASS( ret ) );
2974  return ret.code();
2975  }
2976 
2977  // =-=-=-=-=-=-=-
2978  // resolve a plugin for that object
2979  irods::plugin_ptr db_plug_ptr;
2980  ret = db_obj_ptr->resolve(
2982  db_plug_ptr );
2983  if ( !ret.ok() ) {
2984  irods::log(
2985  PASSMSG(
2986  "failed to resolve database interface",
2987  ret ) );
2988  return ret.code();
2989  }
2990 
2991  // =-=-=-=-=-=-=-
2992  // cast plugin and object to db and fco for call
2993  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
2994  irods::first_class_object > ( db_obj_ptr );
2995  irods::database_ptr db = boost::dynamic_pointer_cast <
2996  irods::database > ( db_plug_ptr );
2997 
2998  // =-=-=-=-=-=-=-
2999  // call the operation on the plugin
3000  ret = db->call <
3001  rodsLong_t,
3002  const char* > (
3003  _comm,
3005  ptr,
3006  _obj_id,
3007  _new_name );
3008 
3009  return ret.code();
3010 
3011 } // chlRenameObject
3012 
3013 // =-=-=-=-=-=-=-
3014 // chlMoveObject - Move a dataObject or collection to another
3015 // collection.
3017  rsComm_t* _comm,
3018  rodsLong_t _obj_id,
3019  rodsLong_t _target_coll_id ) {
3020  // =-=-=-=-=-=-=-
3021  // call factory for database object
3022  irods::database_object_ptr db_obj_ptr;
3025  db_obj_ptr );
3026  if ( !ret.ok() ) {
3027  irods::log( PASS( ret ) );
3028  return ret.code();
3029  }
3030 
3031  // =-=-=-=-=-=-=-
3032  // resolve a plugin for that object
3033  irods::plugin_ptr db_plug_ptr;
3034  ret = db_obj_ptr->resolve(
3036  db_plug_ptr );
3037  if ( !ret.ok() ) {
3038  irods::log(
3039  PASSMSG(
3040  "failed to resolve database interface",
3041  ret ) );
3042  return ret.code();
3043  }
3044 
3045  // =-=-=-=-=-=-=-
3046  // cast plugin and object to db and fco for call
3047  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3048  irods::first_class_object > ( db_obj_ptr );
3049  irods::database_ptr db = boost::dynamic_pointer_cast <
3050  irods::database > ( db_plug_ptr );
3051 
3052  // =-=-=-=-=-=-=-
3053  // call the operation on the plugin
3054  ret = db->call <
3055  rodsLong_t,
3056  rodsLong_t > (
3057  _comm,
3059  ptr,
3060  _obj_id,
3061  _target_coll_id );
3062 
3063  return ret.code();
3064 
3065 } // chlMoveObject
3066 
3067 // =-=-=-=-=-=-=-
3068 // chlRegToken - Register a new token
3070  rsComm_t* _comm,
3071  const char* _name_space,
3072  const char* _name,
3073  const char* _value,
3074  const char* _value2,
3075  const char* _value3,
3076  const char* _comment ) {
3077  // =-=-=-=-=-=-=-
3078  // call factory for database object
3079  irods::database_object_ptr db_obj_ptr;
3082  db_obj_ptr );
3083  if ( !ret.ok() ) {
3084  irods::log( PASS( ret ) );
3085  return ret.code();
3086  }
3087 
3088  // =-=-=-=-=-=-=-
3089  // resolve a plugin for that object
3090  irods::plugin_ptr db_plug_ptr;
3091  ret = db_obj_ptr->resolve(
3093  db_plug_ptr );
3094  if ( !ret.ok() ) {
3095  irods::log(
3096  PASSMSG(
3097  "failed to resolve database interface",
3098  ret ) );
3099  return ret.code();
3100  }
3101 
3102  // =-=-=-=-=-=-=-
3103  // cast plugin and object to db and fco for call
3104  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3105  irods::first_class_object > ( db_obj_ptr );
3106  irods::database_ptr db = boost::dynamic_pointer_cast <
3107  irods::database > ( db_plug_ptr );
3108 
3109  // =-=-=-=-=-=-=-
3110  // call the operation on the plugin
3111  ret = db->call <
3112  const char*,
3113  const char*,
3114  const char*,
3115  const char*,
3116  const char*,
3117  const char* > (
3118  _comm,
3120  ptr,
3121  _name_space,
3122  _name,
3123  _value,
3124  _value2,
3125  _value3,
3126  _comment );
3127 
3128  return ret.code();
3129 
3130 } // chlRegToken
3131 
3132 
3133 // =-=-=-=-=-=-=-
3134 // chlDelToken - Delete a token
3136  rsComm_t* _comm,
3137  const char* _name_space,
3138  const char* _name ) {
3139  // =-=-=-=-=-=-=-
3140  // call factory for database object
3141  irods::database_object_ptr db_obj_ptr;
3144  db_obj_ptr );
3145  if ( !ret.ok() ) {
3146  irods::log( PASS( ret ) );
3147  return ret.code();
3148  }
3149 
3150  // =-=-=-=-=-=-=-
3151  // resolve a plugin for that object
3152  irods::plugin_ptr db_plug_ptr;
3153  ret = db_obj_ptr->resolve(
3155  db_plug_ptr );
3156  if ( !ret.ok() ) {
3157  irods::log(
3158  PASSMSG(
3159  "failed to resolve database interface",
3160  ret ) );
3161  return ret.code();
3162  }
3163 
3164  // =-=-=-=-=-=-=-
3165  // cast plugin and object to db and fco for call
3166  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3167  irods::first_class_object > ( db_obj_ptr );
3168  irods::database_ptr db = boost::dynamic_pointer_cast <
3169  irods::database > ( db_plug_ptr );
3170 
3171  // =-=-=-=-=-=-=-
3172  // call the operation on the plugin
3173  ret = db->call <
3174  const char*,
3175  const char* > (
3176  _comm,
3178  ptr,
3179  _name_space,
3180  _name );
3181 
3182  return ret.code();
3183 
3184 } // chlDelToken
3185 
3186 // =-=-=-=-=-=-=-
3187 // chlRegServerLoad - Register a new iRODS server load row.
3188 // Input - rsComm_t *rsComm - the server handle,
3189 // input values.
3191  rsComm_t* _comm,
3192  const char* _host_name,
3193  const char* _resc_name,
3194  const char* _cpu_used,
3195  const char* _mem_used,
3196  const char* _swap_used,
3197  const char* _run_q_load,
3198  const char* _disk_space,
3199  const char* _net_input,
3200  const char* _net_output ) {
3201  // =-=-=-=-=-=-=-
3202  // call factory for database object
3203  irods::database_object_ptr db_obj_ptr;
3206  db_obj_ptr );
3207  if ( !ret.ok() ) {
3208  irods::log( PASS( ret ) );
3209  return ret.code();
3210  }
3211 
3212  // =-=-=-=-=-=-=-
3213  // resolve a plugin for that object
3214  irods::plugin_ptr db_plug_ptr;
3215  ret = db_obj_ptr->resolve(
3217  db_plug_ptr );
3218  if ( !ret.ok() ) {
3219  irods::log(
3220  PASSMSG(
3221  "failed to resolve database interface",
3222  ret ) );
3223  return ret.code();
3224  }
3225 
3226  // =-=-=-=-=-=-=-
3227  // cast plugin and object to db and fco for call
3228  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3229  irods::first_class_object > ( db_obj_ptr );
3230  irods::database_ptr db = boost::dynamic_pointer_cast <
3231  irods::database > ( db_plug_ptr );
3232 
3233  // =-=-=-=-=-=-=-
3234  // call the operation on the plugin
3235  ret = db->call <
3236  const char*,
3237  const char*,
3238  const char*,
3239  const char*,
3240  const char*,
3241  const char*,
3242  const char*,
3243  const char*,
3244  const char* > (
3245  _comm,
3247  ptr,
3248  _host_name,
3249  _resc_name,
3250  _cpu_used,
3251  _mem_used,
3252  _swap_used,
3253  _run_q_load,
3254  _disk_space,
3255  _net_input,
3256  _net_output );
3257 
3258  return ret.code();
3259 
3260 } // chlRegServerLoad
3261 
3262 // =-=-=-=-=-=-=-
3263 // chlPurgeServerLoad - Purge some rows from iRODS server load table
3264 // that are older than secondsAgo seconds ago.
3265 // Input - rsComm_t *rsComm - the server handle,
3266 // char *secondsAgo (age in seconds).
3268  rsComm_t* _comm,
3269  const char* _seconds_ago ) {
3270  // =-=-=-=-=-=-=-
3271  // call factory for database object
3272  irods::database_object_ptr db_obj_ptr;
3275  db_obj_ptr );
3276  if ( !ret.ok() ) {
3277  irods::log( PASS( ret ) );
3278  return ret.code();
3279  }
3280 
3281  // =-=-=-=-=-=-=-
3282  // resolve a plugin for that object
3283  irods::plugin_ptr db_plug_ptr;
3284  ret = db_obj_ptr->resolve(
3286  db_plug_ptr );
3287  if ( !ret.ok() ) {
3288  irods::log(
3289  PASSMSG(
3290  "failed to resolve database interface",
3291  ret ) );
3292  return ret.code();
3293  }
3294 
3295  // =-=-=-=-=-=-=-
3296  // cast plugin and object to db and fco for call
3297  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3298  irods::first_class_object > ( db_obj_ptr );
3299  irods::database_ptr db = boost::dynamic_pointer_cast <
3300  irods::database > ( db_plug_ptr );
3301 
3302  // =-=-=-=-=-=-=-
3303  // call the operation on the plugin
3304  ret = db->call <
3305  const char* > (
3306  _comm,
3308  ptr,
3309  _seconds_ago );
3310 
3311  return ret.code();
3312 
3313 } // chlPurgeServerLoad
3314 
3315 // =-=-=-=-=-=-=-
3316 // chlRegServerLoadDigest - Register a new iRODS server load-digest row.
3317 // Input - rsComm_t *rsComm - the server handle,
3318 // input values.
3320  rsComm_t* _comm,
3321  const char* _resc_name,
3322  const char* _load_factor ) {
3323  // =-=-=-=-=-=-=-
3324  // call factory for database object
3325  irods::database_object_ptr db_obj_ptr;
3328  db_obj_ptr );
3329  if ( !ret.ok() ) {
3330  irods::log( PASS( ret ) );
3331  return ret.code();
3332  }
3333 
3334  // =-=-=-=-=-=-=-
3335  // resolve a plugin for that object
3336  irods::plugin_ptr db_plug_ptr;
3337  ret = db_obj_ptr->resolve(
3339  db_plug_ptr );
3340  if ( !ret.ok() ) {
3341  irods::log(
3342  PASSMSG(
3343  "failed to resolve database interface",
3344  ret ) );
3345  return ret.code();
3346  }
3347 
3348  // =-=-=-=-=-=-=-
3349  // cast plugin and object to db and fco for call
3350  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3351  irods::first_class_object > ( db_obj_ptr );
3352  irods::database_ptr db = boost::dynamic_pointer_cast <
3353  irods::database > ( db_plug_ptr );
3354 
3355  // =-=-=-=-=-=-=-
3356  // call the operation on the plugin
3357  ret = db->call <
3358  const char*,
3359  const char* > (
3360  _comm,
3362  ptr,
3363  _resc_name,
3364  _load_factor );
3365 
3366  return ret.code();
3367 
3368 } // chlRegServerLoadDigest
3369 
3370 // =-=-=-=-=-=-=-
3371 // chlPurgeServerLoadDigest - Purge some rows from iRODS server LoadDigest table
3372 // that are older than secondsAgo seconds ago.
3373 // Input - rsComm_t *rsComm - the server handle,
3374 // int secondsAgo (age in seconds).
3376  rsComm_t* _comm,
3377  const char* _seconds_ago ) {
3378  // =-=-=-=-=-=-=-
3379  // call factory for database object
3380  irods::database_object_ptr db_obj_ptr;
3383  db_obj_ptr );
3384  if ( !ret.ok() ) {
3385  irods::log( PASS( ret ) );
3386  return ret.code();
3387  }
3388 
3389  // =-=-=-=-=-=-=-
3390  // resolve a plugin for that object
3391  irods::plugin_ptr db_plug_ptr;
3392  ret = db_obj_ptr->resolve(
3394  db_plug_ptr );
3395  if ( !ret.ok() ) {
3396  irods::log(
3397  PASSMSG(
3398  "failed to resolve database interface",
3399  ret ) );
3400  return ret.code();
3401  }
3402 
3403  // =-=-=-=-=-=-=-
3404  // cast plugin and object to db and fco for call
3405  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3406  irods::first_class_object > ( db_obj_ptr );
3407  irods::database_ptr db = boost::dynamic_pointer_cast <
3408  irods::database > ( db_plug_ptr );
3409 
3410  // =-=-=-=-=-=-=-
3411  // call the operation on the plugin
3412  ret = db->call <
3413  const char* > (
3414  _comm,
3416  ptr,
3417  _seconds_ago );
3418 
3419  return ret.code();
3420 
3421 } // chlPurgeServerLoadDigest
3422 
3424  rsComm_t* _comm ) {
3425  // =-=-=-=-=-=-=-
3426  // call factory for database object
3427  irods::database_object_ptr db_obj_ptr;
3430  db_obj_ptr );
3431  if ( !ret.ok() ) {
3432  irods::log( PASS( ret ) );
3433  return ret.code();
3434  }
3435 
3436  // =-=-=-=-=-=-=-
3437  // resolve a plugin for that object
3438  irods::plugin_ptr db_plug_ptr;
3439  ret = db_obj_ptr->resolve(
3441  db_plug_ptr );
3442  if ( !ret.ok() ) {
3443  irods::log(
3444  PASSMSG(
3445  "failed to resolve database interface",
3446  ret ) );
3447  return ret.code();
3448  }
3449 
3450  // =-=-=-=-=-=-=-
3451  // cast plugin and object to db and fco for call
3452  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3453  irods::first_class_object > ( db_obj_ptr );
3454  irods::database_ptr db = boost::dynamic_pointer_cast <
3455  irods::database > ( db_plug_ptr );
3456 
3457  // =-=-=-=-=-=-=-
3458  // call the operation on the plugin
3459  ret = db->call(
3460  _comm,
3462  ptr );
3463 
3464  return ret.code();
3465 
3466 } // chlCalcUsageAndQuota
3467 
3469  rsComm_t* _comm,
3470  const char* _type,
3471  const char* _name,
3472  const char* _resc_name,
3473  const char* _limit ) {
3474  // =-=-=-=-=-=-=-
3475  // call factory for database object
3476  irods::database_object_ptr db_obj_ptr;
3479  db_obj_ptr );
3480  if ( !ret.ok() ) {
3481  irods::log( PASS( ret ) );
3482  return ret.code();
3483  }
3484 
3485  // =-=-=-=-=-=-=-
3486  // resolve a plugin for that object
3487  irods::plugin_ptr db_plug_ptr;
3488  ret = db_obj_ptr->resolve(
3490  db_plug_ptr );
3491  if ( !ret.ok() ) {
3492  irods::log(
3493  PASSMSG(
3494  "failed to resolve database interface",
3495  ret ) );
3496  return ret.code();
3497  }
3498 
3499  // =-=-=-=-=-=-=-
3500  // cast plugin and object to db and fco for call
3501  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3502  irods::first_class_object > ( db_obj_ptr );
3503  irods::database_ptr db = boost::dynamic_pointer_cast <
3504  irods::database > ( db_plug_ptr );
3505 
3506  // =-=-=-=-=-=-=-
3507  // call the operation on the plugin
3508  ret = db->call <
3509  const char*,
3510  const char*,
3511  const char*,
3512  const char* > (
3513  _comm,
3515  ptr,
3516  _type,
3517  _name,
3518  _resc_name,
3519  _limit );
3520 
3521  return ret.code();
3522 
3523 } // chlSetQuota
3524 
3526  rsComm_t* _comm,
3527  const char* _user_name,
3528  const char* _resc_name,
3529  rodsLong_t* _user_quota,
3530  int* _quota_status ) {
3531  // =-=-=-=-=-=-=-
3532  // call factory for database object
3533  irods::database_object_ptr db_obj_ptr;
3536  db_obj_ptr );
3537  if ( !ret.ok() ) {
3538  irods::log( PASS( ret ) );
3539  return ret.code();
3540  }
3541 
3542  // =-=-=-=-=-=-=-
3543  // resolve a plugin for that object
3544  irods::plugin_ptr db_plug_ptr;
3545  ret = db_obj_ptr->resolve(
3547  db_plug_ptr );
3548  if ( !ret.ok() ) {
3549  irods::log(
3550  PASSMSG(
3551  "failed to resolve database interface",
3552  ret ) );
3553  return ret.code();
3554  }
3555 
3556  // =-=-=-=-=-=-=-
3557  // cast plugin and object to db and fco for call
3558  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3559  irods::first_class_object > ( db_obj_ptr );
3560  irods::database_ptr db = boost::dynamic_pointer_cast <
3561  irods::database > ( db_plug_ptr );
3562 
3563  // =-=-=-=-=-=-=-
3564  // call the operation on the plugin
3565  ret = db->call <
3566  const char*,
3567  const char*,
3568  rodsLong_t*,
3569  int* > (
3570  _comm,
3572  ptr,
3573  _user_name,
3574  _resc_name,
3575  _user_quota,
3576  _quota_status );
3577 
3578  return ret.code();
3579 
3580 } // chlCheckQuota
3581 
3582 int
3584  rsComm_t* _comm ) {
3585  // =-=-=-=-=-=-=-
3586  // call factory for database object
3587  irods::database_object_ptr db_obj_ptr;
3590  db_obj_ptr );
3591  if ( !ret.ok() ) {
3592  irods::log( PASS( ret ) );
3593  return ret.code();
3594  }
3595 
3596  // =-=-=-=-=-=-=-
3597  // resolve a plugin for that object
3598  irods::plugin_ptr db_plug_ptr;
3599  ret = db_obj_ptr->resolve(
3601  db_plug_ptr );
3602  if ( !ret.ok() ) {
3603  irods::log(
3604  PASSMSG(
3605  "failed to resolve database interface",
3606  ret ) );
3607  return ret.code();
3608  }
3609 
3610  // =-=-=-=-=-=-=-
3611  // cast plugin and object to db and fco for call
3612  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3613  irods::first_class_object > ( db_obj_ptr );
3614  irods::database_ptr db = boost::dynamic_pointer_cast <
3615  irods::database > ( db_plug_ptr );
3616 
3617  // =-=-=-=-=-=-=-
3618  // call the operation on the plugin
3619  ret = db->call(
3620  _comm,
3622  ptr );
3623 
3624  return ret.code();
3625 
3626 } // chlDelUnusedAVUs
3627 
3628 
3629 // =-=-=-=-=-=-=-
3630 // chlInsRuleTable - Insert a new iRODS Rule Base table row.
3631 // Input - rsComm_t *rsComm - the server handle,
3632 // input values.
3634  rsComm_t* _comm,
3635  const char* _base_name,
3636  const char* _map_priority_str,
3637  const char* _rule_name,
3638  const char* _rule_head,
3639  const char* _rule_condition,
3640  const char* _rule_action,
3641  const char* _rule_recovery,
3642  const char* _rule_id_str,
3643  const char* _my_time ) {
3644  // =-=-=-=-=-=-=-
3645  // call factory for database object
3646  irods::database_object_ptr db_obj_ptr;
3649  db_obj_ptr );
3650  if ( !ret.ok() ) {
3651  irods::log( PASS( ret ) );
3652  return ret.code();
3653  }
3654 
3655  // =-=-=-=-=-=-=-
3656  // resolve a plugin for that object
3657  irods::plugin_ptr db_plug_ptr;
3658  ret = db_obj_ptr->resolve(
3660  db_plug_ptr );
3661  if ( !ret.ok() ) {
3662  irods::log(
3663  PASSMSG(
3664  "failed to resolve database interface",
3665  ret ) );
3666  return ret.code();
3667  }
3668 
3669  // =-=-=-=-=-=-=-
3670  // cast plugin and object to db and fco for call
3671  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3672  irods::first_class_object > ( db_obj_ptr );
3673  irods::database_ptr db = boost::dynamic_pointer_cast <
3674  irods::database > ( db_plug_ptr );
3675 
3676  // =-=-=-=-=-=-=-
3677  // call the operation on the plugin
3678  ret = db->call <
3679  const char*,
3680  const char*,
3681  const char*,
3682  const char*,
3683  const char*,
3684  const char*,
3685  const char*,
3686  const char*,
3687  const char* > (
3688  _comm,
3690  ptr,
3691  _base_name,
3692  _map_priority_str,
3693  _rule_name,
3694  _rule_head,
3695  _rule_condition,
3696  _rule_action,
3697  _rule_recovery,
3698  _rule_id_str,
3699  _my_time );
3700 
3701  return ret.code();
3702 
3703 } // chlInsRuleTable
3704 
3705 // =-=-=-=-=-=-=-
3706 // chlInsDvmTable - Insert a new iRODS DVM table row.
3707 // Input - rsComm_t *rsComm - the server handle,
3708 // input values.
3710  rsComm_t* _comm,
3711  const char* _base_name,
3712  const char* _var_name,
3713  const char* _action,
3714  const char* _var_2_cmap,
3715  const char* _my_time ) {
3716  // =-=-=-=-=-=-=-
3717  // call factory for database object
3718  irods::database_object_ptr db_obj_ptr;
3721  db_obj_ptr );
3722  if ( !ret.ok() ) {
3723  irods::log( PASS( ret ) );
3724  return ret.code();
3725  }
3726 
3727  // =-=-=-=-=-=-=-
3728  // resolve a plugin for that object
3729  irods::plugin_ptr db_plug_ptr;
3730  ret = db_obj_ptr->resolve(
3732  db_plug_ptr );
3733  if ( !ret.ok() ) {
3734  irods::log(
3735  PASSMSG(
3736  "failed to resolve database interface",
3737  ret ) );
3738  return ret.code();
3739  }
3740 
3741  // =-=-=-=-=-=-=-
3742  // cast plugin and object to db and fco for call
3743  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3744  irods::first_class_object > ( db_obj_ptr );
3745  irods::database_ptr db = boost::dynamic_pointer_cast <
3746  irods::database > ( db_plug_ptr );
3747 
3748  // =-=-=-=-=-=-=-
3749  // call the operation on the plugin
3750  ret = db->call <
3751  const char*,
3752  const char*,
3753  const char*,
3754  const char*,
3755  const char* > (
3756  _comm,
3758  ptr,
3759  _base_name,
3760  _var_name,
3761  _action,
3762  _var_2_cmap,
3763  _my_time );
3764 
3765  return ret.code();
3766 
3767 } // chlInsDVMTable
3768 
3769 // =-=-=-=-=-=-=-
3770 // chlInsFnmTable - Insert a new iRODS FNM table row.
3771 // Input - rsComm_t *rsComm - the server handle,
3772 // input values.
3774  rsComm_t* _comm,
3775  const char* _base_name,
3776  const char* _func_name,
3777  const char* _func_2_cmap,
3778  const char* _my_time ) {
3779  // =-=-=-=-=-=-=-
3780  // call factory for database object
3781  irods::database_object_ptr db_obj_ptr;
3784  db_obj_ptr );
3785  if ( !ret.ok() ) {
3786  irods::log( PASS( ret ) );
3787  return ret.code();
3788  }
3789 
3790  // =-=-=-=-=-=-=-
3791  // resolve a plugin for that object
3792  irods::plugin_ptr db_plug_ptr;
3793  ret = db_obj_ptr->resolve(
3795  db_plug_ptr );
3796  if ( !ret.ok() ) {
3797  irods::log(
3798  PASSMSG(
3799  "failed to resolve database interface",
3800  ret ) );
3801  return ret.code();
3802  }
3803 
3804  // =-=-=-=-=-=-=-
3805  // cast plugin and object to db and fco for call
3806  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3807  irods::first_class_object > ( db_obj_ptr );
3808  irods::database_ptr db = boost::dynamic_pointer_cast <
3809  irods::database > ( db_plug_ptr );
3810 
3811  // =-=-=-=-=-=-=-
3812  // call the operation on the plugin
3813  ret = db->call <
3814  const char*,
3815  const char*,
3816  const char*,
3817  const char* > (
3818  _comm,
3820  ptr,
3821  _base_name,
3822  _func_name,
3823  _func_2_cmap,
3824  _my_time );
3825 
3826  return ret.code();
3827 
3828 } // chlInsFnmTable
3829 
3830 // =-=-=-=-=-=-=-
3831 // chlInsMsrvcTable - Insert a new iRODS MSRVC table row (actually in two tables).
3832 // Input - rsComm_t *rsComm - the server handle,
3833 // input values.
3835  rsComm_t* _comm,
3836  const char* _module_name,
3837  const char* _msrvc_name,
3838  const char* _msrvc_signature,
3839  const char* _msrvc_version,
3840  const char* _msrvc_host,
3841  const char* _msrvc_location,
3842  const char* _msrvc_language,
3843  const char* _msrvc_typeName,
3844  const char* _msrvc_status,
3845  const char* _my_time ) {
3846  // =-=-=-=-=-=-=-
3847  // call factory for database object
3848  irods::database_object_ptr db_obj_ptr;
3851  db_obj_ptr );
3852  if ( !ret.ok() ) {
3853  irods::log( PASS( ret ) );
3854  return ret.code();
3855  }
3856 
3857  // =-=-=-=-=-=-=-
3858  // resolve a plugin for that object
3859  irods::plugin_ptr db_plug_ptr;
3860  ret = db_obj_ptr->resolve(
3862  db_plug_ptr );
3863  if ( !ret.ok() ) {
3864  irods::log(
3865  PASSMSG(
3866  "failed to resolve database interface",
3867  ret ) );
3868  return ret.code();
3869  }
3870 
3871  // =-=-=-=-=-=-=-
3872  // cast plugin and object to db and fco for call
3873  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3874  irods::first_class_object > ( db_obj_ptr );
3875  irods::database_ptr db = boost::dynamic_pointer_cast <
3876  irods::database > ( db_plug_ptr );
3877 
3878  // =-=-=-=-=-=-=-
3879  // call the operation on the plugin
3880  ret = db->call <
3881  const char*,
3882  const char*,
3883  const char*,
3884  const char*,
3885  const char*,
3886  const char*,
3887  const char*,
3888  const char*,
3889  const char*,
3890  const char* > (
3891  _comm,
3893  ptr,
3894  _module_name,
3895  _msrvc_name,
3896  _msrvc_signature,
3897  _msrvc_version,
3898  _msrvc_host,
3899  _msrvc_location,
3900  _msrvc_language,
3901  _msrvc_typeName,
3902  _msrvc_status,
3903  _my_time );
3904 
3905  return ret.code();
3906 
3907 } // chlInsMsrvcTable
3908 
3909 // =-=-=-=-=-=-=-
3910 // chlVersionRuleBase - Version out the old base maps with timestamp
3911 // Input - rsComm_t *rsComm - the server handle,
3912 // input values.
3914  rsComm_t* _comm,
3915  const char* _base_name,
3916  const char* _my_time ) {
3917  // =-=-=-=-=-=-=-
3918  // call factory for database object
3919  irods::database_object_ptr db_obj_ptr;
3922  db_obj_ptr );
3923  if ( !ret.ok() ) {
3924  irods::log( PASS( ret ) );
3925  return ret.code();
3926  }
3927 
3928  // =-=-=-=-=-=-=-
3929  // resolve a plugin for that object
3930  irods::plugin_ptr db_plug_ptr;
3931  ret = db_obj_ptr->resolve(
3933  db_plug_ptr );
3934  if ( !ret.ok() ) {
3935  irods::log(
3936  PASSMSG(
3937  "failed to resolve database interface",
3938  ret ) );
3939  return ret.code();
3940  }
3941 
3942  // =-=-=-=-=-=-=-
3943  // cast plugin and object to db and fco for call
3944  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
3945  irods::first_class_object > ( db_obj_ptr );
3946  irods::database_ptr db = boost::dynamic_pointer_cast <
3947  irods::database > ( db_plug_ptr );
3948 
3949  // =-=-=-=-=-=-=-
3950  // call the operation on the plugin
3951  ret = db->call <
3952  const char*,
3953  const char* > (
3954  _comm,
3956  ptr,
3957  _base_name,
3958  _my_time );
3959 
3960  return ret.code();
3961 
3962 } // chlVersionRuleBase
3963 
3964 
3965 // =-=-=-=-=-=-=-
3966 // chlVersionDvmBase - Version out the old dvm base maps with timestamp
3967 // Input - rsComm_t *rsComm - the server handle,
3968 // input values.
3970  rsComm_t* _comm,
3971  const char* _base_name,
3972  const char* _my_time ) {
3973  // =-=-=-=-=-=-=-
3974  // call factory for database object
3975  irods::database_object_ptr db_obj_ptr;
3978  db_obj_ptr );
3979  if ( !ret.ok() ) {
3980  irods::log( PASS( ret ) );
3981  return ret.code();
3982  }
3983 
3984  // =-=-=-=-=-=-=-
3985  // resolve a plugin for that object
3986  irods::plugin_ptr db_plug_ptr;
3987  ret = db_obj_ptr->resolve(
3989  db_plug_ptr );
3990  if ( !ret.ok() ) {
3991  irods::log(
3992  PASSMSG(
3993  "failed to resolve database interface",
3994  ret ) );
3995  return ret.code();
3996  }
3997 
3998  // =-=-=-=-=-=-=-
3999  // cast plugin and object to db and fco for call
4000  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4001  irods::first_class_object > ( db_obj_ptr );
4002  irods::database_ptr db = boost::dynamic_pointer_cast <
4003  irods::database > ( db_plug_ptr );
4004 
4005  // =-=-=-=-=-=-=-
4006  // call the operation on the plugin
4007  ret = db->call <
4008  const char*,
4009  const char* > (
4010  _comm,
4012  ptr,
4013  _base_name,
4014  _my_time );
4015 
4016  return ret.code();
4017 
4018 } // chlVersionDvmBase
4019 
4020 
4021 // =-=-=-=-=-=-=-
4022 // chlVersionFnmBase - Version out the old fnm base maps with timestamp
4023 // Input - rsComm_t *rsComm - the server handle,
4024 // input values.
4026  rsComm_t* _comm,
4027  const char* _base_name,
4028  const char* _my_time ) {
4029  // =-=-=-=-=-=-=-
4030  // call factory for database object
4031  irods::database_object_ptr db_obj_ptr;
4034  db_obj_ptr );
4035  if ( !ret.ok() ) {
4036  irods::log( PASS( ret ) );
4037  return ret.code();
4038  }
4039 
4040  // =-=-=-=-=-=-=-
4041  // resolve a plugin for that object
4042  irods::plugin_ptr db_plug_ptr;
4043  ret = db_obj_ptr->resolve(
4045  db_plug_ptr );
4046  if ( !ret.ok() ) {
4047  irods::log(
4048  PASSMSG(
4049  "failed to resolve database interface",
4050  ret ) );
4051  return ret.code();
4052  }
4053 
4054  // =-=-=-=-=-=-=-
4055  // cast plugin and object to db and fco for call
4056  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4057  irods::first_class_object > ( db_obj_ptr );
4058  irods::database_ptr db = boost::dynamic_pointer_cast <
4059  irods::database > ( db_plug_ptr );
4060 
4061  // =-=-=-=-=-=-=-
4062  // call the operation on the plugin
4063  ret = db->call <
4064  const char*,
4065  const char* > (
4066  _comm,
4068  ptr,
4069  _base_name,
4070  _my_time );
4071 
4072  return ret.code();
4073 
4074 } // chlVersionFnmBase
4075 
4077  rsComm_t* _comm,
4078  const char* _sql,
4079  const char* _alias ) {
4080  // =-=-=-=-=-=-=-
4081  // call factory for database object
4082  irods::database_object_ptr db_obj_ptr;
4085  db_obj_ptr );
4086  if ( !ret.ok() ) {
4087  irods::log( PASS( ret ) );
4088  return ret.code();
4089  }
4090 
4091  // =-=-=-=-=-=-=-
4092  // resolve a plugin for that object
4093  irods::plugin_ptr db_plug_ptr;
4094  ret = db_obj_ptr->resolve(
4096  db_plug_ptr );
4097  if ( !ret.ok() ) {
4098  irods::log(
4099  PASSMSG(
4100  "failed to resolve database interface",
4101  ret ) );
4102  return ret.code();
4103  }
4104 
4105  // =-=-=-=-=-=-=-
4106  // cast plugin and object to db and fco for call
4107  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4108  irods::first_class_object > ( db_obj_ptr );
4109  irods::database_ptr db = boost::dynamic_pointer_cast <
4110  irods::database > ( db_plug_ptr );
4111 
4112  // =-=-=-=-=-=-=-
4113  // call the operation on the plugin
4114  ret = db->call <
4115  const char*,
4116  const char* > (
4117  _comm,
4119  ptr,
4120  _sql,
4121  _alias );
4122 
4123  return ret.code();
4124 
4125 } // chlAddSpecificQuery
4126 
4128  rsComm_t* _comm,
4129  const char* _sql_or_alias ) {
4130  // =-=-=-=-=-=-=-
4131  // call factory for database object
4132  irods::database_object_ptr db_obj_ptr;
4135  db_obj_ptr );
4136  if ( !ret.ok() ) {
4137  irods::log( PASS( ret ) );
4138  return ret.code();
4139  }
4140 
4141  // =-=-=-=-=-=-=-
4142  // resolve a plugin for that object
4143  irods::plugin_ptr db_plug_ptr;
4144  ret = db_obj_ptr->resolve(
4146  db_plug_ptr );
4147  if ( !ret.ok() ) {
4148  irods::log(
4149  PASSMSG(
4150  "failed to resolve database interface",
4151  ret ) );
4152  return ret.code();
4153  }
4154 
4155  // =-=-=-=-=-=-=-
4156  // cast plugin and object to db and fco for call
4157  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4158  irods::first_class_object > ( db_obj_ptr );
4159  irods::database_ptr db = boost::dynamic_pointer_cast <
4160  irods::database > ( db_plug_ptr );
4161 
4162  // =-=-=-=-=-=-=-
4163  // call the operation on the plugin
4164  ret = db->call <
4165  const char* > (
4166  _comm,
4168  ptr,
4169  _sql_or_alias );
4170 
4171  return ret.code();
4172 
4173 } // chlDelSpecificQuery
4174 
4175 // =-=-=-=-=-=-=-
4176 // This is the Specific Query, also known as a sql-based query or
4177 // predefined query. These are some specific queries (admin
4178 // defined/allowed) that can be performed. The caller provides the SQL
4179 // which must match one that is pre-defined, along with input parameters
4180 // (bind variables) in some cases. The output is the same as for a
4181 // general-query.
4182 
4184  specificQueryInp_t _spec_query_inp,
4185  genQueryOut_t* _result ) {
4186  // =-=-=-=-=-=-=-
4187  // call factory for database object
4188  irods::database_object_ptr db_obj_ptr;
4191  db_obj_ptr );
4192  if ( !ret.ok() ) {
4193  irods::log( PASS( ret ) );
4194  return ret.code();
4195  }
4196 
4197  // =-=-=-=-=-=-=-
4198  // resolve a plugin for that object
4199  irods::plugin_ptr db_plug_ptr;
4200  ret = db_obj_ptr->resolve(
4202  db_plug_ptr );
4203  if ( !ret.ok() ) {
4204  irods::log(
4205  PASSMSG(
4206  "failed to resolve database interface",
4207  ret ) );
4208  return ret.code();
4209  }
4210 
4211  // =-=-=-=-=-=-=-
4212  // cast plugin and object to db and fco for call
4213  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4214  irods::first_class_object > ( db_obj_ptr );
4215  irods::database_ptr db = boost::dynamic_pointer_cast <
4216  irods::database > ( db_plug_ptr );
4217 
4218  // =-=-=-=-=-=-=-
4219  // call the operation on the plugin
4220  ret = db->call <
4222  genQueryOut_t* > ( 0,
4224  ptr,
4225  &_spec_query_inp,
4226  _result );
4227 
4228  return ret.code();
4229 
4230 } // chlSpecificQuery
4231 
4235  const std::string& _resc_name,
4236  long long& _count ) {
4237  // =-=-=-=-=-=-=-
4238  // call factory for database object
4239  irods::database_object_ptr db_obj_ptr;
4242  db_obj_ptr );
4243  if ( !ret.ok() ) {
4244  irods::log( PASS( ret ) );
4245  return ret.code();
4246  }
4247 
4248  // =-=-=-=-=-=-=-
4249  // resolve a plugin for that object
4250  irods::plugin_ptr db_plug_ptr;
4251  ret = db_obj_ptr->resolve(
4253  db_plug_ptr );
4254  if ( !ret.ok() ) {
4255  irods::log(
4256  PASSMSG(
4257  "failed to resolve database interface",
4258  ret ) );
4259  return ret.code();
4260  }
4261 
4262  // =-=-=-=-=-=-=-
4263  // cast plugin and object to db and fco for call
4264  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4265  irods::first_class_object > ( db_obj_ptr );
4266  irods::database_ptr db = boost::dynamic_pointer_cast <
4267  irods::database > ( db_plug_ptr );
4268 
4269  // =-=-=-=-=-=-=-
4270  // call the operation on the plugin
4271  ret = db->call <
4272  const char*,
4273  long long* > ( 0,
4275  ptr,
4276  _resc_name.c_str(),
4277  &_count );
4278 
4279  return ret.code();
4280 
4281 } // chlGetDistinctDataObjCountOnResource
4282 
4288  const std::string& _parent,
4289  const std::string& _child,
4290  int _limit,
4291  const std::string& _invocation_timestamp,
4292  dist_child_result_t& _results ) {
4293  // =-=-=-=-=-=-=-
4294  // call factory for database object
4295  irods::database_object_ptr db_obj_ptr;
4298  db_obj_ptr );
4299  if ( !ret.ok() ) {
4300  irods::log( PASS( ret ) );
4301  return ret.code();
4302  }
4303 
4304  // =-=-=-=-=-=-=-
4305  // resolve a plugin for that object
4306  irods::plugin_ptr db_plug_ptr;
4307  ret = db_obj_ptr->resolve(
4309  db_plug_ptr );
4310  if ( !ret.ok() ) {
4311  irods::log(
4312  PASSMSG(
4313  "failed to resolve database interface",
4314  ret ) );
4315  return ret.code();
4316  }
4317 
4318  // =-=-=-=-=-=-=-
4319  // cast plugin and object to db and fco for call
4320  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4321  irods::first_class_object > ( db_obj_ptr );
4322  irods::database_ptr db = boost::dynamic_pointer_cast <
4323  irods::database > ( db_plug_ptr );
4324 
4325  // =-=-=-=-=-=-=-
4326  // call the operation on the plugin
4327  ret = db->call <
4328  const std::string*,
4329  const std::string*,
4330  int,
4331  const std::string*,
4332  dist_child_result_t* > ( 0,
4334  ptr,
4335  &_parent,
4336  &_child,
4337  _limit,
4338  &_invocation_timestamp,
4339  &_results );
4340 
4341  return ret.code();
4342 
4343 } // chlGetDistinctDataObjsMissingFromChildGivenParent
4344 
4348  const std::string& _resc_name,
4349  const std::string& _zone_name,
4350  std::string& _hierarchy ) {
4351  // =-=-=-=-=-=-=-
4352  // call factory for database object
4353  irods::database_object_ptr db_obj_ptr;
4356  db_obj_ptr );
4357  if ( !ret.ok() ) {
4358  irods::log( PASS( ret ) );
4359  return ret.code();
4360  }
4361 
4362  // =-=-=-=-=-=-=-
4363  // resolve a plugin for that object
4364  irods::plugin_ptr db_plug_ptr;
4365  ret = db_obj_ptr->resolve(
4367  db_plug_ptr );
4368  if ( !ret.ok() ) {
4369  irods::log(
4370  PASSMSG(
4371  "failed to resolve database interface",
4372  ret ) );
4373  return ret.code();
4374  }
4375 
4376  // =-=-=-=-=-=-=-
4377  // cast plugin and object to db and fco for call
4378  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4379  irods::first_class_object > ( db_obj_ptr );
4380  irods::database_ptr db = boost::dynamic_pointer_cast <
4381  irods::database > ( db_plug_ptr );
4382 
4383  // =-=-=-=-=-=-=-
4384  // call the operation on the plugin
4385  ret = db->call <
4386  const std::string*,
4387  const std::string*,
4388  std::string* > ( 0,
4390  ptr,
4391  &_resc_name,
4392  &_zone_name,
4393  &_hierarchy );
4394 
4395  return ret.code();
4396 
4397 } // chlGetHierarchyForResc
4398 
4404  rsComm_t* _comm,
4405  const char* _op_name,
4406  const char* _ticket_string,
4407  const char* _arg3,
4408  const char* _arg4,
4409  const char* _arg5 ) {
4410  // =-=-=-=-=-=-=-
4411  // call factory for database object
4412  irods::database_object_ptr db_obj_ptr;
4415  db_obj_ptr );
4416  if ( !ret.ok() ) {
4417  irods::log( PASS( ret ) );
4418  return ret.code();
4419  }
4420 
4421  // =-=-=-=-=-=-=-
4422  // resolve a plugin for that object
4423  irods::plugin_ptr db_plug_ptr;
4424  ret = db_obj_ptr->resolve(
4426  db_plug_ptr );
4427  if ( !ret.ok() ) {
4428  irods::log(
4429  PASSMSG(
4430  "failed to resolve database interface",
4431  ret ) );
4432  return ret.code();
4433  }
4434 
4435  // =-=-=-=-=-=-=-
4436  // cast plugin and object to db and fco for call
4437  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4438  irods::first_class_object > ( db_obj_ptr );
4439  irods::database_ptr db = boost::dynamic_pointer_cast <
4440  irods::database > ( db_plug_ptr );
4441 
4442  // =-=-=-=-=-=-=-
4443  // call the operation on the plugin
4444  ret = db->call <
4445  const char*,
4446  const char*,
4447  const char*,
4448  const char* > (
4449  _comm,
4451  ptr,
4452  _op_name,
4453  _ticket_string,
4454  _arg3,
4455  _arg4,
4456  _arg5 );
4457 
4458  return ret.code();
4459 
4460 } // chlModTicket
4461 
4463  genQueryInp_t _gen_query_inp,
4464  genQueryOut_t* _result ) {
4465  // =-=-=-=-=-=-=-
4466  // call factory for database object
4467  irods::database_object_ptr db_obj_ptr;
4470  db_obj_ptr );
4471  if ( !ret.ok() ) {
4472  irods::log( PASS( ret ) );
4473  return ret.code();
4474  }
4475 
4476  // =-=-=-=-=-=-=-
4477  // resolve a plugin for that object
4478  irods::plugin_ptr db_plug_ptr;
4479  ret = db_obj_ptr->resolve(
4481  db_plug_ptr );
4482  if ( !ret.ok() ) {
4483  irods::log(
4484  PASSMSG(
4485  "failed to resolve database interface",
4486  ret ) );
4487  return ret.code();
4488  }
4489 
4490  // =-=-=-=-=-=-=-
4491  // cast plugin and object to db and fco for call
4492  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4493  irods::first_class_object > ( db_obj_ptr );
4494  irods::database_ptr db = boost::dynamic_pointer_cast <
4495  irods::database > ( db_plug_ptr );
4496 
4497  // =-=-=-=-=-=-=-
4498  // call the operation on the plugin
4499  ret = db->call <
4500  genQueryInp_t*,
4501  genQueryOut_t* > ( 0,
4503  ptr,
4504  &_gen_query_inp,
4505  _result );
4506 
4507  return ret.code();
4508 
4509 } // chlGenQuery
4510 
4512  const char* _user,
4513  const char* _zone,
4514  const char* _host,
4515  int _priv,
4516  int _control_flag ) {
4517  // =-=-=-=-=-=-=-
4518  // call factory for database object
4519  irods::database_object_ptr db_obj_ptr;
4522  db_obj_ptr );
4523  if ( !ret.ok() ) {
4524  irods::log( PASS( ret ) );
4525  return ret.code();
4526  }
4527 
4528  // =-=-=-=-=-=-=-
4529  // resolve a plugin for that object
4530  irods::plugin_ptr db_plug_ptr;
4531  ret = db_obj_ptr->resolve(
4533  db_plug_ptr );
4534  if ( !ret.ok() ) {
4535  irods::log(
4536  PASSMSG(
4537  "failed to resolve database interface",
4538  ret ) );
4539  return ret.code();
4540  }
4541 
4542  // =-=-=-=-=-=-=-
4543  // cast plugin and object to db and fco for call
4544  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4545  irods::first_class_object > ( db_obj_ptr );
4546  irods::database_ptr db = boost::dynamic_pointer_cast <
4547  irods::database > ( db_plug_ptr );
4548 
4549  // =-=-=-=-=-=-=-
4550  // call the operation on the plugin
4551  ret = db->call <
4552  const char*,
4553  const char*,
4554  const char*,
4555  int,
4556  int > ( 0,
4558  ptr,
4559  _user,
4560  _zone,
4561  _host,
4562  _priv,
4563  _control_flag );
4564 
4565  return ret.code();
4566 
4567 } // chlGenQueryAccessControlSetup
4568 
4570  const char* _ticket,
4571  const char* _client_addr ) {
4572  // =-=-=-=-=-=-=-
4573  // call factory for database object
4574  irods::database_object_ptr db_obj_ptr;
4577  db_obj_ptr );
4578  if ( !ret.ok() ) {
4579  irods::log( PASS( ret ) );
4580  return ret.code();
4581  }
4582 
4583  // =-=-=-=-=-=-=-
4584  // resolve a plugin for that object
4585  irods::plugin_ptr db_plug_ptr;
4586  ret = db_obj_ptr->resolve(
4588  db_plug_ptr );
4589  if ( !ret.ok() ) {
4590  irods::log(
4591  PASSMSG(
4592  "failed to resolve database interface",
4593  ret ) );
4594  return ret.code();
4595  }
4596 
4597  // =-=-=-=-=-=-=-
4598  // cast plugin and object to db and fco for call
4599  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4600  irods::first_class_object > ( db_obj_ptr );
4601  irods::database_ptr db = boost::dynamic_pointer_cast <
4602  irods::database > ( db_plug_ptr );
4603 
4604  // =-=-=-=-=-=-=-
4605  // call the operation on the plugin
4606  ret = db->call <
4607  const char*,
4608  const char* > ( 0,
4610  ptr,
4611  _ticket,
4612  _client_addr );
4613 
4614  return ret.code();
4615 
4616 
4617 } // chlGenQueryTicketSetup
4618 
4620  generalUpdateInp_t _update_inp ) {
4621  // =-=-=-=-=-=-=-
4622  // call factory for database object
4623  irods::database_object_ptr db_obj_ptr;
4626  db_obj_ptr );
4627  if ( !ret.ok() ) {
4628  irods::log( PASS( ret ) );
4629  return ret.code();
4630  }
4631 
4632  // =-=-=-=-=-=-=-
4633  // resolve a plugin for that object
4634  irods::plugin_ptr db_plug_ptr;
4635  ret = db_obj_ptr->resolve(
4637  db_plug_ptr );
4638  if ( !ret.ok() ) {
4639  irods::log(
4640  PASSMSG(
4641  "failed to resolve database interface",
4642  ret ) );
4643  return ret.code();
4644  }
4645 
4646  // =-=-=-=-=-=-=-
4647  // cast plugin and object to db and fco for call
4648  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4649  irods::first_class_object > ( db_obj_ptr );
4650  irods::database_ptr db = boost::dynamic_pointer_cast <
4651  irods::database > ( db_plug_ptr );
4652 
4653  // =-=-=-=-=-=-=-
4654  // call the operation on the plugin
4655  ret = db->call <
4656  generalUpdateInp_t* > ( 0,
4658  ptr,
4659  &_update_inp );
4660 
4661  return ret.code();
4662 
4663 } // chlGeneralUpdate
4664 
4666  rodsLong_t _count,
4667  size_t _child_idx,
4668  const std::vector<leaf_bundle_t>* _bundles,
4669  const std::string* _invocation_timestamp,
4670  dist_child_result_t* _results ) {
4671  // =-=-=-=-=-=-=-
4672  // call factory for database object
4673  irods::database_object_ptr db_obj_ptr;
4676  db_obj_ptr );
4677  if ( !ret.ok() ) {
4678  irods::log( PASS( ret ) );
4679  return ret.code();
4680  }
4681 
4682  // =-=-=-=-=-=-=-
4683  // resolve a plugin for that object
4684  irods::plugin_ptr db_plug_ptr;
4685  ret = db_obj_ptr->resolve(
4687  db_plug_ptr );
4688  if ( !ret.ok() ) {
4689  irods::log(
4690  PASSMSG(
4691  "failed to resolve database interface",
4692  ret ) );
4693  return ret.code();
4694  }
4695 
4696  // =-=-=-=-=-=-=-
4697  // cast plugin and object to db and fco for call
4698  irods::first_class_object_ptr ptr = boost::dynamic_pointer_cast <
4699  irods::first_class_object > ( db_obj_ptr );
4700  irods::database_ptr db = boost::dynamic_pointer_cast <
4701  irods::database > ( db_plug_ptr );
4702 
4703  ret = db->call<
4704  rodsLong_t,
4705  size_t,
4706  const std::vector<leaf_bundle_t>*,
4707  const std::string*,
4709  0,
4711  ptr,
4712  _count,
4713  _child_idx,
4714  _bundles,
4715  _invocation_timestamp,
4716  _results );
4717  if (!ret.ok()) {
4718  irods::log(PASS(ret));
4719  }
4720  return ret.code();
4721 
4722 } // chlGetReplListForLeafBundles
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
chlAddAVUMetadata
int chlAddAVUMetadata(rsComm_t *_comm, int _admin_mode, const char *_type, const char *_name, const char *_attribute, const char *_value, const char *_units)
Definition: icatHighLevelRoutines.cpp:2575
irods::plugin_ptr
boost::shared_ptr< plugin_base > plugin_ptr
Definition: irods_first_class_object.hpp:18
irods::DATABASE_OP_SET_AVU_METADATA
const std::string DATABASE_OP_SET_AVU_METADATA("database_set_avu_metadata")
irods_database_constants.hpp
chlRegDataObj
int chlRegDataObj(rsComm_t *_comm, dataObjInfo_t *_data_obj_info)
Definition: icatHighLevelRoutines.cpp:491
chlSetQuota
int chlSetQuota(rsComm_t *_comm, const char *_type, const char *_name, const char *_resc_name, const char *_limit)
Definition: icatHighLevelRoutines.cpp:3468
rsComm_t
Definition: rcConnect.h:145
chlAddSpecificQuery
int chlAddSpecificQuery(rsComm_t *_comm, const char *_sql, const char *_alias)
Definition: icatHighLevelRoutines.cpp:4076
chlInsDvmTable
int chlInsDvmTable(rsComm_t *_comm, const char *_base_name, const char *_var_name, const char *_action, const char *_var_2_cmap, const char *_my_time)
Definition: icatHighLevelRoutines.cpp:3709
irods::DATABASE_OP_INS_MSRVC_TABLE
const std::string DATABASE_OP_INS_MSRVC_TABLE("database_ins_msrvc_table")
irods::DATABASE_OP_MAKE_LIMITED_PW
const std::string DATABASE_OP_MAKE_LIMITED_PW("database_make_limited_pw")
chlRenameLocalZone
int chlRenameLocalZone(rsComm_t *_comm, const char *_old_zone, const char *_new_zone)
Definition: icatHighLevelRoutines.cpp:1576
database_plugin_type
static std::string database_plugin_type
Definition: icatHighLevelRoutines.cpp:47
irods::DATABASE_OP_MOD_RULE_EXEC
const std::string DATABASE_OP_MOD_RULE_EXEC("database_mod_rule_exec")
irods_server_properties.hpp
irods::DATABASE_OP_COPY_AVU_METADATA
const std::string DATABASE_OP_COPY_AVU_METADATA("database_copy_avu_metadata")
irods::DATABASE_OP_REG_TOKEN
const std::string DATABASE_OP_REG_TOKEN("database_reg_token")
irods::transform
void transform(const InputC &ic, OutputC &oc, UnaryOperation func)
Definition: irods_re_plugin.hpp:822
irods::DATABASE_OP_PURGE_SERVER_LOAD_DIGEST
const std::string DATABASE_OP_PURGE_SERVER_LOAD_DIGEST("database_purge_server_load_digest")
chlDelZone
int chlDelZone(rsComm_t *_comm, const char *_zone_name)
Definition: icatHighLevelRoutines.cpp:1628
userInfo_t
Definition: rodsUser.h:65
chlModZoneCollAcl
int chlModZoneCollAcl(rsComm_t *_comm, const char *_access_level, const char *_user_name, const char *_path_name)
Definition: icatHighLevelRoutines.cpp:1520
irods::DATABASE_OP_MOVE_OBJECT
const std::string DATABASE_OP_MOVE_OBJECT("database_move_object")
irods::DATABASE_OP_REG_RESC
const std::string DATABASE_OP_REG_RESC("database_reg_resc")
irods::DATABASE_OP_MOD_COLL
const std::string DATABASE_OP_MOD_COLL("database_mod_coll")
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
irods::DATABASE_OP_MOD_ZONE_COLL_ACL
const std::string DATABASE_OP_MOD_ZONE_COLL_ACL("database_mod_zone_coll_acl")
chlModResc
int chlModResc(rsComm_t *_comm, const char *_resc_name, const char *_option, const char *_option_value)
Definition: icatHighLevelRoutines.cpp:2223
irods::DATABASE_OP_GET_DISTINCT_DATA_OBJ_COUNT_ON_RESOURCE
const std::string DATABASE_OP_GET_DISTINCT_DATA_OBJ_COUNT_ON_RESOURCE("database_get_distinct_data_obj_count_on_resource")
chlModGroup
int chlModGroup(rsComm_t *_comm, const char *_group_name, const char *_option, const char *_user_name, const char *_user_zone)
Definition: icatHighLevelRoutines.cpp:2164
GeneralUpdateInp
Definition: rodsGeneralUpdate.h:27
irods::DATABASE_OP_REG_SERVER_LOAD_DIGEST
const std::string DATABASE_OP_REG_SERVER_LOAD_DIGEST("database_reg_server_load_digest")
irods::database_factory
irods::error database_factory(const std::string &, irods::database_object_ptr &)
Definition: irods_database_factory.cpp:10
chlSpecificQuery
int chlSpecificQuery(specificQueryInp_t _spec_query_inp, genQueryOut_t *_result)
Definition: icatHighLevelRoutines.cpp:4183
irods::DATABASE_OP_PURGE_SERVER_LOAD
const std::string DATABASE_OP_PURGE_SERVER_LOAD("database_purge_server_load")
irods::DATABASE_OP_REG_DATA_OBJ
const std::string DATABASE_OP_REG_DATA_OBJ("database_reg_data_obj")
chlDelToken
int chlDelToken(rsComm_t *_comm, const char *_name_space, const char *_name)
Definition: icatHighLevelRoutines.cpp:3135
GenQueryInp
Definition: rodsGenQuery.h:24
chlRegReplica
int chlRegReplica(rsComm_t *_comm, dataObjInfo_t *_src_data_obj_info, dataObjInfo_t *_dst_data_obj_info, keyValPair_t *_cond_input)
Definition: icatHighLevelRoutines.cpp:546
irods::DATABASE_OP_MOD_ZONE
const std::string DATABASE_OP_MOD_ZONE("database_mod_zone")
irods::CFG_PLUGIN_CONFIGURATION_KW
const std::string CFG_PLUGIN_CONFIGURATION_KW("plugin_configuration")
irods::DATABASE_OP_RENAME_LOCAL_ZONE
const std::string DATABASE_OP_RENAME_LOCAL_ZONE("database_rename_local_zone")
auditEnabled
int auditEnabled
Definition: icatHighLevelRoutines.cpp:42
chlModRescDataPaths
int chlModRescDataPaths(rsComm_t *_comm, const char *_resc_name, const char *_old_path, const char *_new_path, const char *_user_name)
Definition: icatHighLevelRoutines.cpp:2279
chlDeleteAVUMetadata
int chlDeleteAVUMetadata(rsComm_t *_comm, int _option, const char *_type, const char *_name, const char *_attribute, const char *_value, const char *_units, int _nocommit)
Definition: icatHighLevelRoutines.cpp:2711
irods::DATABASE_OP_MOD_ACCESS_CONTROL_RESC
const std::string DATABASE_OP_MOD_ACCESS_CONTROL_RESC("database_mod_access_control_resc")
irods::DATABASE_OP_ROLLBACK
const std::string DATABASE_OP_ROLLBACK("database_rollback")
chlRegRuleExec
int chlRegRuleExec(rsComm_t *_comm, ruleExecSubmitInp_t *_re_sub_inp)
Definition: icatHighLevelRoutines.cpp:661
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
irods::DATABASE_OP_MOD_GROUP
const std::string DATABASE_OP_MOD_GROUP("database_mod_group")
chlUpdateRescObjCount
int chlUpdateRescObjCount(rsComm_t *_comm, const std::string &_resc, int _delta)
Definition: icatHighLevelRoutines.cpp:374
chlRegCollByAdmin
int chlRegCollByAdmin(rsComm_t *_comm, collInfo_t *_coll_info)
Definition: icatHighLevelRoutines.cpp:1190
chlGetDistinctDataObjsMissingFromChildGivenParent
int chlGetDistinctDataObjsMissingFromChildGivenParent(const std::string &_parent, const std::string &_child, int _limit, const std::string &_invocation_timestamp, dist_child_result_t &_results)
Definition: icatHighLevelRoutines.cpp:4287
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
irods::DATABASE_OP_DEL_RULE_EXEC
const std::string DATABASE_OP_DEL_RULE_EXEC("database_del_rule_exec")
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
chlRollback
int chlRollback(rsComm_t *_comm)
Definition: icatHighLevelRoutines.cpp:1039
chlPurgeServerLoadDigest
int chlPurgeServerLoadDigest(rsComm_t *_comm, const char *_seconds_ago)
Definition: icatHighLevelRoutines.cpp:3375
CollInfo
Definition: objInfo.h:177
chlDelUnusedAVUs
int chlDelUnusedAVUs(rsComm_t *_comm)
Definition: icatHighLevelRoutines.cpp:3583
irods::DATABASE_OP_OPEN
const std::string DATABASE_OP_OPEN("database_open")
chlDelChildResc
int chlDelChildResc(rsComm_t *_comm, std::map< std::string, std::string > &_resc_input)
Definition: icatHighLevelRoutines.cpp:923
specificQueryInp_t
Definition: specificQuery.h:8
irods::DATABASE_OP_MOD_RESC_FREESPACE
const std::string DATABASE_OP_MOD_RESC_FREESPACE("database_mod_resc_freespace")
PLUGIN_ERROR
@ PLUGIN_ERROR
Definition: rodsErrorTable.h:757
chlCopyAVUMetadata
int chlCopyAVUMetadata(rsComm_t *_comm, const char *_type1, const char *_type2, const char *_name1, const char *_name2)
Definition: icatHighLevelRoutines.cpp:2779
irods::database_object_ptr
boost::shared_ptr< database_object > database_object_ptr
Definition: irods_database_object.hpp:62
irods::DATABASE_OP_REG_COLL_BY_ADMIN
const std::string DATABASE_OP_REG_COLL_BY_ADMIN("database_reg_coll_by_admin")
chlModColl
int chlModColl(rsComm_t *_comm, collInfo_t *_coll_info)
Definition: icatHighLevelRoutines.cpp:1302
irods::DATABASE_OP_REG_RULE_EXEC
const std::string DATABASE_OP_REG_RULE_EXEC("database_reg_rule_exec")
irods::DATABASE_OP_GET_REPL_LIST_FOR_LEAF_BUNDLES
const std::string DATABASE_OP_GET_REPL_LIST_FOR_LEAF_BUNDLES("database_get_repl_list_for_leaf_bundles")
irods::DATABASE_OP_UPDATE_PAM_PASSWORD
const std::string DATABASE_OP_UPDATE_PAM_PASSWORD("database_update_pam_password")
irods::DATABASE_OP_CALC_USAGE_AND_QUOTA
const std::string DATABASE_OP_CALC_USAGE_AND_QUOTA("database_calc_usage_and_quota")
irods::DATABASE_OP_UNREG_REPLICA
const std::string DATABASE_OP_UNREG_REPLICA("database_unreg_replica")
chlGeneralUpdate
int chlGeneralUpdate(generalUpdateInp_t _update_inp)
Definition: icatHighLevelRoutines.cpp:4619
irods::DATABASE_OP_ADD_AVU_METADATA
const std::string DATABASE_OP_ADD_AVU_METADATA("database_add_avu_metadata")
irods::DATABASE_OP_DEL_SPECIFIC_QUERY
const std::string DATABASE_OP_DEL_SPECIFIC_QUERY("database_del_specific_query")
irods::error::code
long long code() const
Definition: irods_error.cpp:194
irods::DATABASE_OP_ADD_SPECIFIC_QUERY
const std::string DATABASE_OP_ADD_SPECIFIC_QUERY("database_add_specific_query")
chlUnregDataObj
int chlUnregDataObj(rsComm_t *_comm, dataObjInfo_t *_data_obj_info, keyValPair_t *_cond_input)
Definition: icatHighLevelRoutines.cpp:605
irods::DATABASE_OP_VERSION_FNM_BASE
const std::string DATABASE_OP_VERSION_FNM_BASE("database_version_fnm_base")
irods::DATABASE_OP_COMMIT
const std::string DATABASE_OP_COMMIT("database_commit")
irods::DATABASE_OP_MOD_ACCESS_CONTROL
const std::string DATABASE_OP_MOD_ACCESS_CONTROL("database_mod_access_control")
irods::DATABASE_OP_DEL_CHILD_RESC
const std::string DATABASE_OP_DEL_CHILD_RESC("database_del_child_resc")
irods::first_class_object_ptr
boost::shared_ptr< first_class_object > first_class_object_ptr
Definition: irods_first_class_object.hpp:47
irods::DATABASE_OP_INS_DVM_TABLE
const std::string DATABASE_OP_INS_DVM_TABLE("database_ins_dvm_table")
irods::PLUGIN_TYPE_DATABASE
const std::string PLUGIN_TYPE_DATABASE("database")
irods_database_manager.hpp
chlModAccessControl
int chlModAccessControl(rsComm_t *_comm, int _recursive_flag, const char *_access_level, const char *_user_name, const char *_zone, const char *_path_name)
Definition: icatHighLevelRoutines.cpp:2900
chlGetLocalZone
int chlGetLocalZone(std::string &_zone)
Definition: icatHighLevelRoutines.cpp:270
chlInsMsrvcTable
int chlInsMsrvcTable(rsComm_t *_comm, const char *_module_name, const char *_msrvc_name, const char *_msrvc_signature, const char *_msrvc_version, const char *_msrvc_host, const char *_msrvc_location, const char *_msrvc_language, const char *_msrvc_typeName, const char *_msrvc_status, const char *_my_time)
Definition: icatHighLevelRoutines.cpp:3834
chlOpen
int chlOpen()
Definition: icatHighLevelRoutines.cpp:86
chlPurgeServerLoad
int chlPurgeServerLoad(rsComm_t *_comm, const char *_seconds_ago)
Definition: icatHighLevelRoutines.cpp:3267
chlSimpleQuery
int chlSimpleQuery(rsComm_t *_comm, const char *_sql, const char *_arg1, const char *_arg2, const char *_arg3, const char *_arg4, int _format, int *_control, char *_out_buf, int _max_out_buf)
Definition: icatHighLevelRoutines.cpp:1699
chlAddChildResc
int chlAddChildResc(rsComm_t *_comm, std::map< std::string, std::string > &_resc_input)
Definition: icatHighLevelRoutines.cpp:819
irods::DATABASE_OP_MOD_USER
const std::string DATABASE_OP_MOD_USER("database_mod_user")
irods::DATABASE_INTERFACE
const std::string DATABASE_INTERFACE("irods_database_interface")
irods::DATABASE_OP_DEL_USER_RE
const std::string DATABASE_OP_DEL_USER_RE("database_del_user_re")
irods::DATABASE_OP_GEN_QUERY
const std::string DATABASE_OP_GEN_QUERY("database_gen_query")
chlCheckAuth
int chlCheckAuth(rsComm_t *_comm, const char *_scheme, const char *_challenge, const char *_response, const char *_user_name, int *_user_priv_level, int *_client_priv_level)
Definition: icatHighLevelRoutines.cpp:1884
icatStructs.hpp
irods::DATABASE_OP_DEL_RESC
const std::string DATABASE_OP_DEL_RESC("database_del_resc")
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
chlInsRuleTable
int chlInsRuleTable(rsComm_t *_comm, const char *_base_name, const char *_map_priority_str, const char *_rule_name, const char *_rule_head, const char *_rule_condition, const char *_rule_action, const char *_rule_recovery, const char *_rule_id_str, const char *_my_time)
Definition: icatHighLevelRoutines.cpp:3633
chlCheckAndGetObjectID
int chlCheckAndGetObjectID(rsComm_t *_comm, char *_type, char *_name, char *_access)
Definition: icatHighLevelRoutines.cpp:318
chlDelColl
int chlDelColl(rsComm_t *_comm, collInfo_t *_coll_info)
Definition: icatHighLevelRoutines.cpp:1824
chlGetDistinctDataObjCountOnResource
int chlGetDistinctDataObjCountOnResource(const std::string &_resc_name, long long &_count)
Definition: icatHighLevelRoutines.cpp:4234
irods::DATABASE_OP_REG_REPLICA
const std::string DATABASE_OP_REG_REPLICA("database_reg_replica")
chlRegColl
int chlRegColl(rsComm_t *_comm, collInfo_t *_coll_info)
Definition: icatHighLevelRoutines.cpp:1246
irods_database_factory.hpp
GenQueryOut
Definition: rodsGenQuery.h:67
chlRegServerLoadDigest
int chlRegServerLoadDigest(rsComm_t *_comm, const char *_resc_name, const char *_load_factor)
Definition: icatHighLevelRoutines.cpp:3319
irods::DATABASE_OP_CHECK_QUOTA
const std::string DATABASE_OP_CHECK_QUOTA("database_check_quota")
irods::DATABASE_OP_RENAME_COLL
const std::string DATABASE_OP_RENAME_COLL("database_rename_coll")
chlCommit
int chlCommit(rsComm_t *_comm)
Definition: icatHighLevelRoutines.cpp:1090
dist_child_result_t
std::vector< rodsLong_t > dist_child_result_t
Definition: icatHighLevelRoutines.hpp:192
logSQLGenUpdate
int logSQLGenUpdate
Definition: icatHighLevelRoutines.cpp:40
irods_database_object.hpp
irods::DATABASE_OP_CHECK_AUTH
const std::string DATABASE_OP_CHECK_AUTH("database_check_auth")
chlRenameColl
int chlRenameColl(rsComm_t *_comm, const char *_old_coll, const char *_new_coll)
Definition: icatHighLevelRoutines.cpp:1467
irods::DATABASE_OP_SPECIFIC_QUERY
const std::string DATABASE_OP_SPECIFIC_QUERY("database_specific_query")
irods::DATABASE_OP_DEL_TOKEN
const std::string DATABASE_OP_DEL_TOKEN("database_del_token")
logSQLGenQuery
int logSQLGenQuery
Definition: icatHighLevelRoutines.cpp:39
irods::DATABASE_OP_RENAME_OBJECT
const std::string DATABASE_OP_RENAME_OBJECT("database_rename_object")
irods::DATABASE_OP_GEN_QUERY_TICKET_SETUP
const std::string DATABASE_OP_GEN_QUERY_TICKET_SETUP("database_gen_query_ticket_setup")
irods::log
void log(const error &)
Definition: irods_log.cpp:13
chlModZone
int chlModZone(rsComm_t *_comm, const char *_zone_name, const char *_option, const char *_option_value)
Definition: icatHighLevelRoutines.cpp:1411
chlMakeLimitedPw
int chlMakeLimitedPw(rsComm_t *_comm, int _ttl, char *_pw_value_to_hash)
Definition: icatHighLevelRoutines.cpp:1987
irods::DATABASE_OP_CHECK_AND_GET_OBJ_ID
const std::string DATABASE_OP_CHECK_AND_GET_OBJ_ID("database_check_and_get_obj_id")
chlVersionDvmBase
int chlVersionDvmBase(rsComm_t *_comm, const char *_base_name, const char *_my_time)
Definition: icatHighLevelRoutines.cpp:3969
irods::DATABASE_OP_VERSION_DVM_BASE
const std::string DATABASE_OP_VERSION_DVM_BASE("database_version_dvm_base")
chlSetAVUMetadata
int chlSetAVUMetadata(rsComm_t *_comm, const char *_type, const char *_name, const char *_attribute, const char *_new_value, const char *_new_unit)
Definition: icatHighLevelRoutines.cpp:2443
irods::DATABASE_OP_MOD_AVU_METADATA
const std::string DATABASE_OP_MOD_AVU_METADATA("database_mod_avu_metadata")
chlDelResc
int chlDelResc(rsComm_t *_comm, const std::string &_resc_name, int _dry_run)
Definition: icatHighLevelRoutines.cpp:977
chlGenQueryTicketSetup
int chlGenQueryTicketSetup(const char *_ticket, const char *_client_addr)
Definition: icatHighLevelRoutines.cpp:4569
irods::DATABASE_OP_INS_FNM_TABLE
const std::string DATABASE_OP_INS_FNM_TABLE("database_ins_fnm_table")
irods::DATABASE_OP_INS_RULE_TABLE
const std::string DATABASE_OP_INS_RULE_TABLE("database_ins_rule_table")
irods::error
Definition: irods_error.hpp:23
irods::DATABASE_OP_DEL_AVU_METADATA
const std::string DATABASE_OP_DEL_AVU_METADATA("database_del_avu_metadata")
logSQL_CML
int logSQL_CML
Definition: icatHighLevelRoutines.cpp:41
int
typedef int((*funcPtr)())
chlGenQuery
int chlGenQuery(genQueryInp_t _gen_query_inp, genQueryOut_t *_result)
Definition: icatHighLevelRoutines.cpp:4462
chlModUser
int chlModUser(rsComm_t *_comm, const char *_user_name, const char *_option, const char *_new_value)
Definition: icatHighLevelRoutines.cpp:2106
chlMoveObject
int chlMoveObject(rsComm_t *_comm, rodsLong_t _obj_id, rodsLong_t _target_coll_id)
Definition: icatHighLevelRoutines.cpp:3016
ruleExecSubmitInp_t
Definition: ruleExecSubmit.h:21
chlDebug
int chlDebug(const char *_mode)
Definition: icatHighLevelRoutines.cpp:51
irods::DATABASE_OP_REG_SERVER_LOAD
const std::string DATABASE_OP_REG_SERVER_LOAD("database_reg_server_load")
chlDelRuleExec
int chlDelRuleExec(rsComm_t *_comm, const char *_re_id)
Definition: icatHighLevelRoutines.cpp:769
chlRegUserRE
int chlRegUserRE(rsComm_t *_comm, userInfo_t *_user_info)
Definition: icatHighLevelRoutines.cpp:2392
chlRegToken
int chlRegToken(rsComm_t *_comm, const char *_name_space, const char *_name, const char *_value, const char *_value2, const char *_value3, const char *_comment)
Definition: icatHighLevelRoutines.cpp:3069
chlMakeTempPw
int chlMakeTempPw(rsComm_t *_comm, char *_pw_value_to_hash, const char *_other_user)
Definition: icatHighLevelRoutines.cpp:1935
irods::DATABASE_OP_MOD_RESC
const std::string DATABASE_OP_MOD_RESC("database_mod_resc")
irods::DATABASE_OP_UPDATE_RESC_OBJ_COUNT
const std::string DATABASE_OP_UPDATE_RESC_OBJ_COUNT("database_update_resc_obj_count")
irods::DATABASE_OP_CLOSE
const std::string DATABASE_OP_CLOSE("database_close")
irods::DATABASE_OP_MAKE_TEMP_PW
const std::string DATABASE_OP_MAKE_TEMP_PW("database_make_tmp_pw")
irods::DATABASE_OP_ADD_AVU_METADATA_WILD
const std::string DATABASE_OP_ADD_AVU_METADATA_WILD("database_add_avu_metadata_wild")
irods::DATABASE_OP_GET_LOCAL_ZONE
const std::string DATABASE_OP_GET_LOCAL_ZONE("database_get_local_zone")
irods::DATABASE_OP_SIMPLE_QUERY
const std::string DATABASE_OP_SIMPLE_QUERY("database_simple_query")
chlCheckQuota
int chlCheckQuota(rsComm_t *_comm, const char *_user_name, const char *_resc_name, rodsLong_t *_user_quota, int *_quota_status)
Definition: icatHighLevelRoutines.cpp:3525
irods::first_class_object
Definition: irods_first_class_object.hpp:23
irods::DATABASE_OP_MOD_DATA_OBJ_META
const std::string DATABASE_OP_MOD_DATA_OBJ_META("database_mod_data_obj_meta")
chlAddAVUMetadataWild
int chlAddAVUMetadataWild(rsComm_t *_comm, int _admin_mode, const char *_type, const char *_name, const char *_attribute, const char *_value, const char *_units)
Definition: icatHighLevelRoutines.cpp:2510
irods::database_ptr
boost::shared_ptr< database > database_ptr
Definition: irods_database_types.hpp:21
irods::exception
Definition: irods_exception.hpp:15
chlModTicket
int chlModTicket(rsComm_t *_comm, const char *_op_name, const char *_ticket_string, const char *_arg3, const char *_arg4, const char *_arg5)
Definition: icatHighLevelRoutines.cpp:4403
chlDelSpecificQuery
int chlDelSpecificQuery(rsComm_t *_comm, const char *_sql_or_alias)
Definition: icatHighLevelRoutines.cpp:4127
irods::DATABASE_OP_MOD_RESC_DATA_PATHS
const std::string DATABASE_OP_MOD_RESC_DATA_PATHS("database_mod_resc_data_paths")
icatHighLevelRoutines.hpp
irods::DATABASE_OP_ADD_CHILD_RESC
const std::string DATABASE_OP_ADD_CHILD_RESC("database_add_child_resc")
chlGetHierarchyForResc
int chlGetHierarchyForResc(const std::string &_resc_name, const std::string &_zone_name, std::string &_hierarchy)
Definition: icatHighLevelRoutines.cpp:4347
irods::DATABASE_OP_GET_HIERARCHY_FOR_RESC
const std::string DATABASE_OP_GET_HIERARCHY_FOR_RESC("database_get_hierarchy_for_resc")
chlDelUserRE
int chlDelUserRE(rsComm_t *_comm, userInfo_t *_user_info)
Definition: icatHighLevelRoutines.cpp:1137
irods::DATABASE_OP_MOD_TICKET
const std::string DATABASE_OP_MOD_TICKET("database_mod_ticket")
chlInsFnmTable
int chlInsFnmTable(rsComm_t *_comm, const char *_base_name, const char *_func_name, const char *_func_2_cmap, const char *_my_time)
Definition: icatHighLevelRoutines.cpp:3773
irods::database
Definition: irods_database_plugin.hpp:17
irods::DATABASE_OP_REG_USER_RE
const std::string DATABASE_OP_REG_USER_RE("database_reg_user_re")
irods::DATABASE_OP_GET_RCS
const std::string DATABASE_OP_GET_RCS("database_get_rcs")
chlModRescFreeSpace
int chlModRescFreeSpace(rsComm_t *_comm, const char *_resc_name, int _update_value)
Definition: icatHighLevelRoutines.cpp:2339
irods_error.hpp
chlClose
int chlClose()
Definition: icatHighLevelRoutines.cpp:164
chlRegZone
int chlRegZone(rsComm_t *_comm, const char *_zone_name, const char *_zone_type, const char *_zone_conn_info, const char *_zone_comment)
Definition: icatHighLevelRoutines.cpp:1352
chlRenameObject
int chlRenameObject(rsComm_t *_comm, rodsLong_t _obj_id, const char *_new_name)
Definition: icatHighLevelRoutines.cpp:2962
chlModAccessControlResc
int chlModAccessControlResc(rsComm_t *_comm, int _recursive_flag, char *_access_level, char *_user_name, char *_zone, char *_resc_name)
Definition: icatHighLevelRoutines.cpp:2836
mode
int mode
Definition: filesystem.cpp:104
irods::DATABASE_OP_REG_ZONE
const std::string DATABASE_OP_REG_ZONE("database_reg_zone")
chlUpdateIrodsPamPassword
int chlUpdateIrodsPamPassword(rsComm_t *_comm, const char *_user_name, int _ttl, const char *_test_time, char **_irods_password)
Definition: icatHighLevelRoutines.cpp:2046
chlRegResc
int chlRegResc(rsComm_t *_comm, std::map< std::string, std::string > &_resc_input)
Definition: icatHighLevelRoutines.cpp:873
irods::DATABASE_OP_REG_COLL
const std::string DATABASE_OP_REG_COLL("database_reg_coll")
chlModAVUMetadata
int chlModAVUMetadata(rsComm_t *_comm, const char *_type, const char *_name, const char *_attribute, const char *_value, const char *_unitsOrArg0, const char *_arg1, const char *_arg2, const char *_arg3)
Definition: icatHighLevelRoutines.cpp:2639
irods::DATABASE_OP_DEL_COLL_BY_ADMIN
const std::string DATABASE_OP_DEL_COLL_BY_ADMIN("database_del_coll_by_admin")
irods::DATABASE_OP_VERSION_RULE_BASE
const std::string DATABASE_OP_VERSION_RULE_BASE("database_version_rule_base")
KeyValPair
Definition: objInfo.h:120
chlGenQueryAccessControlSetup
int chlGenQueryAccessControlSetup(const char *_user, const char *_zone, const char *_host, int _priv, int _control_flag)
Definition: icatHighLevelRoutines.cpp:4511
chlDelCollByAdmin
int chlDelCollByAdmin(rsComm_t *_comm, collInfo_t *_coll_info)
Definition: icatHighLevelRoutines.cpp:1774
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
logSQL
int logSQL
Definition: icatHighLevelRoutines.cpp:38
irods::DATABASE_OP_GET_DISTINCT_DATA_OBJS_MISSING_FROM_CHILD_GIVEN_PARENT
const std::string DATABASE_OP_GET_DISTINCT_DATA_OBJS_MISSING_FROM_CHILD_GIVEN_PARENT("database_get_distinct_data_objs_missing_from_child_given_parent")
DataObjInfo
Definition: objInfo.h:129
icatSessionStruct
Definition: icatStructs.hpp:26
chlGetReplListForLeafBundles
int chlGetReplListForLeafBundles(rodsLong_t _count, size_t _child_idx, const std::vector< leaf_bundle_t > *_bundles, const std::string *_invocation_timestamp, dist_child_result_t *_results)
Definition: icatHighLevelRoutines.cpp:4665
irods::DATABASE_OP_GEN_QUERY_ACCESS_CONTROL_SETUP
const std::string DATABASE_OP_GEN_QUERY_ACCESS_CONTROL_SETUP("database_gen_query_access_control_setup")
irods::DATABASE_OP_SET_QUOTA
const std::string DATABASE_OP_SET_QUOTA("database_set_quota")
chlVersionFnmBase
int chlVersionFnmBase(rsComm_t *_comm, const char *_base_name, const char *_my_time)
Definition: icatHighLevelRoutines.cpp:4025
irods::DATABASE_OP_DEL_COLL
const std::string DATABASE_OP_DEL_COLL("database_del_coll")
irods::DATABASE_OP_GENERAL_UPDATE
const std::string DATABASE_OP_GENERAL_UPDATE("database_general_update")
rodsLong_t
long long rodsLong_t
Definition: rodsType.h:32
chlRegServerLoad
int chlRegServerLoad(rsComm_t *_comm, const char *_host_name, const char *_resc_name, const char *_cpu_used, const char *_mem_used, const char *_swap_used, const char *_run_q_load, const char *_disk_space, const char *_net_input, const char *_net_output)
Definition: icatHighLevelRoutines.cpp:3190
irods::DATABASE_OP_DEL_UNUSED_AVUS
const std::string DATABASE_OP_DEL_UNUSED_AVUS("database_del_unused_avus")
chlVersionRuleBase
int chlVersionRuleBase(rsComm_t *_comm, const char *_base_name, const char *_my_time)
Definition: icatHighLevelRoutines.cpp:3913
chlGetRcs
int chlGetRcs(icatSessionStruct **_icss)
Definition: icatHighLevelRoutines.cpp:222
irods::DATABASE_OP_DEL_ZONE
const std::string DATABASE_OP_DEL_ZONE("database_del_zone")
chlModDataObjMeta
int chlModDataObjMeta(rsComm_t *_comm, dataObjInfo_t *_data_obj_info, keyValPair_t *_reg_param)
Definition: icatHighLevelRoutines.cpp:436
chlModRuleExec
int chlModRuleExec(rsComm_t *_comm, const char *_re_id, keyValPair_t *_reg_param)
Definition: icatHighLevelRoutines.cpp:716
chlCalcUsageAndQuota
int chlCalcUsageAndQuota(rsComm_t *_comm)
Definition: icatHighLevelRoutines.cpp:3423