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)  

reDataObjOpr.cpp
Go to the documentation of this file.
1 
6 #include "reDataObjOpr.hpp"
7 #include "apiHeaderAll.h"
8 #include "rsApiHandler.hpp"
9 #include "collection.hpp"
10 #include "rsDataObjCreate.hpp"
11 #include "rsDataObjOpen.hpp"
12 #include "rsDataObjClose.hpp"
13 #include "rsDataObjRead.hpp"
14 #include "rsDataObjWrite.hpp"
15 #include "rsDataObjUnlink.hpp"
16 #include "rsDataObjRepl.hpp"
17 #include "rsDataObjCopy.hpp"
18 #include "rsDataObjChksum.hpp"
19 #include "rsDataObjLseek.hpp"
20 #include "rsDataObjPhymv.hpp"
21 #include "rsDataObjRename.hpp"
22 #include "rsDataObjTrim.hpp"
23 #include "rsCollCreate.hpp"
24 #include "rsRmColl.hpp"
25 #include "rsPhyPathReg.hpp"
26 #include "rsObjStat.hpp"
27 #include "rsDataObjRsync.hpp"
28 #include "rsOpenCollection.hpp"
29 #include "rsReadCollection.hpp"
30 #include "rsCloseCollection.hpp"
31 #include "rsExecCmd.hpp"
32 #include "rsCollRepl.hpp"
33 #include "rsModDataObjMeta.hpp"
35 #include "rsModDataObjMeta.hpp"
36 #include "rsStructFileBundle.hpp"
37 #include "rsPhyBundleColl.hpp"
38 #include <string>
39 #include <vector>
40 #include <boost/regex.hpp>
41 #include <boost/algorithm/string/regex.hpp>
42 
86 int
87 msiDataObjCreate( msParam_t *inpParam1, msParam_t *msKeyValStr,
88  msParam_t *outParam, ruleExecInfo_t *rei ) {
89  rsComm_t *rsComm;
90  dataObjInp_t dataObjInp, *myDataObjInp;
91  char *outBadKeyWd;
92  int validKwFlags;
93 
94  RE_TEST_MACRO( " Calling msiDataObjCreate" )
95 
96  if ( rei == NULL || rei->rsComm == NULL ) {
98  "msiDataObjCreate: input rei or rsComm is NULL" );
100  }
101 
102  rsComm = rei->rsComm;
103 
104  /* parse inpParam1 */
105  rei->status = parseMspForDataObjInp( inpParam1, &dataObjInp,
106  &myDataObjInp, 0 );
107 
108  if ( rei->status < 0 ) {
109  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
110  "msiDataObjCreate: input inpParam1 error. status = %d", rei->status );
111  return rei->status;
112  }
113 
116  rei->status = parseMsKeyValStrForDataObjInp( msKeyValStr, myDataObjInp,
117  DEST_RESC_NAME_KW, validKwFlags, &outBadKeyWd );
118 
119  if ( rei->status < 0 ) {
120  if ( outBadKeyWd != NULL ) {
121  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
122  "msiDataObjCreate: input keyWd - %s error. status = %d",
123  outBadKeyWd, rei->status );
124  free( outBadKeyWd );
125  }
126  else {
127  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
128  "msiDataObjCreate: input msKeyValStr error. status = %d",
129  rei->status );
130  }
131  return rei->status;
132  }
133 
134  rei->status = rsDataObjCreate( rsComm, myDataObjInp );
135 
136  if ( myDataObjInp == &dataObjInp ) {
137  clearKeyVal( &myDataObjInp->condInput );
138  }
139 
140  if ( rei->status >= 0 ) {
141  fillIntInMsParam( outParam, rei->status );
142  }
143  else {
144  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
145  "msiDataObjCreate: rsDataObjCreate failed for %s, status = %d",
146  myDataObjInp->objPath,
147  rei->status );
148  }
149 
150  return rei->status;
151 }
152 
199 int
200 msiDataObjOpen( msParam_t *inpParam, msParam_t *outParam,
201  ruleExecInfo_t *rei ) {
202  rsComm_t *rsComm;
203  dataObjInp_t dataObjInp, *myDataObjInp;
204  char *outBadKeyWd = NULL;
205  int validKwFlags;
206 
207  RE_TEST_MACRO( " Calling msiDataObjOpen" )
208 
209  if ( rei == NULL || rei->rsComm == NULL ) {
211  "msiDataObjOpen: input rei or rsComm is NULL" );
213  }
214 
215  rsComm = rei->rsComm;
216 
217  /* parse inpParam */
218  if ( strcmp( inpParam->type, STR_MS_T ) == 0 ) {
219  bzero( &dataObjInp, sizeof( dataObjInp ) );
220  myDataObjInp = &dataObjInp;
221  validKwFlags = OBJ_PATH_FLAG | RESC_NAME_FLAG | OPEN_FLAGS_FLAG |
223  rei->status = parseMsKeyValStrForDataObjInp( inpParam, myDataObjInp,
224  OBJ_PATH_KW, validKwFlags, &outBadKeyWd );
225  }
226  else {
227  rei->status = parseMspForDataObjInp( inpParam, &dataObjInp,
228  &myDataObjInp, 0 );
229  }
230 
231  if ( rei->status < 0 ) {
232  if ( outBadKeyWd != NULL ) {
233  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
234  "msiDataObjOpen: input keyWd - %s error. status = %d",
235  outBadKeyWd, rei->status );
236  free( outBadKeyWd );
237  }
238  else {
239  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
240  "msiDataObjOpen: input msKeyValStr error. status = %d",
241  rei->status );
242  }
243  return rei->status;
244  }
245 
246  rei->status = rsDataObjOpen( rsComm, myDataObjInp );
247  if ( rei->status >= 0 ) {
248  fillIntInMsParam( outParam, rei->status );
249  }
250  else {
251  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
252  "msiDataObjOpen: rsDataObjOpen failed for %s, status = %d",
253  dataObjInp.objPath,
254  rei->status );
255  }
256 
257  return rei->status;
258 }
259 
292 int
293 msiDataObjClose( msParam_t *inpParam, msParam_t *outParam, ruleExecInfo_t *rei ) {
294  rsComm_t *rsComm;
295  openedDataObjInp_t dataObjCloseInp, *myDataObjCloseInp;
296 
297  RE_TEST_MACRO( " Calling msiDataObjClose" )
298 
299  if ( rei == NULL || rei->rsComm == NULL ) {
301  "msiDataObjClose: input rei or rsComm is NULL" );
303  }
304 
305  rsComm = rei->rsComm;
306 
307  if ( inpParam == NULL ) {
309  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
310  "msiDataObjClose: input inpParam is NULL" );
311  return rei->status;
312  }
313 
314  if ( strcmp( inpParam->type, DataObjCloseInp_MS_T ) == 0 ) {
315  myDataObjCloseInp = ( openedDataObjInp_t* )inpParam->inOutStruct;
316  }
317  else {
318  int myInt;
319 
320  myInt = parseMspForPosInt( inpParam );
321  if ( myInt >= 0 ) {
322  memset( &dataObjCloseInp, 0, sizeof( dataObjCloseInp ) );
323  dataObjCloseInp.l1descInx = myInt;
324  myDataObjCloseInp = &dataObjCloseInp;
325  }
326  else {
327  rei->status = myInt;
328  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
329  "msiDataObjClose: parseMspForPosInt error for param1." );
330  return rei->status;
331  }
332  }
333 
334  rei->status = rsDataObjClose( rsComm, myDataObjCloseInp );
335  if ( rei->status >= 0 ) {
336  fillIntInMsParam( outParam, rei->status );
337  }
338  else {
339  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
340  "msiDataObjClose: rsDataObjClose failed, status = %d",
341  rei->status );
342  }
343 
344  return rei->status;
345 }
346 
381 int
382 msiDataObjLseek( msParam_t *inpParam1, msParam_t *inpParam2,
383  msParam_t *inpParam3, msParam_t *outParam,
384  ruleExecInfo_t *rei ) {
385  rsComm_t *rsComm;
386  openedDataObjInp_t dataObjLseekInp, *myDataObjLseekInp;
387  fileLseekOut_t *dataObjLseekOut = NULL;
388 
389  RE_TEST_MACRO( " Calling msiDataObjLseek" )
390 
391  if ( rei == NULL || rei->rsComm == NULL ) {
393  "msiDataObjLseek: input rei or rsComm is NULL" );
395  }
396 
397  rsComm = rei->rsComm;
398 
399  if ( inpParam1 == NULL ) {
401  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
402  "msiDataObjLseek: input inpParam1 is NULL" );
403  return rei->status;
404  }
405 
406  if ( strcmp( inpParam1->type, STR_MS_T ) == 0 ) {
407  /* str input */
408  memset( &dataObjLseekInp, 0, sizeof( dataObjLseekInp ) );
409  dataObjLseekInp.l1descInx = atoi( ( char* )inpParam1->inOutStruct );
410  myDataObjLseekInp = &dataObjLseekInp;
411  }
412  else if ( strcmp( inpParam1->type, INT_MS_T ) == 0 ) {
413  memset( &dataObjLseekInp, 0, sizeof( dataObjLseekInp ) );
414  dataObjLseekInp.l1descInx = *( int * )inpParam1->inOutStruct;
415  myDataObjLseekInp = &dataObjLseekInp;
416  }
417  else if ( strcmp( inpParam1->type, DataObjLseekInp_MS_T ) == 0 ) {
418  myDataObjLseekInp = ( openedDataObjInp_t* )inpParam1->inOutStruct;
419  }
420  else {
422  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
423  "msiDataObjLseek: Unsupported input Param type %s",
424  inpParam1->type );
425  return rei->status;
426  }
427 
428  if ( inpParam2 != NULL ) {
429  if ( strcmp( inpParam2->type, INT_MS_T ) == 0 ) {
430  myDataObjLseekInp->offset = *( int * )inpParam2->inOutStruct;
431  }
432  else if ( strcmp( inpParam2->type, STR_MS_T ) == 0 ) {
433  /* str input */
434  if ( strcmp( ( char * ) inpParam2->inOutStruct, "null" ) != 0 ) {
435  myDataObjLseekInp->offset = strtoll( ( char* )inpParam2->inOutStruct,
436  0, 0 );
437  }
438  }
439  else if ( strcmp( inpParam2->type, DOUBLE_MS_T ) == 0 ) {
440  myDataObjLseekInp->offset = *( rodsLong_t * )inpParam2->inOutStruct;
441  }
442  else {
444  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
445  "msiDataObjLseek: Unsupported input Param type %s",
446  inpParam2->type );
447  return rei->status;
448  }
449  }
450 
451  if ( inpParam3 != NULL ) {
452  /* str input */
453  if ( strcmp( inpParam3->type, STR_MS_T ) == 0 ) {
454  if ( strcmp( ( char * ) inpParam3->inOutStruct, "SEEK_SET" ) == 0 ) {
455  myDataObjLseekInp->whence = SEEK_SET;
456  }
457  else if ( strcmp( ( char * ) inpParam3->inOutStruct,
458  "SEEK_CUR" ) == 0 ) {
459  myDataObjLseekInp->whence = SEEK_CUR;
460  }
461  else if ( strcmp( ( char * ) inpParam3->inOutStruct,
462  "SEEK_END" ) == 0 ) {
463  myDataObjLseekInp->whence = SEEK_END;
464  }
465  else if ( strcmp( ( char * ) inpParam3->inOutStruct, "null" ) != 0 ) {
466  myDataObjLseekInp->whence = atoi( ( char* )inpParam3->inOutStruct );
467  }
468  }
469  else if ( strcmp( inpParam3->type, INT_MS_T ) == 0 ) {
470  myDataObjLseekInp->whence = *( int * )inpParam3->inOutStruct;
471  }
472  else {
474  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
475  "msiDataObjLseek: Unsupported input Param type %s",
476  inpParam3->type );
477  return rei->status;
478  }
479  }
480 
481  if ( myDataObjLseekInp->whence != SEEK_SET &&
482  myDataObjLseekInp->whence != SEEK_CUR &&
483  myDataObjLseekInp->whence != SEEK_END ) {
485  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
486  "msiDataObjLseek: Unsupported input whence value %d",
487  myDataObjLseekInp->whence );
488  return rei->status;
489  }
490 
491  rei->status = rsDataObjLseek( rsComm, myDataObjLseekInp, &dataObjLseekOut );
492  if ( rei->status >= 0 && outParam != NULL ) {
493  fillMsParam( outParam, NULL, DataObjLseekOut_MS_T, dataObjLseekOut, NULL );
494  }
495  else {
496  free( dataObjLseekOut );
497  if ( rei->status >= 0 ) {
498  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
499  "msiDataObjLseek: rsDataObjLseek failed, status = %d",
500  rei->status );
501  }
502  }
503 
504  return rei->status;
505 }
506 
540 int
541 msiDataObjRead( msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei ) {
542  rsComm_t *rsComm;
543  openedDataObjInp_t dataObjReadInp, *myDataObjReadInp;
544  bytesBuf_t *dataObjReadOutBBuf = NULL;
545  int myInt;
546 
547  RE_TEST_MACRO( " Calling msiDataObjRead" )
548 
549  if ( rei == NULL || rei->rsComm == NULL ) {
551  "msiDataObjRead: input rei or rsComm is NULL" );
553  }
554 
555  rsComm = rei->rsComm;
556 
557  if ( inpParam1 == NULL ) {
559  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
560  "msiDataObjRead: input inpParam1 is NULL" );
561  return rei->status;
562  }
563 
564  if ( strcmp( inpParam1->type, DataObjReadInp_MS_T ) == 0 ) {
565  myDataObjReadInp = ( openedDataObjInp_t* )inpParam1->inOutStruct;
566  }
567  else {
568  myInt = parseMspForPosInt( inpParam1 );
569  if ( myInt >= 0 ) {
570  memset( &dataObjReadInp, 0, sizeof( dataObjReadInp ) );
571  dataObjReadInp.l1descInx = myInt;
572  myDataObjReadInp = &dataObjReadInp;
573  }
574  else {
575  rei->status = myInt;
576  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
577  "msiDataObjRead: parseMspForPosInt error for param1." );
578  return rei->status;
579  }
580  }
581 
582  if ( inpParam2 != NULL ) {
583  myInt = parseMspForPosInt( inpParam2 );
584 
585  if ( myInt < 0 ) {
586  if ( myInt != SYS_NULL_INPUT ) {
587  rei->status = myInt;
588  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
589  "msiDataObjRead: parseMspForPosInt error for param2." );
590  return rei->status;
591  }
592  }
593  else {
594  myDataObjReadInp->len = myInt;
595  }
596  }
597 
598  dataObjReadOutBBuf = ( bytesBuf_t * ) malloc( sizeof( bytesBuf_t ) );
599  memset( dataObjReadOutBBuf, 0, sizeof( bytesBuf_t ) );
600 
601  rei->status = rsDataObjRead( rsComm, myDataObjReadInp, dataObjReadOutBBuf );
602 
603  if ( rei->status >= 0 ) {
604  fillBufLenInMsParam( outParam, rei->status, dataObjReadOutBBuf );
605  }
606  else {
607  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
608  "msiDataObjRead: rsDataObjRead failed, status = %d",
609  rei->status );
610  }
611 
612  return rei->status;
613 }
614 
649 int
650 msiDataObjWrite( msParam_t *inpParam1, msParam_t *inpParam2,
651  msParam_t *outParam, ruleExecInfo_t *rei ) {
652  rsComm_t *rsComm;
653  openedDataObjInp_t dataObjWriteInp, *myDataObjWriteInp;
654  int myInt;
655  bytesBuf_t tmpBBuf, *myBBuf = NULL;
656  execCmdOut_t *myExecCmdOut;
657  msParam_t *mP;
658 
659  RE_TEST_MACRO( " Calling msiDataObjWrite" )
660 
661  if ( rei == NULL || rei->rsComm == NULL ) {
662  rodsLog( LOG_ERROR, "msiDataObjWrite: input rei or rsComm is NULL" );
664  }
665 
666  rsComm = rei->rsComm;
667 
668 
669  if ( inpParam1 == NULL || ( inpParam1->inpOutBuf == NULL &&
670  inpParam1->inOutStruct == NULL ) ) {
672  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
673  "msiDataObjWrite: input inpParam1 or inpOutBuf or inOutStruct is NULL" );
674  return rei->status;
675  }
676 
677  if ( strcmp( inpParam1->type, DataObjWriteInp_MS_T ) == 0 ) {
678  myDataObjWriteInp = ( openedDataObjInp_t* )inpParam1->inOutStruct;
679  }
680  else {
681  myInt = parseMspForPosInt( inpParam1 );
682  if ( myInt >= 0 ) {
683  memset( &dataObjWriteInp, 0, sizeof( dataObjWriteInp ) );
684  dataObjWriteInp.l1descInx = myInt;
685  myDataObjWriteInp = &dataObjWriteInp;
686  }
687  else {
688  rei->status = myInt;
689  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
690  "msiDataObjWrite: parseMspForPosInt error for param1." );
691  return rei->status;
692  }
693  }
694 
695  if ( inpParam2 != NULL ) {
696  if ( ( strcmp( ( char * )inpParam2->inOutStruct, "stdout" ) == 0 ) ||
697  ( strcmp( ( char * ) inpParam2->inOutStruct, "stderr" ) == 0 ) ) {
698  if ( ( mP = getMsParamByLabel( rei->msParamArray, "ruleExecOut" ) ) == NULL ) {
699  return NO_VALUES_FOUND;
700  }
701  myExecCmdOut = ( execCmdOut_t* )mP->inOutStruct;
702  if ( strcmp( ( char * ) inpParam2->inOutStruct, "stdout" ) == 0 ) {
703  free( inpParam2->inOutStruct );
704  inpParam2->inOutStruct = 0;
705  if ( myExecCmdOut->stdoutBuf.len > 0 ) {
706  inpParam2->inOutStruct = strdup( ( char * ) myExecCmdOut->stdoutBuf.buf );
707  }
708  else {
709  inpParam2->inOutStruct = strdup( "" );
710  }
711  }
712  else {
713  free( inpParam2->inOutStruct );
714  if ( myExecCmdOut->stdoutBuf.len > 0 ) {
715  inpParam2->inOutStruct = strdup( ( char * ) myExecCmdOut->stderrBuf.buf );
716  }
717  else {
718  inpParam2->inOutStruct = strdup( "" );
719  }
720  }
721  inpParam2->type = strdup( STR_MS_T );
722  }
723  if ( strcmp( inpParam2->type, STR_MS_T ) == 0 ) {
724  tmpBBuf.len = myDataObjWriteInp->len =
725  strlen( ( char* )inpParam2->inOutStruct );
726  tmpBBuf.buf = inpParam2->inOutStruct;
727  myBBuf = &tmpBBuf;
728  }
729  else {
730  myInt = parseMspForPosInt( inpParam2 );
731  if ( myInt < 0 ) {
732  if ( myInt != SYS_NULL_INPUT ) {
733  rei->status = myInt;
734  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
735  "msiDataObjWrite: parseMspForPosInt error for param2." );
736  return rei->status;
737  }
738  }
739  else {
740  myDataObjWriteInp->len = myInt;
741  }
742  myBBuf = inpParam2->inpOutBuf;
743  }
744  rei->status = rsDataObjWrite( rsComm, myDataObjWriteInp, myBBuf );
745  }
746 
747  if ( rei->status >= 0 ) {
748  fillIntInMsParam( outParam, rei->status );
749  }
750  else {
751  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
752  "msiDataObjWrite: rsDataObjWrite failed, status = %d",
753  rei->status );
754  }
755 
756  return rei->status;
757 }
758 
806 int
807 msiDataObjUnlink( msParam_t *inpParam, msParam_t *outParam,
808  ruleExecInfo_t *rei ) {
809  rsComm_t *rsComm;
810  dataObjInp_t dataObjInp, *myDataObjInp;
811  char *outBadKeyWd = NULL;
812  int validKwFlags;
813 
814  RE_TEST_MACRO( " Calling msiDataObjUnlink" )
815 
816  if ( rei == NULL || rei->rsComm == NULL ) {
818  "msiDataObjUnlink: input rei or rsComm is NULL" );
820  }
821 
822  rsComm = rei->rsComm;
823 
824  /* parse inpParam */
825  if ( strcmp( inpParam->type, STR_MS_T ) == 0 ) {
826  bzero( &dataObjInp, sizeof( dataObjInp ) );
827  myDataObjInp = &dataObjInp;
828  validKwFlags = OBJ_PATH_FLAG | FORCE_FLAG_FLAG | REPL_NUM_FLAG |
830  rei->status = parseMsKeyValStrForDataObjInp( inpParam, myDataObjInp,
831  OBJ_PATH_KW, validKwFlags, &outBadKeyWd );
832  }
833  else {
834  rei->status = parseMspForDataObjInp( inpParam, &dataObjInp,
835  &myDataObjInp, 0 );
836  }
837 
838  if ( rei->status < 0 ) {
839  if ( outBadKeyWd != NULL ) {
840  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
841  "msiDataObjUnlink: input keyWd - %s error. status = %d",
842  outBadKeyWd, rei->status );
843  free( outBadKeyWd );
844  }
845  else {
846  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
847  "msiDataObjUnlink: input msKeyValStr error. status = %d",
848  rei->status );
849  }
850  return rei->status;
851  }
852 
853  rei->status = rsDataObjUnlink( rsComm, myDataObjInp );
854  if ( rei->status >= 0 ) {
855  fillIntInMsParam( outParam, rei->status );
856  }
857  else {
858  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
859  "msiDataObjUnlink: rsDataObjUnlink failed for %s, status = %d",
860  myDataObjInp->objPath,
861  rei->status );
862  }
863 
864  return rei->status;
865 }
866 
932 int
933 msiDataObjRepl( msParam_t *inpParam1, msParam_t *msKeyValStr,
934  msParam_t *outParam, ruleExecInfo_t *rei ) {
935  rsComm_t *rsComm;
936  dataObjInp_t dataObjInp, *myDataObjInp;
937  transferStat_t *transStat = NULL;
938  char *outBadKeyWd;
939  int validKwFlags;
940 
941  RE_TEST_MACRO( " Calling msiDataObjRepl" )
942 
943  if ( rei == NULL || rei->rsComm == NULL ) {
945  "msiDataObjRepl: input rei or rsComm is NULL" );
947  }
948 
949  rsComm = rei->rsComm;
950 
951  /* parse inpParam1 */
952  rei->status = parseMspForDataObjInp( inpParam1, &dataObjInp,
953  &myDataObjInp, 0 );
954 
955  if ( rei->status < 0 ) {
956  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
957  "msiDataObjRepl: input inpParam1 error. status = %d", rei->status );
958  return rei->status;
959  }
960 
965  rei->status = parseMsKeyValStrForDataObjInp( msKeyValStr, myDataObjInp,
966  DEST_RESC_NAME_KW, validKwFlags, &outBadKeyWd );
967 
968  if ( rei->status < 0 ) {
969  if ( outBadKeyWd != NULL ) {
970  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
971  "msiDataObjRepl: input keyWd - %s error. status = %d",
972  outBadKeyWd, rei->status );
973  free( outBadKeyWd );
974  }
975  else {
976  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
977  "msiDataObjRepl: input msKeyValStr error. status = %d",
978  rei->status );
979  }
980  return rei->status;
981  }
982 
983  rei->status = rsDataObjRepl( rsComm, myDataObjInp, &transStat );
984 
985  if ( myDataObjInp == &dataObjInp ) {
986  clearKeyVal( &myDataObjInp->condInput );
987  }
988 
989  if ( transStat != NULL ) {
990  free( transStat );
991  }
992 
993  if ( rei->status >= 0 ) {
994  fillIntInMsParam( outParam, rei->status );
995  }
996  else {
997  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
998  "msiDataObjRepl: rsDataObjRepl failed %s, status = %d",
999  myDataObjInp->objPath,
1000  rei->status );
1001  }
1002 
1003  return rei->status;
1004 }
1005 
1058 int
1059 msiDataObjCopy( msParam_t *inpParam1, msParam_t *inpParam2,
1060  msParam_t *msKeyValStr, msParam_t *outParam, ruleExecInfo_t *rei ) {
1061  rsComm_t *rsComm;
1062  dataObjCopyInp_t dataObjCopyInp, *myDataObjCopyInp;
1063  dataObjInp_t *myDataObjInp;
1064  transferStat_t *transStat = NULL;
1065  char *outBadKeyWd;
1066  int validKwFlags;
1067 
1068  RE_TEST_MACRO( " Calling msiDataObjCopy" )
1069 
1070  if ( rei == NULL || rei->rsComm == NULL ) {
1071  rodsLog( LOG_ERROR,
1072  "msiDataObjCopy: input rei or rsComm is NULL" );
1074  }
1075 
1076  rsComm = rei->rsComm;
1077  /* parse inpParam1 */
1078  rei->status = parseMspForDataObjCopyInp( inpParam1, &dataObjCopyInp, &myDataObjCopyInp );
1079 
1080 
1081  if ( rei->status < 0 ) {
1082  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1083  "msiDataObjCopy: input inpParam1 error. status = %d", rei->status );
1084  return rei->status;
1085  }
1086 
1087  /* parse inpParam2 */
1088  rei->status = parseMspForDataObjInp( inpParam2, &myDataObjCopyInp->destDataObjInp, &myDataObjInp, 1 );
1089 
1090 
1091  if ( rei->status < 0 ) {
1092  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1093  "msiDataObjCopy: input inpParam2 error. status = %d", rei->status );
1094  return rei->status;
1095  }
1096 
1097  validKwFlags = OBJ_PATH_FLAG | DEST_RESC_NAME_FLAG | FILE_PATH_FLAG |
1100  rei->status = parseMsKeyValStrForDataObjInp( msKeyValStr, &myDataObjCopyInp->destDataObjInp,
1101  DEST_RESC_NAME_KW, validKwFlags, &outBadKeyWd );
1102 
1103  if ( rei->status < 0 ) {
1104  if ( outBadKeyWd != NULL ) {
1105  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1106  "msiDataObjCopy: input keyWd - %s error. status = %d",
1107  outBadKeyWd, rei->status );
1108  free( outBadKeyWd );
1109  }
1110  else {
1111  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1112  "msiDataObjCopy: input msKeyValStr error. status = %d",
1113  rei->status );
1114  }
1115  return rei->status;
1116  }
1117 
1118  if ( rei->status < 0 ) {
1119  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1120  "msiDataObjCopy: input inpParam2 error. status = %d", rei->status );
1121  return rei->status;
1122  }
1123 
1124  rei->status = rsDataObjCopy( rsComm, myDataObjCopyInp, &transStat );
1125  if ( transStat != NULL ) {
1126  free( transStat );
1127  }
1128 
1129  if ( myDataObjCopyInp == &dataObjCopyInp ) {
1130  clearKeyVal( &myDataObjCopyInp->destDataObjInp.condInput );
1131  }
1132 
1133  if ( rei->status >= 0 ) {
1134  fillIntInMsParam( outParam, rei->status );
1135  }
1136  else {
1137  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1138  "msiDataObjCopy: rsDataObjCopy failed for %s, status = %d",
1139  myDataObjCopyInp->srcDataObjInp.objPath,
1140  rei->status );
1141  }
1142 
1143  return rei->status;
1144 }
1145 
1204 int
1205 msiDataObjPut( msParam_t *inpParam1, msParam_t *inpParam2,
1206  msParam_t *msKeyValStr, msParam_t *outParam, ruleExecInfo_t *rei ) {
1207  rsComm_t *rsComm;
1208  dataObjInp_t *myDataObjInp = NULL;
1209  msParamArray_t *myMsParamArray;
1210  char *outBadKeyWd;
1211  int validKwFlags;
1212 
1213  RE_TEST_MACRO( " Calling msiDataObjPut" )
1214 
1215  if ( rei == NULL || rei->rsComm == NULL ) {
1216  rodsLog( LOG_ERROR,
1217  "msiDataObjPut: input rei or rsComm is NULL" );
1219  }
1220 
1221  rsComm = rei->rsComm;
1222 
1223  /* parse inpParam1 */
1224  dataObjInp_t *dataObjInp = ( dataObjInp_t* )malloc( sizeof( *dataObjInp ) );
1225  rei->status = parseMspForDataObjInp( inpParam1, dataObjInp,
1226  &myDataObjInp, 1 );
1227 
1228  if ( rei->status < 0 ) {
1229  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1230  "msiDataObjPut: input inpParam1 error. status = %d", rei->status );
1231  clearDataObjInp( dataObjInp );
1232  free( dataObjInp );
1233  return rei->status;
1234  }
1235 
1236  rei->status = parseMspForCondInp( inpParam2, &dataObjInp->condInput,
1238 
1239  if ( rei->status < 0 ) {
1240  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1241  "msiDataObjPut: input inpParam2 error. status = %d", rei->status );
1242  clearDataObjInp( dataObjInp );
1243  free( dataObjInp );
1244  return rei->status;
1245  }
1246 
1250  rei->status = parseMsKeyValStrForDataObjInp( msKeyValStr, dataObjInp,
1251  LOCAL_PATH_KW, validKwFlags, &outBadKeyWd );
1252 
1253  if ( rei->status < 0 ) {
1254  if ( outBadKeyWd != NULL ) {
1255  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1256  "msiDataObjPut: input keyWd - %s error. status = %d",
1257  outBadKeyWd, rei->status );
1258  free( outBadKeyWd );
1259  }
1260  else {
1261  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1262  "msiDataObjPut: input msKeyValStr error. status = %d",
1263  rei->status );
1264  }
1265  clearDataObjInp( dataObjInp );
1266  free( dataObjInp );
1267  return rei->status;
1268  }
1269 
1270  myMsParamArray = ( msParamArray_t* )malloc( sizeof( msParamArray_t ) );
1271  memset( myMsParamArray, 0, sizeof( msParamArray_t ) );
1272 
1273  rei->status = addMsParam( myMsParamArray, CL_PUT_ACTION, DataObjInp_MS_T,
1274  ( void * ) dataObjInp, NULL );
1275 
1276  if ( rei->status < 0 ) {
1277  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1278  "msiDataObjPut: addMsParam error. status = %d", rei->status );
1279  clearMsParamArray( myMsParamArray, 0 );
1280  free( myMsParamArray );
1281  clearDataObjInp( dataObjInp );
1282  free( dataObjInp );
1283  return rei->status;
1284  }
1285 
1286  /* tell the client to do the put */
1287  rei->status = sendAndRecvBranchMsg( rsComm, rsComm->apiInx,
1288  SYS_SVR_TO_CLI_MSI_REQUEST, ( void * ) myMsParamArray, NULL );
1289 
1290  if ( rei->status >= 0 ) {
1291  fillIntInMsParam( outParam, rei->status );
1292  }
1293  else {
1294  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1295  "msiDataObjPut: rsDataObjPut failed for %s, status = %d",
1296  dataObjInp->objPath,
1297  rei->status );
1298  }
1299 
1300  return rei->status;
1301 }
1302 
1356 int
1357 msiDataObjGet( msParam_t *inpParam1, msParam_t *msKeyValStr,
1358  msParam_t *outParam, ruleExecInfo_t *rei ) {
1359  rsComm_t *rsComm;
1360  dataObjInp_t *myDataObjInp = NULL;
1361  msParamArray_t *myMsParamArray;
1362  char *outBadKeyWd = NULL;
1363  int validKwFlags;
1364 
1365  RE_TEST_MACRO( " Calling msiDataObjGet" )
1366 
1367  if ( rei == NULL || rei->rsComm == NULL ) {
1368  rodsLog( LOG_ERROR,
1369  "msiDataObjGet: input rei or rsComm is NULL" );
1371  }
1372 
1373  rsComm = rei->rsComm;
1374 
1375  /* parse inpParam1 */
1376  dataObjInp_t *dataObjInp = ( dataObjInp_t* )malloc( sizeof( *dataObjInp ) );
1377  rei->status = parseMspForDataObjInp( inpParam1, dataObjInp,
1378  &myDataObjInp, 1 );
1379 
1380  if ( rei->status < 0 ) {
1381  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1382  "msiDataObjGet: input inpParam1 error. status = %d",
1383  rei->status );
1384  clearDataObjInp( dataObjInp );
1385  free( dataObjInp );
1386  return rei->status;
1387  }
1388 
1389  validKwFlags = LOCAL_PATH_FLAG | FORCE_FLAG_FLAG | NUM_THREADS_FLAG |
1391  rei->status = parseMsKeyValStrForDataObjInp( msKeyValStr, dataObjInp,
1392  LOCAL_PATH_KW, validKwFlags, &outBadKeyWd );
1393 
1394  if ( rei->status < 0 ) {
1395  if ( outBadKeyWd != NULL ) {
1396  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1397  "msiDataObjGet: input keyWd - %s error. status = %d",
1398  outBadKeyWd, rei->status );
1399  free( outBadKeyWd );
1400  }
1401  else {
1402  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1403  "msiDataObjGet: input msKeyValStr error. status = %d",
1404  rei->status );
1405  }
1406  clearDataObjInp( dataObjInp );
1407  free( dataObjInp );
1408  return rei->status;
1409  }
1410 
1411  myMsParamArray = ( msParamArray_t* )malloc( sizeof( msParamArray_t ) );
1412  memset( myMsParamArray, 0, sizeof( msParamArray_t ) );
1413 
1414  rei->status = addMsParam( myMsParamArray, CL_GET_ACTION, DataObjInp_MS_T,
1415  ( void * ) dataObjInp, NULL );
1416 
1417  if ( rei->status < 0 ) {
1418  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1419  "msiDataObjGet: addMsParam error. status = %d",
1420  rei->status );
1421  clearMsParamArray( myMsParamArray, 0 );
1422  free( myMsParamArray );
1423  clearDataObjInp( dataObjInp );
1424  free( dataObjInp );
1425  return rei->status;
1426  }
1427 
1428  /* tell the client to do the get */
1429  rei->status = sendAndRecvBranchMsg( rsComm, rsComm->apiInx,
1430  SYS_SVR_TO_CLI_MSI_REQUEST, ( void * ) myMsParamArray, NULL );
1431 
1432  if ( rei->status >= 0 ) {
1433  fillIntInMsParam( outParam, rei->status );
1434  }
1435  else {
1436  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1437  "msiDataObjGet: rsDataObjGet failed for %s, status = %d",
1438  dataObjInp->objPath, rei->status );
1439  }
1440 
1441  return rei->status;
1442 }
1443 
1486 int
1487 msiDataObjChksum( msParam_t *inpParam1, msParam_t *msKeyValStr,
1488  msParam_t *outParam, ruleExecInfo_t *rei ) {
1489  rsComm_t *rsComm;
1490  dataObjInp_t dataObjInp, *myDataObjInp = NULL;
1491  char *chksum = NULL;
1492  char *outBadKeyWd;
1493  int validKwFlags;
1494 
1495  RE_TEST_MACRO( " Calling msiDataObjChksum" )
1496 
1497  if ( rei == NULL || rei->rsComm == NULL ) {
1498  rodsLog( LOG_ERROR,
1499  "msiDataObjChksum: input rei or rsComm is NULL" );
1501  }
1502 
1503  rsComm = rei->rsComm;
1504 
1505  /* parse inpParam1 */
1506  rei->status = parseMspForDataObjInp( inpParam1, &dataObjInp,
1507  &myDataObjInp, 1 );
1508 
1509  if ( rei->status < 0 ) {
1510  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1511  "msiDataObjChksum: input inpParam1 error. status = %d", rei->status );
1512  return rei->status;
1513  }
1514 
1515  validKwFlags = CHKSUM_ALL_FLAG | FORCE_CHKSUM_FLAG | REPL_NUM_FLAG |
1517  if ( ( rei->status = parseMsKeyValStrForDataObjInp( msKeyValStr,
1518  myDataObjInp, KEY_WORD_KW, validKwFlags, &outBadKeyWd ) ) < 0 ) {
1519  if ( outBadKeyWd != NULL ) {
1520  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1521  "msiDataObjChksum: input keyWd - %s error. status = %d",
1522  outBadKeyWd, rei->status );
1523  free( outBadKeyWd );
1524  }
1525  else {
1526  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1527  "msiDataObjChksum: input msKeyValStr error. status = %d",
1528  rei->status );
1529  }
1530  return rei->status;
1531  }
1532 
1533  rei->status = rsDataObjChksum( rsComm, myDataObjInp, &chksum );
1534 
1535  if ( myDataObjInp == &dataObjInp ) {
1536  clearKeyVal( &myDataObjInp->condInput );
1537  }
1538 
1539  if ( rei->status >= 0 ) {
1540  fillStrInMsParam( outParam, chksum );
1541  free( chksum );
1542  }
1543  else {
1544  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1545  "msiDataObjChksum: rsDataObjChksum failed for %s, status = %d",
1546  myDataObjInp->objPath ,
1547  rei->status );
1548  }
1549 
1550  return rei->status;
1551 }
1552 
1590 int
1591 msiDataObjPhymv( msParam_t *inpParam1, msParam_t *inpParam2,
1592  msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *inpParam5,
1593  msParam_t *outParam, ruleExecInfo_t *rei ) {
1594  rsComm_t *rsComm;
1595  dataObjInp_t dataObjInp, *myDataObjInp = NULL;
1596  transferStat_t *transStat = NULL;
1597 
1598  RE_TEST_MACRO( " Calling msiDataObjPhymv" )
1599 
1600  if ( rei == NULL || rei->rsComm == NULL ) {
1601  rodsLog( LOG_ERROR,
1602  "msiDataObjPhymv: input rei or rsComm is NULL" );
1604  }
1605 
1606  rsComm = rei->rsComm;
1607 
1608  /* parse inpParam1 */
1609 
1610  if ( ( rei->status = parseMspForDataObjInp( inpParam1, &dataObjInp,
1611  &myDataObjInp, 0 ) ) < 0 ) {
1612  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1613  "msiDataObjPhymv: input inpParam1 error. status = %d", rei->status );
1614  return rei->status;
1615  }
1616 
1617  if ( ( rei->status = parseMspForCondInp( inpParam2, &myDataObjInp->condInput,
1618  DEST_RESC_NAME_KW ) ) < 0 ) {
1619  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1620  "msiDataObjPhymv: input inpParam2 error. status = %d", rei->status );
1621  return rei->status;
1622  }
1623 
1624  if ( ( rei->status = parseMspForCondInp( inpParam3, &myDataObjInp->condInput,
1625  RESC_NAME_KW ) ) < 0 ) {
1626  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1627  "msiDataObjPhymv: input inpParam3 error. status = %d", rei->status );
1628  return rei->status;
1629  }
1630 
1631  if ( ( rei->status = parseMspForCondInp( inpParam4, &myDataObjInp->condInput,
1632  REPL_NUM_KW ) ) < 0 ) {
1633  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1634  "msiDataObjPhymv: input inpParam4 error. status = %d", rei->status );
1635  return rei->status;
1636  }
1637 
1638  if ( ( rei->status = parseMspForCondInp( inpParam5, &myDataObjInp->condInput,
1639  ADMIN_KW ) ) < 0 ) {
1640  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1641  "msiDataObjPhymv: input inpParam5 error. status = %d", rei->status );
1642  return rei->status;
1643  }
1644 
1645  rei->status = rsDataObjPhymv( rsComm, myDataObjInp, &transStat );
1646 
1647  if ( transStat != NULL ) {
1648  free( transStat );
1649  }
1650 
1651  if ( myDataObjInp == &dataObjInp ) {
1652  clearKeyVal( &myDataObjInp->condInput );
1653  }
1654 
1655  if ( rei->status >= 0 ) {
1656  fillIntInMsParam( outParam, rei->status );
1657  }
1658  else {
1659  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1660  "msiDataObjPhymv: rsDataObjPhymv failed for %s, status = %d",
1661  myDataObjInp->objPath,
1662  rei->status );
1663  }
1664 
1665  return rei->status;
1666 }
1667 
1704 int
1705 msiDataObjRename( msParam_t *inpParam1, msParam_t *inpParam2,
1706  msParam_t *inpParam3, msParam_t *outParam, ruleExecInfo_t *rei ) {
1707  rsComm_t *rsComm;
1708  dataObjCopyInp_t dataObjRenameInp, *myDataObjRenameInp;
1709  dataObjInp_t *myDataObjInp = NULL;
1710 
1711  RE_TEST_MACRO( " Calling msiDataObjRename" )
1712 
1713  if ( rei == NULL || rei->rsComm == NULL ) {
1714  rodsLog( LOG_ERROR,
1715  "msiDataObjRename: input rei or rsComm is NULL" );
1717  }
1718 
1719  rsComm = rei->rsComm;
1720 
1721  /* parse inpParam1 */
1722  rei->status = parseMspForDataObjCopyInp( inpParam1, &dataObjRenameInp,
1723  &myDataObjRenameInp );
1724 
1725  if ( rei->status < 0 ) {
1726  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1727  "msiDataObjRename: input inpParam1 error. status = %d", rei->status );
1728  return rei->status;
1729  }
1730 
1731  /* parse inpParam2 */
1732  rei->status = parseMspForDataObjInp( inpParam2,
1733  &myDataObjRenameInp->destDataObjInp, &myDataObjInp, 1 );
1734 
1735  if ( rei->status < 0 ) {
1736  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1737  "msiDataObjRename: input inpParam2 error. status = %d", rei->status );
1738  return rei->status;
1739  }
1740 
1741  if ( inpParam3 != NULL ) {
1742  int myInt;
1743  myInt = parseMspForPosInt( inpParam3 );
1744  if ( myInt > 0 ) {
1745  myDataObjRenameInp->srcDataObjInp.oprType = RENAME_COLL;
1746  }
1747  else {
1748  myDataObjRenameInp->srcDataObjInp.oprType = RENAME_DATA_OBJ;
1749  }
1750  }
1751 
1752  rei->status = rsDataObjRename( rsComm, myDataObjRenameInp );
1753 
1754  if ( rei->status >= 0 ) {
1755  fillIntInMsParam( outParam, rei->status );
1756  }
1757  else {
1758  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1759  "msiDataObjRename: rsDataObjRename failed for %s, status = %d",
1760  myDataObjRenameInp->srcDataObjInp.objPath,
1761  rei->status );
1762  }
1763 
1764  return rei->status;
1765 }
1766 
1804 int
1805 msiDataObjTrim( msParam_t *inpParam1, msParam_t *inpParam2,
1806  msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *inpParam5,
1807  msParam_t *outParam, ruleExecInfo_t *rei ) {
1808  rsComm_t *rsComm;
1809  dataObjInp_t dataObjInp, *myDataObjInp = NULL;
1810 
1811  RE_TEST_MACRO( " Calling msiDataObjTrim" )
1812 
1813  if ( rei == NULL || rei->rsComm == NULL ) {
1814  rodsLog( LOG_ERROR,
1815  "msiDataObjTrim: input rei or rsComm is NULL" );
1817  }
1818 
1819  rsComm = rei->rsComm;
1820 
1821  /* parse inpParam1 */
1822 
1823  if ( ( rei->status = parseMspForDataObjInp( inpParam1, &dataObjInp,
1824  &myDataObjInp, 0 ) ) < 0 ) {
1825  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1826  "msiDataObjTrim: input inpParam1 error. status = %d", rei->status );
1827  return rei->status;
1828  }
1829 
1830  if ( ( rei->status = parseMspForCondInp( inpParam2, &myDataObjInp->condInput, RESC_NAME_KW ) ) < 0 ) {
1831  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1832  "msiDataObjTrim: input inpParam2 error. status = %d", rei->status );
1833  return rei->status;
1834  }
1835 
1836  if ( ( rei->status = parseMspForCondInp( inpParam3, &myDataObjInp->condInput,
1837  REPL_NUM_KW ) ) < 0 ) {
1838  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1839  "msiDataObjTrim: input inpParam3 error. status = %d", rei->status );
1840  return rei->status;
1841  }
1842 
1843  if ( ( rei->status = parseMspForCondInp( inpParam4, &myDataObjInp->condInput,
1844  COPIES_KW ) ) < 0 ) {
1845  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1846  "msiDataObjTrim: input inpParam4 error. status = %d", rei->status );
1847  return rei->status;
1848  }
1849 
1850  if ( ( rei->status = parseMspForCondInp( inpParam5, &myDataObjInp->condInput,
1851  ADMIN_KW ) ) < 0 ) {
1852  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1853  "msiDataObjTrim: input inpParam5 error. status = %d", rei->status );
1854  return rei->status;
1855  }
1856 
1857  rei->status = rsDataObjTrim( rsComm, myDataObjInp );
1858 
1859  if ( myDataObjInp == &dataObjInp ) {
1860  clearKeyVal( &myDataObjInp->condInput );
1861  }
1862 
1863  if ( rei->status >= 0 ) {
1864  fillIntInMsParam( outParam, rei->status );
1865  }
1866  else {
1867  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1868  "msiDataObjTrim: rsDataObjTrim failed for %s, status = %d",
1869  myDataObjInp->objPath,
1870  rei->status );
1871  }
1872 
1873  return rei->status;
1874 }
1875 
1910 int
1911 msiCollCreate( msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei ) {
1912  rsComm_t *rsComm;
1913  collInp_t collCreateInp, *myCollCreateInp;
1914  int flags;
1915 
1916  RE_TEST_MACRO( " Calling msiCollCreate" )
1917 
1918  if ( rei == NULL || rei->rsComm == NULL ) {
1919  rodsLog( LOG_ERROR,
1920  "msiCollCreate: input rei or rsComm is NULL" );
1922  }
1923 
1924  rsComm = rei->rsComm;
1925 
1926  /* parse inpParam1 */
1927  rei->status = parseMspForCollInp( inpParam1, &collCreateInp,
1928  &myCollCreateInp, 1 );
1929 
1930  if ( rei->status < 0 ) {
1931  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1932  "msiCollCreate: input inpParam1 error. status = %d", rei->status );
1933  return rei->status;
1934  }
1935 
1936  flags = parseMspForPosInt( inpParam2 );
1937 
1938  if ( flags > 0 ) {
1939  addKeyVal( &collCreateInp.condInput, RECURSIVE_OPR__KW, "" );
1940  }
1941  rei->status = rsCollCreate( rsComm, myCollCreateInp );
1942 
1943  if ( rei->status >= 0 ) {
1944  fillIntInMsParam( outParam, rei->status );
1945  }
1946  else {
1947  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
1948  "msiCollCreate: rsCollCreate failed %s, status = %d",
1949  collCreateInp.collName,
1950  rei->status );
1951  }
1952 
1953  if ( myCollCreateInp == &collCreateInp ) {
1954  clearKeyVal( &myCollCreateInp->condInput );
1955  }
1956 
1957  return rei->status;
1958 }
1959 
1960 
2003 int
2004 msiRmColl( msParam_t *inpParam1, msParam_t *msKeyValStr, msParam_t *outParam, ruleExecInfo_t *rei ) {
2005  rsComm_t *rsComm;
2006  collInp_t rmCollInp, *myRmCollInp;
2007  char *outBadKeyWd;
2008  int validKwFlags;
2009 
2010  RE_TEST_MACRO( " Calling msiRmColl" )
2011 
2012  if ( rei == NULL || rei->rsComm == NULL ) {
2013  rodsLog( LOG_ERROR,
2014  "msiRmColl: input rei or rsComm is NULL" );
2016  }
2017 
2018  rsComm = rei->rsComm;
2019 
2020  /* parse inpParam1 */
2021  rei->status = parseMspForCollInp( inpParam1, &rmCollInp,
2022  &myRmCollInp, 1 );
2023 
2024  if ( rei->status < 0 ) {
2025  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2026  "msiRmColl: input inpParam1 error. status = %d", rei->status );
2027  return rei->status;
2028  }
2029 
2030  validKwFlags = RMTRASH_FLAG | ADMIN_RMTRASH_FLAG |
2032  if ( ( rei->status = parseMsKeyValStrForCollInp( msKeyValStr,
2033  myRmCollInp, KEY_WORD_KW, validKwFlags, &outBadKeyWd ) ) < 0 ) {
2034  if ( outBadKeyWd != NULL ) {
2035  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2036  "msiRmColl: input keyWd - %s error. status = %d",
2037  outBadKeyWd, rei->status );
2038  free( outBadKeyWd );
2039  }
2040  else {
2041  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2042  "msiRmColl: input msKeyValStr error. status = %d",
2043  rei->status );
2044  }
2045  return rei->status;
2046  }
2047 
2048  addKeyVal( &myRmCollInp->condInput, RECURSIVE_OPR__KW, "" );
2049 
2050  rei->status = rsRmColl( rsComm, myRmCollInp, NULL );
2051 
2052  if ( rei->status >= 0 ) {
2053  fillIntInMsParam( outParam, rei->status );
2054  }
2055  else {
2056  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2057  "msiRmColl: rsRmColl failed for %s, status = %d",
2058  myRmCollInp->collName,
2059  rei->status );
2060  }
2061 
2062  if ( myRmCollInp == &rmCollInp ) {
2063  clearKeyVal( &myRmCollInp->condInput );
2064  }
2065 
2066  return rei->status;
2067 }
2068 
2112 int
2113 msiPhyPathReg( msParam_t *inpParam1, msParam_t *inpParam2,
2114  msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *outParam,
2115  ruleExecInfo_t *rei ) {
2116  rsComm_t *rsComm;
2117  dataObjInp_t dataObjInp, *myDataObjInp = NULL;
2118 
2119  RE_TEST_MACRO( " Calling msiPhyPathReg" )
2120 
2121  if ( rei == NULL || rei->rsComm == NULL ) {
2122  rodsLog( LOG_ERROR,
2123  "msiPhyPathReg: input rei or rsComm is NULL" );
2125  }
2126 
2127  rsComm = rei->rsComm;
2128 
2129  /* parse inpParam1 */
2130  rei->status = parseMspForDataObjInp( inpParam1, &dataObjInp,
2131  &myDataObjInp, 1 );
2132 
2133  if ( rei->status < 0 ) {
2134  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2135  "msiPhyPathReg: input inpParam1 error. status = %d", rei->status );
2136  return rei->status;
2137  }
2138 
2139  if ( ( rei->status = parseMspForCondInp( inpParam2, &myDataObjInp->condInput,
2140  DEST_RESC_NAME_KW ) ) < 0 ) {
2141  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2142  "msiPhyPathReg: input inpParam2 error. status = %d", rei->status );
2143  return rei->status;
2144  }
2145 
2146  if ( ( rei->status = parseMspForCondInp( inpParam3, &myDataObjInp->condInput,
2147  FILE_PATH_KW ) ) < 0 ) {
2148  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2149  "msiPhyPathReg: input inpParam3 error. status = %d", rei->status );
2150  return rei->status;
2151  }
2152 
2153  if ( ( rei->status = parseMspForPhyPathReg( inpParam4,
2154  &myDataObjInp->condInput ) ) < 0 ) {
2155  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2156  "msiPhyPathReg: input inpParam4 error. status = %d", rei->status );
2157  return rei->status;
2158  }
2159 
2160  rei->status = rsPhyPathReg( rsComm, myDataObjInp );
2161 
2162  if ( myDataObjInp == &dataObjInp ) {
2163  clearKeyVal( &myDataObjInp->condInput );
2164  }
2165 
2166  if ( rei->status >= 0 ) {
2167  fillIntInMsParam( outParam, rei->status );
2168  }
2169  else {
2170  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2171  "msiPhyPathReg: rsPhyPathReg failed for %s, status = %d",
2172  myDataObjInp->objPath,
2173  rei->status );
2174  }
2175 
2176  return rei->status;
2177 }
2178 
2210 int
2211 msiObjStat( msParam_t *inpParam1, msParam_t *outParam, ruleExecInfo_t *rei ) {
2212  rsComm_t *rsComm;
2213  dataObjInp_t dataObjInp, *myDataObjInp = NULL;
2214 
2215  RE_TEST_MACRO( " Calling msiObjStat" )
2216 
2217  if ( rei == NULL || rei->rsComm == NULL ) {
2218  rodsLog( LOG_ERROR,
2219  "msiObjStat: input rei or rsComm is NULL" );
2221  }
2222 
2223  rsComm = rei->rsComm;
2224 
2225  /* parse inpParam1 */
2226  rei->status = parseMspForDataObjInp( inpParam1, &dataObjInp,
2227  &myDataObjInp, 0 );
2228 
2229  if ( rei->status < 0 ) {
2230  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2231  "msiObjStat: input inpParam1 error. status = %d", rei->status );
2232  return rei->status;
2233  }
2234 
2235  rodsObjStat_t *rodsObjStatOut = NULL;
2236  rei->status = rsObjStat( rsComm, myDataObjInp, &rodsObjStatOut );
2237 
2238  if ( rei->status >= 0 ) {
2239  fillMsParam( outParam, NULL, RodsObjStat_MS_T, rodsObjStatOut, NULL );
2240  }
2241  else {
2242  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2243  "msiObjStat: rsObjStat failed for %s, status = %d",
2244  myDataObjInp->objPath,
2245  rei->status );
2246  }
2247 
2248  return rei->status;
2249 }
2250 
2298 int
2299 msiDataObjRsync( msParam_t *inpParam1, msParam_t *inpParam2,
2300  msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *outParam,
2301  ruleExecInfo_t *rei ) {
2302  rsComm_t *rsComm;
2303  dataObjInp_t dataObjInp, *myDataObjInp = NULL;
2304  msParamArray_t *outParamArray = NULL;
2305  char *rsyncMode;
2306  char *targCollection, *tmpPtr;
2307  char targPath[MAX_NAME_LEN];
2308 
2309  RE_TEST_MACRO( " Calling msiDataObjRsync" )
2310 
2311  if ( rei == NULL || rei->rsComm == NULL ) {
2312  rodsLog( LOG_ERROR,
2313  "msiDataObjRsync: input rei or rsComm is NULL" );
2315  }
2316 
2317  rsComm = rei->rsComm;
2318 
2319  /* parse inpParam1 */
2320  rei->status = parseMspForDataObjInp( inpParam1, &dataObjInp,
2321  &myDataObjInp, 1 );
2322 
2323  if ( rei->status < 0 ) {
2324  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2325  "msiDataObjRsync: input inpParam1 error. status = %d", rei->status );
2326  return rei->status;
2327  }
2328 
2329  if ( ( rei->status = parseMspForCondInp( inpParam2, &myDataObjInp->condInput,
2330  RSYNC_MODE_KW ) ) < 0 ) {
2331  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2332  "msiDataObjRsync: input inpParam2 error. status = %d", rei->status );
2333  return rei->status;
2334  }
2335 
2336 
2337  if ( ( rei->status = parseMspForCondInp( inpParam3, &myDataObjInp->condInput,
2338  DEST_RESC_NAME_KW ) ) < 0 ) {
2339  }
2340 
2341  if ( ( rei->status = parseMspForCondInp( inpParam4, &myDataObjInp->condInput,
2342  RSYNC_DEST_PATH_KW ) ) < 0 ) {
2343  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2344  "msiDataObjRsync: input inpParam4 error. status = %d", rei->status );
2345  return rei->status;
2346  }
2347 
2348  /* just call rsDataObjRsync for now. client must supply the chksum of
2349  * the local file. Could ask the client to do a chksum first */
2350 
2351  rsyncMode = getValByKey( &myDataObjInp->condInput, RSYNC_MODE_KW );
2352  if ( rsyncMode == NULL ) {
2353  rodsLog( LOG_ERROR,
2354  "msiDataObjRsync: RSYNC_MODE_KW input is missing" );
2356  return rei->status;
2357  }
2358 
2359  if ( strcmp( rsyncMode, IRODS_TO_LOCAL ) == 0 ||
2360  strcmp( rsyncMode, LOCAL_TO_IRODS ) == 0 ) {
2361  rodsLog( LOG_ERROR,
2362  "msiDataObjRsync: local/iRODS rsync not supported for %s",
2363  myDataObjInp->objPath );
2365  return rei->status;
2366  }
2367  else if ( strcmp( rsyncMode, IRODS_TO_COLLECTION ) == 0 ) {
2368  targCollection = getValByKey( &myDataObjInp->condInput,
2370  if ( targCollection == NULL ) {
2371  rodsLog( LOG_ERROR,
2372  "msiDataObjRsync: RSYNC_DEST_PATH_KW input for %s is missing",
2373  myDataObjInp->objPath );
2374  rei->status = USER_INPUT_PATH_ERR;
2375  return rei->status;
2376  }
2377  tmpPtr = strchr( myDataObjInp->objPath + 1, '/' );
2378  if ( tmpPtr == NULL ) {
2379  rodsLog( LOG_ERROR,
2380  "msiDataObjRsync: problem parsing %s", myDataObjInp->objPath );
2381  rei->status = USER_INPUT_PATH_ERR;
2382  return rei->status;
2383  }
2384  snprintf( targPath, MAX_NAME_LEN, "%s%s", targCollection, tmpPtr );
2385  addKeyVal( &myDataObjInp->condInput, RSYNC_MODE_KW, IRODS_TO_IRODS );
2386  addKeyVal( &myDataObjInp->condInput, RSYNC_DEST_PATH_KW, targPath );
2387  }
2388 
2389  rei->status = rsDataObjRsync( rsComm, myDataObjInp, &outParamArray );
2390 
2391  if ( outParamArray != NULL ) {
2392  clearMsParamArray( outParamArray, 1 );
2393  free( outParamArray );
2394  }
2395  if ( myDataObjInp == &dataObjInp ) {
2396  clearKeyVal( &myDataObjInp->condInput );
2397  }
2398 
2399  if ( rei->status >= 0 ) {
2400  fillIntInMsParam( outParam, rei->status );
2401  }
2402  else {
2403  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2404  "msiDataObjRsync: rsDataObjRsync failed for %s, status = %d",
2405  myDataObjInp->objPath,
2406  rei->status );
2407  }
2408 
2409  return rei->status;
2410 }
2411 
2450 int
2451 msiCollRsync( msParam_t *inpParam1, msParam_t *inpParam2,
2452  msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *outParam,
2453  ruleExecInfo_t *rei ) {
2454  rsComm_t *rsComm;
2455  dataObjInp_t dataObjInp;
2456  char *rsyncMode;
2457  char *srcColl = NULL;
2458  char *destColl = NULL;
2459 
2460  RE_TEST_MACRO( " Calling msiCollRsync" )
2461 
2462  if ( rei == NULL || rei->rsComm == NULL ) {
2463  rodsLog( LOG_ERROR,
2464  "msiCollRsync: input rei or rsComm is NULL" );
2466  }
2467 
2468  rsComm = rei->rsComm;
2469 
2470  bzero( &dataObjInp, sizeof( dataObjInp ) );
2471 
2472  /* parse inpParam1 */
2473  srcColl = parseMspForStr( inpParam1 );
2474 
2475  if ( srcColl == NULL ) {
2477  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2478  "msiCollRsync: input inpParam1 error. status = %d", rei->status );
2479  return rei->status;
2480  }
2481 
2482  /* parse inpParam2 */
2483  destColl = parseMspForStr( inpParam2 );
2484 
2485  if ( destColl == NULL ) {
2487  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2488  "msiCollRsync: input inpParam2 error. status = %d", rei->status );
2489  return rei->status;
2490  }
2491 
2492  if ( ( rei->status = parseMspForCondInp( inpParam3, &dataObjInp.condInput,
2493  DEST_RESC_NAME_KW ) ) < 0 ) {
2494  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2495  "msiCollRsync: input inpParam3 error. status = %d", rei->status );
2496  return rei->status;
2497  }
2498 
2499  if ( ( rei->status = parseMspForCondInp( inpParam4, &dataObjInp.condInput,
2500  RSYNC_MODE_KW ) ) < 0 ) {
2501  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2502  "msiCollRsync: input inpParam4 error. status = %d", rei->status );
2503  return rei->status;
2504  }
2505 
2506  /* just call rsDataObjRsync for now. client must supply the chksum of
2507  * the local file. Could ask the client to do a chksum first */
2508 
2509  rsyncMode = getValByKey( &dataObjInp.condInput, RSYNC_MODE_KW );
2510  if ( rsyncMode == NULL ) {
2511  rodsLog( LOG_ERROR,
2512  "msiCollRsync: RSYNC_MODE_KW input is missing" );
2514  return rei->status;
2515  }
2516 
2517  if ( strcmp( rsyncMode, IRODS_TO_LOCAL ) == 0 ||
2518  strcmp( rsyncMode, LOCAL_TO_IRODS ) == 0 ) {
2519  rodsLog( LOG_ERROR,
2520  "msiCollRsync: local/iRODS rsync not supported for %s",
2521  srcColl );
2523  return rei->status;
2524  }
2525 
2526  rei->status = _rsCollRsync( rsComm, &dataObjInp, srcColl, destColl );
2527 
2528  clearKeyVal( &dataObjInp.condInput );
2529 
2530  if ( rei->status >= 0 ) {
2531  fillIntInMsParam( outParam, rei->status );
2532  }
2533  else {
2534  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2535  "msiCollRsync: rsDataObjRsync failed for %s, status = %d",
2536  srcColl,
2537  rei->status );
2538  }
2539 
2540  return rei->status;
2541 }
2542 
2543 int
2544 _rsCollRsync( rsComm_t *rsComm, dataObjInp_t *dataObjInp,
2545  char *srcColl, char *destColl ) {
2546  collInp_t openCollInp;
2547  collEnt_t *collEnt;
2548  int handleInx;
2549  char parPath[MAX_NAME_LEN], childPath[MAX_NAME_LEN];
2550  char destChildPath[MAX_NAME_LEN];
2551  msParamArray_t *outParamArray = NULL;
2552  int status = 0;
2553  int status1 = 0;
2554 
2555  memset( &openCollInp, 0, sizeof( openCollInp ) );
2556  rstrcpy( openCollInp.collName, srcColl, MAX_NAME_LEN );
2557  openCollInp.flags = 0;
2558  handleInx = rsOpenCollection( rsComm, &openCollInp );
2559  if ( handleInx < 0 ) {
2560  rodsLog( LOG_ERROR,
2561  "_rsCollRsync: rsOpenCollection of %s error. status = %d",
2562  openCollInp.collName, handleInx );
2563  return handleInx;
2564  }
2565 
2566  rsMkCollR( rsComm, "/", destColl );
2567  while ( ( status1 = rsReadCollection( rsComm, &handleInx, &collEnt ) ) >= 0 ) {
2568  if ( collEnt->objType == DATA_OBJ_T ) {
2569  snprintf( dataObjInp->objPath, MAX_NAME_LEN, "%s/%s",
2570  srcColl, collEnt->dataName );
2571  snprintf( destChildPath, MAX_NAME_LEN, "%s/%s",
2572  destColl, collEnt->dataName );
2573  addKeyVal( &dataObjInp->condInput, RSYNC_DEST_PATH_KW,
2574  destChildPath );
2575  status = rsDataObjRsync( rsComm, dataObjInp, &outParamArray );
2576  if ( outParamArray != NULL ) {
2577  clearMsParamArray( outParamArray, 1 );
2578  free( outParamArray );
2579  }
2580  }
2581  else if ( collEnt->objType == COLL_OBJ_T ) {
2582  if ( ( status = splitPathByKey(
2583  collEnt->collName, parPath, MAX_NAME_LEN, childPath, MAX_NAME_LEN, '/' ) ) < 0 ) {
2585  "_rsCollRsync:: splitPathByKey for %s error, status = %d",
2586  collEnt->collName, status );
2587  freeCollEnt( collEnt );
2588  return status;
2589  }
2590  snprintf( destChildPath, MAX_NAME_LEN, "%s/%s",
2591  destColl, childPath );
2592 
2593  status = _rsCollRsync( rsComm, dataObjInp, collEnt->collName,
2594  destChildPath );
2595  }
2596  free( collEnt ); /* just free collEnt but not content */
2597  if ( status < 0 ) {
2598  break;
2599  }
2600  }
2601  rsCloseCollection( rsComm, &handleInx );
2602  if ( status1 < 0 && status1 != CAT_NO_ROWS_FOUND ) {
2603  return status1;
2604  }
2605  else {
2606  return status;
2607  }
2608 }
2609 
2658 int
2659 msiExecCmd( msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3,
2660  msParam_t *inpParam4, msParam_t *inpParam5, msParam_t *outParam,
2661  ruleExecInfo_t *rei ) {
2662  rsComm_t *rsComm;
2663  execCmd_t execCmdInp, *myExecCmdInp;
2664  execCmdOut_t *execCmdOut = NULL;
2665  char *tmpPtr;
2666 
2667  RE_TEST_MACRO( " Calling msiExecCmd" )
2668 
2669  if ( rei == NULL || rei->rsComm == NULL ) {
2670  rodsLog( LOG_ERROR,
2671  "msiExecCmd: input rei or rsComm is NULL" );
2673  }
2674 
2675  rsComm = rei->rsComm;
2676 
2677  /* parse inpParam1 */
2678  rei->status = parseMspForExecCmdInp( inpParam1, &execCmdInp,
2679  &myExecCmdInp );
2680 
2681  if ( rei->status < 0 ) {
2682  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2683  "msiExecCmd: input inpParam1 error. status = %d", rei->status );
2684  return rei->status;
2685  }
2686 
2687  if ( ( tmpPtr = parseMspForStr( inpParam2 ) ) != NULL ) {
2688  rstrcpy( myExecCmdInp->cmdArgv, tmpPtr, HUGE_NAME_LEN );
2689  }
2690 
2691  if ( ( tmpPtr = parseMspForStr( inpParam3 ) ) != NULL ) {
2692  rstrcpy( myExecCmdInp->execAddr, tmpPtr, LONG_NAME_LEN );
2693  }
2694 
2695  if ( ( tmpPtr = parseMspForStr( inpParam4 ) ) != NULL ) {
2696  rstrcpy( myExecCmdInp->hintPath, tmpPtr, MAX_NAME_LEN );
2697  }
2698 
2699  if ( parseMspForPosInt( inpParam5 ) > 0 ) {
2700  myExecCmdInp->addPathToArgv = 1;
2701  }
2702 
2703  if ( strlen( rei->ruleName ) > 0 &&
2704  strcmp( rei->ruleName, EXEC_MY_RULE_KW ) != 0 ) {
2705  /* does not come from rsExecMyRule */
2706  addKeyVal( &myExecCmdInp->condInput, EXEC_CMD_RULE_KW, rei->ruleName );
2707  }
2708  rei->status = rsExecCmd( rsComm, myExecCmdInp, &execCmdOut );
2709 
2710  if ( myExecCmdInp == &execCmdInp ) {
2711  clearKeyVal( &myExecCmdInp->condInput );
2712  }
2713 
2714  if ( execCmdOut != NULL ) { /* something was written to it */
2715  fillMsParam( outParam, NULL, ExecCmdOut_MS_T, execCmdOut, NULL );
2716  }
2717 
2718  if ( rei->status < 0 ) {
2719  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2720  "msiExecCmd: rsExecCmd failed for %s, status = %d",
2721  myExecCmdInp->cmd,
2722  rei->status );
2723  }
2724 
2725  return rei->status;
2726 }
2727 
2728 
2786 int
2787 msiCollRepl( msParam_t *collection, msParam_t *msKeyValStr, msParam_t *status,
2788  ruleExecInfo_t *rei ) {
2789  /* for parsing collection input param */
2790  collInp_t collInpCache, *collInp;
2791  char *outBadKeyWd;
2792  int validKwFlags;
2793 
2794  /* misc. to avoid repeating rei->rsComm */
2795  rsComm_t *rsComm;
2796 
2797 
2798 
2800  /* For testing mode when used with irule --test */
2801  RE_TEST_MACRO( " Calling msiCollRepl" )
2802 
2803  /* Sanity checks */
2804  if ( rei == NULL || rei->rsComm == NULL ) {
2805  rodsLog( LOG_ERROR, "msiCollRepl: inp rei or rsComm is NULL." );
2807  }
2808 
2809  rsComm = rei->rsComm;
2810 
2811 
2813  /* Parse target collection */
2814  rei->status =
2815  parseMspForCollInp( collection, &collInpCache, &collInp, 0 );
2816 
2817  if ( rei->status < 0 ) {
2818  rodsLog( LOG_ERROR,
2819  "msiCollRepl: input collection error. status = %d", rei->status );
2820  return rei->status;
2821  }
2822 
2823 
2824  /* Parse resource name and directly write to collReplInp */
2825  validKwFlags = COLL_NAME_FLAG | DEST_RESC_NAME_FLAG |
2828  rei->status = parseMsKeyValStrForCollInp( msKeyValStr, collInp,
2829  DEST_RESC_NAME_KW, validKwFlags, &outBadKeyWd );
2830 
2831  if ( rei->status < 0 ) {
2832  if ( outBadKeyWd != NULL ) {
2833  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2834  "msiCollRepl: input keyWd - %s error. status = %d",
2835  outBadKeyWd, rei->status );
2836  free( outBadKeyWd );
2837  }
2838  else {
2839  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2840  "msiCollRepl: input msKeyValStr error. status = %d",
2841  rei->status );
2842  }
2843  return rei->status;
2844  }
2845 
2846 
2848  /* Call rsCollRepl() */
2849  rei->status = rsCollRepl( rsComm, collInp, NULL );
2850 
2851 
2853  /* Send out op status */
2854  fillIntInMsParam( status, rei->status );
2855 
2856  return rei->status;
2857 }
2858 
2896 int
2897 msiTarFileExtract( msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *outParam, ruleExecInfo_t *rei ) {
2898  rsComm_t *rsComm;
2899  structFileExtAndRegInp_t structFileExtAndRegInp,
2900  *myStructFileExtAndRegInp;
2901  keyValPair_t regParam;
2902  modDataObjMeta_t modDataObjMetaInp;
2903  int rc1;
2904  char origDataType[NAME_LEN];
2905 
2906  RE_TEST_MACRO( " Calling msiTarFileExtract" )
2907 
2908  if ( rei == NULL || rei->rsComm == NULL ) {
2909  rodsLog( LOG_ERROR,
2910  "msiTarFileExtract: input rei or rsComm is NULL" );
2911  if ( rei ) {
2913  }
2915  }
2916 
2917  rsComm = rei->rsComm;
2918 
2919  /* start building the structFileExtAndRegInp instance.
2920  extract from inpParam1 the tar file object path: tarFilePath
2921  and from inpParam2 the collection target: colTarget */
2922 
2923  if ( inpParam1 == NULL || inpParam2 == NULL ) {
2924  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2925  "msiTarFileExtract: input Param1 and/or Param2 are NULL" );
2927  return rei->status;
2928  }
2929 
2930  if ( strcmp( inpParam1->type, STR_MS_T ) == 0 ) {
2931  bzero( &structFileExtAndRegInp, sizeof( structFileExtAndRegInp ) );
2932  myStructFileExtAndRegInp = &structFileExtAndRegInp;
2933  snprintf( myStructFileExtAndRegInp->objPath, sizeof( myStructFileExtAndRegInp->objPath ),
2934  "%s", ( char* )inpParam1->inOutStruct );
2935  }
2936  else if ( strcmp( inpParam1->type, StructFileExtAndRegInp_MS_T ) == 0 ) {
2937  myStructFileExtAndRegInp =
2938  ( structFileExtAndRegInp_t * ) inpParam1->inOutStruct;
2939  }
2940  else {
2942  return rei->status;
2943  }
2944 
2945  if ( strcmp( inpParam2->type, STR_MS_T ) == 0 ) {
2946  if ( strcmp( ( char * ) inpParam2->inOutStruct, "null" ) != 0 ) {
2947  snprintf( myStructFileExtAndRegInp->collection, sizeof( myStructFileExtAndRegInp->collection ),
2948  "%s", ( char* )inpParam2->inOutStruct );
2949  }
2950  }
2951  else {
2952  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
2953  "msiTarFileExtract: Unsupported input Param2 type %s",
2954  inpParam2->type );
2956  return rei->status;
2957  }
2958 
2959  if ( inpParam3 != NULL && strcmp( inpParam3->type, STR_MS_T ) == 0 &&
2960  strcmp( ( char * ) inpParam3->inOutStruct, "null" ) != 0 ) {
2961  addKeyVal( &myStructFileExtAndRegInp->condInput, DEST_RESC_NAME_KW,
2962  ( char * ) inpParam3->inOutStruct );
2963  /* RESC_NAME_KW is needed so Open will pick this resource */
2964  addKeyVal( &myStructFileExtAndRegInp->condInput, RESC_NAME_KW,
2965  ( char * ) inpParam3->inOutStruct );
2966  }
2967 
2968  if ( rei->doi != NULL ) { /* rei->doi may not exist */
2969  /* retrieve the input object data_type in order to rollback in case
2970  * of a tar extraction problem */
2971  snprintf( origDataType, sizeof( origDataType ), "%s", rei->doi->dataType );
2972  /* modify the input object data_type to "tar file" */
2973  memset( &regParam, 0, sizeof( regParam ) );
2974  addKeyVal( &regParam, DATA_TYPE_KW, "tar file" );
2975  modDataObjMetaInp.dataObjInfo = rei->doi;
2976  modDataObjMetaInp.regParam = &regParam;
2977  rc1 = rsModDataObjMeta( rsComm, &modDataObjMetaInp );
2978  if ( rc1 < 0 ) {
2979  irods::log( ERROR( rc1, "rsModDataObjMeta failed." ) );
2980  }
2981  }
2982 
2983  /* tar file extraction */
2984  rei->status = rsStructFileExtAndReg( rsComm, myStructFileExtAndRegInp );
2985  if ( rei->status < 0 && rei->doi != NULL ) {
2986  rodsLog( LOG_ERROR, "msiTarFileExtract: tar file extraction failed" );
2987  /* switch back to the original input object data_type as tar
2988  * extraction failed */
2989  memset( &regParam, 0, sizeof( regParam ) );
2990  addKeyVal( &regParam, DATA_TYPE_KW, origDataType );
2991  rc1 = rsModDataObjMeta( rsComm, &modDataObjMetaInp );
2992  if ( rc1 < 0 ) {
2993  irods::log( ERROR( rc1, "rsModDataObjMeta failed." ) );
2994  }
2995  }
2996 
2997  fillIntInMsParam( outParam, rei->status );
2998 
2999  return rei->status;
3000 }
3001 
3039 int
3040 msiTarFileCreate( msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *inpParam4, ruleExecInfo_t *rei ) {
3041  rsComm_t *rsComm;
3042  structFileExtAndRegInp_t structFileExtAndRegInp,
3043  *myStructFileExtAndRegInp;
3044 
3045  RE_TEST_MACRO( " Calling msiTarFileCreate" )
3046 
3047  if ( rei == NULL || rei->rsComm == NULL ) {
3048  rodsLog( LOG_ERROR,
3049  "msiTarFileCreate: input rei or rsComm is NULL" );
3050  if ( rei ) {
3052  }
3054  }
3055 
3056  rsComm = rei->rsComm;
3057 
3058  /* start building the structFileExtAndRegInp instance.
3059  extract from inpParam1 the tar file object path: tarFilePath
3060  and from inpParam2 the target collection: colTarget */
3061 
3062  if ( inpParam1 == NULL || inpParam2 == NULL ) {
3063  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
3064  "msiTarFileCreate: input Param1 and/or Param2 are NULL" );
3066  return rei->status;
3067  }
3068 
3069  if ( strcmp( inpParam1->type, STR_MS_T ) == 0 ) {
3070  bzero( &structFileExtAndRegInp, sizeof( structFileExtAndRegInp ) );
3071  myStructFileExtAndRegInp = &structFileExtAndRegInp;
3072  snprintf( myStructFileExtAndRegInp->objPath, sizeof( myStructFileExtAndRegInp->objPath ),
3073  "%s", ( char* )inpParam1->inOutStruct );
3074  }
3075  else if ( strcmp( inpParam1->type, StructFileExtAndRegInp_MS_T ) == 0 ) {
3076  myStructFileExtAndRegInp =
3077  ( structFileExtAndRegInp_t * ) inpParam1->inOutStruct;
3078  }
3079  else {
3081  return rei->status;
3082  }
3083 
3084  if ( strcmp( inpParam2->type, STR_MS_T ) == 0 ) {
3085  if ( strcmp( ( char * ) inpParam2->inOutStruct, "null" ) != 0 ) {
3086  snprintf( myStructFileExtAndRegInp->collection, sizeof( myStructFileExtAndRegInp->collection ),
3087  "%s", ( char* )inpParam2->inOutStruct );
3088  }
3089  }
3090  else {
3091  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
3092  "msiTarFileCreate: Unsupported input Param2 type %s",
3093  inpParam2->type );
3095  return rei->status;
3096  }
3097 
3098  if ( inpParam3 != NULL && strcmp( inpParam3->type, STR_MS_T ) == 0 &&
3099  strcmp( ( char * ) inpParam3->inOutStruct, "null" ) != 0 ) {
3100  addKeyVal( &myStructFileExtAndRegInp->condInput, DEST_RESC_NAME_KW,
3101  ( char * ) inpParam3->inOutStruct );
3102  }
3103 
3104  if ( inpParam4 != NULL && strcmp( inpParam4->type, STR_MS_T ) == 0 &&
3105  strcmp( ( char * ) inpParam4->inOutStruct, "force" ) == 0 ) {
3106  addKeyVal( &myStructFileExtAndRegInp->condInput, FORCE_FLAG_KW, "" );
3107  }
3108 
3109  /* tar file extraction */
3110  rei->status = rsStructFileBundle( rsComm, myStructFileExtAndRegInp );
3111 
3112  return rei->status;
3113 
3114 }
3115 
3116 
3117 
3160 int
3161 msiPhyBundleColl( msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei ) {
3162  rsComm_t *rsComm;
3163  structFileExtAndRegInp_t structFileExtAndRegInp,
3164  *myStructFileExtAndRegInp;
3165 
3166  RE_TEST_MACRO( " Calling msiPhyBundleColl" )
3167 
3168  if ( rei == NULL || rei->rsComm == NULL ) {
3169  rodsLog( LOG_ERROR,
3170  "msiPhyBundleColl: input rei or rsComm is NULL" );
3171  if ( rei ) {
3173  }
3175  }
3176 
3177  rsComm = rei->rsComm;
3178 
3179  /* start building the structFileExtAndRegInp instance.
3180  extract from inpParam1 the tar file object path: tarFilePath
3181  and from inpParam2 the target collection: colTarget */
3182 
3183 
3184  if ( inpParam1 == NULL ) {
3185  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
3186  "msiPhyBundleColl: input Param1 is NULL" );
3188  return rei->status;
3189  }
3190 
3191  // For consistency with iphybun
3192  if ( rei->uoic->authInfo.authFlag < LOCAL_PRIV_USER_AUTH ) {
3193  rei->status = SYS_NO_API_PRIV;
3194  rodsLog( LOG_ERROR, "msiPhyBundleColl: User %s does not have sufficient privilege, status = %d",
3195  rei->uoic->userName, rei->status );
3196  return rei->status;
3197  }
3198 
3199 
3200  if ( strcmp( inpParam1->type, STR_MS_T ) == 0 ) {
3201  bzero( &structFileExtAndRegInp, sizeof( structFileExtAndRegInp ) );
3202  myStructFileExtAndRegInp = &structFileExtAndRegInp;
3203  snprintf( myStructFileExtAndRegInp->collection, sizeof( myStructFileExtAndRegInp->collection ),
3204  "%s", ( char* )inpParam1->inOutStruct );
3205 
3206  }
3207  else if ( strcmp( inpParam1->type, StructFileExtAndRegInp_MS_T ) == 0 ) {
3208  myStructFileExtAndRegInp =
3209  ( structFileExtAndRegInp_t * ) inpParam1->inOutStruct;
3210 
3211  }
3212  else {
3213 
3215  return rei->status;
3216  }
3217 
3218  if ( inpParam2 != NULL && strcmp( inpParam2->type, STR_MS_T ) == 0 &&
3219  strcmp( ( char * ) inpParam2->inOutStruct, "null" ) != 0 ) {
3220  /* parse the input parameter which is: <string> or <string>++++N=<int>.... */
3221  std::vector<std::string> tokens;
3222  boost::algorithm::split_regex( tokens, ( char * ) inpParam2->inOutStruct, boost::regex( "\\+\\+\\+\\+" ) );
3223  if ( !tokens[0].empty() ) {
3224  addKeyVal( &myStructFileExtAndRegInp->condInput, DEST_RESC_NAME_KW, tokens[0].c_str() );
3225  }
3226  for ( size_t i = 1; i < tokens.size(); i++ ) {
3227  if ( tokens[i].empty() ) {
3228  continue;
3229  }
3230  std::vector<std::string> current_arg;
3231  boost::algorithm::split_regex( current_arg, tokens[i], boost::regex( "=" ) );
3232  if ( current_arg.size() != 2 || current_arg[0].size() != 1 ) {
3233  rodsLog( LOG_ERROR, "msiPhyBundleColl called with improperly formatted arguments" );
3234  continue;
3235  }
3236  switch ( current_arg[0].c_str()[0] ) {
3237  case 'N':
3238  addKeyVal( &myStructFileExtAndRegInp->condInput, MAX_SUB_FILE_KW, current_arg[1].c_str() );
3239  break;
3240  case 'S':
3241  addKeyVal( &myStructFileExtAndRegInp->condInput, RESC_NAME_KW, current_arg[1].c_str() );
3242  break;
3243  case 's':
3244  addKeyVal( &myStructFileExtAndRegInp->condInput, MAX_BUNDLE_SIZE_KW, current_arg[1].c_str() );
3245  break;
3246  default:
3247  rodsLog( LOG_ERROR, "msiPhyBundleColl called with improperly formatted arguments" );
3248  }
3249  }
3250  }
3251 
3252  /* tar file extraction */
3253  rei->status = rsPhyBundleColl( rsComm, myStructFileExtAndRegInp );
3254 
3255 
3256  fillIntInMsParam( outParam, rei->status );
3257 
3258 
3259  return rei->status;
3260 
3261 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
getValByKey
char * getValByKey(const keyValPair_t *condInput, const char *keyWord)
Definition: rcMisc.cpp:675
DataObjInp::objPath
char objPath[(1024+64)]
Definition: dataObjInpOut.h:66
OpenedDataObjInp
Definition: dataObjInpOut.h:104
RESC_NAME_KW
#define RESC_NAME_KW
Definition: rodsKeyWdDef.h:19
NUM_THREADS_FLAG
#define NUM_THREADS_FLAG
Definition: msParam.h:125
ADMIN_FLAG
#define ADMIN_FLAG
Definition: msParam.h:114
NULL
#define NULL
Definition: rodsDef.h:70
rsCollCreate
int rsCollCreate(rsComm_t *rsComm, collInp_t *collCreateInp)
Definition: rsCollCreate.cpp:52
MAX_SUB_FILE_KW
#define MAX_SUB_FILE_KW
Definition: rodsKeyWdDef.h:123
rsComm_t
Definition: rcConnect.h:145
IRODS_TO_IRODS
#define IRODS_TO_IRODS
Definition: rodsDef.h:126
DataObjCopyInp::srcDataObjInp
dataObjInp_t srcDataObjInp
Definition: dataObjCopy.h:26
ExecCmd::execAddr
char execAddr[256]
Definition: execCmd.h:13
irods.pyparsing.empty
empty
Definition: pyparsing.py:3430
rsReadCollection
int rsReadCollection(rsComm_t *rsComm, int *handleInxInp, collEnt_t **collEnt)
Definition: rsReadCollection.cpp:15
NO_VALUES_FOUND
@ NO_VALUES_FOUND
Definition: rodsErrorTable.h:680
transferStat_t
Definition: objInfo.h:291
ExecCmd::hintPath
char hintPath[(1024+64)]
Definition: execCmd.h:14
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
rsOpenCollection
int rsOpenCollection(rsComm_t *rsComm, collInp_t *openCollInp)
Definition: rsOpenCollection.cpp:16
NO_LOCAL_FILE_RSYNC_IN_MSI
@ NO_LOCAL_FILE_RSYNC_IN_MSI
Definition: rodsErrorTable.h:277
SYS_INTERNAL_NULL_INPUT_ERR
@ SYS_INTERNAL_NULL_INPUT_ERR
Definition: rodsErrorTable.h:92
SYS_NO_API_PRIV
@ SYS_NO_API_PRIV
Definition: rodsErrorTable.h:81
UPDATE_REPL_FLAG
#define UPDATE_REPL_FLAG
Definition: msParam.h:115
OPEN_FLAGS_FLAG
#define OPEN_FLAGS_FLAG
Definition: msParam.h:122
DataObjCopyInp
Definition: dataObjCopy.h:25
parseMsKeyValStrForCollInp
int parseMsKeyValStrForCollInp(msParam_t *inpParam, collInp_t *collInp, char *hintForMissingKw, int validKwFlags, char **outBadKeyWd)
Definition: msParam.cpp:1285
getMsParamByLabel
msParam_t * getMsParamByLabel(msParamArray_t *msParamArray, const char *label)
Definition: msParam.cpp:376
msiCollRsync
int msiCollRsync(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:2451
rsDataObjWrite.hpp
rsDataObjPhymv
int rsDataObjPhymv(rsComm_t *rsComm, dataObjInp_t *dataObjInp, transferStat_t **transferStat)
Definition: rsDataObjPhymv.cpp:130
parseMspForDataObjCopyInp
int parseMspForDataObjCopyInp(msParam_t *inpParam, dataObjCopyInp_t *dataObjCopyInpCache, dataObjCopyInp_t **outDataObjCopyInp)
Definition: msParam.cpp:727
CollInp
Definition: dataObjInpOut.h:157
BytesBuf::buf
void * buf
Definition: rodsDef.h:199
ExecCmdOut
Definition: execCmd.h:20
DataObjInp_MS_T
#define DataObjInp_MS_T
Definition: msParam.h:30
REPL_NUM_FLAG
#define REPL_NUM_FLAG
Definition: msParam.h:116
msiDataObjCopy
int msiDataObjCopy(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *msKeyValStr, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:1059
rsDataObjOpen.hpp
rsDataObjCreate.hpp
reDataObjOpr.hpp
DEST_RESC_NAME_FLAG
#define DEST_RESC_NAME_FLAG
Definition: msParam.h:108
userInfo_t::userName
char userName[64]
Definition: rodsUser.h:66
RuleExecInfo::status
int status
Definition: irods_re_structs.hpp:19
HUGE_NAME_LEN
#define HUGE_NAME_LEN
Definition: rodsDef.h:62
fillBufLenInMsParam
void fillBufLenInMsParam(msParam_t *msParam, int myInt, bytesBuf_t *bytesBuf)
Definition: msParam.cpp:287
rsDataObjOpen
int rsDataObjOpen(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: rsDataObjOpen.cpp:45
OpenedDataObjInp::l1descInx
int l1descInx
Definition: dataObjInpOut.h:105
FORCE_FLAG_FLAG
#define FORCE_FLAG_FLAG
Definition: msParam.h:110
rsDataObjCreate
int rsDataObjCreate(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: rsDataObjCreate.cpp:77
CollEnt::collName
char * collName
Definition: miscUtil.h:119
StructFileExtAndRegInp
Definition: structFileExtAndReg.h:7
USER_RSYNC_NO_MODE_INPUT_ERR
@ USER_RSYNC_NO_MODE_INPUT_ERR
Definition: rodsErrorTable.h:258
RSYNC_DEST_PATH_KW
#define RSYNC_DEST_PATH_KW
Definition: rodsKeyWdDef.h:57
sendAndRecvBranchMsg
int sendAndRecvBranchMsg(rsComm_t *rsComm, int apiInx, int status, void *myOutStruct, bytesBuf_t *myOutBsBBuf)
Definition: rsApiHandler.cpp:626
rsExecCmd
int rsExecCmd(rsComm_t *rsComm, execCmd_t *execCmdInp, execCmdOut_t **execCmdOut)
Definition: rsExecCmd.cpp:34
DataObjInfo::dataType
char dataType[64]
Definition: objInfo.h:133
RBUDP_TRANSFER_FLAG
#define RBUDP_TRANSFER_FLAG
Definition: msParam.h:132
rsPhyBundleColl.hpp
rsOpenCollection.hpp
parseMspForStr
char * parseMspForStr(msParam_t *inpParam)
Definition: msParam.cpp:893
LONG_NAME_LEN
#define LONG_NAME_LEN
Definition: rodsDef.h:57
RENAME_COLL
#define RENAME_COLL
Definition: dataObjInpOut.h:178
SYS_SVR_TO_CLI_MSI_REQUEST
#define SYS_SVR_TO_CLI_MSI_REQUEST
Definition: rodsDef.h:109
COLL_NAME_FLAG
#define COLL_NAME_FLAG
Definition: msParam.h:128
IRODS_TO_COLLECTION
#define IRODS_TO_COLLECTION
Definition: rodsDef.h:127
RuleExecInfo::doi
dataObjInfo_t * doi
Definition: irods_re_structs.hpp:28
StructFileExtAndRegInp::objPath
char objPath[(1024+64)]
Definition: structFileExtAndReg.h:8
fillMsParam
int fillMsParam(msParam_t *msParam, const char *label, const char *type, void *inOutStruct, bytesBuf_t *inpOutBuf)
Definition: msParam.cpp:222
rsDataObjLseek
int rsDataObjLseek(rsComm_t *rsComm, openedDataObjInp_t *dataObjLseekInp, fileLseekOut_t **dataObjLseekOut)
Definition: rsDataObjLseek.cpp:21
OpenedDataObjInp::whence
int whence
Definition: dataObjInpOut.h:107
REPL_NUM_KW
#define REPL_NUM_KW
Definition: rodsKeyWdDef.h:30
rsCollRepl
int rsCollRepl(rsComm_t *rsComm, collInp_t *collReplInp, collOprStat_t **collOprStat)
Definition: rsCollRepl.cpp:32
ADMIN_RMTRASH_FLAG
#define ADMIN_RMTRASH_FLAG
Definition: msParam.h:130
INT_MS_T
#define INT_MS_T
Definition: msParam.h:22
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
DataObjLseekInp_MS_T
#define DataObjLseekInp_MS_T
Definition: msParam.h:35
CollInp::flags
int flags
Definition: dataObjInpOut.h:159
MAX_BUNDLE_SIZE_KW
#define MAX_BUNDLE_SIZE_KW
Definition: rodsKeyWdDef.h:119
rsDataObjPhymv.hpp
rsDataObjRsync.hpp
rsDataObjTrim.hpp
RECURSIVE_OPR__KW
#define RECURSIVE_OPR__KW
Definition: rodsKeyWdDef.h:66
rsReadCollection.hpp
BACKUP_RESC_NAME_FLAG
#define BACKUP_RESC_NAME_FLAG
Definition: msParam.h:109
MsParam::type
char * type
Definition: msParam.h:78
STR_MS_T
#define STR_MS_T
Definition: msParam.h:21
DATA_TYPE_KW
#define DATA_TYPE_KW
Definition: rodsKeyWdDef.h:23
StructFileExtAndRegInp::collection
char collection[(1024+64)]
Definition: structFileExtAndReg.h:9
clearDataObjInp
void clearDataObjInp(void *)
Definition: rcMisc.cpp:1475
RuleExecInfo::rsComm
rsComm_t * rsComm
Definition: irods_re_structs.hpp:22
RENAME_DATA_OBJ
#define RENAME_DATA_OBJ
Definition: dataObjInpOut.h:177
BytesBuf::len
int len
Definition: rodsDef.h:198
CHKSUM_ALL_FLAG
#define CHKSUM_ALL_FLAG
Definition: msParam.h:118
rsCloseCollection
int rsCloseCollection(rsComm_t *rsComm, int *handleInxInp)
Definition: rsCloseCollection.cpp:14
COLL_OBJ_T
@ COLL_OBJ_T
Definition: rodsType.h:39
DEST_RESC_NAME_KW
#define DEST_RESC_NAME_KW
Definition: rodsKeyWdDef.h:20
CL_PUT_ACTION
#define CL_PUT_ACTION
Definition: rodsDef.h:119
parseMsKeyValStrForDataObjInp
int parseMsKeyValStrForDataObjInp(msParam_t *inpParam, dataObjInp_t *dataObjInp, char *hintForMissingKw, int validKwFlags, char **outBadKeyWd)
Definition: msParam.cpp:1151
COPIES_KW
#define COPIES_KW
Definition: rodsKeyWdDef.h:11
msiDataObjPut
int msiDataObjPut(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *msKeyValStr, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:1205
clearMsParamArray
int clearMsParamArray(msParamArray_t *msParamArray, int freeStruct)
Definition: msParam.cpp:447
rsComm_t::rError
rError_t rError
Definition: rcConnect.h:158
msiDataObjLseek
int msiDataObjLseek(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:382
DataObjLseekOut_MS_T
#define DataObjLseekOut_MS_T
Definition: msParam.h:36
ExecCmdOut_MS_T
#define ExecCmdOut_MS_T
Definition: msParam.h:41
msiExecCmd
int msiExecCmd(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *inpParam5, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:2659
parseMspForCondInp
int parseMspForCondInp(msParam_t *inpParam, keyValPair_t *condInput, char *condKw)
Definition: msParam.cpp:782
parseMspForCollInp
int parseMspForCollInp(msParam_t *inpParam, collInp_t *collInpCache, collInp_t **outCollInp, int writeToCache)
Definition: msParam.cpp:677
rodsLogAndErrorMsg
void rodsLogAndErrorMsg(int level, rError_t *myError, int status, const char *formatStr,...)
Definition: rodsLog.cpp:231
rsComm_t::apiInx
int apiInx
Definition: rcConnect.h:160
rsCollRepl.hpp
EXEC_CMD_RULE_KW
#define EXEC_CMD_RULE_KW
Definition: rodsKeyWdDef.h:101
DATA_TYPE_FLAG
#define DATA_TYPE_FLAG
Definition: msParam.h:117
freeCollEnt
int freeCollEnt(collEnt_t *collEnt)
Definition: miscUtil.cpp:1759
rsDataObjWrite
int rsDataObjWrite(rsComm_t *rsComm, openedDataObjInp_t *dataObjWriteInp, bytesBuf_t *dataObjWriteInpBBuf)
Definition: rsDataObjWrite.cpp:68
OpenedDataObjInp::len
int len
Definition: dataObjInpOut.h:106
FILE_PATH_FLAG
#define FILE_PATH_FLAG
Definition: msParam.h:120
ExecCmdOut::stdoutBuf
bytesBuf_t stdoutBuf
Definition: execCmd.h:21
LOCAL_TO_IRODS
#define LOCAL_TO_IRODS
Definition: rodsDef.h:124
_rsCollRsync
int _rsCollRsync(rsComm_t *rsComm, dataObjInp_t *dataObjInp, char *srcColl, char *destColl)
Definition: reDataObjOpr.cpp:2544
rsObjStat
int rsObjStat(rsComm_t *rsComm, dataObjInp_t *dataObjInp, rodsObjStat_t **rodsObjStatOut)
Definition: rsObjStat.cpp:23
rsDataObjCopy.hpp
StructFileExtAndRegInp_MS_T
#define StructFileExtAndRegInp_MS_T
Definition: msParam.h:54
DataObjReadInp_MS_T
#define DataObjReadInp_MS_T
Definition: msParam.h:33
rsDataObjRename.hpp
msiDataObjCreate
int msiDataObjCreate(msParam_t *inpParam1, msParam_t *msKeyValStr, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:87
DataObjCloseInp_MS_T
#define DataObjCloseInp_MS_T
Definition: msParam.h:31
CollEnt
Definition: miscUtil.h:113
rsDataObjClose
int rsDataObjClose(rsComm_t *rsComm, openedDataObjInp_t *dataObjCloseInp)
Definition: rsDataObjClose.cpp:56
UNREG_FLAG
#define UNREG_FLAG
Definition: msParam.h:136
msiDataObjClose
int msiDataObjClose(msParam_t *inpParam, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:293
DataObjInp
Definition: dataObjInpOut.h:65
rsDataObjClose.hpp
msiDataObjRepl
int msiDataObjRepl(msParam_t *inpParam1, msParam_t *msKeyValStr, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:933
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
rsDataObjRename
int rsDataObjRename(rsComm_t *rsComm, dataObjCopyInp_t *dataObjRenameInp)
Definition: rsDataObjRename.cpp:42
rsDataObjChksum.hpp
CollInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:161
ADMIN_KW
#define ADMIN_KW
Definition: rodsKeyWdDef.h:62
LOCAL_PRIV_USER_AUTH
#define LOCAL_PRIV_USER_AUTH
Definition: rodsUser.h:36
LOCAL_PATH_FLAG
#define LOCAL_PATH_FLAG
Definition: msParam.h:112
rsDataObjChksum
int rsDataObjChksum(rsComm_t *rsComm, dataObjInp_t *dataObjChksumInp, char **outChksum)
Definition: rsDataObjChksum.cpp:64
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
RSYNC_MODE_KW
#define RSYNC_MODE_KW
Definition: rodsKeyWdDef.h:56
MsParam
Definition: msParam.h:76
SYS_NULL_INPUT
@ SYS_NULL_INPUT
Definition: rodsErrorTable.h:876
collection.hpp
rsPhyBundleColl
int rsPhyBundleColl(rsComm_t *rsComm, structFileExtAndRegInp_t *phyBundleCollInp)
Definition: rsPhyBundleColl.cpp:50
StructFileExtAndRegInp::condInput
keyValPair_t condInput
Definition: structFileExtAndReg.h:12
splitPathByKey
int splitPathByKey(const char *srcPath, char *dir, size_t maxDirLen, char *file, size_t maxFileLen, char key)
Definition: stringOpr.cpp:222
LOCAL_PATH_KW
#define LOCAL_PATH_KW
Definition: rodsKeyWdDef.h:55
irods::log
void log(const error &)
Definition: irods_log.cpp:13
msiObjStat
int msiObjStat(msParam_t *inpParam1, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:2211
modDataObjMeta_t::regParam
keyValPair_t * regParam
Definition: modDataObjMeta.h:9
msiDataObjOpen
int msiDataObjOpen(msParam_t *inpParam, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:200
msiPhyPathReg
int msiPhyPathReg(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:2113
RESC_NAME_FLAG
#define RESC_NAME_FLAG
Definition: msParam.h:107
ExecCmd::condInput
keyValPair_t condInput
Definition: execCmd.h:17
rsPhyPathReg
int rsPhyPathReg(rsComm_t *rsComm, dataObjInp_t *phyPathRegInp)
Definition: rsPhyPathReg.cpp:78
rsDataObjCopy
int rsDataObjCopy(rsComm_t *rsComm, dataObjCopyInp_t *dataObjCopyInp, transferStat_t **transferStat)
Definition: rsDataObjCopy.cpp:148
msiDataObjTrim
int msiDataObjTrim(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *inpParam5, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:1805
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
BytesBuf
Definition: rodsDef.h:197
RuleExecInfo::ruleName
char ruleName[64]
Definition: irods_re_structs.hpp:21
RBUDP_SEND_RATE_FLAG
#define RBUDP_SEND_RATE_FLAG
Definition: msParam.h:133
msiDataObjGet
int msiDataObjGet(msParam_t *inpParam1, msParam_t *msKeyValStr, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:1357
MsParam::inpOutBuf
bytesBuf_t * inpOutBuf
Definition: msParam.h:81
FileLseekOut
Definition: fileLseek.h:53
DATA_OBJ_T
@ DATA_OBJ_T
Definition: rodsType.h:38
modDataObjMeta_t::dataObjInfo
dataObjInfo_t * dataObjInfo
Definition: modDataObjMeta.h:8
msiDataObjRead
int msiDataObjRead(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:541
CollEnt::dataName
char * dataName
Definition: miscUtil.h:120
SYS_INVALID_FILE_PATH
@ SYS_INVALID_FILE_PATH
Definition: rodsErrorTable.h:99
RMTRASH_FLAG
#define RMTRASH_FLAG
Definition: msParam.h:129
parseMspForExecCmdInp
int parseMspForExecCmdInp(msParam_t *inpParam, execCmd_t *execCmdInpCache, execCmd_t **ouExecCmdInp)
Definition: msParam.cpp:972
OBJ_PATH_FLAG
#define OBJ_PATH_FLAG
Definition: msParam.h:127
CL_GET_ACTION
#define CL_GET_ACTION
Definition: rodsDef.h:120
RBUDP_PACK_SIZE_FLAG
#define RBUDP_PACK_SIZE_FLAG
Definition: msParam.h:134
parseMspForDataObjInp
int parseMspForDataObjInp(msParam_t *inpParam, dataObjInp_t *dataObjInpCache, dataObjInp_t **outDataObjInp, int writeToCache)
Definition: msParam.cpp:597
USER_PARAM_TYPE_ERR
@ USER_PARAM_TYPE_ERR
Definition: rodsErrorTable.h:254
ExecCmd
Definition: execCmd.h:10
DataObjCopyInp::destDataObjInp
dataObjInp_t destDataObjInp
Definition: dataObjCopy.h:27
VERIFY_CHKSUM_FLAG
#define VERIFY_CHKSUM_FLAG
Definition: msParam.h:113
FORCE_FLAG_KW
#define FORCE_FLAG_KW
Definition: rodsKeyWdDef.h:13
RuleExecInfo::uoic
userInfo_t * uoic
Definition: irods_re_structs.hpp:30
rsObjStat.hpp
rsDataObjRead.hpp
RuleExecInfo::msParamArray
msParamArray_t * msParamArray
Definition: irods_re_structs.hpp:24
rsDataObjLseek.hpp
UNKNOWN_PARAM_IN_RULE_ERR
@ UNKNOWN_PARAM_IN_RULE_ERR
Definition: rodsErrorTable.h:599
fillStrInMsParam
void fillStrInMsParam(msParam_t *msParam, const char *myStr)
Definition: msParam.cpp:278
apiHeaderAll.h
DataObjInp::oprType
int oprType
Definition: dataObjInpOut.h:72
CAT_NO_ROWS_FOUND
@ CAT_NO_ROWS_FOUND
Definition: rodsErrorTable.h:423
msiDataObjUnlink
int msiDataObjUnlink(msParam_t *inpParam, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:807
msiTarFileCreate
int msiTarFileCreate(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *inpParam4, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:3040
IRODS_TO_LOCAL
#define IRODS_TO_LOCAL
Definition: rodsDef.h:125
DATA_SIZE_FLAGS
#define DATA_SIZE_FLAGS
Definition: msParam.h:124
rsDataObjRead
int rsDataObjRead(rsComm_t *rsComm, openedDataObjInp_t *dataObjReadInp, bytesBuf_t *dataObjReadOutBBuf)
Definition: rsDataObjRead.cpp:65
rsMkCollR
int rsMkCollR(rsComm_t *rsComm, const char *startColl, const char *destColl)
Definition: collection.cpp:428
RuleExecInfo
Definition: irods_re_structs.hpp:18
rsDataObjRepl
int rsDataObjRepl(rsComm_t *rsComm, dataObjInp_t *dataObjInp, transferStat_t **transferStat)
Definition: rsDataObjRepl.cpp:65
rsModDataObjMeta
int rsModDataObjMeta(rsComm_t *rsComm, modDataObjMeta_t *modDataObjMetaInp)
Definition: rsModDataObjMeta.cpp:23
msiDataObjPhymv
int msiDataObjPhymv(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *inpParam5, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:1591
rsStructFileBundle.hpp
rodsLogError
void rodsLogError(int level, int errCode, char *formatStr,...)
Definition: rodsLog.cpp:422
OBJ_PATH_KW
#define OBJ_PATH_KW
Definition: rodsKeyWdDef.h:18
RE_TEST_MACRO
#define RE_TEST_MACRO(msg)
Definition: reDefines.h:58
rsModDataObjMeta.hpp
parseMspForPosInt
int parseMspForPosInt(msParam_t *inpParam)
Definition: msParam.cpp:861
ExecCmd::addPathToArgv
int addPathToArgv
Definition: execCmd.h:15
rsStructFileBundle
int rsStructFileBundle(rsComm_t *rsComm, structFileExtAndRegInp_t *structFileBundleInp)
Definition: rsStructFileBundle.cpp:33
msiRmColl
int msiRmColl(msParam_t *inpParam1, msParam_t *msKeyValStr, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:2004
msiDataObjRsync
int msiDataObjRsync(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:2299
RodsObjStat_MS_T
#define RodsObjStat_MS_T
Definition: msParam.h:42
CollEnt::objType
objType_t objType
Definition: miscUtil.h:114
CollInp::collName
char collName[(1024+64)]
Definition: dataObjInpOut.h:158
EXEC_MY_RULE_KW
#define EXEC_MY_RULE_KW
Definition: rodsKeyWdDef.h:102
msiDataObjRename
int msiDataObjRename(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:1705
msiTarFileExtract
int msiTarFileExtract(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:2897
OpenedDataObjInp::offset
rodsLong_t offset
Definition: dataObjInpOut.h:109
rodsObjStat
Definition: objStat.h:8
rsRmColl.hpp
fillIntInMsParam
void fillIntInMsParam(msParam_t *msParam, const int myInt)
Definition: msParam.cpp:242
msiDataObjChksum
int msiDataObjChksum(msParam_t *inpParam1, msParam_t *msKeyValStr, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:1487
ALL_FLAG
#define ALL_FLAG
Definition: msParam.h:111
userInfo_t::authInfo
authInfo_t authInfo
Definition: rodsUser.h:70
MsParam::inOutStruct
void * inOutStruct
Definition: msParam.h:80
addMsParam
int addMsParam(msParamArray_t *msParamArray, const char *label, const char *packInstruct, void *inOutStruct, bytesBuf_t *inpOutBuf)
Definition: msParam.cpp:17
DOUBLE_MS_T
#define DOUBLE_MS_T
Definition: msParam.h:27
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
rsPhyPathReg.hpp
rsApiHandler.hpp
DataObjInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:74
rsRmColl
int rsRmColl(rsComm_t *rsComm, collInp_t *rmCollInp, collOprStat_t **collOprStat)
Definition: rsRmColl.cpp:35
MsParamArray
Definition: msParam.h:84
modDataObjMeta_t
Definition: modDataObjMeta.h:7
rsDataObjTrim
int rsDataObjTrim(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: rsDataObjTrim.cpp:28
DataObjWriteInp_MS_T
#define DataObjWriteInp_MS_T
Definition: msParam.h:34
rsStructFileExtAndReg
int rsStructFileExtAndReg(rsComm_t *rsComm, structFileExtAndRegInp_t *structFileExtAndRegInp)
Definition: rsStructFileExtAndReg.cpp:68
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
KeyValPair
Definition: objInfo.h:120
ExecCmd::cmd
char cmd[256]
Definition: execCmd.h:11
rsCollCreate.hpp
authInfo_t::authFlag
int authFlag
Definition: rodsUser.h:42
clearKeyVal
int clearKeyVal(keyValPair_t *condInput)
Definition: rcMisc.cpp:1047
msiCollRepl
int msiCollRepl(msParam_t *collection, msParam_t *msKeyValStr, msParam_t *status, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:2787
FILE_PATH_KW
#define FILE_PATH_KW
Definition: rodsKeyWdDef.h:28
msiDataObjWrite
int msiDataObjWrite(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:650
CREATE_MODE_FLAG
#define CREATE_MODE_FLAG
Definition: msParam.h:121
ExecCmd::cmdArgv
char cmdArgv[100000]
Definition: execCmd.h:12
USER_INPUT_PATH_ERR
@ USER_INPUT_PATH_ERR
Definition: rodsErrorTable.h:248
KEY_WORD_KW
#define KEY_WORD_KW
Definition: rodsKeyWdDef.h:88
msiCollCreate
int msiCollCreate(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:1911
rsCloseCollection.hpp
rsDataObjRepl.hpp
msiPhyBundleColl
int msiPhyBundleColl(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:3161
parseMspForPhyPathReg
int parseMspForPhyPathReg(msParam_t *inpParam, keyValPair_t *condInput)
Definition: msParam.cpp:827
rsDataObjRsync
int rsDataObjRsync(rsComm_t *rsComm, dataObjInp_t *dataObjInp, msParamArray_t **outParamArray)
Definition: rsDataObjRsync.cpp:16
FORCE_CHKSUM_FLAG
#define FORCE_CHKSUM_FLAG
Definition: msParam.h:119
rodsLong_t
long long rodsLong_t
Definition: rodsType.h:32
rsStructFileExtAndReg.hpp
ExecCmdOut::stderrBuf
bytesBuf_t stderrBuf
Definition: execCmd.h:22
rsExecCmd.hpp