EnvGen.hpp 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef _ENVGEN2_INCL
  14. #define _ENVGEN2_INCL
  15. //#include <vector>
  16. #include "jliball.hpp"
  17. #include "XMLTags.h"
  18. #include "IConfigEnv.hpp"
  19. #include "ConfigEnvFactory.hpp"
  20. using namespace std;
  21. using namespace ech;
  22. #define ATTR_SEP "^"
  23. #define ATTR_V_SEP "|"
  24. interface IPropertyTree;
  25. //typedef vector<IPropertyTree*> IPropertyTreePtrArray;
  26. class CEnvGen
  27. {
  28. public:
  29. CEnvGen();
  30. ~CEnvGen();
  31. bool parseArgs(int argc, char** argv);
  32. void createUpdateTask(const char* action, IPropertyTree* config, const char* param);
  33. void createUpdateNodeTask(const char* action, IPropertyTree * config, const char* param);
  34. void createUpdateBindingTask(const char* action, IPropertyTree * config, const char* param);
  35. void createUpdateServiceTask(const char* action, IPropertyTree * config, const char* param);
  36. void createUpdateTopologyTask(const char* action, IPropertyTree * config, const char* param);
  37. void addUpdateAttributesFromString(IPropertyTree *updateTree, const char *attrs);
  38. void addUpdateTaskFromFile(const char* inFile);
  39. bool convertOverrideTask(IPropertyTree * config, const char* input);
  40. void cloudConfiguration(IPropertyTree * config, const char* cloud);
  41. bool process();
  42. void usage();
  43. void usage_update_input_format_1();
  44. void usage_update_input_format_2();
  45. void usage_update_input_format_3();
  46. void usage_update_input_format_3_json();
  47. private:
  48. static map<string, string> m_envCategoryMap;
  49. static map<string, string> m_actionAbbrMap;
  50. IConfigEnv<IPropertyTree, StringBuffer>* m_iConfigEnv;
  51. //IPropertyTree * params;
  52. Owned<IPropertyTree> m_params;
  53. bool m_showInputOnly;
  54. int m_inputFormat;
  55. int m_displayFormat;
  56. StringBufferArray m_arrXPaths;
  57. StringBufferArray m_arrAttrib;
  58. StringBufferArray m_arrValues;
  59. StringBufferArray m_arrContentXPaths;
  60. StringBufferArray m_arrContentFormats;
  61. StringBufferArray m_arrContents;
  62. //StringArray m_arrAssignIPRanges;
  63. //StringArray m_arrBuildSetWithAssignedIPs;
  64. };
  65. #endif