SipXecsService Class Reference

#include <SipXecsService.h>

List of all members.


Detailed Description

Superclass for common features of all sipXecs services.

This class provides for the common features of sipXecs service processes.

Static Public Member Functions

static OsPath Path (DirectoryType pathType, const char *fileName=NULL)
 Get a full path for a file in the specified directory type.
static OsPath domainConfigPath ()
 name of the configuration common to all services in the domain.
static const char * User ()
 Default user name for a sipXecs service.
static const char * Group ()
 Default process group name for a sipXecs service.
static const char * Name ()
 Name for the sipXecs system (can be overridden by environment or configure).
static OsSysLogPriority setLogPriority (const char *configSettingsFile, const char *servicePrefix, OsSysLogPriority defaultLevel=PRI_NOTICE)
 Read the log level from the specified config file and set it for the current process.
static OsSysLogPriority setLogPriority (const OsConfigDb &configSettings, const char *servicePrefix, OsSysLogPriority defaultLevel=PRI_NOTICE)
 Read the log level from a preloaded OsConfigDb, set it for the current process, and return it so that it can be set explicitly for other facilities.

Static Public Attributes

static DirectoryType ConfigurationDirType = "SIPX_CONFDIR"
static DirectoryType LocalStateDirType = "SIPX_VARDIR"
static DirectoryType LogDirType = "SIPX_LOGDIR"
static DirectoryType RunDirType = "SIPX_RUNDIR"
static DirectoryType TmpDirType = "SIPX_TMPDIR"
static DirectoryType DatabaseDirType = "SIPX_DBDIR"
static DirectoryType VarDirType = "SIPX_VARDIR"
static DirectoryType DataDirType = "SIPX_DATADIR"
static DirectoryType BinDirType = "SIPX_BINDIR"
static DirectoryType LibExecDirType = "SIPX_LIBEXECDIR"
static DirectoryType NameType = "SIPXECS_NAME"

Protected Member Functions

 SipXecsService (const char *serviceName)
 constructor
virtual ~SipXecsService ()
 destructor

Static Protected Member Functions

static bool decodeLogLevel (UtlString &logLevel, OsSysLogPriority &priority)
 Translate a log level name string to the enum value.

Static Private Member Functions

static const char * defaultDir (DirectoryType pathType)

Private Attributes

UtlString mServiceName

Static Private Attributes

static const char * DefaultConfigurationDir = SIPX_CONFDIR
static const char * DefaultLogDir = SIPX_LOGDIR
static const char * DefaultLocalStateDir = SIPX_VARDIR
static const char * DefaultRunDir = SIPX_RUNDIR
static const char * DefaultTmpDir = SIPX_TMPDIR
static const char * DefaultDatabaseDir = SIPX_DBDIR
static const char * DefaultVarDir = SIPX_VARDIR
static const char * DefaultDataDir = SIPX_DATADIR
static const char * DefaultBinDir = SIPX_BINDIR
static const char * DefaultLibExecDir = SIPX_LIBEXECDIR
static const char * DefaultUser = SIPXPBXUSER
static const char * DefaultGroup = SIPXPBXGROUP
static const char * DefaultName = SIPXECS_NAME

Classes

class  DomainDbKey
 lookup keys for the domain configuration More...


Constructor & Destructor Documentation

SipXecsService ( const char *  serviceName  )  [protected]

constructor

~SipXecsService (  )  [protected, virtual]

destructor


Member Function Documentation

OsPath Path ( DirectoryType  pathType,
const char *  fileName = NULL 
) [static]

Get a full path for a file in the specified directory type.

The returned path will concatentate the base directory type with the OsPath;:separator and the file name (if either already contains the separator where this concatenation would put it, then it is not inserted).

If no filename is specified, or if it is the null string, then the name of the directory is returned with no trailing separator.

OsPath domainConfigPath (  )  [static]

name of the configuration common to all services in the domain.

Open the configuration common to all services in the domain.

const char * User (  )  [static]

Default user name for a sipXecs service.

const char * Group (  )  [static]

Default process group name for a sipXecs service.

const char * Name (  )  [static]

Name for the sipXecs system (can be overridden by environment or configure).

OsSysLogPriority setLogPriority ( const char *  configSettingsFile,
const char *  servicePrefix,
OsSysLogPriority  defaultLevel = PRI_NOTICE 
) [static]

Read the log level from the specified config file and set it for the current process.

Parameters:
configSettingsFile  path to configuration file
servicePrefix  the string "_LOG_LEVEL" is appended to this prefix to find the config directive that sets the level
defaultLevel  used if no directive is found, or the value found is not a valid level name

OsSysLogPriority setLogPriority ( const OsConfigDb configSettings,
const char *  servicePrefix,
OsSysLogPriority  defaultLevel = PRI_NOTICE 
) [static]

Read the log level from a preloaded OsConfigDb, set it for the current process, and return it so that it can be set explicitly for other facilities.

Parameters:
configSettings  configuration data
servicePrefix  the string "_LOG_LEVEL" is appended to this prefix to find the config directive that sets the level
defaultLevel  used if no directive is found, or the value found is not a valid level name

static bool decodeLogLevel ( UtlString logLevel,
OsSysLogPriority priority 
) [static, protected]

Translate a log level name string to the enum value.

Returns:
true iff a valid translation was found.

const char * defaultDir ( DirectoryType  pathType  )  [static, private]


Member Data Documentation

DirectoryType ConfigurationDirType = "SIPX_CONFDIR" [static]

DirectoryType LocalStateDirType = "SIPX_VARDIR" [static]

DirectoryType LogDirType = "SIPX_LOGDIR" [static]

DirectoryType RunDirType = "SIPX_RUNDIR" [static]

DirectoryType TmpDirType = "SIPX_TMPDIR" [static]

DirectoryType DatabaseDirType = "SIPX_DBDIR" [static]

DirectoryType VarDirType = "SIPX_VARDIR" [static]

DirectoryType DataDirType = "SIPX_DATADIR" [static]

DirectoryType BinDirType = "SIPX_BINDIR" [static]

DirectoryType LibExecDirType = "SIPX_LIBEXECDIR" [static]

DirectoryType NameType = "SIPXECS_NAME" [static]

const char * DefaultConfigurationDir = SIPX_CONFDIR [static, private]

const char * DefaultLogDir = SIPX_LOGDIR [static, private]

const char * DefaultLocalStateDir = SIPX_VARDIR [static, private]

const char * DefaultRunDir = SIPX_RUNDIR [static, private]

const char * DefaultTmpDir = SIPX_TMPDIR [static, private]

const char * DefaultDatabaseDir = SIPX_DBDIR [static, private]

const char * DefaultVarDir = SIPX_VARDIR [static, private]

const char * DefaultDataDir = SIPX_DATADIR [static, private]

const char * DefaultBinDir = SIPX_BINDIR [static, private]

const char * DefaultLibExecDir = SIPX_LIBEXECDIR [static, private]

const char * DefaultUser = SIPXPBXUSER [static, private]

const char * DefaultGroup = SIPXPBXGROUP [static, private]

const char * DefaultName = SIPXECS_NAME [static, private]


Online Library Docs

sipXecs home page

Version 4.2.1-018930 2010-07-31T01:13:23 build16 abuild