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)  

rsRuleExecMod.cpp
Go to the documentation of this file.
1 
3 /* See ruleExecMod.h for a description of this API call.*/
4 
5 #include "miscServerFunct.hpp"
6 #include "ruleExecMod.h"
7 #include "rsRuleExecMod.hpp"
9 #include "irods_log.hpp"
11 
12 int
13 rsRuleExecMod( rsComm_t *rsComm, ruleExecModInp_t *ruleExecModInp ) {
15  int status;
16 
17  status = getAndConnRcatHost( rsComm, MASTER_RCAT, ( const char* )NULL, &rodsServerHost );
18  if ( status < 0 ) {
19  return status;
20  }
21 
23  std::string svc_role;
24  irods::error ret = get_catalog_service_role(svc_role);
25  if(!ret.ok()) {
26  irods::log(PASS(ret));
27  return ret.code();
28  }
29 
30  if( irods::CFG_SERVICE_ROLE_PROVIDER == svc_role ) {
31  status = _rsRuleExecMod( rsComm, ruleExecModInp );
32  } else if( irods::CFG_SERVICE_ROLE_CONSUMER == svc_role ) {
34  } else {
35  rodsLog(
36  LOG_ERROR,
37  "role not supported [%s]",
38  svc_role.c_str() );
40  }
41  }
42  else {
44  ruleExecModInp );
45  }
46 
47  if ( status < 0 ) {
49  "rsRuleExecMod: rcRuleExecMod failed" );
50  }
51  return status;
52 }
53 
54 int
56  ruleExecModInp_t *ruleExecModInp ) {
57  int status;
58 
59  status = chlModRuleExec( rsComm,
60  ruleExecModInp->ruleId,
61  &ruleExecModInp->condInput );
62  return status;
63 }
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
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
rcRuleExecMod
int rcRuleExecMod(rcComm_t *conn, ruleExecModInp_t *ruleExecModInp)
Definition: rcRuleExecMod.cpp:32
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
ruleExecModInp_t::ruleId
char ruleId[64]
Definition: ruleExecMod.h:9
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
chlModRuleExec
int chlModRuleExec(rsComm_t *rsComm, const char *ruleExecId, keyValPair_t *regParam)
Definition: icatHighLevelRoutines.cpp:716
irods::error::code
long long code() const
Definition: irods_error.cpp:194
irods::CFG_SERVICE_ROLE_PROVIDER
const std::string CFG_SERVICE_ROLE_PROVIDER("provider")
ruleExecModInp_t
Definition: ruleExecMod.h:8
SYS_NO_RCAT_SERVER_ERR
@ SYS_NO_RCAT_SERVER_ERR
Definition: rodsErrorTable.h:110
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
irods::log
void log(const error &)
Definition: irods_log.cpp:13
ruleExecMod.h
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
getAndConnRcatHost
int getAndConnRcatHost(rsComm_t *rsComm, int rcatType, const char *rcatZoneHint, rodsServerHost_t **rodsServerHost)
Definition: rodsConnect.cpp:26
_rsRuleExecMod
int _rsRuleExecMod(rsComm_t *rsComm, ruleExecModInp_t *ruleExecModInp)
Definition: rsRuleExecMod.cpp:55
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
icatHighLevelRoutines.hpp
ruleExecModInp_t::condInput
keyValPair_t condInput
Definition: ruleExecMod.h:10
rsRuleExecMod.hpp
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
irods_log.hpp
rsRuleExecMod
int rsRuleExecMod(rsComm_t *rsComm, ruleExecModInp_t *ruleExecModInp)
Definition: rsRuleExecMod.cpp:13