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)  

msiHelper.cpp File Reference
#include "rcMisc.h"
#include "msiHelper.hpp"
#include "reFuncDefs.hpp"
Include dependency graph for msiHelper.cpp:

Go to the source code of this file.

Functions

int msiGetStdoutInExecCmdOut (msParam_t *inpExecCmdOut, msParam_t *outStr, ruleExecInfo_t *rei)
 
int msiGetStderrInExecCmdOut (msParam_t *inpExecCmdOut, msParam_t *outStr, ruleExecInfo_t *rei)
 
int msiWriteRodsLog (msParam_t *inpParam1, msParam_t *outParam, ruleExecInfo_t *rei)
 
int msiAddKeyValToMspStr (msParam_t *keyStr, msParam_t *valStr, msParam_t *msKeyValStr, ruleExecInfo_t *rei)
 
int msiSplitPath (msParam_t *inpPath, msParam_t *outParentColl, msParam_t *outChildName, ruleExecInfo_t *rei)
 
int msiGetSessionVarValue (msParam_t *inpVar, msParam_t *outputMode, ruleExecInfo_t *rei)
 
int msiStrlen (msParam_t *stringIn, msParam_t *lengthOut, ruleExecInfo_t *rei)
 
int msiStrchop (msParam_t *stringIn, msParam_t *stringOut, ruleExecInfo_t *rei)
 
int msiSubstr (msParam_t *stringIn, msParam_t *offset, msParam_t *length, msParam_t *stringOut, ruleExecInfo_t *rei)
 
int msiExit (msParam_t *inpParam1, msParam_t *inpParam2, ruleExecInfo_t *rei)
 
int msiStrCat (msParam_t *targParam, msParam_t *srcParam, ruleExecInfo_t *rei)
 
int msiSplitPathByKey (msParam_t *inpPath, msParam_t *inpKey, msParam_t *outParentColl, msParam_t *outChildName, ruleExecInfo_t *rei)
 

Function Documentation

◆ msiAddKeyValToMspStr()

msiAddKeyValToMspStr ( msParam_t keyStr,
msParam_t valStr,
msParam_t msKeyValStr,
ruleExecInfo_t rei 
)
Description:\n Adds a key and value to existing msKeyValStr which is a special
kind of STR_MS_T which has the format - keyWd1=value1++++keyWd2=value2++++keyWd3=value3...
Module:\n core
Since
since 2.3
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]keyStr- a STR_MS_T key to be added to msKeyValStr.
[in]valStr- a STR_MS_T value to be added to msKeyValStr.
[in]msKeyValStr- a msKeyValStr to hold the new keyVal pair.
[in,out]rei- The RuleExecInfo structure that is automatically handled by the rule engine. The user does not include rei as a parameter in the rule invocation.
Session Variables Used:\n none
Session Variables Modified:\n none
iCAT Attributes Used:\n none
iCAT Attributes Modified:\n none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
none
Postcondition
none
See also
none

Definition at line 231 of file msiHelper.cpp.

References addKeyValToMspStr(), LOG_ERROR, NULL, RE_TEST_MACRO, rodsLog(), RuleExecInfo::status, and SYS_INTERNAL_NULL_INPUT_ERR.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiExit()

msiExit ( msParam_t inpParam1,
msParam_t inpParam2,
ruleExecInfo_t rei 
)
Description:\n Add a user message to the error stack.
Module:\n core
Since
after 2.4.1
Note
This call should only be used through the rcExecMyRule (irule) call i.e., rule execution initiated by clients and should not be called internally by the server since it interacts with the client through the normal client/server socket connection.
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]inpParam1- A STR_MS_T which specifies the status error to add to the error stack.
[in]inpParam2- A STR_MS_T which specifies the message to add to the error stack.
[in,out]rei- The RuleExecInfo structure that is automatically handled by the rule engine. The user does not include rei as a parameter in the rule invocation.
Session Variables Used:\n none
Session Variables Modified:\n none
iCAT Attributes Used:\n none
iCAT Attributes Modified:\n none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
N/A
Postcondition
N/A
See also
N/A

Definition at line 754 of file msiHelper.cpp.

References addRErrorMsg(), ERR_MSG_LEN, MsParam::inOutStruct, LOG_ERROR, NULL, RE_TEST_MACRO, rsComm_t::rError, rodsLog(), rodsLogAndErrorMsg(), RuleExecInfo::rsComm, irods.pypyodbc::status, RuleExecInfo::status, STR_MS_T, SYS_INTERNAL_NULL_INPUT_ERR, MsParam::type, UNKNOWN_PARAM_IN_RULE_ERR, and USER__NULL_INPUT_ERR.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiGetSessionVarValue()

msiGetSessionVarValue ( msParam_t inpVar,
msParam_t outputMode,
ruleExecInfo_t rei 
)
Description:\n Gets the value of a session variable in the rei
Module:\n core
Since
2.3
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]inpVar- A STR_MS_T which specifies the name of the session variable to output. The input session variable should NOT start with the "$" character. An input value of "all" means output all valid session variables.
[in]outputMode- A STR_MS_T which specifies the output mode. Valid modes are:
  • "server" - log the output to the server log
  • "client" - send the output to the client in rError
  • "all" - both client and server
[in,out]rei- The RuleExecInfo structure that is automatically handled by the rule engine. The user does not include rei as a parameter in the rule invocation.
Session Variables Used:\n none
Session Variables Modified:\n none
iCAT Attributes Used:\n none
iCAT Attributes Modified:\n none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
none
Postcondition
none
See also
none

Definition at line 359 of file msiHelper.cpp.

References addRErrorMsg(), clearKeyVal(), ERR_MSG_LEN, getAllSessionVarValue(), getSessionVarValue(), MsParam::inOutStruct, KeyValPair::keyWord, KeyValPair::len, LOG_ERROR, NULL, RE_TEST_MACRO, rsComm_t::rError, rodsLog(), RuleExecInfo::rsComm, RuleExecInfo::status, STR_MS_T, SYS_INTERNAL_NULL_INPUT_ERR, MsParam::type, UNKNOWN_PARAM_IN_RULE_ERR, USER__NULL_INPUT_ERR, and KeyValPair::value.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiGetStderrInExecCmdOut()

msiGetStderrInExecCmdOut ( msParam_t inpExecCmdOut,
msParam_t outStr,
ruleExecInfo_t rei 
)
Description:\n Gets stderr buffer from ExecCmdOut into buffer.
Module:\n core
Since
pre-2.1
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]inpExecCmdOut- a STR_MS_T which specifies the ExecCmdOut.
[out]outStr- a STR_MS_T to hold the retrieved stderr buffer.
[in,out]rei- The RuleExecInfo structure that is automatically handled by the rule engine. The user does not include rei as a parameter in the rule invocation.
Session Variables Used:\n none
Session Variables Modified:\n none
iCAT Attributes Used:\n none
iCAT Attributes Modified:\n none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
none
Postcondition
none
See also
none

Definition at line 93 of file msiHelper.cpp.

References fillStrInMsParam(), getStderrInExecCmdOut(), NULL, RuleExecInfo::status, and SYS_INTERNAL_NULL_INPUT_ERR.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiGetStdoutInExecCmdOut()

msiGetStdoutInExecCmdOut ( msParam_t inpExecCmdOut,
msParam_t outStr,
ruleExecInfo_t rei 
)
Description:\n Gets stdout buffer from ExecCmdOut into buffer.
Module:\n core
Since
pre-2.1
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]inpExecCmdOut- a STR_MS_T which specifies the ExecCmdOut.
[out]outStr- a STR_MS_T to hold the retrieved stdout buffer.
[in,out]rei- The RuleExecInfo structure that is automatically handled by the rule engine. The user does not include rei as a parameter in the rule invocation.
Session Variables Used:\n none
Session Variables Modified:\n none
iCAT Attributes Used:\n none
iCAT Attributes Modified:\n none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
none
Postcondition
none
See also
none

Definition at line 45 of file msiHelper.cpp.

References fillStrInMsParam(), getStdoutInExecCmdOut(), and RuleExecInfo::status.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiSplitPath()

msiSplitPath ( msParam_t inpPath,
msParam_t outParentColl,
msParam_t outChildName,
ruleExecInfo_t rei 
)
Description:\n Splits a pathname into parent and child values.
Module:\n core
Since
2.3
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]inpPath- a STR_MS_T which specifies the pathname to split.
[out]outParentColl- a STR_MS_T to hold the returned parent path.
[out]outChildName- a STR_MS_T to hold the returned child value.
[in,out]rei- The RuleExecInfo structure that is automatically handled by the rule engine. The user does not include rei as a parameter in the rule invocation.
Session Variables Used:\n none
Session Variables Modified:\n none
iCAT Attributes Used:\n none
iCAT Attributes Modified:\n none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
none
Postcondition
none
See also
none

Definition at line 281 of file msiHelper.cpp.

References fillStrInMsParam(), MsParam::inOutStruct, LOG_ERROR, MAX_NAME_LEN, NULL, RE_TEST_MACRO, rodsLog(), splitPathByKey(), RuleExecInfo::status, STR_MS_T, SYS_INTERNAL_NULL_INPUT_ERR, MsParam::type, UNKNOWN_PARAM_IN_RULE_ERR, and USER__NULL_INPUT_ERR.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiSplitPathByKey()

int msiSplitPathByKey ( msParam_t inpPath,
msParam_t inpKey,
msParam_t outParentColl,
msParam_t outChildName,
ruleExecInfo_t rei 
)

Definition at line 838 of file msiHelper.cpp.

References fillStrInMsParam(), MsParam::inOutStruct, LOG_ERROR, MAX_NAME_LEN, NULL, RE_TEST_MACRO, rodsLog(), splitPathByKey(), RuleExecInfo::status, STR_MS_T, SYS_INTERNAL_NULL_INPUT_ERR, MsParam::type, UNKNOWN_PARAM_IN_RULE_ERR, and USER__NULL_INPUT_ERR.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiStrCat()

int msiStrCat ( msParam_t targParam,
msParam_t srcParam,
ruleExecInfo_t rei 
)

Definition at line 801 of file msiHelper.cpp.

References MsParam::inOutStruct, LOG_ERROR, NULL, RE_TEST_MACRO, rodsLog(), rstrcpy(), STR_MS_T, MsParam::type, USER__NULL_INPUT_ERR, and USER_PARAM_TYPE_ERR.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiStrchop()

msiStrchop ( msParam_t stringIn,
msParam_t stringOut,
ruleExecInfo_t rei 
)
Description:\n Removes the last character of a given string.
Module:\n core
Since
after 2.4
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]stringIn- a STR_MS_T which specifies the input string.
[out]stringOut- a STR_MS_T to hold the string without the last char.
[in,out]rei- The RuleExecInfo structure that is automatically handled by the rule engine. The user does not include rei as a parameter in the rule invocation.
Session Variables Used:\n none
Session Variables Modified:\n none
iCAT Attributes Used:\n none
iCAT Attributes Modified:\n none
Side Effect:\n none
Returns
integer
Return values
thelength of the returned string
Precondition
none
Postcondition
none
See also
none

Definition at line 549 of file msiHelper.cpp.

References fillStrInMsParam(), MsParam::inOutStruct, LOG_ERROR, NULL, RE_TEST_MACRO, rodsLog(), RuleExecInfo::status, STR_MS_T, SYS_INTERNAL_NULL_INPUT_ERR, MsParam::type, UNKNOWN_PARAM_IN_RULE_ERR, and USER__NULL_INPUT_ERR.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiStrlen()

msiStrlen ( msParam_t stringIn,
msParam_t lengthOut,
ruleExecInfo_t rei 
)
Description:\n Returns the length of a given string.
Module:\n core
Since
after 2.4
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]stringIn- a STR_MS_T which specifies the input string.
[out]lengthOut- a STR_MS_T to hold the returned string length.
[in,out]rei- The RuleExecInfo structure that is automatically handled by the rule engine. The user does not include rei as a parameter in the rule invocation.
Session Variables Used:\n none
Session Variables Modified:\n none
iCAT Attributes Used:\n none
iCAT Attributes Modified:\n none
Side Effect:\n none
Returns
integer
Return values
thelength of the given string
Precondition
none
Postcondition
none
See also
none

Definition at line 479 of file msiHelper.cpp.

References fillStrInMsParam(), MsParam::inOutStruct, LOG_ERROR, NAME_LEN, NULL, RE_TEST_MACRO, rodsLog(), RuleExecInfo::status, STR_MS_T, SYS_INTERNAL_NULL_INPUT_ERR, MsParam::type, UNKNOWN_PARAM_IN_RULE_ERR, and USER__NULL_INPUT_ERR.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiSubstr()

msiSubstr ( msParam_t stringIn,
msParam_t offset,
msParam_t length,
msParam_t stringOut,
ruleExecInfo_t rei 
)
Description:\n Returns a substring of the given string.
Module:\n core
Since
after 2.4
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]stringIn- a STR_MS_T which specifies the input string.
[in]offset- a STR_MS_T which specifies the position of the beginning of the substring (0 is first character). If negative, then offset specifies the position from the end of the string (-1 is the last character).
[in]length- a STR_MS_T which specifies the length of substring to return. If length is not specified, too large, negative, or "null", then return the substring from the offset to the end of stringIn.
[out]stringOut- a STR_MS_T to hold the resulting substring.
[in,out]rei- The RuleExecInfo structure that is automatically handled by the rule engine. The user does not include rei as a parameter in the rule invocation.
Session Variables Used:\n none
Session Variables Modified:\n none
iCAT Attributes Used:\n none
iCAT Attributes Modified:\n none
Side Effect:\n none
Returns
integer
Return values
thelength of the substring
Precondition
none
Postcondition
none
See also
none

Definition at line 628 of file msiHelper.cpp.

References fillStrInMsParam(), MsParam::inOutStruct, LOG_ERROR, NULL, RE_TEST_MACRO, rodsLog(), RuleExecInfo::status, STR_MS_T, SYS_INTERNAL_NULL_INPUT_ERR, MsParam::type, UNKNOWN_PARAM_IN_RULE_ERR, and USER__NULL_INPUT_ERR.

Referenced by initialize_microservice_table().

Here is the call graph for this function:

◆ msiWriteRodsLog()

msiWriteRodsLog ( msParam_t inpParam1,
msParam_t outParam,
ruleExecInfo_t rei 
)
Description:\n Writes a message into the server rodsLog.
Module:\n core
Since
2.3
Note
This call should only be used through the rcExecMyRule (irule) call i.e., rule execution initiated by clients and should not be called internally by the server since it interacts with the client through the normal client/server socket connection.
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]inpParam1- A STR_MS_T which specifies the message to log.
[out]outParam- An INT_MS_T containing the status.
[in,out]rei- The RuleExecInfo structure that is automatically handled by the rule engine. The user does not include rei as a parameter in the rule invocation.
Session Variables Used:\n none
Session Variables Modified:\n none
iCAT Attributes Used:\n none
iCAT Attributes Modified:\n none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
N/A
Postcondition
N/A
See also
N/A

Definition at line 157 of file msiHelper.cpp.

References fillIntInMsParam(), MsParam::inOutStruct, LOG_ERROR, LOG_NOTICE, NULL, RE_TEST_MACRO, rsComm_t::rError, rodsLog(), rodsLogAndErrorMsg(), RuleExecInfo::rsComm, RuleExecInfo::status, STR_MS_T, SYS_INTERNAL_NULL_INPUT_ERR, MsParam::type, UNKNOWN_PARAM_IN_RULE_ERR, and USER__NULL_INPUT_ERR.

Referenced by initialize_microservice_table().

Here is the call graph for this function: