Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Client Class Reference

#include <Client.h>

Inheritance diagram for Client:

Object List of all members.

Public Methods

 Client ()
 ~Client ()
JobIdclientOn (const char *user, const char *passwd, const char *JobID_name, const int jobNumber=-1)
int clientOff (int terminate_job)
void setUserPswd (const char *user, const char *passwd)
JobStatusjobCtrl (const JobId &jobID, const job_ctrl_action action)
TaskStatustaskCreate (const TaskId &taskID, List &listTaskInfo, const char *data, const Address *slaveAddress)
TaskStatustaskCreate (const TaskId &taskID, XMLData *listTaskInfo, const char *data, const Address *slaveAddress=NULL)
TaskStatustaskCtrl (const TaskId &taskID, const task_ctrl_action action, const char *arg)
ReserveIdslaveReserve (const char *reserveName, const int slavesRequired, const int parallel, const int nSlaveInfos, const SlaveInfo *slaveInfo)
ReserveIdslaveReserve (const char *reserveName, const int slavesRequired, const int parallel, const int nSlaveInfos, XMLData *slaveInfo)
wait_master_result waitMaster (Object *&result, long timeout)
int put_data (const char *fileName, int taskId, const char *url_upload)
int get_data (const char *fileName, int taskId, const char *url_download)
void statistics (qadpz_cli_stat *stat)
virtual int compare (Object *)
virtual ObjectCopy ()

Static Public Methods

void init_sockets ()
void release_sockets ()

Private Methods

TaskStatus_taskCreate (const TaskId &taskID, XMLData *listTaskInfo, const char *data, const Address *slaveAddress)
XMLDatawait_for (CharStr *msg_type)
int send (XMLData *msg)

Private Attributes

PostOfficepo
Addressaddr
Addressmaster
short firsttime
JobId jobID
char * user
char * passwd
qadpz_cli_stat stat
long master_timeout

Constructor & Destructor Documentation

Client::Client  
 

Definition at line 47 of file Client.cpp.

References addr, DBUG_PRINT, DBUG_SETFILE, DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_DBUG_FILE, DEFAULT_MASTER_HOST, DEFAULT_MASTER_KEYFILE, DEFAULT_RANDOM_FILE, firsttime, Address::getAddress(), PostOffice::getLocalPort(), JobId::id, PostOffice::initialized(), jobID, K_DBUG_FILE, K_DBUG_LOG_ON, K_MASTER_HOST, K_MASTER_PORT, K_MASTER_PUBLICKEYFILE, K_MASTER_TIMEOUT, K_RANDOM_FILE, master, master_timeout, N_CLIENT_CFG_KWS, passwd, po, RSAcrypter::publickey, read_config(), PostOffice::setRemote(), qadpz_cli_stat::slavesProvided, qadpz_cli_stat::slavesReserved, stat, qadpz_cli_stat::tasksCrashed, qadpz_cli_stat::tasksFinished, qadpz_cli_stat::tasksRefused, qadpz_cli_stat::tasksRequested, qadpz_cli_stat::tasksStarted, qadpz_cli_stat::tasksStopped, UDP_PORT_ITERATE, uint, and user.

Client::~Client  
 

Definition at line 115 of file Client.cpp.

References addr, free_messages(), master, passwd, po, and user.


Member Function Documentation

TaskStatus * Client::_taskCreate const TaskId   taskID,
XMLData   listTaskInfo,
const char *    data,
const Address   slaveAddress
[private]
 

Definition at line 321 of file Client.cpp.

References XMLData::add(), addr, XMLData::CDATA, DBUG_PRINT, Address::getIP(), JobId::id, jobID, master, XMLData::Nil, o2x(), po, PostOffice::put_back(), send(), stat, TaskStatus::state, XMLData::sub(), task_refused, qadpz_cli_stat::tasksRefused, qadpz_cli_stat::tasksRequested, wait_for(), x2o(), XMLData, and xmlmsg().

Referenced by taskCreate().

int Client::clientOff int    terminate_job
 

Definition at line 259 of file Client.cpp.

References XMLData::add(), XMLData::getString(), JobId::id, jobCtrl(), jobID, XMLData::Nil, o2x(), send(), stop_job, CharStr::str, XMLData::sub(), wait_for(), XMLData, and xmlmsg().

Referenced by q2adpz_cli_client_off().

JobId * Client::clientOn const char *    user,
const char *    passwd,
const char *    JobID_name,
const int    jobNumber = -1
 

Definition at line 176 of file Client.cpp.

References XMLData::add(), addr, DBUG_PRINT, get_job_status, Address::getIP(), XMLData::getString(), JobId::id, job_refused, job_running, jobCtrl(), jobID, JobId::name(), XMLData::Nil, o2x(), passwd, send(), setUserPswd(), JobStatus::state, CharStr::str, XMLData::sub(), user, wait_for(), x2o(), XMLData, and xmlmsg().

Referenced by q2adpz_cli_client_on().

virtual int Object::compare Object   [inline, virtual, inherited]
 

To ensure a consistent comparison interface and to allow comparison of all kinds of different objects, we will define a comparison functions.

Definition at line 31 of file Object.h.

virtual Object* Object::Copy   [inline, virtual, inherited]
 

To allow a deep copy of data structures we will define a standard interface... This member will return a copy of itself, freshly allocated and deep copied.

Reimplemented in List.

Definition at line 37 of file Object.h.

Referenced by List::Copy(), and List::operator=().

int Client::get_data const char *    fileName,
int    taskId,
const char *    url_download
 

Definition at line 630 of file Client.cpp.

References EXTRACT_FILENAME, JobId::id, jobID, JobId::name(), and postURL().

Referenced by q2adpz_cli_get_data().

void Client::init_sockets   [inline, static]
 

Definition at line 84 of file Client.h.

References PostOffice::init_sockets().

Referenced by init_sockets().

JobStatus * Client::jobCtrl const JobId   jobID,
const job_ctrl_action    action
 

Definition at line 298 of file Client.cpp.

References XMLData::add(), job_ctrl_action, job_refused, XMLData::Nil, o2x(), send(), XMLData::sub(), wait_for(), x2o(), XMLData, and xmlmsg().

Referenced by clientOff(), clientOn(), and q2adpz_cli_job_ctrl().

int Client::put_data const char *    fileName,
int    taskId,
const char *    url_upload
 

Definition at line 580 of file Client.cpp.

References EXTRACT_FILENAME, JobId::id, jobID, JobId::name(), and postURL().

Referenced by q2adpz_cli_put_data().

void Client::release_sockets   [inline, static]
 

Definition at line 91 of file Client.h.

References PostOffice::release_sockets().

Referenced by release_sockets().

int Client::send XMLData   msg [private]
 

Definition at line 657 of file Client.cpp.

References passwd, po, PostOffice::send(), sm_crypt, sm_plain, user, and XMLData.

Referenced by _taskCreate(), clientOff(), clientOn(), jobCtrl(), slaveReserve(), and taskCtrl().

void Client::setUserPswd const char *    user,
const char *    passwd
 

Definition at line 167 of file Client.cpp.

References passwd, and user.

Referenced by clientOn(), and q2adpz_cli_client_on().

ReserveId * Client::slaveReserve const char *    reserveName,
const int    slavesRequired,
const int    parallel,
const int    nSlaveInfos,
XMLData   slaveInfo
 

Definition at line 457 of file Client.cpp.

References XMLData::add(), DBUG_PRINT, XMLData::getString(), JobId::id, jobID, XMLData::Nil, o2x(), XMLData::reset(), send(), qadpz_cli_stat::slavesReserved, stat, CharStr::str, XMLData::sub(), wait_for(), x2o(), XMLData, and xmlmsg().

ReserveId * Client::slaveReserve const char *    reserveName,
const int    slavesRequired,
const int    parallel,
const int    nSlaveInfos,
const SlaveInfo   slaveInfo
 

Definition at line 449 of file Client.cpp.

References XMLData::add(), XMLData::Nil, o2x(), XMLData::sub(), and XMLData.

Referenced by q2adpz_cli_slave_reserve().

void Client::statistics qadpz_cli_stat   stat
 

Definition at line 652 of file Client.cpp.

Referenced by q2adpz_cli_statistics().

TaskStatus * Client::taskCreate const TaskId   taskID,
XMLData   listTaskInfo,
const char *    data,
const Address   slaveAddress = NULL
 

Definition at line 398 of file Client.cpp.

References _taskCreate().

TaskStatus * Client::taskCreate const TaskId   taskID,
List   listTaskInfo,
const char *    data,
const Address   slaveAddress
 

Definition at line 387 of file Client.cpp.

References _taskCreate(), XMLData::add(), List::Count(), List::Get_Next(), XMLData::Nil, o2x(), List::Start_Get(), XMLData::sub(), and XMLData.

Referenced by q2adpz_cli_task_create().

TaskStatus * Client::taskCtrl const TaskId   taskID,
const task_ctrl_action    action,
const char *    arg
 

Definition at line 404 of file Client.cpp.

References XMLData::add(), JobId::id, jobID, master, XMLData::Nil, o2x(), po, PostOffice::put_back(), send(), stop_task, XMLData::sub(), task_ctrl_action, task_refused, wait_for(), x2o(), XMLData, and xmlmsg().

Referenced by q2adpz_cli_task_ctrl().

XMLData * Client::wait_for CharStr   msg_type [private]
 

Definition at line 128 of file Client.cpp.

References DBUG_PRINT, firsttime, JobId::id, jobID, master, master_timeout, msgType(), XMLData::Nil, po, PostOffice::put_back(), PostOffice::receive(), PostOffice::receive_any(), PostOffice::setRemote(), and PostOffice::Timeout.

Referenced by _taskCreate(), clientOff(), clientOn(), jobCtrl(), slaveReserve(), and taskCtrl().

wait_master_result Client::waitMaster Object *&    result,
long    timeout
 

Definition at line 514 of file Client.cpp.

References DBUG_PRINT, XMLData::getAttrib(), XMLData::getString(), job_status, master, msgType(), XMLData::Nil, NO_TIMEOUT, po, PostOffice::receive(), slave_avail, slave_status, qadpz_cli_stat::slavesProvided, SlaveAvail::slavesRequired, stat, TaskStatus::state, CharStr::str, XMLData::sub(), task_crashed, task_finish, task_refused, task_started, task_status, task_stopped, qadpz_cli_stat::tasksCrashed, qadpz_cli_stat::tasksFinished, qadpz_cli_stat::tasksRefused, qadpz_cli_stat::tasksStarted, qadpz_cli_stat::tasksStopped, PostOffice::Timeout, wait_master_result, wait_timeout, waitmaster_error, and x2o().

Referenced by q2adpz_cli_wait_master().


Member Data Documentation

Address* Client::addr [private]
 

Definition at line 21 of file Client.h.

Referenced by _taskCreate(), Client(), clientOn(), and ~Client().

short Client::firsttime [private]
 

Definition at line 23 of file Client.h.

Referenced by Client(), and wait_for().

JobId Client::jobID [private]
 

Definition at line 24 of file Client.h.

Referenced by _taskCreate(), Client(), clientOff(), clientOn(), get_data(), put_data(), slaveReserve(), taskCtrl(), and wait_for().

Address* Client::master [private]
 

Definition at line 22 of file Client.h.

Referenced by _taskCreate(), Client(), taskCtrl(), wait_for(), waitMaster(), and ~Client().

long Client::master_timeout [private]
 

Definition at line 33 of file Client.h.

Referenced by Client(), and wait_for().

char* Client::passwd [private]
 

Definition at line 26 of file Client.h.

Referenced by Client(), clientOn(), send(), setUserPswd(), and ~Client().

PostOffice* Client::po [private]
 

Definition at line 20 of file Client.h.

Referenced by _taskCreate(), Client(), send(), taskCtrl(), wait_for(), waitMaster(), and ~Client().

qadpz_cli_stat Client::stat [private]
 

Definition at line 30 of file Client.h.

Referenced by _taskCreate(), Client(), slaveReserve(), and waitMaster().

char* Client::user [private]
 

Definition at line 25 of file Client.h.

Referenced by Client(), clientOn(), send(), setUserPswd(), and ~Client().


The documentation for this class was generated from the following files:
Generated on Mon Nov 25 12:46:37 2002 for qadpz by doxygen1.2.18