irods  4.3.0
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.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

msiHelper.cpp File Reference
#include "irods/rcMisc.h"
#include "irods/msiHelper.hpp"
#include "irods/private/re/reFuncDefs.hpp"
#include <cstring>
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:
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:
none
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
none
Postcondition
none
See also
none

Definition at line 230 of file msiHelper.cpp.

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

Referenced by initialize_microservice_table().

◆ msiExit()

msiExit ( msParam_t inpParam1,
msParam_t inpParam2,
ruleExecInfo_t rei 
)
Description:\n Add a user message to the error stack.
Module:
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:
none
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
N/A
Postcondition
N/A
See also
N/A

Definition at line 753 of file msiHelper.cpp.

References addRErrorMsg(), ERR_MSG_LEN, MsParam::inOutStruct, LOG_ERROR, NULL, RE_TEST_MACRO, RsComm::rError, rodsLog(), rodsLogAndErrorMsg(), RuleExecInfo::rsComm, RuleExecInfo::status, STR_MS_T, and MsParam::type.

Referenced by initialize_microservice_table().

◆ msiGetSessionVarValue()

msiGetSessionVarValue ( msParam_t inpVar,
msParam_t outputMode,
ruleExecInfo_t rei 
)
Description:\n Gets the value of a session variable in the rei
Module:
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:
none
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
none
Postcondition
none
See also
none

Definition at line 358 of file msiHelper.cpp.

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

Referenced by initialize_microservice_table().

◆ msiGetStderrInExecCmdOut()

msiGetStderrInExecCmdOut ( msParam_t inpExecCmdOut,
msParam_t outStr,
ruleExecInfo_t rei 
)
Description:\n Gets stderr buffer from ExecCmdOut into buffer.
Module:
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:
none
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
none
Postcondition
none
See also
none

Definition at line 92 of file msiHelper.cpp.

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

Referenced by initialize_microservice_table().

◆ msiGetStdoutInExecCmdOut()

msiGetStdoutInExecCmdOut ( msParam_t inpExecCmdOut,
msParam_t outStr,
ruleExecInfo_t rei 
)
Description:\n Gets stdout buffer from ExecCmdOut into buffer.
Module:
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:
none
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
none
Postcondition
none
See also
none

Definition at line 44 of file msiHelper.cpp.

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

Referenced by initialize_microservice_table().

◆ 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:
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:
none
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
none
Postcondition
none
See also
none

Definition at line 280 of file msiHelper.cpp.

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

Referenced by initialize_microservice_table().

◆ msiSplitPathByKey()

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

◆ msiStrCat()

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

◆ msiStrchop()

msiStrchop ( msParam_t stringIn,
msParam_t stringOut,
ruleExecInfo_t rei 
)
Description:\n Removes the last character of a given string.
Module:
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:
none
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
thelength of the returned string
Precondition
none
Postcondition
none
See also
none

Definition at line 548 of file msiHelper.cpp.

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

Referenced by initialize_microservice_table().

◆ msiStrlen()

msiStrlen ( msParam_t stringIn,
msParam_t lengthOut,
ruleExecInfo_t rei 
)
Description:\n Returns the length of a given string.
Module:
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:
none
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
thelength of the given string
Precondition
none
Postcondition
none
See also
none

Definition at line 478 of file msiHelper.cpp.

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

Referenced by initialize_microservice_table().

◆ 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:
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:
none
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
thelength of the substring
Precondition
none
Postcondition
none
See also
none

Definition at line 627 of file msiHelper.cpp.

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

Referenced by initialize_microservice_table().

◆ msiWriteRodsLog()

msiWriteRodsLog ( msParam_t inpParam1,
msParam_t outParam,
ruleExecInfo_t rei 
)
Description:\n Writes a message into the server rodsLog.
Module:
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:
none
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0upon success
Precondition
N/A
Postcondition
N/A
See also
N/A

Definition at line 156 of file msiHelper.cpp.

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

Referenced by initialize_microservice_table().