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)  

rsGeneralUpdate.cpp
Go to the documentation of this file.
1 
4 /* See generalUpdate.h for a description of this API call.*/
5 
6 #include "generalUpdate.h"
7 #include "rsGeneralUpdate.hpp"
9 #include "miscServerFunct.hpp"
11 
12 int
13 rsGeneralUpdate( rsComm_t *rsComm, generalUpdateInp_t *generalUpdateInp ) {
15  int status;
16 
17  rodsLog( LOG_DEBUG, "generalUpdate" );
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 
32  if( irods::CFG_SERVICE_ROLE_PROVIDER == svc_role ) {
33  status = _rsGeneralUpdate( generalUpdateInp );
34  } else if( irods::CFG_SERVICE_ROLE_CONSUMER == svc_role ) {
36  } else {
37  rodsLog(
38  LOG_ERROR,
39  "role not supported [%s]",
40  svc_role.c_str() );
42  }
43 
44  }
45  else {
47  generalUpdateInp );
48  }
49 
50  if ( status < 0 ) {
52  "rsGeneralUpdate: rcGeneralUpdate failed" );
53  }
54  return status;
55 }
56 
57 int
58 _rsGeneralUpdate( generalUpdateInp_t *generalUpdateInp ) {
59  int status;
60 
61  status = chlGeneralUpdate( *generalUpdateInp );
62 
63  return status;
64 }
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
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
GeneralUpdateInp
Definition: rodsGeneralUpdate.h:27
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
rsGeneralUpdate
int rsGeneralUpdate(rsComm_t *rsComm, generalUpdateInp_t *generalUpdateInp)
Definition: rsGeneralUpdate.cpp:13
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
rcGeneralUpdate
int rcGeneralUpdate(rcComm_t *conn, generalUpdateInp_t *generalUpdateInp)
Definition: rcGeneralUpdate.cpp:41
irods::error::code
long long code() const
Definition: irods_error.cpp:194
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
irods::CFG_SERVICE_ROLE_PROVIDER
const std::string CFG_SERVICE_ROLE_PROVIDER("provider")
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
_rsGeneralUpdate
int _rsGeneralUpdate(generalUpdateInp_t *generalUpdateInp)
Definition: rsGeneralUpdate.cpp:58
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
generalUpdate.h
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
chlGeneralUpdate
int chlGeneralUpdate(generalUpdateInp_t generalUpdateInp)
Definition: icatHighLevelRoutines.cpp:4619
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
rsGeneralUpdate.hpp
irods::error::ok
bool ok()
Definition: irods_error.cpp:258