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)  

rcDataObjRsync.cpp
Go to the documentation of this file.
1 
6 /* This is script-generated code. */
7 /* See dataObjRsync.h for a description of this API call.*/
8 
9 #include "dataObjRsync.h"
10 #include "dataObjPut.h"
11 #include "dataObjGet.h"
12 #include "procApiRequest.h"
13 #include "apiNumber.h"
14 #include "oprComplete.h"
15 #include "rcMisc.h"
16 
91 int
92 rcDataObjRsync( rcComm_t *conn, dataObjInp_t *dataObjInp ) {
93  int status;
94  msParamArray_t *outParamArray = NULL;
95  char *locFilePath;
96 
97  status = _rcDataObjRsync( conn, dataObjInp, &outParamArray );
98 
100  if ( ( locFilePath = getValByKey( &dataObjInp->condInput,
101  RSYNC_DEST_PATH_KW ) ) == NULL ) {
102  return USER_INPUT_PATH_ERR;
103  }
104  else {
105  status = rcDataObjPut( conn, dataObjInp, locFilePath );
106  if ( status >= 0 ) {
108  }
109  else {
110  return status;
111  }
112  }
113  }
114  else if ( status == SYS_SVR_TO_CLI_GET_ACTION ) {
115  if ( ( locFilePath = getValByKey( &dataObjInp->condInput,
116  RSYNC_DEST_PATH_KW ) ) == NULL ) {
117  return USER_INPUT_PATH_ERR;
118  }
119  else {
120  status = rcDataObjGet( conn, dataObjInp, locFilePath );
121  if ( status >= 0 ) {
123  }
124  else {
125  return status;
126  }
127  }
128  }
129 
130  /* below is for backward compatibility */
131  while ( status == SYS_SVR_TO_CLI_MSI_REQUEST && outParamArray != NULL ) {
132  /* it is a server request */
133  msParam_t *myMsParam;
134  dataObjInp_t *dataObjInp = NULL;
135  int l1descInx;
136 
137  myMsParam = getMsParamByLabel( outParamArray, CL_ZONE_OPR_INX );
138  if ( myMsParam == NULL ) {
139  l1descInx = -1;
140  }
141  else {
142  l1descInx = *( int* ) myMsParam->inOutStruct;
143  }
144 
145  if ( ( myMsParam = getMsParamByLabel( outParamArray, CL_PUT_ACTION ) )
146  != NULL ) {
147 
148  dataObjInp = ( dataObjInp_t * ) myMsParam->inOutStruct;
149  if ( ( locFilePath = getValByKey( &dataObjInp->condInput,
150  RSYNC_DEST_PATH_KW ) ) == NULL ) {
151  if ( l1descInx >= 0 ) {
152  rcOprComplete( conn, l1descInx );
153  }
154  else {
156  }
157  }
158  else {
159  status = rcDataObjPut( conn, dataObjInp, locFilePath );
160  if ( l1descInx >= 0 ) {
161  rcOprComplete( conn, l1descInx );
162  }
163  else {
164  rcOprComplete( conn, status );
165  }
166  }
167  }
168  else if ( ( myMsParam = getMsParamByLabel( outParamArray,
169  CL_GET_ACTION ) ) != NULL ) {
170  dataObjInp = ( dataObjInp_t * ) myMsParam->inOutStruct;
171  if ( ( locFilePath = getValByKey( &dataObjInp->condInput,
172  RSYNC_DEST_PATH_KW ) ) == NULL ) {
173  if ( l1descInx >= 0 ) {
174  rcOprComplete( conn, l1descInx );
175  }
176  else {
178  }
179  }
180  else {
181  status = rcDataObjGet( conn, dataObjInp, locFilePath );
182  if ( l1descInx >= 0 ) {
183  rcOprComplete( conn, l1descInx );
184  }
185  else {
186  rcOprComplete( conn, status );
187  }
188  }
189  }
190  else {
191  if ( l1descInx >= 0 ) {
192  rcOprComplete( conn, l1descInx );
193  }
194  else {
196  }
197  }
198  if ( dataObjInp != NULL ) {
199  clearKeyVal( &dataObjInp->condInput );
200  }
201  /* free outParamArray */
202  clearMsParamArray( outParamArray, 1 );
203  free( outParamArray );
204  outParamArray = NULL;
205 
206  /* read the reply from the eariler call */
207 
209  ( void ** )( static_cast< void * >( &outParamArray ) ), NULL );
210  if ( status < 0 ) {
212  "rcDataObjRsync: readAndProcApiReply failed. status = %d",
213  status );
214  }
215  }
216 
217  return status;
218 }
219 
220 int
222  msParamArray_t **outParamArray ) {
223  int status;
224 
225  status = procApiRequest( conn, DATA_OBJ_RSYNC_AN, dataObjInp, NULL,
226  ( void ** )outParamArray, NULL );
227 
228  return status;
229 }
getValByKey
char * getValByKey(const keyValPair_t *condInput, const char *keyWord)
Definition: rcMisc.cpp:675
rcComm_t
Definition: rcConnect.h:95
NULL
#define NULL
Definition: rodsDef.h:70
getMsParamByLabel
msParam_t * getMsParamByLabel(msParamArray_t *msParamArray, const char *label)
Definition: msParam.cpp:376
_rcDataObjRsync
int _rcDataObjRsync(rcComm_t *conn, dataObjInp_t *dataObjInp, msParamArray_t **outParamArray)
Definition: rcDataObjRsync.cpp:221
branchReadAndProcApiReply
int branchReadAndProcApiReply(rcComm_t *conn, int apiNumber, void **outStruct, bytesBuf_t *outBsBBuf)
Definition: procApiRequest.cpp:94
SYS_SVR_TO_CLI_MSI_NO_EXIST
@ SYS_SVR_TO_CLI_MSI_NO_EXIST
Definition: rodsErrorTable.h:112
RSYNC_DEST_PATH_KW
#define RSYNC_DEST_PATH_KW
Definition: rodsKeyWdDef.h:57
rcMisc.h
SYS_SVR_TO_CLI_MSI_REQUEST
#define SYS_SVR_TO_CLI_MSI_REQUEST
Definition: rodsDef.h:109
USER_FILE_DOES_NOT_EXIST
@ USER_FILE_DOES_NOT_EXIST
Definition: rodsErrorTable.h:241
DATA_OBJ_RSYNC_AN
#define DATA_OBJ_RSYNC_AN
Definition: apiNumber.h:60
CL_PUT_ACTION
#define CL_PUT_ACTION
Definition: rodsDef.h:119
clearMsParamArray
int clearMsParamArray(msParamArray_t *msParamArray, int freeStruct)
Definition: msParam.cpp:447
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
procApiRequest.h
rcDataObjGet
int rcDataObjGet(rcComm_t *conn, dataObjInp_t *dataObjInp, char *locFilePath)
Definition: rcDataObjGet.cpp:91
SYS_SVR_TO_CLI_PUT_ACTION
#define SYS_SVR_TO_CLI_PUT_ACTION
Definition: rodsDef.h:112
DataObjInp
Definition: dataObjInpOut.h:65
rcOprComplete
int rcOprComplete(rcComm_t *conn, int retval)
Definition: rcOprComplete.cpp:32
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
MsParam
Definition: msParam.h:76
CL_ZONE_OPR_INX
#define CL_ZONE_OPR_INX
Definition: rodsDef.h:121
dataObjPut.h
apiNumber.h
CL_GET_ACTION
#define CL_GET_ACTION
Definition: rodsDef.h:120
procApiRequest
int procApiRequest(rcComm_t *conn, int apiNumber, void *inputStruct, bytesBuf_t *inputBsBBuf, void **outStruct, bytesBuf_t *outBsBBuf)
Definition: procApiRequest.cpp:55
SYS_RSYNC_TARGET_MODIFIED
#define SYS_RSYNC_TARGET_MODIFIED
Definition: rodsDef.h:114
rodsLogError
void rodsLogError(int level, int errCode, char *formatStr,...)
Definition: rodsLog.cpp:422
dataObjRsync.h
rcDataObjRsync
int rcDataObjRsync(rcComm_t *conn, dataObjInp_t *dataObjInp)
Definition: rcDataObjRsync.cpp:92
oprComplete.h
rcDataObjPut
int rcDataObjPut(rcComm_t *conn, dataObjInp_t *dataObjInp, char *locFilePath)
Definition: rcDataObjPut.cpp:100
MsParam::inOutStruct
void * inOutStruct
Definition: msParam.h:80
DataObjInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:74
MsParamArray
Definition: msParam.h:84
clearKeyVal
int clearKeyVal(keyValPair_t *condInput)
Definition: rcMisc.cpp:1047
USER_INPUT_PATH_ERR
@ USER_INPUT_PATH_ERR
Definition: rodsErrorTable.h:248
dataObjGet.h
SYS_SVR_TO_CLI_GET_ACTION
#define SYS_SVR_TO_CLI_GET_ACTION
Definition: rodsDef.h:113