QMsgClient Class Reference

Inheritance diagram for QMsgClient:

QBaseClient List of all members.

Detailed Description

client side methods for interaction with Message Logger server

Author:
sergio.didomizio@ge.infn.it


Public Member Functions

 QMsgClient ()
 default constructor: server address and port are determined from environment variables. A QError is thrown if they are not set.
 QMsgClient (const std::string &address, const std::string &port)
 default constructor
virtual ~QMsgClient ()
 destructor
bool RegisterProcess (const std::string &processName, const std::string &host, pid_t processPid)
 register a process to message server
bool UnregisterProcess (const std::string &processName)
 unregister a process previously registered to message server
bool SendStatus (const std::string &processName, ProcessStatus_t status)
 inform message server about the status of a process
bool SendLog (const std::string &processName, const std::string &message, MsgLevel level=InfoMsg)
 send log message to message server
bool GetStatus (const std::string &processName, ProcessStatus_t &status)
 get current status for a certain process
bool GetRegisteredProcesses (std::list< std::string > &processes)
 get a list of registered processes
bool IsRegistered (const std::string &processName, bool &isReg)
 check whether a certain process is registered


Constructor & Destructor Documentation

QMsgClient::QMsgClient ( const std::string &  address,
const std::string &  port 
)

default constructor

Parameters:
address network address of the MsgLogger server
port port for network connection


Member Function Documentation

bool QMsgClient::RegisterProcess ( const std::string &  processName,
const std::string &  host,
pid_t  processPid 
)

register a process to message server

Parameters:
processName process name with which the server will identify the client in future communications
host the host name from which the client is connecting
pid process id of the process that is being registered
Returns:
true on success, false if a process with the same name is already registered or an error occurred in the network communication.

bool QMsgClient::UnregisterProcess ( const std::string &  processName  ) 

unregister a process previously registered to message server

Parameters:
processName name of the process to be released
Returns:
true on success, false if the requested process was not registered or an error occurred in the network communication.

bool QMsgClient::SendStatus ( const std::string &  processName,
ProcessStatus_t  status 
)

inform message server about the status of a process

Parameters:
processName name of the process
status process status to be sent return true on success, false if process was not previously registered or an error occurred in the network communication

bool QMsgClient::SendLog ( const std::string &  processName,
const std::string &  message,
MsgLevel  level = InfoMsg 
)

send log message to message server

Parameters:
processName name of the process that is sending the message
message log message
level log level (defaults to InfoMsg)
Returns:
true on success or false if sending process is not registerd to message server or an error occurred in the network communication

bool QMsgClient::GetStatus ( const std::string &  processName,
ProcessStatus_t status 
)

get current status for a certain process

Parameters:
processName name of the process for which informations are requested
status is filled with current status of the process
Returns:
true on success or false if requested process is not registered or an error occurs in the network communication

bool QMsgClient::GetRegisteredProcesses ( std::list< std::string > &  processes  ) 

get a list of registered processes

Parameters:
processes filled with the names of registered processes
Returns:
true on success, false in case of network communication error

bool QMsgClient::IsRegistered ( const std::string &  processName,
bool &  isReg 
)

check whether a certain process is registered

Parameters:
processName name of the process to eb cheched
isReg will be set to true if process is regstered
return true, unless an error occurs in network communication
This method searches for processName through the list obtained with GetRegisteredProcesses()


The documentation for this class was generated from the following files:
Generated on Fri Mar 6 13:40:44 2009 for CUORE Software by  doxygen 1.5.1