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)  

reSysDataObjOpr.hpp File Reference
Include dependency graph for reSysDataObjOpr.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int msiSetDataObjPreferredResc (msParam_t *preferredResc, ruleExecInfo_t *rei)
 
int msiSetDataObjAvoidResc (msParam_t *preferredResc, ruleExecInfo_t *rei)
 
int msiSetDataTypeFromExt (ruleExecInfo_t *rei)
 
int msiSetNoDirectRescInp (msParam_t *rescList, ruleExecInfo_t *rei)
 
int msiSetDefaultResc (msParam_t *defaultResc, msParam_t *forceStr, ruleExecInfo_t *rei)
 
int msiSetNumThreads (msParam_t *sizePerThrInMbStr, msParam_t *maxNumThrStr, msParam_t *windowSizeStr, ruleExecInfo_t *rei)
 
int msiDeleteDisallowed (ruleExecInfo_t *rei)
 
int msiOprDisallowed (ruleExecInfo_t *rei)
 
int msiNoChkFilePathPerm (ruleExecInfo_t *rei)
 
int msiSetChkFilePathPerm (msParam_t *xchkType, ruleExecInfo_t *rei)
 
int msiNoTrashCan (ruleExecInfo_t *rei)
 
int msiSetPublicUserOpr (msParam_t *xoprList, ruleExecInfo_t *rei)
 
int setApiPerm (int apiNumber, int proxyPerm, int clientPerm)
 
int msiSetGraftPathScheme (msParam_t *xaddUserName, msParam_t *xtrimDirCnt, ruleExecInfo_t *rei)
 
int msiSetRandomScheme (ruleExecInfo_t *rei)
 
int msiSetRescQuotaPolicy (msParam_t *xflag, ruleExecInfo_t *rei)
 

Function Documentation

◆ msiDeleteDisallowed()

msiDeleteDisallowed ( ruleExecInfo_t rei)
Description:\n This microservice sets the policy for determining that certain data cannot be deleted.
Module:
core
Since
pre-2.1
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[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
0on success
Precondition
none
Postcondition
none
See also
none

Definition at line 638 of file reSysDataObjOpr.cpp.

References RE_TEST_MACRO, and RuleExecInfo::status.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiNoChkFilePathPerm()

msiNoChkFilePathPerm ( ruleExecInfo_t rei)
Description:\n This microservice does not check file path permissions when registering a file. This microservice is REPLACED by msiSetChkFilePathPerm
Module:
core
Since
pre-2.1
Author
Mike Wan
Warning
This microservice can create a security problem if used incorrectly.
Example Usage:\n See clients/icommands/test/rules/
Parameters
[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
NO_CHK_PATH_PERM
Precondition
none
Postcondition
none
See also
none

Definition at line 718 of file reSysDataObjOpr.cpp.

References NO_CHK_PATH_PERM, and RuleExecInfo::status.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiNoTrashCan()

msiNoTrashCan ( ruleExecInfo_t rei)
Description:\n This microservice sets the policy to no trash can.
Module:
core
Since
pre-2.1
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[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
NO_TRASH_CAN
Precondition
none
Postcondition
none
See also
none

Definition at line 811 of file reSysDataObjOpr.cpp.

References NO_TRASH_CAN, and RuleExecInfo::status.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiOprDisallowed()

msiOprDisallowed ( ruleExecInfo_t rei)
Description:\n This generic microservice sets the policy for determining that certain operation is not allowed.
Module:
core
Since
2.3
Author
Date
Example Usage:\n See clients/icommands/test/rules/
Parameters
[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:
Session Variables Modified:
iCAT Attributes Used:
iCAT Attributes Modified:
Side Effect:\n
Returns
integer
Return values
0on success
Precondition
Postcondition
See also

Definition at line 677 of file reSysDataObjOpr.cpp.

References RE_TEST_MACRO, and RuleExecInfo::status.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetChkFilePathPerm()

msiSetChkFilePathPerm ( msParam_t xchkType,
ruleExecInfo_t rei 
)
Description:\n This microservice set the check type for file path permission check when registering a file.
Module:
core
Since
pre-3.1
Author
Mike Wan
Warning
This microservice can create a security problem if set to anything other than DISALLOW_PATH_REG and used incorrectly.
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]xchkType- Required - a msParam of type STR_MS_T which defines the check type to set. Valid values are DO_CHK_PATH_PERM_STR, NO_CHK_PATH_PERM_STR, CHK_NON_VAULT_PATH_PERM_STR and DISALLOW_PATH_REG_STR.
[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
DO_CHK_PATH_PERM,NO_CHK_PATH_PERM,CHK_NON_VAULT_PATH_PERMor DISALLOW_PATH_REG.
Precondition
none
Postcondition
none
See also
none

Definition at line 755 of file reSysDataObjOpr.cpp.

References CHK_NON_VAULT_PATH_PERM, CHK_NON_VAULT_PATH_PERM_STR, DISALLOW_PATH_REG, DISALLOW_PATH_REG_STR, DO_CHK_PATH_PERM, DO_CHK_PATH_PERM_STR, if(), MsParam::inOutStruct, LOG_ERROR, NO_CHK_PATH_PERM, NO_CHK_PATH_PERM_STR, rodsLog(), and RuleExecInfo::status.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetDataObjAvoidResc()

msiSetDataObjAvoidResc ( msParam_t xavoidResc,
ruleExecInfo_t rei 
)
Description:\n This microservice specifies the copy to avoid.
Module:
core
Since
pre-2.1
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]xavoidResc- a msParam of type STR_MS_T - the name of the resource to avoid
[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:
  • rei->doinp->openFlags, rei->doi
Session Variables Modified:
  • rei->doi
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0on success
Precondition
none
Postcondition
none
See also
none

Definition at line 284 of file reSysDataObjOpr.cpp.

References RuleExecInfo::doi, RuleExecInfo::doinp, getWriteFlag(), MsParam::inOutStruct, NULL, DataObjInp::openFlags, RE_TEST_MACRO, requeDataObjInfoByResc(), and RuleExecInfo::status.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetDataObjPreferredResc()

msiSetDataObjPreferredResc ( msParam_t xpreferredRescList,
ruleExecInfo_t rei 
)
Description:\n If the data has multiple copies, this microservice specifies the preferred copy to use.
It sets the preferred resources of the opened object.
Module:
core
Since
pre-2.1
Author
Mike Wan
Note
The copy stored in this preferred resource will be picked if it exists. More than one resource can be input using the character "%" as separator. e.g., resc1resc2resc3. The most preferred resource should be at the top of the list.
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]xpreferredRescList- a msParam of type STR_MS_T, comma-delimited list of resources
[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:
  • rei->doinp->openFlags, rei->doi
Session Variables Modified:
  • rei->doi
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0on success
Precondition
none
Postcondition
none
See also
none

Definition at line 211 of file reSysDataObjOpr.cpp.

References RuleExecInfo::doi, RuleExecInfo::doinp, getWriteFlag(), i, MsParam::inOutStruct, StrArray::len, DataObjInfo::next, NULL, DataObjInp::openFlags, parseMultiStr(), RE_TEST_MACRO, requeDataObjInfoByResc(), StrArray::size, RuleExecInfo::status, and StrArray::value.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetDataTypeFromExt()

msiSetDataTypeFromExt ( ruleExecInfo_t rei)
Description:\n This microservice checks if the filename has an extension
(string following a period (.)) and if so, checks if the iCAT has a matching entry for it, and if so sets the dataObj data type.
Module:
core
Since
pre-2.1
Note
Always returns success since it is only doing an attempt; that is, failure is common and not really a failure.
Example Usage:\n See clients/icommands/test/rules/
Parameters
[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
0on success
Precondition
none
Postcondition
none
See also
none

Definition at line 338 of file reSysDataObjOpr.cpp.

References addInxIval(), addInxVal(), addKeyVal(), clearGenQueryInp(), COL_TOKEN_NAME, COL_TOKEN_NAMESPACE, COL_TOKEN_VALUE2, DATA_TYPE_KW, ModDataObjMetaInp::dataObjInfo, RuleExecInfo::doi, ERROR, freeGenQueryOut(), IN_PDMO_KW, LOG_DEBUG, MAX_NAME_LEN, GenQueryInp::maxRows, NULL, DataObjInfo::objPath, RE_TEST_MACRO, ModDataObjMetaInp::regParam, DataObjInfo::rescHier, rodsLog(), GenQueryOut::rowCnt, RuleExecInfo::rsComm, rsGenQuery(), rsModDataObjMeta(), GenQueryInp::selectInp, splitPathByKey(), GenQueryInp::sqlCondInp, GenQueryOut::sqlResult, RuleExecInfo::status, svrCloseQueryOut(), and SqlResult::value.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetDefaultResc()

msiSetDefaultResc ( msParam_t xdefaultRescList,
msParam_t xoptionStr,
ruleExecInfo_t rei 
)
Description:\n This microservice sets the default resource and query resource metadata for
the subsequent use based on an input array and condition given in the dataObject Input Structure.
Module:
core
Since
pre-2.1
Note
This function is mandatory even no defaultResc is specified (null) and should be executed right after the screening function msiSetNoDirectRescInp.
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]xdefaultRescList- Required - a msParam of type STR_MS_T which is a list of %-delimited resourceNames. It is a resource to use if no resource is input. A "null" means there is no defaultResc.
[in]xoptionStr- a msParam of type STR_MS_T which is an option (preferred, forced, random) with random as default. A "forced" input means the defaultResc will be used regardless of the user input. The forced action only apply to to users with normal privilege.
[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:
rei->doinp->condInput, rei->rsComm->proxyUser.authInfo.authFlag
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0on success
Precondition
none
Postcondition
none
See also
none

Definition at line 59 of file reSysDataObjOpr.cpp.

References irods::error::code(), DataObjInp::condInput, RuleExecInfo::doinp, MsParam::inOutStruct, NAME_LEN, PASS, RE_TEST_MACRO, RuleExecInfo::rescName, RuleExecInfo::rsComm, irods::set_default_resource(), and RuleExecInfo::status.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetGraftPathScheme()

msiSetGraftPathScheme ( msParam_t xaddUserName,
msParam_t xtrimDirCnt,
ruleExecInfo_t rei 
)
Description:\n This microservice sets the VaultPath scheme to GRAFT_PATH.
It grafts (adds) the logical path to the vault path of the resource when generating the physical path for a data object.
Module:
core
Since
pre-2.1
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]xaddUserName- This msParam specifies whether the userName should be added to the physical path. e.g. $vaultPath/$userName/$logicalPath. "xaddUserName" can have two values - yes or no.
[in]xtrimDirCnt- This msParam specifies the number of leading directory elements of the logical path to trim. Sometimes it may not be desirable to graft the entire logical path. e.g.,for a logicalPath /myZone/home/me/foo/bar, it may be desirable to graft just the part "foo/bar" to the vaultPath. "xtrimDirCnt" should be set to 3 in this case.
[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:
  • rei->inOutMsParamArray (label == VAULT_PATH_POLICY)
Session Variables Modified:
  • rei->inOutMsParamArray (label == VAULT_PATH_POLICY)
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0on success
Precondition
none
Postcondition
none
See also
none

Definition at line 988 of file reSysDataObjOpr.cpp.

References addMsParam(), VaultPathPolicy::addUserName, getMsParamByLabel(), GRAFT_PATH_S, if(), RuleExecInfo::inOutMsParamArray, MsParam::inOutStruct, LOG_ERROR, NULL, RE_TEST_MACRO, rodsLog(), VaultPathPolicy::scheme, RuleExecInfo::status, VaultPathPolicy::trimDirCnt, VAULT_PATH_POLICY, and VaultPathPolicy_MS_T.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetNoDirectRescInp()

msiSetNoDirectRescInp ( msParam_t xrescList,
ruleExecInfo_t rei 
)
Description:\n This microservice sets a list of resources that cannot be used by a normal
user directly. It checks a given list of taboo-resources against the user provided resource name and disallows if the resource is in the list of taboo-resources.
Module:
core
Since
pre-2.1
Note
This microservice is optional, but if used, should be the first function to execute because it screens the resource input.
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]xrescList- InpParam is a xrescList of type STR_MS_T which is a list of %-delimited resourceNames e.g., resc1resc2resc3.
[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:
rei->doinp->condInput - user set resource list rei->rsComm->proxyUser.authInfo.authFlag
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0if user set resource is allowed or user is privileged.
USER_DIRECT_RESC_INPUT_ERRif resource is taboo.
Precondition
none
Postcondition
none
See also
none

Definition at line 119 of file reSysDataObjOpr.cpp.

References AuthInfo::authFlag, UserInfo::authInfo, BACKUP_RESC_NAME_KW, DataObjInp::condInput, DEF_RESC_NAME_KW, DEST_RESC_NAME_KW, RuleExecInfo::doinp, getValByKey(), i, MsParam::inOutStruct, StrArray::len, LOCAL_PRIV_USER_AUTH, NULL, parseMultiStr(), RsComm::proxyUser, RE_TEST_MACRO, RESC_NAME_KW, RuleExecInfo::rsComm, StrArray::size, RuleExecInfo::status, and StrArray::value.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetNumThreads()

msiSetNumThreads ( msParam_t xsizePerThrInMbStr,
msParam_t xmaxNumThrStr,
msParam_t xwindowSizeStr,
ruleExecInfo_t rei 
)
Description:\n This microservice specifies the parameters for determining the number of
threads to use for data transfer. It sets the number of threads and the TCP window size.
Module:
core
Since
pre-2.1
Author
Mike Wan
Note
The msiSetNumThreads function must be present or no thread will be used for all transfer.
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]xsizePerThrInMbStr- The number of threads is computed using: numThreads = fileSizeInMb / sizePerThrInMb + 1 where sizePerThrInMb is an integer value in MBytes. It also accepts the word "default" which sets sizePerThrInMb to a default value of 32.
[in]xmaxNumThrStr- The maximum number of threads to use. It accepts integer value up to 64. It also accepts the word "default" which sets maxNumThr to a default value of 4.
[in]xwindowSizeStr- The TCP window size in Bytes for the parallel transfer. A value of 0 or "default" means a default size of 1,048,576 Bytes.
[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:
  • rei->doinp->numThreads, rei->doinp->dataSize
Session Variables Modified:
  • rei->rsComm->windowSize (rei->rsComm == NULL, OK),
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0on success
Precondition
none
Postcondition
none
See also
none

Definition at line 485 of file reSysDataObjOpr.cpp.

References MsParam::inOutStruct, and irods::KW_CFG_DEF_NUMBER_TRANSFER_THREADS.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetPublicUserOpr()

msiSetPublicUserOpr ( msParam_t xoprList,
ruleExecInfo_t rei 
)
Description:\n This microservice sets a list of operations that can be performed
by the user "public".
Module:
core
Since
pre-2.1
Author
Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]xoprList- Only 2 operations are allowed - "read" - read files; "query" - browse some system level metadata. More than one operation can be input using the character "%" as separator. e.g., readquery.
[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:
  • rei->rsComm->clientUser.authInfo.authFlag
Session Variables Modified:
none
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0on success
Precondition
none
Postcondition
none
See also
none

Definition at line 850 of file reSysDataObjOpr.cpp.

References AuthInfo::authFlag, UserInfo::authInfo, RsComm::clientUser, i, MsParam::inOutStruct, StrArray::len, LOCAL_PRIV_USER_AUTH, LOG_ERROR, NULL, parseMultiStr(), PUBLIC_USER_AUTH, RE_TEST_MACRO, REMOTE_PRIV_USER_AUTH, rodsLog(), RuleExecInfo::rsComm, setApiPerm(), StrArray::size, RuleExecInfo::status, and StrArray::value.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetRandomScheme()

msiSetRandomScheme ( ruleExecInfo_t rei)
Description:\n This microservice sets the scheme for composing the physical path in the vault to RANDOM. A randomly generated path is appended to the
vaultPath when generating the physical path. e.g., $vaultPath/$userName/$randomPath. The advantage with the RANDOM scheme is renaming operations (imv, irm) are much faster because there is no need to rename the corresponding physical path.
Module:
core
Since
pre-2.1
Author
- Mike Wan
Example Usage:\n See clients/icommands/test/rules/
Parameters
[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:
  • rei->inOutMsParamArray (label==VAULT_PATH_POLICY)
Session Variables Modified:
  • rei->inOutMsParamArray (label==VAULT_PATH_POLICY)
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
0on success
Precondition
none
Postcondition
none
See also
none

Definition at line 1083 of file reSysDataObjOpr.cpp.

References addMsParam(), getMsParamByLabel(), if(), RuleExecInfo::inOutMsParamArray, MsParam::inOutStruct, NULL, RANDOM_S, RE_TEST_MACRO, VaultPathPolicy::scheme, RuleExecInfo::status, VAULT_PATH_POLICY, and VaultPathPolicy_MS_T.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ msiSetRescQuotaPolicy()

msiSetRescQuotaPolicy ( msParam_t xflag,
ruleExecInfo_t rei 
)
Description:\n This microservice sets the resource quota to on or off.
Module:
core
Since
2.3
Example Usage:\n See clients/icommands/test/rules/
Parameters
[in]xflag- Required - a msParam of type STR_MS_T.
  • "on" - enable Resource Quota enforcement
  • "off" - disable Resource Quota enforcement (default)
[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:
RescQuotaPolicy.
iCAT Attributes Used:
none
iCAT Attributes Modified:
none
Side Effect:\n none
Returns
integer
Return values
RESC_QUOTA_OFFor RESC_QUOTA_ON.
Precondition
none
Postcondition
none
See also
none

Definition at line 1145 of file reSysDataObjOpr.cpp.

References MsParam::inOutStruct, RE_TEST_MACRO, RESC_QUOTA_OFF, RESC_QUOTA_ON, RescQuotaPolicy, and RuleExecInfo::status.

Referenced by irods::lookup_table< ValueType, KeyType, HashType >::lookup_table().

◆ setApiPerm()

int setApiPerm ( int  apiNumber,
int  proxyPerm,
int  clientPerm 
)