void Cmd::handleRequest() { switch(getCommand()) { case LIST : prepareDb(); executeList(); break; case UPDATE : prepareDb(); executeUpdate(); break; case ACT : prepareDb(); executeAct(); break; case DEACT : prepareDb(); executeDeact(); break; case EXEC : prepareDb(); executeExec(); break; case EVENT : prepareDb(); executeEvent(); break; case VERSION : executeVersion(); default: cons.printError("no command found"); break; } }
VMRequest * VMGahp::preExecuteCommand(const char* cmd, Gahp_Args *args) { char *command = args->argv[0]; vmprintf(D_FULLDEBUG, "Command: %s\n", command); // Special commands first if(strcasecmp(command, VMGAHP_COMMAND_ASYNC_MODE_ON) == 0 ) { m_async_mode = true; m_new_results_signaled = false; returnOutputSuccess(); } else if(strcasecmp(command, VMGAHP_COMMAND_ASYNC_MODE_OFF) == 0 ) { m_async_mode = false; returnOutputSuccess(); } else if(strcasecmp(command, VMGAHP_COMMAND_QUIT) == 0 ) { executeQuit(); } else if(strcasecmp(command, VMGAHP_COMMAND_VERSION) == 0 ) { executeVersion(); } else if(strcasecmp(command, VMGAHP_COMMAND_COMMANDS) == 0 ) { executeCommands(); } else if(strcasecmp(command, VMGAHP_COMMAND_SUPPORT_VMS) == 0 ) { executeSupportVMS(); } else if(strcasecmp(command, VMGAHP_COMMAND_RESULTS) == 0 ) { executeResults(); } else if(strcasecmp(command, VMGAHP_COMMAND_CLASSAD) == 0 ) { if( m_jobAd != NULL ) { delete m_jobAd; m_jobAd = NULL; } m_jobAd = new ClassAd; ASSERT(m_jobAd); m_inClassAd = true; returnOutputSuccess(); } else if(strcasecmp(command, VMGAHP_COMMAND_CLASSAD_END) == 0 ) { if( m_jobAd != NULL ) { delete m_jobAd; m_jobAd = NULL; } m_inClassAd = false; returnOutputSuccess(); } else { VMRequest *new_req; new_req = addNewRequest(cmd); returnOutputSuccess(); return new_req; } return NULL; }