int ClientMain::run ( string  operation,
string  jobID 
) throw (const char *)

Definition at line 66 of file ClientMain.cpp.

00066                                                                        {
00067         int jobIdValue = atoi(jobID.c_str());
00068         if (!operation.compare("service")) {
00069                 registerSignalHandler();
00070                 if (!jobID.compare("once")) {
00071                         bool somethingToDo = requestService();
00072                         if (somethingToDo) {
00073                                 fulfillService();
00074                         }
00075                 } else {
00076                         bool somethingToDo = true;
00077                         while (somethingToDo) {
00078                                 somethingToDo = requestService();
00079                                 if (somethingToDo) {
00080                                         fulfillService();
00081                                 }
00082                         }
00083                 }
00084                 removeSignalHandler();
00085                 cout << DateFormater::getDate() << "Canceling the program..." << endl;
00086                 return 0;
00087         }
00088         else if (!operation.compare("status") && jobIdValue > 0) {
00089                 requestStatus(jobIdValue);
00090                 return 0;
00091         }
00092         else if (!operation.compare("halt") && jobIdValue > 0) {
00093                 requestHalt(jobIdValue);
00094                 return 0;
00095         }
00096         if (!operation.compare("status") || !operation.compare("halt")) {
00097                 throw "Invalid or no job id specified for selected operation. Canceling...";
00098         }
00099         throw "Invalid operation specified. Canceling...";
00100 }


Generated on Wed Jun 25 14:47:08 2008 for keyvil by  doxygen 1.5.1