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)  

configuration.hpp File Reference
#include "rules.hpp"
#include "irods_hashtable.h"
#include "parser.hpp"
#include "datetime.hpp"
#include "checksum.hpp"
Include dependency graph for configuration.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Cache
 

Macros

#define RESC_CORE_RULE_SET   0x1
 
#define RESC_APP_RULE_SET   0x2
 
#define RESC_EXT_RULE_SET   0x4
 
#define RESC_SYS_FUNC_DESC_INDEX   0x10
 
#define RESC_CORE_FUNC_DESC_INDEX   0x20
 
#define RESC_APP_FUNC_DESC_INDEX   0x40
 
#define RESC_EXT_FUNC_DESC_INDEX   0x80
 
#define RESC_REGION_SYS   0x100
 
#define RESC_REGION_CORE   0x200
 
#define RESC_REGION_APP   0x400
 
#define RESC_REGION_EXT   0x800
 
#define RESC_CACHE   0x1000
 
#define isComponentInitialized(x)   ((x)==INITIALIZED || (x)==COMPRESSED)
 
#define isComponentAllocated(x)   ((x)==INITIALIZED)
 
#define clearRegion(u, l)
 
#define delayClearRegion(u, l)
 
#define createRegion(u, l)
 
#define clearRuleSet(u, l)
 
#define delayClearRuleSet(u, l)
 
#define delayClearFuncDescIndex(u, l)
 
#define createRuleSet(u, l)
 
#define clearFuncDescIndex(u, l)
 
#define createFuncDescIndex(u, l)
 
#define RE_LOGGING_ATTR   "rulelogging"
 

Typedefs

typedef enum ruleEngineStatus RuleEngineStatus
 

Enumerations

enum  ruleEngineStatus { UNINITIALIZED, INITIALIZED, COMPRESSED }
 

Functions

RuleEngineStatus getRuleEngineStatus ()
 
int unlinkFuncDescIndex ()
 
int clearResources (int resources)
 
int clearCoreRuleIndex ()
 
int clearAppRuleIndex ()
 
int readRuleStructAndRuleSetFromFile (const char *ruleBaseName, const char *rulesFileName)
 
int loadRuleFromCacheOrFile (const char *, const char *irbSet)
 
int createCoreRuleIndex ()
 
int createAppRuleIndex ()
 
int availableRules ()
 
void removeRuleFromExtIndex (char *ruleName, int i)
 
void appendRuleIntoExtIndex (RuleDesc *rule, int i, Region *r)
 
void prependRuleIntoAppIndex (RuleDesc *rule, int i, Region *r)
 
int checkPointExtRuleSet (Region *r)
 
void appendAppRule (RuleDesc *rd, Region *r)
 
void prependAppRule (RuleDesc *rd, Region *r)
 
void popExtRuleSet (int checkPoint)
 
void clearDelayed ()
 
int generateFunctionDescriptionTables ()
 
int readICatUserInfo (char *userName, char *attr, char userInfo[(1024+64)], rsComm_t *rsComm)
 
int writeICatUserInfo (char *userName, char *attr, char *userInfo, rsComm_t *rsComm)
 
int readICatUserLogging (char *userName, int *logging, rsComm_t *rsComm)
 
int writeICatUserLogging (char *userName, int logging, rsComm_t *rsComm)
 

Variables

RuleEngineStatus _ruleEngineStatus
 
int isServer
 
Cache ruleEngineConfig
 

Macro Definition Documentation

◆ clearFuncDescIndex

#define clearFuncDescIndex (   u,
 
)
Value:
if((resources & RESC_##u##_FUNC_DESC_INDEX) && isComponentInitialized(ruleEngineConfig.l##FuncDescIndexStatus)) { \
/* deleteEnv(ruleEngineConfig.l##FuncDescIndex, 1); */\
ruleEngineConfig.l##FuncDescIndex = NULL; \
ruleEngineConfig.l##FuncDescIndexStatus = UNINITIALIZED; \
} \

Definition at line 123 of file configuration.hpp.

◆ clearRegion

#define clearRegion (   u,
 
)
Value:
if((resources & RESC_REGION_##u) && isComponentAllocated(ruleEngineConfig.l##Region##Status)) { \
region_free(ruleEngineConfig.l##Region); \
ruleEngineConfig.l##Region = NULL; \
ruleEngineConfig.l##Region##Status = UNINITIALIZED; \
} \

Definition at line 75 of file configuration.hpp.

◆ clearRuleSet

#define clearRuleSet (   u,
 
)
Value:
if((resources & RESC_##u##_RULE_SET) && isComponentInitialized(ruleEngineConfig.l##RuleSetStatus)) { \
ruleEngineConfig.l##RuleSet = NULL; \
ruleEngineConfig.l##RuleSetStatus = UNINITIALIZED; \
} \

Definition at line 95 of file configuration.hpp.

◆ createFuncDescIndex

#define createFuncDescIndex (   u,
 
)
Value:
if(!isComponentInitialized(ruleEngineConfig.l##FuncDescIndexStatus)) { \
ruleEngineConfig.l##FuncDescIndex = newEnv(NULL, NULL, NULL, ruleEngineConfig.l##Region); \
ruleEngineConfig.l##FuncDescIndex->current = newHashTable2(1000, ruleEngineConfig.l##Region); \
ruleEngineConfig.l##FuncDescIndexStatus = INITIALIZED; \
} \

Definition at line 130 of file configuration.hpp.

◆ createRegion

#define createRegion (   u,
 
)
Value:
if(ruleEngineConfig.l##Region##Status != INITIALIZED) { \
ruleEngineConfig.l##Region = make_region(0, NULL); \
ruleEngineConfig.l##Region##Status = INITIALIZED; \
} \

Definition at line 89 of file configuration.hpp.

◆ createRuleSet

#define createRuleSet (   u,
 
)
Value:
if(!isComponentInitialized(ruleEngineConfig.l##RuleSetStatus)) { \
ruleEngineConfig.l##RuleSet = (RuleSet *)region_alloc(ruleEngineConfig.l##Region, sizeof(RuleSet)); \
ruleEngineConfig.l##RuleSet->len = 0; \
ruleEngineConfig.l##RuleSetStatus = INITIALIZED; \
} \

Definition at line 116 of file configuration.hpp.

◆ delayClearFuncDescIndex

#define delayClearFuncDescIndex (   u,
 
)
Value:
if((resources & RESC_##u##_FUNC_DESC_INDEX) && isComponentInitialized(ruleEngineConfig.l##FuncDescIndexStatus)) { \
listAppendNoRegion(&envToClear, ruleEngineConfig.l##FuncDescIndex); \
ruleEngineConfig.l##FuncDescIndex = NULL; \
ruleEngineConfig.l##FuncDescIndexStatus = UNINITIALIZED; \
} else if((resources & RESC_##u##_FUNC_DESC_INDEX) && ruleEngineConfig.l##FuncDescIndexStatus == COMPRESSED) { \
ruleEngineConfig.l##FuncDescIndexStatus = UNINITIALIZED; \
} \

Definition at line 107 of file configuration.hpp.

◆ delayClearRegion

#define delayClearRegion (   u,
 
)
Value:
if((resources & RESC_REGION_##u) && isComponentAllocated(ruleEngineConfig.l##Region##Status)) { \
listAppendNoRegion(&regionsToClear, ruleEngineConfig.l##Region); \
ruleEngineConfig.l##Region = NULL; \
ruleEngineConfig.l##Region##Status = UNINITIALIZED; \
} \

Definition at line 82 of file configuration.hpp.

◆ delayClearRuleSet

#define delayClearRuleSet (   u,
 
)
Value:
if((resources & RESC_##u##_RULE_SET) && isComponentInitialized(ruleEngineConfig.l##RuleSetStatus)) { \
ruleEngineConfig.l##RuleSet = NULL; \
ruleEngineConfig.l##RuleSetStatus = UNINITIALIZED; \
} \

Definition at line 101 of file configuration.hpp.

◆ isComponentAllocated

#define isComponentAllocated (   x)    ((x)==INITIALIZED)

Definition at line 74 of file configuration.hpp.

◆ isComponentInitialized

#define isComponentInitialized (   x)    ((x)==INITIALIZED || (x)==COMPRESSED)

Definition at line 73 of file configuration.hpp.

◆ RE_LOGGING_ATTR

#define RE_LOGGING_ATTR   "rulelogging"

Definition at line 165 of file configuration.hpp.

◆ RESC_APP_FUNC_DESC_INDEX

#define RESC_APP_FUNC_DESC_INDEX   0x40

Definition at line 18 of file configuration.hpp.

◆ RESC_APP_RULE_SET

#define RESC_APP_RULE_SET   0x2

Definition at line 14 of file configuration.hpp.

◆ RESC_CACHE

#define RESC_CACHE   0x1000

Definition at line 24 of file configuration.hpp.

◆ RESC_CORE_FUNC_DESC_INDEX

#define RESC_CORE_FUNC_DESC_INDEX   0x20

Definition at line 17 of file configuration.hpp.

◆ RESC_CORE_RULE_SET

#define RESC_CORE_RULE_SET   0x1

Definition at line 13 of file configuration.hpp.

◆ RESC_EXT_FUNC_DESC_INDEX

#define RESC_EXT_FUNC_DESC_INDEX   0x80

Definition at line 19 of file configuration.hpp.

◆ RESC_EXT_RULE_SET

#define RESC_EXT_RULE_SET   0x4

Definition at line 15 of file configuration.hpp.

◆ RESC_REGION_APP

#define RESC_REGION_APP   0x400

Definition at line 22 of file configuration.hpp.

◆ RESC_REGION_CORE

#define RESC_REGION_CORE   0x200

Definition at line 21 of file configuration.hpp.

◆ RESC_REGION_EXT

#define RESC_REGION_EXT   0x800

Definition at line 23 of file configuration.hpp.

◆ RESC_REGION_SYS

#define RESC_REGION_SYS   0x100

Definition at line 20 of file configuration.hpp.

◆ RESC_SYS_FUNC_DESC_INDEX

#define RESC_SYS_FUNC_DESC_INDEX   0x10

Definition at line 16 of file configuration.hpp.

Typedef Documentation

◆ RuleEngineStatus

Enumeration Type Documentation

◆ ruleEngineStatus

Enumerator
UNINITIALIZED 
INITIALIZED 
COMPRESSED 

Definition at line 25 of file configuration.hpp.

Function Documentation

◆ appendAppRule()

void appendAppRule ( RuleDesc rd,
Region r 
)

◆ appendRuleIntoExtIndex()

void appendRuleIntoExtIndex ( RuleDesc rule,
int  i,
Region r 
)

Definition at line 93 of file configuration.cpp.

References appendRuleNodeToRuleIndexList(), env::current, node::exprType, Cache::extFuncDescIndex, FD_RULE_INDEX_LIST, getNodeType, insertIntoHashTable(), lookupFromHashTable(), N_FD_EXTERNAL, N_FD_RULE_INDEX_LIST, newRuleIndexList(), newRuleIndexListFD(), RuleDesc::node, NULL, RULE_NAME, ruleEngineConfig, and updateInHashTable().

Referenced by parseAndComputeRule().

Here is the call graph for this function:

◆ availableRules()

◆ checkPointExtRuleSet()

int checkPointExtRuleSet ( Region r)

Definition at line 130 of file configuration.cpp.

References Cache::extFuncDescIndex, Cache::extRuleSet, ruleSet::len, newEnv(), newHashTable2(), NULL, and ruleEngineConfig.

Referenced by parseAndComputeRule().

Here is the call graph for this function:

◆ clearAppRuleIndex()

int clearAppRuleIndex ( )

Definition at line 316 of file configuration.cpp.

References clearResources(), and RESC_APP_FUNC_DESC_INDEX.

Here is the call graph for this function:

◆ clearCoreRuleIndex()

int clearCoreRuleIndex ( )

Definition at line 312 of file configuration.cpp.

References clearResources(), and RESC_CORE_FUNC_DESC_INDEX.

Referenced by loadRuleFromCacheOrFile().

Here is the call graph for this function:

◆ clearDelayed()

void clearDelayed ( )

Definition at line 221 of file configuration.cpp.

References deleteHashTable(), envToClear, hashtablesToClear, list::head, listRemoveNoRegion(), memoryToFree, nop(), NULL, region_free(), regionsToClear, and listNode::value.

Referenced by computeExpressionWithParams(), parseAndComputeExpressionAdapter(), and parseAndComputeRuleAdapter().

Here is the call graph for this function:

◆ clearResources()

◆ createAppRuleIndex()

int createAppRuleIndex ( )

Definition at line 327 of file configuration.cpp.

References APP_RULE_INDEX_OFF, Cache::appFuncDescIndex, Cache::appRegion, Cache::appRuleSet, createRuleNodeIndex(), env::current, and ruleEngineConfig.

Here is the call graph for this function:

◆ createCoreRuleIndex()

int createCoreRuleIndex ( )

Definition at line 322 of file configuration.cpp.

References CORE_RULE_INDEX_OFF, Cache::coreFuncDescIndex, Cache::coreRegion, Cache::coreRuleSet, createCondIndex(), createRuleNodeIndex(), env::current, and ruleEngineConfig.

Referenced by load_rules().

Here is the call graph for this function:

◆ generateFunctionDescriptionTables()

◆ getRuleEngineStatus()

RuleEngineStatus getRuleEngineStatus ( )

Definition at line 154 of file configuration.cpp.

References ruleEngineConfig, and Cache::ruleEngineStatus.

◆ loadRuleFromCacheOrFile()

◆ popExtRuleSet()

void popExtRuleSet ( int  checkPoint)

◆ prependAppRule()

void prependAppRule ( RuleDesc rd,
Region r 
)

Definition at line 139 of file configuration.cpp.

References Cache::appRuleSet, ruleSet::len, prependRuleIntoAppIndex(), ruleEngineConfig, and ruleSet::rules.

Here is the call graph for this function:

◆ prependRuleIntoAppIndex()

void prependRuleIntoAppIndex ( RuleDesc rule,
int  i,
Region r 
)

Definition at line 117 of file configuration.cpp.

References Cache::appFuncDescIndex, env::current, FD_RULE_INDEX_LIST, insertIntoHashTable(), lookupFromHashTable(), newRuleIndexList(), newRuleIndexListFD(), RuleDesc::node, NULL, prependRuleNodeToRuleIndexList(), RULE_NAME, and ruleEngineConfig.

Referenced by prependAppRule().

Here is the call graph for this function:

◆ readICatUserInfo()

int readICatUserInfo ( char *  userName,
char *  attr,
char  userInfo[(1024+64)],
rsComm_t rsComm 
)

◆ readICatUserLogging()

int readICatUserLogging ( char *  userName,
int logging,
rsComm_t rsComm 
)

Definition at line 650 of file configuration.cpp.

References MAX_NAME_LEN, RE_LOGGING_ATTR, RE_RUNTIME_ERROR, and readICatUserInfo().

Referenced by initRuleStruct(), and smsi_getReLogging().

Here is the call graph for this function:

◆ readRuleStructAndRuleSetFromFile()

int readRuleStructAndRuleSetFromFile ( const char *  ruleBaseName,
const char *  rulesFileName 
)

Definition at line 583 of file configuration.cpp.

References buf, Cache::coreFuncDescIndex, Cache::coreRegion, Cache::coreRuleSet, ERR_MSG_LEN, rError_t::errMsg, errMsgToString(), freeRErrorContent(), rError_t::len, LOG_ERROR, NULL, readRuleSetFromLocalFile(), rodsLog(), and ruleEngineConfig.

Referenced by load_rules().

Here is the call graph for this function:

◆ removeRuleFromExtIndex()

void removeRuleFromExtIndex ( char *  ruleName,
int  i 
)

Definition at line 80 of file configuration.cpp.

References env::current, deleteFromHashTable(), Cache::extFuncDescIndex, Cache::extFuncDescIndexStatus, FD_RULE_INDEX_LIST, ruleIndexList::head, isComponentInitialized, lookupFromHashTable(), NULL, removeNodeFromRuleIndexList2(), and ruleEngineConfig.

Here is the call graph for this function:

◆ unlinkFuncDescIndex()

◆ writeICatUserInfo()

int writeICatUserInfo ( char *  userName,
char *  attr,
char *  userInfo,
rsComm_t rsComm 
)

Definition at line 637 of file configuration.cpp.

References modAVUMetadataInp_t::arg0, modAVUMetadataInp_t::arg1, modAVUMetadataInp_t::arg2, modAVUMetadataInp_t::arg3, modAVUMetadataInp_t::arg4, modAVUMetadataInp_t::arg5, rsModAVUMetadata(), and get_irods_version::value.

Referenced by writeICatUserLogging().

Here is the call graph for this function:

◆ writeICatUserLogging()

int writeICatUserLogging ( char *  userName,
int  logging,
rsComm_t rsComm 
)

Definition at line 667 of file configuration.cpp.

References MAX_NAME_LEN, RE_LOGGING_ATTR, rstrcpy(), get_irods_version::value, and writeICatUserInfo().

Referenced by smsi_setReLogging().

Here is the call graph for this function:

Variable Documentation

◆ _ruleEngineStatus

RuleEngineStatus _ruleEngineStatus

◆ isServer

int isServer

◆ ruleEngineConfig

Cache ruleEngineConfig

Definition at line 68 of file configuration.cpp.

NULL
#define NULL
Definition: rodsDef.h:70
envToClear
List envToClear
Definition: configuration.cpp:190
region_alloc
void * region_alloc(Region *r, size_t s)
Definition: region.cpp:138
isComponentAllocated
#define isComponentAllocated(x)
Definition: configuration.hpp:73
ruleSet::len
int len
Definition: restructs.hpp:283
regionsToClear
List regionsToClear
Definition: configuration.cpp:191
make_region
Region * make_region(size_t is, jmp_buf *label)
Definition: region.cpp:85
UNINITIALIZED
@ UNINITIALIZED
Definition: configuration.hpp:26
isComponentInitialized
#define isComponentInitialized(x)
Definition: configuration.hpp:72
generate_iadmin_commands_for_41_to_42_upgrade.resources
dictionary resources
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:18
newHashTable2
Hashtable * newHashTable2(int size, Region *r)
Definition: hashtable.cpp:72
irods.six.u
def u(s)
Definition: six.py:609
COMPRESSED
@ COMPRESSED
Definition: configuration.hpp:28
region
Definition: region.h:45
INITIALIZED
@ INITIALIZED
Definition: configuration.hpp:27
newEnv
Env * newEnv(Hashtable *current, Env *previous, Env *lower, Region *r)
Definition: restructs.cpp:281
ruleEngineConfig
Cache ruleEngineConfig
Definition: configuration.cpp:68
ruleSet
Definition: restructs.hpp:282