00001
00002
00003
00004
00005
00006 #include "dataGet.h"
00007 #include "miscServerFunct.h"
00008 #include "rsGlobalExtern.h"
00009 #include "rcGlobalExtern.h"
00010
00011
00012
00013
00014
00015 int
00016 rsDataGet (rsComm_t *rsComm, dataOprInp_t *dataOprInp,
00017 portalOprOut_t **portalOprOut)
00018 {
00019 int status;
00020 int remoteFlag;
00021 int l3descInx;
00022 rodsServerHost_t *rodsServerHost;
00023
00024 l3descInx = dataOprInp->srcL3descInx;
00025
00026 if (getValByKey (&dataOprInp->condInput, EXEC_LOCALLY_KW) != NULL) {
00027 remoteFlag = LOCAL_HOST;
00028 } else {
00029 rodsServerHost = FileDesc[l3descInx].rodsServerHost;
00030 if (rodsServerHost == NULL) {
00031 rodsLog (LOG_NOTICE, "rsDataGet: NULL rodsServerHost");
00032 return (SYS_INTERNAL_NULL_INPUT_ERR);
00033 }
00034 remoteFlag = rodsServerHost->localFlag;
00035 }
00036
00037 if (remoteFlag == LOCAL_HOST) {
00038 status = _rsDataGet (rsComm, dataOprInp, portalOprOut);
00039 } else {
00040 addKeyVal (&dataOprInp->condInput, EXEC_LOCALLY_KW, "");
00041 status = remoteDataGet (rsComm, dataOprInp, portalOprOut,
00042 rodsServerHost);
00043 clearKeyVal (&dataOprInp->condInput);
00044 }
00045
00046
00047 return (status);
00048 }
00049
00050 int
00051 _rsDataGet (rsComm_t *rsComm, dataOprInp_t *dataOprInp,
00052 portalOprOut_t **portalOprOut)
00053 {
00054 return setupSrvPortalForParaOpr(
00055 rsComm,
00056 dataOprInp,
00057 GET_OPR,
00058 portalOprOut );
00059
00060 }
00061
00062 int
00063 remoteDataGet (rsComm_t *rsComm, dataOprInp_t *dataOprInp,
00064 portalOprOut_t **portalOprOut, rodsServerHost_t *rodsServerHost)
00065 {
00066 int status;
00067
00068 if (rodsServerHost == NULL) {
00069 rodsLog (LOG_NOTICE,
00070 "remoteDataGet: Invalid rodsServerHost");
00071 return SYS_INVALID_SERVER_HOST;
00072 }
00073
00074 if ((status = svrToSvrConnect (rsComm, rodsServerHost)) < 0) {
00075 return status;
00076 }
00077
00078 dataOprInp->srcL3descInx = convL3descInx (dataOprInp->srcL3descInx);
00079 status = rcDataGet (rodsServerHost->conn, dataOprInp, portalOprOut);
00080
00081 return (status);
00082 }
00083