00001
00002
00003
00004
00005
00006 #include "generalRowInsert.h"
00007 #include "reGlobalsExtern.h"
00008 #include "icatHighLevelRoutines.h"
00009
00010 int
00011 rsGeneralRowInsert (rsComm_t *rsComm, generalRowInsertInp_t *generalRowInsertInp )
00012 {
00013 rodsServerHost_t *rodsServerHost;
00014 int status;
00015
00016 rodsLog(LOG_DEBUG, "generalRowInsert");
00017
00018 status = getAndConnRcatHost(rsComm, MASTER_RCAT, NULL, &rodsServerHost);
00019 if (status < 0) {
00020 return(status);
00021 }
00022
00023 if (rodsServerHost->localFlag == LOCAL_HOST) {
00024 #ifdef RODS_CAT
00025 status = _rsGeneralRowInsert (rsComm, generalRowInsertInp);
00026 #else
00027 status = SYS_NO_RCAT_SERVER_ERR;
00028 #endif
00029 }
00030 else {
00031 status = rcGeneralRowInsert(rodsServerHost->conn,
00032 generalRowInsertInp);
00033 }
00034
00035 if (status < 0) {
00036 rodsLog (LOG_NOTICE,
00037 "rsGeneralRowInsert: rcGeneralRowInsert failed");
00038 }
00039 return (status);
00040 }
00041
00042 #ifdef RODS_CAT
00043 int
00044 _rsGeneralRowInsert(rsComm_t *rsComm, generalRowInsertInp_t *generalRowInsertInp )
00045 {
00046 int status;
00047
00048 rodsLog (LOG_DEBUG,
00049 "_rsGeneralRowInsert tableName=%s",
00050 generalRowInsertInp->tableName);
00051
00052 if (strcmp(generalRowInsertInp->tableName,"serverload")==0) {
00053 status = chlRegServerLoad(rsComm,
00054 generalRowInsertInp->arg1,
00055 generalRowInsertInp->arg2,
00056 generalRowInsertInp->arg3,
00057 generalRowInsertInp->arg4,
00058 generalRowInsertInp->arg5,
00059 generalRowInsertInp->arg6,
00060 generalRowInsertInp->arg7,
00061 generalRowInsertInp->arg8,
00062 generalRowInsertInp->arg9);
00063 return(status);
00064 }
00065 if (strcmp(generalRowInsertInp->tableName,"serverloaddigest")==0) {
00066 status = chlRegServerLoadDigest(rsComm,
00067 generalRowInsertInp->arg1,
00068 generalRowInsertInp->arg2);
00069 return(status);
00070 }
00071 if (strcmp(generalRowInsertInp->tableName,"ruleTable") == 0) {
00072 status = chlInsRuleTable(rsComm,
00073 generalRowInsertInp->arg1,
00074 generalRowInsertInp->arg2,
00075 generalRowInsertInp->arg3,
00076 generalRowInsertInp->arg4,
00077 generalRowInsertInp->arg5,
00078 generalRowInsertInp->arg6,
00079 generalRowInsertInp->arg7,
00080 generalRowInsertInp->arg8,
00081 generalRowInsertInp->arg9);
00082 return(status);
00083 }
00084 if (strcmp(generalRowInsertInp->tableName,"versionRuleBase") == 0) {
00085 status = chlVersionRuleBase(rsComm,
00086 generalRowInsertInp->arg1,
00087 generalRowInsertInp->arg2);
00088 return(status);
00089 }
00090 if (strcmp(generalRowInsertInp->tableName,"dvmTable") == 0) {
00091 status = chlInsDvmTable(rsComm,
00092 generalRowInsertInp->arg1,
00093 generalRowInsertInp->arg2,
00094 generalRowInsertInp->arg3,
00095 generalRowInsertInp->arg4,
00096 generalRowInsertInp->arg5);
00097 return(status);
00098 }
00099 if (strcmp(generalRowInsertInp->tableName,"versionDVMBase") == 0) {
00100 status = chlVersionDvmBase(rsComm,
00101 generalRowInsertInp->arg1,
00102 generalRowInsertInp->arg2);
00103 return(status);
00104 }
00105 if (strcmp(generalRowInsertInp->tableName,"fnmTable") == 0) {
00106 status = chlInsFnmTable(rsComm,
00107 generalRowInsertInp->arg1,
00108 generalRowInsertInp->arg2,
00109 generalRowInsertInp->arg3,
00110 generalRowInsertInp->arg4);
00111 return(status);
00112 }
00113 if (strcmp(generalRowInsertInp->tableName,"versionFNMBase") == 0) {
00114 status = chlVersionFnmBase(rsComm,
00115 generalRowInsertInp->arg1,
00116 generalRowInsertInp->arg2);
00117 return(status);
00118 }
00119
00120 if (strcmp(generalRowInsertInp->tableName,"msrvcTable") == 0) {
00121 status = chlInsMsrvcTable(rsComm,
00122 generalRowInsertInp->arg1,
00123 generalRowInsertInp->arg2,
00124 generalRowInsertInp->arg3,
00125 generalRowInsertInp->arg4,
00126 generalRowInsertInp->arg5,
00127 generalRowInsertInp->arg6,
00128 generalRowInsertInp->arg7,
00129 generalRowInsertInp->arg8,
00130 generalRowInsertInp->arg9,
00131 generalRowInsertInp->arg10);
00132 return(status);
00133 }
00134 return(CAT_INVALID_ARGUMENT);
00135 }
00136 #endif