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)  

rsGeneralRowInsert.cpp
Go to the documentation of this file.
1 
3 /* This is script-generated code (for the most part). */
4 /* See generalRowInsert.h for a description of this API call.*/
5 
6 #include "generalRowInsert.h"
7 #include "rsGeneralRowInsert.hpp"
9 #include "miscServerFunct.hpp"
11 
12 int
13 rsGeneralRowInsert( rsComm_t *rsComm, generalRowInsertInp_t *generalRowInsertInp ) {
15  int status;
16 
17  rodsLog( LOG_DEBUG, "generalRowInsert" );
18 
19  status = getAndConnRcatHost( rsComm, MASTER_RCAT, ( const char* )NULL, &rodsServerHost );
20  if ( status < 0 ) {
21  return status;
22  }
23 
25  std::string svc_role;
26  irods::error ret = get_catalog_service_role(svc_role);
27  if(!ret.ok()) {
28  irods::log(PASS(ret));
29  return ret.code();
30  }
31  if( irods::CFG_SERVICE_ROLE_PROVIDER == svc_role ) {
32  status = _rsGeneralRowInsert( rsComm, generalRowInsertInp );
33  } else if( irods::CFG_SERVICE_ROLE_CONSUMER == svc_role ) {
35  } else {
36  rodsLog(
37  LOG_ERROR,
38  "role not supported [%s]",
39  svc_role.c_str() );
41  }
42  }
43  else {
45  generalRowInsertInp );
46  }
47 
48  if ( status < 0 ) {
50  "rsGeneralRowInsert: rcGeneralRowInsert failed" );
51  }
52  return status;
53 }
54 
55 int
56 _rsGeneralRowInsert( rsComm_t *rsComm, generalRowInsertInp_t *generalRowInsertInp ) {
57  int status;
58 
60  "_rsGeneralRowInsert tableName=%s",
61  generalRowInsertInp->tableName );
62 
63  if ( strcmp( generalRowInsertInp->tableName, "serverload" ) == 0 ) {
64  status = chlRegServerLoad( rsComm,
65  generalRowInsertInp->arg1,
66  generalRowInsertInp->arg2,
67  generalRowInsertInp->arg3,
68  generalRowInsertInp->arg4,
69  generalRowInsertInp->arg5,
70  generalRowInsertInp->arg6,
71  generalRowInsertInp->arg7,
72  generalRowInsertInp->arg8,
73  generalRowInsertInp->arg9 );
74  return status;
75  }
76  if ( strcmp( generalRowInsertInp->tableName, "serverloaddigest" ) == 0 ) {
78  generalRowInsertInp->arg1,
79  generalRowInsertInp->arg2 );
80  return status;
81  }
82  if ( strcmp( generalRowInsertInp->tableName, "ruleTable" ) == 0 ) {
83  status = chlInsRuleTable( rsComm,
84  generalRowInsertInp->arg1,
85  generalRowInsertInp->arg2,
86  generalRowInsertInp->arg3,
87  generalRowInsertInp->arg4,
88  generalRowInsertInp->arg5,
89  generalRowInsertInp->arg6,
90  generalRowInsertInp->arg7,
91  generalRowInsertInp->arg8,
92  generalRowInsertInp->arg9 );
93  return status;
94  }
95  if ( strcmp( generalRowInsertInp->tableName, "versionRuleBase" ) == 0 ) {
96  status = chlVersionRuleBase( rsComm,
97  generalRowInsertInp->arg1,
98  generalRowInsertInp->arg2 );
99  return status;
100  }
101  if ( strcmp( generalRowInsertInp->tableName, "dvmTable" ) == 0 ) {
102  status = chlInsDvmTable( rsComm,
103  generalRowInsertInp->arg1,
104  generalRowInsertInp->arg2,
105  generalRowInsertInp->arg3,
106  generalRowInsertInp->arg4,
107  generalRowInsertInp->arg5 );
108  return status;
109  }
110  if ( strcmp( generalRowInsertInp->tableName, "versionDVMBase" ) == 0 ) {
111  status = chlVersionDvmBase( rsComm,
112  generalRowInsertInp->arg1,
113  generalRowInsertInp->arg2 );
114  return status;
115  }
116  if ( strcmp( generalRowInsertInp->tableName, "fnmTable" ) == 0 ) {
117  status = chlInsFnmTable( rsComm,
118  generalRowInsertInp->arg1,
119  generalRowInsertInp->arg2,
120  generalRowInsertInp->arg3,
121  generalRowInsertInp->arg4 );
122  return status;
123  }
124  if ( strcmp( generalRowInsertInp->tableName, "versionFNMBase" ) == 0 ) {
125  status = chlVersionFnmBase( rsComm,
126  generalRowInsertInp->arg1,
127  generalRowInsertInp->arg2 );
128  return status;
129  }
130 
131  if ( strcmp( generalRowInsertInp->tableName, "msrvcTable" ) == 0 ) {
132  status = chlInsMsrvcTable( rsComm,
133  generalRowInsertInp->arg1,
134  generalRowInsertInp->arg2,
135  generalRowInsertInp->arg3,
136  generalRowInsertInp->arg4,
137  generalRowInsertInp->arg5,
138  generalRowInsertInp->arg6,
139  generalRowInsertInp->arg7,
140  generalRowInsertInp->arg8,
141  generalRowInsertInp->arg9,
142  generalRowInsertInp->arg10 );
143  return status;
144  }
145  return CAT_INVALID_ARGUMENT;
146 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
NULL
#define NULL
Definition: rodsDef.h:70
rsComm_t
Definition: rcConnect.h:145
irods::CFG_SERVICE_ROLE_CONSUMER
const std::string CFG_SERVICE_ROLE_CONSUMER("consumer")
irods_configuration_keywords.hpp
rodsServerHost::localFlag
int localFlag
Definition: rodsConnect.h:68
SYS_SERVICE_ROLE_NOT_SUPPORTED
@ SYS_SERVICE_ROLE_NOT_SUPPORTED
Definition: rodsErrorTable.h:217
chlInsFnmTable
int chlInsFnmTable(rsComm_t *rsComm, const char *baseName, const char *funcName, const char *func2CMap, const char *myTime)
Definition: icatHighLevelRoutines.cpp:3773
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
generalRowInsertInp_t::arg9
const char * arg9
Definition: generalRowInsert.h:16
chlInsRuleTable
int chlInsRuleTable(rsComm_t *rsComm, const char *baseName, const char *priorityStr, const char *ruleName, const char *ruleHead, const char *ruleCondition, const char *ruleAction, const char *ruleRecovery, const char *ruleIdStr, const char *myTime)
Definition: icatHighLevelRoutines.cpp:3633
generalRowInsertInp_t::arg2
const char * arg2
Definition: generalRowInsert.h:9
generalRowInsertInp_t::arg6
const char * arg6
Definition: generalRowInsert.h:13
generalRowInsertInp_t::arg7
const char * arg7
Definition: generalRowInsert.h:14
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
chlVersionRuleBase
int chlVersionRuleBase(rsComm_t *rsComm, const char *baseName, const char *myTime)
Definition: icatHighLevelRoutines.cpp:3913
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
generalRowInsertInp_t::arg4
const char * arg4
Definition: generalRowInsert.h:11
irods::error::code
long long code() const
Definition: irods_error.cpp:194
chlInsMsrvcTable
int chlInsMsrvcTable(rsComm_t *rsComm, const char *moduleName, const char *msrvcName, const char *msrvcSignature, const char *msrvcVersion, const char *msrvcHost, const char *msrvcLocation, const char *msrvcLanguage, const char *msrvcTypeName, const char *msrvcStatus, const char *myTime)
Definition: icatHighLevelRoutines.cpp:3834
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
generalRowInsertInp_t
Definition: generalRowInsert.h:6
generalRowInsertInp_t::arg1
const char * arg1
Definition: generalRowInsert.h:8
irods::CFG_SERVICE_ROLE_PROVIDER
const std::string CFG_SERVICE_ROLE_PROVIDER("provider")
chlVersionFnmBase
int chlVersionFnmBase(rsComm_t *rsComm, const char *baseName, const char *myTime)
Definition: icatHighLevelRoutines.cpp:4025
generalRowInsertInp_t::arg8
const char * arg8
Definition: generalRowInsert.h:15
SYS_NO_RCAT_SERVER_ERR
@ SYS_NO_RCAT_SERVER_ERR
Definition: rodsErrorTable.h:110
chlRegServerLoadDigest
int chlRegServerLoadDigest(rsComm_t *rsComm, const char *rescName, const char *loadFactor)
Definition: icatHighLevelRoutines.cpp:3319
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
irods::log
void log(const error &)
Definition: irods_log.cpp:13
chlRegServerLoad
int chlRegServerLoad(rsComm_t *rsComm, const char *hostName, const char *rescName, const char *cpuUsed, const char *memUsed, const char *swapUsed, const char *runqLoad, const char *diskSpace, const char *netInput, const char *netOutput)
Definition: icatHighLevelRoutines.cpp:3190
rcGeneralRowInsert
int rcGeneralRowInsert(rcComm_t *conn, generalRowInsertInp_t *generalRowInsertInp)
Definition: rcGeneralRowInsert.cpp:36
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
rsGeneralRowInsert
int rsGeneralRowInsert(rsComm_t *rsComm, generalRowInsertInp_t *generalRowInsertInp)
Definition: rsGeneralRowInsert.cpp:13
getAndConnRcatHost
int getAndConnRcatHost(rsComm_t *rsComm, int rcatType, const char *rcatZoneHint, rodsServerHost_t **rodsServerHost)
Definition: rodsConnect.cpp:26
rsGeneralRowInsert.hpp
chlVersionDvmBase
int chlVersionDvmBase(rsComm_t *rsComm, const char *baseName, const char *myTime)
Definition: icatHighLevelRoutines.cpp:3969
MASTER_RCAT
#define MASTER_RCAT
Definition: rodsDef.h:85
get_catalog_service_role
irods::error get_catalog_service_role(std::string &_role)
Definition: miscServerFunct.cpp:3153
rodsServerHost
Definition: rodsConnect.h:62
_rsGeneralRowInsert
int _rsGeneralRowInsert(rsComm_t *rsComm, generalRowInsertInp_t *generalRowInsertInp)
Definition: rsGeneralRowInsert.cpp:56
generalRowInsertInp_t::arg5
const char * arg5
Definition: generalRowInsert.h:12
icatHighLevelRoutines.hpp
CAT_INVALID_ARGUMENT
@ CAT_INVALID_ARGUMENT
Definition: rodsErrorTable.h:431
generalRowInsertInp_t::tableName
const char * tableName
Definition: generalRowInsert.h:7
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
generalRowInsert.h
generalRowInsertInp_t::arg3
const char * arg3
Definition: generalRowInsert.h:10
chlInsDvmTable
int chlInsDvmTable(rsComm_t *rsComm, const char *baseName, const char *varName, const char *action, const char *var2CMap, const char *myTime)
Definition: icatHighLevelRoutines.cpp:3709
generalRowInsertInp_t::arg10
const char * arg10
Definition: generalRowInsert.h:17