hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DRCETaskFactory.cpp
Go to the documentation of this file.
1 #include "DRCEMessageConst.hpp"
2 #include "DRCEError.hpp"
3 #include "DRCETaskShellHost.hpp"
4 #include "DRCETaskSsh.hpp"
5 #include "DRCETaskFactory.hpp"
6 
7 namespace HCE
8 {
9 namespace drce
10 {
11 //-----------------------------------------------------------------------------
13  const std::string& taskName_,
14  DRCENodeOptions& nodeOptions_,
15  CustomMessage& message_,
16  const DRCETaskRequestSetExecute& taskRequestSetExecute_,
17  DRCEAsyncTasksQueue& asyncTasksQueue_,
18  DRCEResourceMonitor& resourceMonitor_,
19  DRCEInputJsonMessage& inputJsonMessage_,
20  unsigned int parentTaskId_)
21 {
22  DRCECommonTask* pCommonTask = nullptr;
23  switch(sessionType)
24  {
25  case SessionOptions::SessionType::stHostShell:
26  {
27  pCommonTask = new DRCETaskShellHost(taskName_, nodeOptions_, message_, taskRequestSetExecute_, asyncTasksQueue_, resourceMonitor_, inputJsonMessage_, parentTaskId_);
28  }
29  break;
30  case SessionOptions::SessionType::stSsh:
31  {
32  pCommonTask = new DRCETaskSsh(taskName_, nodeOptions_, message_, taskRequestSetExecute_, asyncTasksQueue_, resourceMonitor_, inputJsonMessage_, parentTaskId_);
33  }
34  break;
35  default: throw Poco::Exception(message_(message_const::WRONG_TYPE_REMOTE_EXCUTION), ERROR_CREATE_NEW_TASK);
36  }
37  return pCommonTask;
38 }
39 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
41 } // end namespace drce
42 } // end namespace HCE