HCE project C++ developers source code library  1.1.1
HCE project developer library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DRCEFunctionalObject.hpp
Go to the documentation of this file.
1 
14 #ifndef DRCE_FUNCTIONAL_OBJECT_HPP
15 #define DRCE_FUNCTIONAL_OBJECT_HPP
16 
17 #include <iostream>
18 
19 #include "DRCEInputJsonMessage.hpp"
22 #include "DRCEResultData.hpp"
23 #include "CustomMessage.hpp"
24 
25 namespace HCE
26 {
27 namespace drce
28 {
29 //-----------------------------------------------------------------------------
31 {
32 public:
33  explicit DRCEFunctionalObject(const std::string& nodeName_, const std::string& homeDir_);
34  virtual ~DRCEFunctionalObject(void) {}
35 
36  std::string Process(const std::string& json);
38 
39  void setNodeName(const std::string& nodeName_) {nodeName=nodeName_;}
40  std::string getNodeName(void) const {return nodeName;}
41 
42  bool setHomeDir(const std::string& homeDir_);
43  std::string getHomeDir(void) const {return homeDir;}
44 
45  void resetError(void);
46 protected:
47  std::string getDefaultJSON(void);
48  void makeFilesBefore(DRCEFilesList& filesList) throw (Poco::Exception);
49  void makeFilesAfter(DRCEFilesList& filesList, DRCEResultDataItem& resultDataItem) throw (Poco::Exception);
50  void makeSetEnviroment(const std::vector<std::pair<std::string, std::string> >& enviroments) throw (Poco::Exception);
51 private:
52  std::string getFullFileName(const std::string& fileName);
53  void applyInputStream(std::stringstream& cmd, std::stringstream& istr);
54 
55  std::string nodeName;
56  std::string homeDir;
57 
58  MessagesCollection messagesCollection;
59  CustomMessage message;
60 protected:
61  void makeProcessHostShell(DRCEInputJsonMessage& inputJsonMessage, DRCEResultDataItem& resultDataItem) throw (Poco::Exception);
62  void makeProcessSsh(DRCEInputJsonMessage& inputJsonMessage, DRCEResultDataItem& resultDataItem) throw (Poco::Exception);
63 
65 };
66 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 } // namespace drce
69 } // namespace HCE
70 
71 #endif // DRCE_FUNCTIONAL_OBJECT_HPP