Pārlūkot izejas kodu

Merge pull request #11771 from kenrowland/HPCC-20664

HPCC-20664 Change directory layout and component names

Reviewed-By: Xiaoming Wang <xiaoming.wang@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 6 gadi atpakaļ
vecāks
revīzija
4325e0aec0
73 mainītis faili ar 342 papildinājumiem un 401 dzēšanām
  1. 1 1
      configuration/CMakeLists.txt
  2. 0 270
      configuration/config2/test.cpp
  3. 18 0
      configuration/configmgr/CMakeLists.txt
  4. 0 0
      configuration/configmgr/Test/MasterTestSchema.xsd
  5. 0 0
      configuration/configmgr/Test/TestEnvironment.xml
  6. 0 0
      configuration/configmgr/Test/types.xsd
  7. 7 9
      configuration/config2/CMakeLists.txt
  8. 0 0
      configuration/configmgr/configmgrlib/ConfigPath.cpp
  9. 0 0
      configuration/configmgr/configmgrlib/ConfigPath.hpp
  10. 0 0
      configuration/configmgr/configmgrlib/EnvSupportLib.cpp
  11. 0 0
      configuration/configmgr/configmgrlib/EnvSupportLib.hpp
  12. 0 0
      configuration/configmgr/configmgrlib/EnvironmentEventHandlers.cpp
  13. 0 0
      configuration/configmgr/configmgrlib/EnvironmentEventHandlers.hpp
  14. 0 0
      configuration/configmgr/configmgrlib/EnvironmentLoader.cpp
  15. 0 0
      configuration/configmgr/configmgrlib/EnvironmentLoader.hpp
  16. 4 3
      configuration/config2/EnvironmentMgr.cpp
  17. 0 0
      configuration/configmgr/configmgrlib/EnvironmentMgr.hpp
  18. 14 1
      configuration/config2/EnvironmentNode.cpp
  19. 2 1
      configuration/config2/EnvironmentNode.hpp
  20. 9 0
      configuration/config2/EnvironmentValue.cpp
  21. 2 2
      configuration/config2/EnvironmentValue.hpp
  22. 0 0
      configuration/configmgr/configmgrlib/Exceptions.hpp
  23. 0 0
      configuration/configmgr/configmgrlib/InsertableItem.cpp
  24. 0 0
      configuration/configmgr/configmgrlib/InsertableItem.hpp
  25. 0 0
      configuration/configmgr/configmgrlib/NameValue.hpp
  26. 0 0
      configuration/configmgr/configmgrlib/SchemaItem.cpp
  27. 0 0
      configuration/configmgr/configmgrlib/SchemaItem.hpp
  28. 0 0
      configuration/configmgr/configmgrlib/SchemaParser.cpp
  29. 0 0
      configuration/configmgr/configmgrlib/SchemaParser.hpp
  30. 0 0
      configuration/configmgr/configmgrlib/SchemaType.hpp
  31. 0 0
      configuration/configmgr/configmgrlib/SchemaTypeIntegerLimits.cpp
  32. 0 0
      configuration/configmgr/configmgrlib/SchemaTypeIntegerLimits.hpp
  33. 0 0
      configuration/configmgr/configmgrlib/SchemaTypeLimits.cpp
  34. 0 0
      configuration/configmgr/configmgrlib/SchemaTypeLimits.hpp
  35. 0 0
      configuration/configmgr/configmgrlib/SchemaTypeStringLimits.cpp
  36. 0 0
      configuration/configmgr/configmgrlib/SchemaTypeStringLimits.hpp
  37. 28 9
      configuration/config2/SchemaValue.cpp
  38. 6 0
      configuration/config2/SchemaValue.hpp
  39. 0 0
      configuration/configmgr/configmgrlib/Status.cpp
  40. 0 0
      configuration/configmgr/configmgrlib/Status.hpp
  41. 0 0
      configuration/configmgr/configmgrlib/Utils.cpp
  42. 0 0
      configuration/configmgr/configmgrlib/Utils.hpp
  43. 0 0
      configuration/configmgr/configmgrlib/XMLEnvironmentLoader.cpp
  44. 0 0
      configuration/configmgr/configmgrlib/XMLEnvironmentLoader.hpp
  45. 0 0
      configuration/configmgr/configmgrlib/XMLEnvironmentMgr.cpp
  46. 0 0
      configuration/configmgr/configmgrlib/XMLEnvironmentMgr.hpp
  47. 0 0
      configuration/configmgr/configmgrlib/XSDComponentParser.cpp
  48. 0 0
      configuration/configmgr/configmgrlib/XSDComponentParser.hpp
  49. 11 1
      configuration/config2/XSDSchemaParser.cpp
  50. 0 0
      configuration/configmgr/configmgrlib/XSDSchemaParser.hpp
  51. 0 0
      configuration/configmgr/configmgrlib/XSDValueSetParser.cpp
  52. 0 0
      configuration/configmgr/configmgrlib/XSDValueSetParser.hpp
  53. 0 0
      configuration/configmgr/hpcc_support/CMakeLists.txt
  54. 0 0
      configuration/configmgr/hpcc_support/HPCCConfigSupport.hpp
  55. 0 0
      configuration/configmgr/hpcc_support/add_required_instances/AddRequiredInstancesSupport.cpp
  56. 0 0
      configuration/configmgr/hpcc_support/add_required_instances/AddRequiredInstancesSupport.hpp
  57. 2 2
      configuration/config2/hpcc_support/add_required_instances/CMakeLists.txt
  58. 3 3
      esp/scm/espscm.cmake
  59. 3 3
      esp/scm/ws_config2.ecm
  60. 1 1
      esp/services/CMakeLists.txt
  61. 12 14
      esp/services/ws_config2/CMakeLists.txt
  62. 0 0
      esp/services/ws_configmgr/ws_configmgrError.hpp
  63. 42 42
      esp/services/ws_config2/ws_config2Service.cpp
  64. 9 9
      esp/services/ws_config2/ws_config2Service.hpp
  65. 2 2
      esp/services/ws_config2/ws_config2Session.hpp
  66. 4 4
      esp/services/ws_config2/ws_config2_binding.hpp
  67. 7 7
      esp/services/ws_config2/ws_config2_plugin.cpp
  68. 48 0
      initfiles/componentfiles/configschema/xsd/backupnode.xsd
  69. 70 0
      initfiles/componentfiles/configschema/xsd/dfuserver.xsd
  70. 34 0
      initfiles/componentfiles/configschema/xsd/thor.xsd
  71. 0 2
      initfiles/etc/DIR_NAME/config2mgr/CMakeLists.txt
  72. 0 8
      initfiles/etc/DIR_NAME/config2mgr/config2mgr.conf.in
  73. 3 7
      initfiles/etc/DIR_NAME/config2mgr/esp.xml.in

+ 1 - 1
configuration/CMakeLists.txt

@@ -14,4 +14,4 @@
 #    limitations under the License.
 ################################################################################
 
-HPCC_ADD_SUBDIRECTORY (config2)
+HPCC_ADD_SUBDIRECTORY (configmgr)

+ 0 - 270
configuration/config2/test.cpp

@@ -1,270 +0,0 @@
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <memory.h>
-#include <string>
-#include <exception>
-#include <iostream>
-
-#include "Exceptions.hpp"
-
-//#include "libxml/parser.h"
-//#include "libxml/tree.h"
-
-
-// namespace pt = boost::property_tree;
-
-const std::string c_path = "..\\..\\initfiles\\componentfiles\\configschema\\xsd"; ///opt/HPCCSystems/componentfiles/configschema/xsd";
-
-// void parseComponentXSD(pt::ptree &xsdTree);
-// void parseIncludes(pt::ptree &xsdTree);
-
-#include "SchemaItem.hpp"
-#include "XSDSchemaParser.hpp"
-#include "XMLEnvironmentMgr.hpp"
-#include "InsertableItem.hpp"
-
-
-int main()
-{
-
-    try
-    {
-        //std::shared_ptr<ConfigItem> pConfig = std::make_shared<ConfigItem>("root");
-
-        //ConfigParser *pCfgParser = new XSDConfigParser("", pConfig);
-        //std::string fpath = c_path + "types.xsd";  //dafilesrv.xsd";
-        // std::shared_ptr<ConfigParser> pCfgParser = std::make_shared<XSDConfigParser>("");
-        // std::shared_ptr<ConfigItem> pNull;
-        // std::shared_ptr<ConfigItem> pConfig = std::make_shared<ConfigItem>("myconfig", pNull);
-
-        //pCfgParser->parseEnvironmentConfig("newenv.xsd", "");
-
-        EnvironmentMgr *pEnvMgr = getEnvironmentMgrInstance(EnvironmentType::XML);
-        std::vector<std::string> cfgParms;
-        cfgParms.push_back("buildset.xml");  // not used right now
-        pEnvMgr->loadSchema(c_path, "environment.xsd", cfgParms);
-        pEnvMgr->loadEnvironment(c_path + "/environment.xml");
-
-        std::vector<std::shared_ptr<EnvironmentNode>> nodes;
-        pEnvMgr->fetchNodes("/Environment/Software/EspService@buildSet=espsmc", nodes);
-
-        // 158
-        //auto pNode = envMgr.getNodeFromPath("158");
-        // auto pNode = pEnvMgr->getEnvironmentNode("74");     // 29 is Hardware/Computer
-        //auto pNode = pEnvMgr->getEnvironmentNode("35");
-
-        //auto x = pNode->getAllFieldValues("name");
-
-        //auto list = pNode->getInsertableItems();
-
-        Status status;
-        //auto pNewNode = pEnvMgr->addNewEnvironmentNode("108", "espsmc", status);
-        //auto newList = pNewNode->getInsertableItems();
-        //pEnvMgr->addNewEnvironmentNode("35", "ws_ecl", status);
-        //pEnvMgr->addNewEnvironmentNode("35", "ws_ecl", status);
-
-        auto pNode = pEnvMgr->getEnvironmentNode("138");
-        std::vector<InsertableItem> espBindingItems;
-        pNode->getInsertableItems(espBindingItems);
-
-        /*for (auto it = espBindingItems.begin(); it != espBindingItems.end(); ++it)
-        {
-            if ((*it).m_pSchemaItem->getProperty("insertChoice") != "")
-            {
-                std::string choice = (*it).m_pSchemaItem->getProperty("insertChoice");
-                std::shared_ptr<SchemaValue> pSchemaValue = (*it).m_pSchemaItem->getAttribute(choice);
-                std::vector<AllowedValue> allowedValues;
-                pSchemaValue->getAllowedValues(allowedValues);
-            }
-        }*/
-
-
-
-        Status status2;
-        //pNewNode = pEnvMgr->addNewEnvironmentNode("138", "espbinding@service=EclWatch1", status2);  // todo: when valildating, look at required flag first
-
-
-        /*auto attributes = pNode->getAttributes();
-        for (auto it = attributes.begin(); it != attributes.end(); ++it)
-        {
-            if ((*it)->getName() == "service")
-            {
-                std::shared_ptr<EnvironmentValue> pEnvValue = *it;
-                const std::shared_ptr<ConfigValue> &pCfgValue = pEnvValue->getCfgValue();
-                auto values = pCfgValue->getAllowedValues(pEnvValue.get());
-                int i = 3;
-            }
-        }*/
-
-
-        // keyref needs to look local first, then search the config tree, but field is ALWAYS local
-        // Used during validation.
-
-        //
-        // Validate the environment
-
-
-
-
-        //
-        // Value set test
-        //std::vector<EnvironmentMgr::NameValue> newValues;
-        //newValues.push_back({ "name", "namehasbeenchanged" });
-        //pEnvMgr->setAttributeValues("158", newValues, "", false);
-
-        //pEnvMgr->saveEnvironment("testout.xml", status);
-
-        //auto results = pEnvMgr->getEnvironmentNode(".");
-
-    }
-    catch (ParseException &e)
-    {
-        std::cout << "Error: " << e.what() << "\n";
-    }
-
-    //pt::ptree xsdTree;
-
-    // try
-    // {
-    //     std::string fpath = c_path + "types.xsd";  //dafilesrv.xsd";
-    //     pt::read_xml(fpath, xsdTree);
-
-    //     // throw(ParseException("exception throw test"));
-
-    //     parseComponentXSD(xsdTree);
-
-
-        //
-        // Let's try iterating
-        // for (pt::ptree::const_iterator it=xsdTree.begin(); it!=xsdTree.end(); ++it)
-        // {
-        //     std::cout << "here: " << it->first << std::endl;
-        // }
-
-        // auto it = xsdTree.find("xs:schema");
-        // bool isEnd = (it == xsdTree.not_found());
-        // std::cout << "here " << it->first << "  " << it->second.get_value<std::string>() << std::endl;
-
-        // parseIncludes(it->second);
-
-        // const pt::ptree &attributes = it->second.get_child("<xmlattr>", pt::ptree());
-        // for (auto attrIt=attributes.begin(); attrIt!=attributes.end(); ++attrIt)
-        // {
-        //     std::cout << "attr = " << attrIt->first.data() << " second = " << attrIt->second.get_value<std::string>() << std::endl;
-        // }
-
-
-        // std::cout << "First level keys: " << std::endl;
-        // const pt::ptree &keys = it->second.get_child("", pt::ptree());
-
-        // std::string val = it->second.get_value<std::string>("xs:include.<xmlattr>.schemaLocation");
-        // std::cout << "value: " << val << std::endl;
-
-        // for (auto keyIt=keys.begin(); keyIt!=keys.end(); ++keyIt)
-        // {
-        //     std::cout << "key = >>" << keyIt->first << "<< " << std::endl;
-        //     if (keyIt->first == "xs:include")
-        //     {
-        //         int i = 5;
-        //         std::string val = keyIt->second.get("<xmlattr>.schemaLocation", "not found");
-        //         std::cout << "   schema Location = " << val << std::endl;
-        //     }
-        //     //if (keyIt->first.get_value())
-        // }
-
-
-
-        std::cout << "Success\n";
-
-        // std::cout << std::endl << "Using Boost "
-        //   << BOOST_VERSION / 100000     << "."  // major version
-        //   << BOOST_VERSION / 100 % 1000 << "."  // minor version
-        //   << BOOST_VERSION % 100                // patch level
-        //   << std::endl;
-    // }
-    // catch (const ParseException &e)
-    // {
-    //     std::cout << "Error: " << e.what() << "\n";
-    // }
-    // catch (std::exception &e)
-    // {
-    //     std::cout << "Error: " << e.what() << "\n";
-    // }
-    // return 0;
-}
-
-
-
-// void parseComponentXSD(pt::ptree &xsdTree)
-// {
-//     //
-//     // Get to the schema
-//     auto schemaIt = xsdTree.find("xs:schema");
-
-//     //
-//     // Since we only support includes for a component schema at the top level, look for includes first and process them.
-//     // Note that these includes may NOT define elements or anything like that. Only types, attribute groups, keyrefs
-//     const pt::ptree &keys = schemaIt->second.get_child("", pt::ptree());
-//     for (auto it=keys.begin(); it!=keys.end(); ++it)
-//     {
-//         if (it->first == "xs:include")
-//         {
-//             std::string schema = it->second.get("<xmlattr>.schemaLocation", "not found");
-//             std::cout << "Parsing found include: " << schema << std::endl;
-//         }
-//     }
-
-//     std::vector<std::string> vec;
-//     vec.push_back("Hello");
-//     vec.push_back("There");
-
-
-    //
-    // Now look for any special sections we support
-    // for (auto it=keys.begin(); it!=keys.end(); ++it)
-    // {
-        // if (it->first == "xs:attributeGroup")
-        // {
-        //     std::string groupName = it->second.get("<xmlattr>.name", "not found");
-        //     std::cout << "Attribute group name: " << groupName << std::endl;
-
-        //     //
-        //     // Lets parse the attributes now
-        //     const pt::ptree &attrs = it->second.get_child("", pt::ptree());
-        //     for (auto attributeIt = attrs.begin(); attributeIt != attrs.end(); ++attributeIt)
-        //     {
-        //         auto ss = attributeIt->first;
-        //         if (attributeIt->first == "xs:attribute")
-        //         {
-        //             std::cout << "found attribute" << groupName << std::endl;
-        //             XSDAttribute attr;
-        //             attr.parse(attributeIt->second);
-        //         }
-        //     }
-//         // }
-//         if (it->first == "xs:simpleType")
-//         {
-//             //std::string typeName = it->second.get("<xmlattr>.name", "not found");
-//             //int i = 4;
-//             std::shared_ptr<CfgType> pType = XSDTypeParser::parseSimpleType(it->second);
-//         }
-//     }
-
-
-// }
-
-
-
-// void parseIncludes(pt::ptree &xsdTree)
-// {
-//     const pt::ptree &keys = xsdTree.get_child("", pt::ptree());
-//     for (auto it=keys.begin(); it!=keys.end(); ++it)
-//     {
-//         if (it->first == "xs:include")
-//         {
-//             std::string schema = it->second.get("<xmlattr>.schemaLocation", "not found");
-//             std::cout << "Parsing found include: " << schema << std::endl;
-//         }
-//     }
-// }

+ 18 - 0
configuration/configmgr/CMakeLists.txt

@@ -0,0 +1,18 @@
+################################################################################
+#    HPCC SYSTEMS software Copyright (C) 2018 HPCC Systems.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+################################################################################
+
+HPCC_ADD_SUBDIRECTORY (configmgrlib)
+HPCC_ADD_SUBDIRECTORY (hpcc_support)

configuration/config2/Test/MasterTestSchema.xsd → configuration/configmgr/Test/MasterTestSchema.xsd


configuration/config2/Test/TestEnvironment.xml → configuration/configmgr/Test/TestEnvironment.xml


configuration/config2/Test/types.xsd → configuration/configmgr/Test/types.xsd


+ 7 - 9
configuration/config2/CMakeLists.txt

@@ -15,9 +15,7 @@
 #    limitations under the License.
 ##############################################################################
 
-project ( config2 )
-
-HPCC_ADD_SUBDIRECTORY (hpcc_support)
+project ( configmgr )
 
 if (USE_BOOST_REGEX)
 
@@ -50,17 +48,17 @@ if (USE_BOOST_REGEX)
         ${HPCC_SOURCE_DIR}/deployment/deploy
         ${CMAKE_PREFIX_PATH}/mkspecs/linux-g++
         ${CMAKE_CURRENT_SOURCE_DIR}
-        ${CMAKE_CURRENT_SOURCE_DIR}/hpcc_support
+        ${CMAKE_CURRENT_SOURCE_DIR}/../hpcc_support
         ${CMAKE_BINARY_DIR}
         ${CMAKE_BINARY_DIR}/oss
     )
 
-    ADD_DEFINITIONS( -D_USRDLL -DCONFIG2_LIB)
-    HPCC_ADD_LIBRARY( config2 SHARED ${SRCS} )
-    TARGET_LINK_LIBRARIES( config2 jlib ${BOOST_REGEX_LIBRARIES})
+    ADD_DEFINITIONS( -D_USRDLL -DCONFIGMGR_LIB)
+    HPCC_ADD_LIBRARY( configmgr SHARED ${SRCS} )
+    TARGET_LINK_LIBRARIES( configmgr jlib ${BOOST_REGEX_LIBRARIES})
 
-    INSTALL ( TARGETS config2 RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
+    INSTALL ( TARGETS configmgr RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
 
 else ()
-    message(warning "skipping config2 - USE_BOOST_REGEX not defined")
+    message(warning "skipping configmg - USE_BOOST_REGEX not defined")
 endif ()

configuration/config2/ConfigPath.cpp → configuration/configmgr/configmgrlib/ConfigPath.cpp


configuration/config2/ConfigPath.hpp → configuration/configmgr/configmgrlib/ConfigPath.hpp


configuration/config2/EnvSupportLib.cpp → configuration/configmgr/configmgrlib/EnvSupportLib.cpp


configuration/config2/EnvSupportLib.hpp → configuration/configmgr/configmgrlib/EnvSupportLib.hpp


configuration/config2/EnvironmentEventHandlers.cpp → configuration/configmgr/configmgrlib/EnvironmentEventHandlers.cpp


configuration/config2/EnvironmentEventHandlers.hpp → configuration/configmgr/configmgrlib/EnvironmentEventHandlers.hpp


configuration/config2/EnvironmentLoader.cpp → configuration/configmgr/configmgrlib/EnvironmentLoader.cpp


configuration/config2/EnvironmentLoader.hpp → configuration/configmgr/configmgrlib/EnvironmentLoader.hpp


+ 4 - 3
configuration/config2/EnvironmentMgr.cpp

@@ -378,17 +378,18 @@ bool EnvironmentMgr::removeEnvironmentNode(const std::string &nodeId)
 {
     bool rc = false;
     std::shared_ptr<EnvironmentNode> pNode = findEnvironmentNodeById(nodeId);
+    std::vector<std::string> deletedNodeIds;
 
     if (pNode)
     {
         std::shared_ptr<EnvironmentNode> pParentNode = pNode->getParent();
-        if (pParentNode->removeChild(pNode))
+        if (pParentNode->removeChild(pNode, deletedNodeIds))
         {
-            m_nodeIds.erase(nodeId);
+            for (auto delNodeId: deletedNodeIds)
+                m_nodeIds.erase(delNodeId);
             rc = true;
         }
     }
-
     return rc;
 }
 

configuration/config2/EnvironmentMgr.hpp → configuration/configmgr/configmgrlib/EnvironmentMgr.hpp


+ 14 - 1
configuration/config2/EnvironmentNode.cpp

@@ -28,13 +28,15 @@ void EnvironmentNode::addChild(std::shared_ptr<EnvironmentNode> pNode)
 }
 
 
-bool EnvironmentNode::removeChild(const std::shared_ptr<EnvironmentNode> pNode)
+bool EnvironmentNode::removeChild(const std::shared_ptr<EnvironmentNode> pNode, std::vector<std::string> &removedNodeIds)
 {
     bool removed = false;
     for (auto it=m_children.begin(); it!= m_children.end() && !removed; ++it)
     {
         if (pNode == it->second)
         {
+            pNode->removeAllChildren(removedNodeIds);
+            removedNodeIds.emplace_back(pNode->getId());
             m_children.erase(it);
             removed = true;
         }
@@ -43,6 +45,17 @@ bool EnvironmentNode::removeChild(const std::shared_ptr<EnvironmentNode> pNode)
 }
 
 
+void EnvironmentNode::removeAllChildren(std::vector<std::string> &removedNodeIds)
+{
+    for (auto &childNodeIt: m_children)
+    {
+        childNodeIt.second->removeAllChildren(removedNodeIds);
+        removedNodeIds.emplace_back(childNodeIt.second->getId());
+    }
+    m_children.clear();
+}
+
+
 bool EnvironmentNode::addAttribute(const std::string &name, std::shared_ptr<EnvironmentValue> pValue)
 {
     auto retValue = m_attributes.insert(std::make_pair(name, pValue));

+ 2 - 1
configuration/config2/EnvironmentNode.hpp

@@ -39,7 +39,8 @@ class DECL_EXPORT EnvironmentNode : public std::enable_shared_from_this<Environm
         ~EnvironmentNode() { }
         const std::string &getName() const { return m_name;  }
         void addChild(std::shared_ptr<EnvironmentNode> pNode);
-        bool removeChild(std::shared_ptr<EnvironmentNode> pNode);
+        bool removeChild(std::shared_ptr<EnvironmentNode> pNode, std::vector<std::string> &removedNodeIds);
+        void removeAllChildren(std::vector<std::string> &removedNodeIds);
         void getChildren(std::vector<std::shared_ptr<EnvironmentNode>> &children, const std::string &name=std::string("")) const;
         bool hasChildren() const { return m_children.size() != 0; }
         int getNumChildren() const { return m_children.size(); }

+ 9 - 0
configuration/config2/EnvironmentValue.cpp

@@ -18,6 +18,15 @@
 #include "EnvironmentValue.hpp"
 #include "EnvironmentNode.hpp"
 
+
+EnvironmentValue::~EnvironmentValue()
+{
+    //
+    // Tell the schema vallue that we are going away
+    m_pSchemaValue->removeEnvironmentValue(shared_from_this());
+}
+
+
 bool EnvironmentValue::setValue(const std::string &value, Status *pStatus, bool forceSet)
 {
     bool rc = true;

+ 2 - 2
configuration/config2/EnvironmentValue.hpp

@@ -25,7 +25,7 @@
 
 class EnvironmentNode;
 
-class DECL_EXPORT EnvironmentValue
+class DECL_EXPORT EnvironmentValue : public std::enable_shared_from_this<EnvironmentValue>
 {
     public:
 
@@ -34,7 +34,7 @@ class DECL_EXPORT EnvironmentValue
         EnvironmentValue(const std::shared_ptr<EnvironmentNode> &pMyNode, const std::shared_ptr<SchemaValue> &pCfgValue, const std::string &name, const std::string initValue) :
             EnvironmentValue(pMyNode, pCfgValue, name) { m_value = initValue; }
 
-        ~EnvironmentValue() { }
+        ~EnvironmentValue();
         bool setValue(const std::string &value, Status *pStatus, bool forceSet=false);
         bool isValueSet() const { return !m_value.empty(); }
         const std::string &getValue() const { return m_value.empty() ? getForcedValue() : m_value;  }

configuration/config2/Exceptions.hpp → configuration/configmgr/configmgrlib/Exceptions.hpp


configuration/config2/InsertableItem.cpp → configuration/configmgr/configmgrlib/InsertableItem.cpp


configuration/config2/InsertableItem.hpp → configuration/configmgr/configmgrlib/InsertableItem.hpp


configuration/config2/NameValue.hpp → configuration/configmgr/configmgrlib/NameValue.hpp


configuration/config2/SchemaItem.cpp → configuration/configmgr/configmgrlib/SchemaItem.cpp


configuration/config2/SchemaItem.hpp → configuration/configmgr/configmgrlib/SchemaItem.hpp


configuration/config2/SchemaParser.cpp → configuration/configmgr/configmgrlib/SchemaParser.cpp


configuration/config2/SchemaParser.hpp → configuration/configmgr/configmgrlib/SchemaParser.hpp


configuration/config2/SchemaType.hpp → configuration/configmgr/configmgrlib/SchemaType.hpp


configuration/config2/SchemaTypeIntegerLimits.cpp → configuration/configmgr/configmgrlib/SchemaTypeIntegerLimits.cpp


configuration/config2/SchemaTypeIntegerLimits.hpp → configuration/configmgr/configmgrlib/SchemaTypeIntegerLimits.hpp


configuration/config2/SchemaTypeLimits.cpp → configuration/configmgr/configmgrlib/SchemaTypeLimits.cpp


configuration/config2/SchemaTypeLimits.hpp → configuration/configmgr/configmgrlib/SchemaTypeLimits.hpp


configuration/config2/SchemaTypeStringLimits.cpp → configuration/configmgr/configmgrlib/SchemaTypeStringLimits.cpp


configuration/config2/SchemaTypeStringLimits.hpp → configuration/configmgr/configmgrlib/SchemaTypeStringLimits.hpp


+ 28 - 9
configuration/config2/SchemaValue.cpp

@@ -177,19 +177,25 @@ void SchemaValue::resetEnvironment()
 // replicates the new value throughout the environment
 void SchemaValue::mirrorValueToEnvironment(const std::string &oldValue, const std::string &newValue, Status *pStatus)
 {
+    for (auto &pSchemaValue: m_mirrorToSchemaValues)
+    {
+        pSchemaValue->doMirroroToEnvironmentValues(oldValue, newValue, pStatus);
+    }
+}
+
+
+void SchemaValue::doMirroroToEnvironmentValues(const std::string &oldValue, const std::string &newValue, Status *pStatus)
+{
     std::string msg = "Value automatically changed from " + oldValue + " to " + newValue;
-    for (auto mirrorCfgIt = m_mirrorToSchemaValues.begin(); mirrorCfgIt != m_mirrorToSchemaValues.end(); ++mirrorCfgIt)
+    for (auto &envValueIt: m_envValues)
     {
-        for (auto &envValueIt: m_envValues)
+        std::shared_ptr<EnvironmentValue> pEnvValue = envValueIt.lock();
+        if (pEnvValue && pEnvValue->getValue() == oldValue)
         {
-            std::shared_ptr<EnvironmentValue> pEnvValue = envValueIt.lock();
-            if (pEnvValue && pEnvValue->getValue() == oldValue)
+            pEnvValue->setValue(newValue, nullptr, true);
+            if (pStatus != nullptr)
             {
-                pEnvValue->setValue(newValue, nullptr, true);
-                if (pStatus != nullptr)
-                {
-                    pStatus->addMsg(statusMsg::change, msg, pEnvValue->getEnvironmentNode()->getId(), pEnvValue->getSchemaValue()->getDisplayName());
-                }
+                pStatus->addMsg(statusMsg::change, msg, pEnvValue->getEnvironmentNode()->getId(), pEnvValue->getSchemaValue()->getDisplayName());
             }
         }
     }
@@ -389,3 +395,16 @@ bool SchemaValue::isHidden(const EnvironmentValue *pEnvValue) const
     }
     return hidden;
 }
+
+
+void SchemaValue::removeEnvironmentValue(const std::shared_ptr<EnvironmentValue> &pEnvValue)
+{
+    for (auto it = m_envValues.begin(); it != m_envValues.end(); ++it)
+    {
+        if ((*it).lock() == pEnvValue)
+        {
+            m_envValues.erase(it);
+            break;
+        }
+    }
+}

+ 6 - 0
configuration/config2/SchemaValue.hpp

@@ -74,6 +74,7 @@ class DECL_EXPORT SchemaValue
         void mirrorValueToEnvironment(const std::string &oldValue, const std::string &newValue, Status *pStatus = nullptr);
         void addEnvironmentValue(const std::shared_ptr<EnvironmentValue> &pEnvValue) { m_envValues.push_back(pEnvValue); }
         void getAllEnvironmentValues(std::vector<std::shared_ptr<EnvironmentValue>> &envValues) const;
+        void removeEnvironmentValue(const std::shared_ptr<EnvironmentValue> &pEnvValue);
         void validate(Status &status, const std::string &id, const EnvironmentValue *pEnvValue = nullptr) const;
         bool getAllowedValues(std::vector<AllowedValue> &allowedValues, const std::shared_ptr<const EnvironmentNode> &pEnvNode) const;
         void setAutoGenerateType(const std::string &type) { m_autoGenerateType = type; }
@@ -95,6 +96,11 @@ class DECL_EXPORT SchemaValue
 
     protected:
 
+        void doMirroroToEnvironmentValues(const std::string &oldValue, const std::string &newValue, Status *pStatus = nullptr);
+
+
+    protected:
+
         // DON'T FORGET IF DATA ADDED, IT MAY MAY TO BE COPIED IN THE COPY CONSTRUCTOR!!
         std::shared_ptr<SchemaType> m_pType;
         std::string m_name;

configuration/config2/Status.cpp → configuration/configmgr/configmgrlib/Status.cpp


configuration/config2/Status.hpp → configuration/configmgr/configmgrlib/Status.hpp


configuration/config2/Utils.cpp → configuration/configmgr/configmgrlib/Utils.cpp


configuration/config2/Utils.hpp → configuration/configmgr/configmgrlib/Utils.hpp


configuration/config2/XMLEnvironmentLoader.cpp → configuration/configmgr/configmgrlib/XMLEnvironmentLoader.cpp


configuration/config2/XMLEnvironmentLoader.hpp → configuration/configmgr/configmgrlib/XMLEnvironmentLoader.hpp


configuration/config2/XMLEnvironmentMgr.cpp → configuration/configmgr/configmgrlib/XMLEnvironmentMgr.cpp


configuration/config2/XMLEnvironmentMgr.hpp → configuration/configmgr/configmgrlib/XMLEnvironmentMgr.hpp


configuration/config2/XSDComponentParser.cpp → configuration/configmgr/configmgrlib/XSDComponentParser.cpp


configuration/config2/XSDComponentParser.hpp → configuration/configmgr/configmgrlib/XSDComponentParser.hpp


+ 11 - 1
configuration/config2/XSDSchemaParser.cpp

@@ -359,7 +359,17 @@ void XSDSchemaParser::parseElement(const pt::ptree &elemTree)
     std::string insertLimitData = elemTree.get("<xmlattr>.hpcc:insertLimitData", "");
     unsigned minOccurs = elemTree.get<unsigned>("<xmlattr>.minOccurs", 1);
     std::string maxOccursStr = elemTree.get("<xmlattr>.maxOccurs", "1");
-    unsigned maxOccurs = (maxOccursStr != "unbounded") ? stoi(maxOccursStr) : UINT_MAX;
+    unsigned maxOccurs;
+
+    try
+    {
+        maxOccurs = (maxOccursStr != "unbounded") ? stoi(maxOccursStr) : UINT_MAX;
+    }
+    catch(...)
+    {
+        std::string msg = "Invalid maxOccurs value: '" + maxOccursStr + "', Unable to convert to a number in element = '" + elementName;
+        throw(ParseException(msg));
+    }
 
     if (category == "root")
     {

configuration/config2/XSDSchemaParser.hpp → configuration/configmgr/configmgrlib/XSDSchemaParser.hpp


configuration/config2/XSDValueSetParser.cpp → configuration/configmgr/configmgrlib/XSDValueSetParser.cpp


configuration/config2/XSDValueSetParser.hpp → configuration/configmgr/configmgrlib/XSDValueSetParser.hpp


configuration/config2/hpcc_support/CMakeLists.txt → configuration/configmgr/hpcc_support/CMakeLists.txt


configuration/config2/hpcc_support/HPCCConfigSupport.hpp → configuration/configmgr/hpcc_support/HPCCConfigSupport.hpp


configuration/config2/hpcc_support/add_required_instances/AddRequiredInstancesSupport.cpp → configuration/configmgr/hpcc_support/add_required_instances/AddRequiredInstancesSupport.cpp


configuration/config2/hpcc_support/add_required_instances/AddRequiredInstancesSupport.hpp → configuration/configmgr/hpcc_support/add_required_instances/AddRequiredInstancesSupport.hpp


+ 2 - 2
configuration/config2/hpcc_support/add_required_instances/CMakeLists.txt

@@ -28,13 +28,13 @@ INCLUDE_DIRECTORIES(
     ${CMAKE_PREFIX_PATH}/mkspecs/linux-g++
     ${CMAKE_CURRENT_SOURCE_DIR}
     ${CMAKE_CURRENT_SOURCE_DIR}/..
-    ${CMAKE_CURRENT_SOURCE_DIR}/../..
+    ${CMAKE_CURRENT_SOURCE_DIR}/../../configmgrlib
     ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}/oss
 )
 
 ADD_DEFINITIONS( -D_USRDLL -DCFGSUPPORT_DAFILESRV_LIB)
 HPCC_ADD_LIBRARY( cfgsupport_addrequiredinstances SHARED ${SRCS} )
-TARGET_LINK_LIBRARIES( cfgsupport_addrequiredinstances config2 jlib )
+TARGET_LINK_LIBRARIES( cfgsupport_addrequiredinstances jlib )
 
 INSTALL ( TARGETS cfgsupport_addrequiredinstances RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )

+ 3 - 3
esp/scm/espscm.cmake

@@ -40,7 +40,7 @@ set ( ESPSCM_SRCS
       ws_esdlconfig.ecm
       ws_loggingservice.ecm
       ws_espcontrol.ecm
-      ws_config2.ecm
+      ws_configmgr.ecm
       ws_elk.ecm
     )
 
@@ -64,9 +64,9 @@ foreach ( loop_var ${ESPSCM_SRCS} )
     set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}_esp.ipp PROPERTIES GENERATED TRUE)
     set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}.xml PROPERTIES GENERATED TRUE)
     set ( ESP_GENERATED_INCLUDES ${ESP_GENERATED_INCLUDES} ${ESPSCM_GENERATED_DIR}/${result}.esp ${ESPSCM_GENERATED_DIR}/${result}.hpp ${ESPSCM_GENERATED_DIR}/${result}.int ${ESPSCM_GENERATED_DIR}/${result}.ipp ${ESPSCM_GENERATED_DIR}/${result}_esp.ipp ${ESPSCM_GENERATED_DIR}/${result}.xml )
-    if ( PLATFORM )    
+    if ( PLATFORM )
         Install( FILES ${ESPSCM_GENERATED_DIR}/${result}.xml DESTINATION componentfiles/esdl_files COMPONENT Runtime )
-    endif ( PLATFORM )    
+    endif ( PLATFORM )
 endforeach ( loop_var ${ESPSCM_SRCS} )
 
 include_directories ( ${ESPSCM_GENERATED_DIR} )

+ 3 - 3
esp/scm/ws_config2.ecm

@@ -401,7 +401,7 @@ ESPresponse [exceptions_inline] FetchNodesResponse
 };
 
 
-ESPservice [auth_feature("DEFERRED"),version("2.0"), default_client_version("2.0"), exceptions_inline("xslt/exceptions.xslt")] ws_config2
+ESPservice [auth_feature("DEFERRED"),version("2.0"), default_client_version("2.0"), exceptions_inline("xslt/exceptions.xslt")] ws_configmgr
 {
     ESPMethod
         [
@@ -478,6 +478,6 @@ ESPservice [auth_feature("DEFERRED"),version("2.0"), default_client_version("2.0
 };
 
 
-SCMexportdef(ws_config2);
+SCMexportdef(ws_configmgr);
 
-SCMapi(ws_config2) IClientws_config2 *createws_config2Client();
+SCMapi(ws_configmgr) IClientws_configmgr *createws_configmgrClient();

+ 1 - 1
esp/services/CMakeLists.txt

@@ -19,7 +19,7 @@ IF (USE_OPENLDAP)
 ENDIF(USE_OPENLDAP)
 HPCC_ADD_SUBDIRECTORY (ws_account "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_config "PLATFORM")
-HPCC_ADD_SUBDIRECTORY (ws_config2 "PLATFORM")
+HPCC_ADD_SUBDIRECTORY (ws_configmgr "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_dfu "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_ecl "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_fileio "PLATFORM")

+ 12 - 14
esp/services/ws_config2/CMakeLists.txt

@@ -16,14 +16,14 @@
 #
 ###############################################################################
 
-project(ws_config2)
+project(ws_configmgr)
 
 include(${HPCC_SOURCE_DIR}/esp/scm/espscm.cmake)
 
 set(SRCS
-    ${ESPSCM_GENERATED_DIR}/ws_config2_esp.cpp
-    ws_config2Service.cpp
-    ws_config2_plugin.cpp
+    ${ESPSCM_GENERATED_DIR}/ws_configmgr_esp.cpp
+        ws_configmgrService.cpp
+        ws_configmgr_plugin.cpp
     )
 
 include_directories(
@@ -46,35 +46,33 @@ include_directories(
     ${HPCC_SOURCE_DIR}/esp/http/platform
     ${HPCC_SOURCE_DIR}/system/mp
     ${HPCC_SOURCE_DIR}/system/xmllib
-    ${HPCC_SOURCE_DIR}/configuration/config2
+    ${HPCC_SOURCE_DIR}/configuration/configmgr/configmgrlib
     ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}/oss
-    ${CMAKE_BINARY_DIR}/esp/services/ws_config2
+    ${CMAKE_BINARY_DIR}/esp/services/ws_configmgr
     )
 
 add_definitions(-D_USRDLL)
 
-HPCC_ADD_LIBRARY(ws_config2 SHARED ${SRCS})
+HPCC_ADD_LIBRARY(ws_configmgr SHARED ${SRCS})
 install(
-    TARGETS ws_config2
+    TARGETS ws_configmgr
     RUNTIME DESTINATION ${EXEC_DIR}
     LIBRARY DESTINATION ${LIB_DIR}
     COMPONENT Runtime
     )
-add_dependencies(ws_config2 espscm config2)
-target_link_libraries(ws_config2
+add_dependencies(ws_configmgr espscm configmgr)
+target_link_libraries(ws_configmgr
     jlib
     xmllib
     esphttp
     environment
     dllserver
-    config2
+    configmgr
     )
 
 IF (USE_OPENSSL)
-    target_link_libraries ( ws_config2
+    target_link_libraries ( ws_configmgr
         securesocket
     )
 ENDIF()
-
-

esp/services/ws_config2/ws_config2Error.hpp → esp/services/ws_configmgr/ws_configmgrError.hpp


+ 42 - 42
esp/services/ws_config2/ws_config2Service.cpp

@@ -15,32 +15,32 @@
     limitations under the License.
 ############################################################################## */
 
-#include "ws_config2Service.hpp"
+#include "ws_configmgrService.hpp"
 #include "jfile.hpp"
 #include "SchemaItem.hpp"
 #include "InsertableItem.hpp"
 #include "jexcept.hpp"
-#include "ws_config2Error.hpp"
+#include "ws_configmgrError.hpp"
 #include "Exceptions.hpp"
 
-static const std::string CFG2_MASTER_CONFIG_FILE = "environment.xsd";
-static const std::string CFG2_CONFIG_DIR = COMPONENTFILES_DIR PATHSEPSTR "configschema" PATHSEPSTR "xsd" PATHSEPSTR;
-static const std::string CFG2_PLUGINS_DIR = COMPONENTFILES_DIR PATHSEPSTR "configschema" PATHSEPSTR "xsd" PATHSEPSTR "plugins" PATHSEPSTR;
-static const std::string CFG2_SOURCE_DIR = CONFIG_SOURCE_DIR;
+static const std::string CFGMGR_MASTER_CONFIG_FILE = "environment.xsd";
+static const std::string CFGMGR_CONFIG_DIR = COMPONENTFILES_DIR PATHSEPSTR "configschema" PATHSEPSTR "xsd" PATHSEPSTR;
+static const std::string CFGMGR_PLUGINS_DIR = COMPONENTFILES_DIR PATHSEPSTR "configschema" PATHSEPSTR "xsd" PATHSEPSTR "plugins" PATHSEPSTR;
+static const std::string CFGMGR_SOURCE_DIR = CONFIG_SOURCE_DIR;
 static const std::string ACTIVE_ENVIRONMENT_FILE = CONFIG_DIR PATHSEPSTR ENV_XML_FILE;
 
-Cws_config2Ex::Cws_config2Ex()
+Cws_configMgrEx::Cws_configMgrEx()
 {
     m_sessionKey = 0;
 }
 
 
-Cws_config2Ex::~Cws_config2Ex()
+Cws_configMgrEx::~Cws_configMgrEx()
 {
 }
 
 
-bool Cws_config2Ex::onOpenSession(IEspContext &context, IEspOpenSessionRequest &req, IEspOpenSessionResponse &resp)
+bool Cws_configMgrEx::onOpenSession(IEspContext &context, IEspOpenSessionRequest &req, IEspOpenSessionResponse &resp)
 {
     bool loaded = false;
     ConfigMgrSession *pNewSession = new ConfigMgrSession();
@@ -49,10 +49,10 @@ bool Cws_config2Ex::onOpenSession(IEspContext &context, IEspOpenSessionRequest &
     std::string inputSchemaPath = req.getSchemaPath();
     std::string inputSourcePath = req.getSourcePath();
     std::string inputActivePath = req.getActivePath();
-    pNewSession->masterConfigFile = !inputMasterFile.empty() ? inputMasterFile : CFG2_MASTER_CONFIG_FILE;
+    pNewSession->masterConfigFile = !inputMasterFile.empty() ? inputMasterFile : CFGMGR_MASTER_CONFIG_FILE;
     pNewSession->username = req.getUsername();
-    pNewSession->schemaPath = !inputSchemaPath.empty() ? inputSchemaPath : CFG2_CONFIG_DIR;
-    pNewSession->sourcePath = !inputSourcePath.empty() ? inputSourcePath : CFG2_SOURCE_DIR;
+    pNewSession->schemaPath = !inputSchemaPath.empty() ? inputSchemaPath : CFGMGR_CONFIG_DIR;
+    pNewSession->sourcePath = !inputSourcePath.empty() ? inputSourcePath : CFGMGR_SOURCE_DIR;
     pNewSession->activePath = !inputActivePath.empty() ? inputActivePath : ACTIVE_ENVIRONMENT_FILE;
 
     //
@@ -75,7 +75,7 @@ bool Cws_config2Ex::onOpenSession(IEspContext &context, IEspOpenSessionRequest &
     std::string inputSupportLibs = req.getSupportLibs();
     cfgParms["support_libs"] = inputSupportLibs.empty() ? "libcfgsupport_addrequiredinstances" : inputSupportLibs;
     std::string pluginsPath = req.getPluginPaths();
-    cfgParms["plugin_paths"] = !pluginsPath.empty() ? pluginsPath : CFG2_PLUGINS_DIR;
+    cfgParms["plugin_paths"] = !pluginsPath.empty() ? pluginsPath : CFGMGR_PLUGINS_DIR;
 
     if (pNewSession->initializeSession(cfgParms))
     {
@@ -94,7 +94,7 @@ bool Cws_config2Ex::onOpenSession(IEspContext &context, IEspOpenSessionRequest &
 }
 
 
-bool Cws_config2Ex::onCloseSession(IEspContext &context, IEspCloseSessionRequest &req, IEspEmptyResponse &resp)
+bool Cws_configMgrEx::onCloseSession(IEspContext &context, IEspCloseSessionRequest &req, IEspEmptyResponse &resp)
 {
     std::string sessionId = req.getSessionId();
     ConfigMgrSession *pSession = getConfigSession(sessionId);
@@ -112,7 +112,7 @@ bool Cws_config2Ex::onCloseSession(IEspContext &context, IEspCloseSessionRequest
 }
 
 
-bool Cws_config2Ex::onGetOpenSessions(IEspContext &context, IEspListOpenSessionsRequest &req, IEspListOpenSessionsResponse &resp)
+bool Cws_configMgrEx::onGetOpenSessions(IEspContext &context, IEspListOpenSessionsRequest &req, IEspListOpenSessionsResponse &resp)
 {
     IArrayOf<IEspOpenSessionInfo> openSessions;
     for (auto sessionIt=m_sessions.begin(); sessionIt != m_sessions.end(); ++sessionIt)
@@ -130,7 +130,7 @@ bool Cws_config2Ex::onGetOpenSessions(IEspContext &context, IEspListOpenSessions
 }
 
 
-bool Cws_config2Ex::onGetEnvironmentFileList(IEspContext &context, IEspGetEnvironmentFileListRequest &req, IEspGetEnvironmentListResponse &resp)
+bool Cws_configMgrEx::onGetEnvironmentFileList(IEspContext &context, IEspGetEnvironmentFileListRequest &req, IEspGetEnvironmentListResponse &resp)
 {
     std::string sessionId = req.getSessionId();
     ConfigMgrSession *pSession = getConfigSession(sessionId);
@@ -176,7 +176,7 @@ bool Cws_config2Ex::onGetEnvironmentFileList(IEspContext &context, IEspGetEnviro
 }
 
 
-bool Cws_config2Ex::onOpenEnvironmentFile(IEspContext &context, IEspOpenEnvironmentFileRequest &req, IEspOpenEnvironmentFileResponse &resp)
+bool Cws_configMgrEx::onOpenEnvironmentFile(IEspContext &context, IEspOpenEnvironmentFileRequest &req, IEspOpenEnvironmentFileResponse &resp)
 {
     bool doOpen = false;
     ConfigMgrSession *pSession = getConfigSession(req.getSessionId());
@@ -200,7 +200,7 @@ bool Cws_config2Ex::onOpenEnvironmentFile(IEspContext &context, IEspOpenEnvironm
 }
 
 
-bool Cws_config2Ex::onCloseEnvironmentFile(IEspContext &context, IEspCloseEnvironmentFileRequest &req, IEspEmptyResponse &resp)
+bool Cws_configMgrEx::onCloseEnvironmentFile(IEspContext &context, IEspCloseEnvironmentFileRequest &req, IEspEmptyResponse &resp)
 {
     bool doClose = false;
     ConfigMgrSession *pSession = getConfigSession(req.getSessionId());
@@ -222,7 +222,7 @@ bool Cws_config2Ex::onCloseEnvironmentFile(IEspContext &context, IEspCloseEnviro
 }
 
 
-bool Cws_config2Ex::onSaveEnvironmentFile(IEspContext &context, IEspSaveEnvironmentFileRequest &req, IEspEmptyResponse &resp)
+bool Cws_configMgrEx::onSaveEnvironmentFile(IEspContext &context, IEspSaveEnvironmentFileRequest &req, IEspEmptyResponse &resp)
 {
     // todo: If this envronment file is loaded by any other session, go mark that session that the environment has changed
     // and don't allow a save w/o reloading first. maybe add a reload request. Add relevant errors.
@@ -282,7 +282,7 @@ bool Cws_config2Ex::onSaveEnvironmentFile(IEspContext &context, IEspSaveEnvironm
 }
 
 
-bool Cws_config2Ex::onLockSession(IEspContext &context, IEspLockSessionRequest &req, IEspLockSessionResponse &resp)
+bool Cws_configMgrEx::onLockSession(IEspContext &context, IEspLockSessionRequest &req, IEspLockSessionResponse &resp)
 {
     std::string sessionId = req.getSessionId();
     ConfigMgrSession *pSession = getConfigSession(sessionId, true);
@@ -319,7 +319,7 @@ bool Cws_config2Ex::onLockSession(IEspContext &context, IEspLockSessionRequest &
 }
 
 
-bool Cws_config2Ex::onUnlockSession(IEspContext &context, IEspUnlockSessionRequest &req, IEspEmptyResponse &resp)
+bool Cws_configMgrEx::onUnlockSession(IEspContext &context, IEspUnlockSessionRequest &req, IEspEmptyResponse &resp)
 {
     ConfigMgrSession *pSession = getConfigSessionForUpdate(req.getSessionId(), req.getSessionLockKey());
 
@@ -337,7 +337,7 @@ bool Cws_config2Ex::onUnlockSession(IEspContext &context, IEspUnlockSessionReque
 }
 
 
-bool Cws_config2Ex::onGetNode(IEspContext &context, IEspGetNodeRequest &req, IEspGetNodeResponse &resp)
+bool Cws_configMgrEx::onGetNode(IEspContext &context, IEspGetNodeRequest &req, IEspGetNodeResponse &resp)
 {
     std::string sessionId = req.getSessionId();
     std::string id = req.getNodeId();
@@ -362,7 +362,7 @@ bool Cws_config2Ex::onGetNode(IEspContext &context, IEspGetNodeRequest &req, IEs
 }
 
 
-bool Cws_config2Ex::onGetCreateNodeInfo(IEspContext &context, IEspGetCreateNodeInfoRequest &req, IEspGetCreateNodeInfoResponse &resp)
+bool Cws_configMgrEx::onGetCreateNodeInfo(IEspContext &context, IEspGetCreateNodeInfoRequest &req, IEspGetCreateNodeInfoResponse &resp)
 {
     ConfigMgrSession *pSession = getConfigSession(req.getSessionId());
     Status status;
@@ -388,7 +388,7 @@ bool Cws_config2Ex::onGetCreateNodeInfo(IEspContext &context, IEspGetCreateNodeI
 }
 
 
-bool Cws_config2Ex::onInsertNode(IEspContext &context, IEspInsertNodeRequest &req, IEspGetNodeResponse &resp)
+bool Cws_configMgrEx::onInsertNode(IEspContext &context, IEspInsertNodeRequest &req, IEspGetNodeResponse &resp)
 {
     ConfigMgrSession *pSession = getConfigSessionForUpdate(req.getSessionId(), req.getSessionLockKey());
     Status status;
@@ -428,7 +428,7 @@ bool Cws_config2Ex::onInsertNode(IEspContext &context, IEspInsertNodeRequest &re
 }
 
 
-bool Cws_config2Ex::onRemoveNode(IEspContext &context, IEspRemoveNodeRequest &req, IEspStatusResponse &resp)
+bool Cws_configMgrEx::onRemoveNode(IEspContext &context, IEspRemoveNodeRequest &req, IEspStatusResponse &resp)
 {
     std::string sessionId = req.getSessionId();
     std::string key = req.getSessionLockKey();
@@ -450,7 +450,7 @@ bool Cws_config2Ex::onRemoveNode(IEspContext &context, IEspRemoveNodeRequest &re
 }
 
 
-bool Cws_config2Ex::onValidateEnvironment(IEspContext &context, IEspValidateEnvironmentRequest &req, IEspStatusResponse &resp)
+bool Cws_configMgrEx::onValidateEnvironment(IEspContext &context, IEspValidateEnvironmentRequest &req, IEspStatusResponse &resp)
 {
     Status status;
     std::string sessionId = req.getSessionId();
@@ -463,7 +463,7 @@ bool Cws_config2Ex::onValidateEnvironment(IEspContext &context, IEspValidateEnvi
 }
 
 
-bool Cws_config2Ex::onSetValues(IEspContext &context, IEspSetValuesRequest &req, IEspStatusResponse &resp)
+bool Cws_configMgrEx::onSetValues(IEspContext &context, IEspSetValuesRequest &req, IEspStatusResponse &resp)
 {
     Status status;
     std::string sessionId = req.getSessionId();
@@ -496,7 +496,7 @@ bool Cws_config2Ex::onSetValues(IEspContext &context, IEspSetValuesRequest &req,
 }
 
 
-bool Cws_config2Ex::onGetParents(IEspContext &context, IEspGetParentsRequest &req, IEspGetParentsResponse &resp)
+bool Cws_configMgrEx::onGetParents(IEspContext &context, IEspGetParentsRequest &req, IEspGetParentsResponse &resp)
 {
     std::string nodeId = req.getNodeId();
     std::string sessionId = req.getSessionId();
@@ -524,7 +524,7 @@ bool Cws_config2Ex::onGetParents(IEspContext &context, IEspGetParentsRequest &re
 }
 
 
-bool Cws_config2Ex::onGetNodeTree(IEspContext &context, IEspGetTreeRequest &req, IEspGetTreeResponse &resp)
+bool Cws_configMgrEx::onGetNodeTree(IEspContext &context, IEspGetTreeRequest &req, IEspGetTreeResponse &resp)
 {
     std::string nodeId = req.getNodeId();
     std::string sessionId = req.getSessionId();
@@ -544,7 +544,7 @@ bool Cws_config2Ex::onGetNodeTree(IEspContext &context, IEspGetTreeRequest &req,
 }
 
 
-bool Cws_config2Ex::onFetchNodes(IEspContext &context, IEspFetchNodesRequest &req, IEspFetchNodesResponse &resp)
+bool Cws_configMgrEx::onFetchNodes(IEspContext &context, IEspFetchNodesRequest &req, IEspFetchNodesResponse &resp)
 {
     std::string sessionId = req.getSessionId();
     std::string path = req.getPath();
@@ -593,7 +593,7 @@ bool Cws_config2Ex::onFetchNodes(IEspContext &context, IEspFetchNodesRequest &re
 }
 
 
-void Cws_config2Ex::buildStatusResponse(const Status &status, ConfigMgrSession *pSession, IEspStatusType &respStatus) const
+void Cws_configMgrEx::buildStatusResponse(const Status &status, ConfigMgrSession *pSession, IEspStatusType &respStatus) const
 {
     std::vector<statusMsg> statusMsgs = status.getMessages();
 
@@ -622,7 +622,7 @@ void Cws_config2Ex::buildStatusResponse(const Status &status, ConfigMgrSession *
 }
 
 
-ConfigMgrSession *Cws_config2Ex::getConfigSession(const std::string &sessionId, bool environmentRequired)
+ConfigMgrSession *Cws_configMgrEx::getConfigSession(const std::string &sessionId, bool environmentRequired)
 {
     ConfigMgrSession *pSession = nullptr;
 
@@ -645,7 +645,7 @@ ConfigMgrSession *Cws_config2Ex::getConfigSession(const std::string &sessionId,
 }
 
 
-ConfigMgrSession *Cws_config2Ex::getConfigSessionForUpdate(const std::string &sessionId, const std::string &lockKey)
+ConfigMgrSession *Cws_configMgrEx::getConfigSessionForUpdate(const std::string &sessionId, const std::string &lockKey)
 {
     ConfigMgrSession *pSession = getConfigSession(sessionId, true);
     if (!pSession->doesKeyFit(lockKey))
@@ -656,7 +656,7 @@ ConfigMgrSession *Cws_config2Ex::getConfigSessionForUpdate(const std::string &se
 }
 
 
-bool Cws_config2Ex::deleteConfigSession(const std::string &sessionId)
+bool Cws_configMgrEx::deleteConfigSession(const std::string &sessionId)
 {
     bool rc = false;
     ConfigMgrSession *pSession = getConfigSession(sessionId);
@@ -670,7 +670,7 @@ bool Cws_config2Ex::deleteConfigSession(const std::string &sessionId)
 }
 
 
-void Cws_config2Ex::getNodeResponse(const std::shared_ptr<EnvironmentNode> &pNode, IEspGetNodeResponse &resp) const
+void Cws_configMgrEx::getNodeResponse(const std::shared_ptr<EnvironmentNode> &pNode, IEspGetNodeResponse &resp) const
 {
     const std::shared_ptr<SchemaItem> &pNodeSchemaItem = pNode->getSchemaItem();
     std::string nodeDisplayName;
@@ -782,7 +782,7 @@ void Cws_config2Ex::getNodeResponse(const std::shared_ptr<EnvironmentNode> &pNod
 }
 
 
-void Cws_config2Ex::getCreateNodeInfoResponse(const std::shared_ptr<EnvironmentNode> &pNode, IEspGetCreateNodeInfoResponse &resp) const
+void Cws_configMgrEx::getCreateNodeInfoResponse(const std::shared_ptr<EnvironmentNode> &pNode, IEspGetCreateNodeInfoResponse &resp) const
 {
     const std::shared_ptr<SchemaItem> &pNodeSchemaItem = pNode->getSchemaItem();
     std::string nodeDisplayName;
@@ -834,7 +834,7 @@ void Cws_config2Ex::getCreateNodeInfoResponse(const std::shared_ptr<EnvironmentN
 
 
 
-void Cws_config2Ex::getNodeInfo(const std::shared_ptr<EnvironmentNode> &pNode, IEspNodeInfoType &nodeInfo) const
+void Cws_configMgrEx::getNodeInfo(const std::shared_ptr<EnvironmentNode> &pNode, IEspNodeInfoType &nodeInfo) const
 {
     const std::shared_ptr<SchemaItem> &pNodeSchemaItem = pNode->getSchemaItem();
     std::string nodeDisplayName;
@@ -847,7 +847,7 @@ void Cws_config2Ex::getNodeInfo(const std::shared_ptr<EnvironmentNode> &pNode, I
 }
 
 
-void Cws_config2Ex::getNodeInfo(const std::shared_ptr<SchemaItem> &pNodeSchemaItem, IEspNodeInfoType &nodeInfo) const
+void Cws_configMgrEx::getNodeInfo(const std::shared_ptr<SchemaItem> &pNodeSchemaItem, IEspNodeInfoType &nodeInfo) const
 {
     //
     // Fill in base node info struct
@@ -863,7 +863,7 @@ void Cws_config2Ex::getNodeInfo(const std::shared_ptr<SchemaItem> &pNodeSchemaIt
 }
 
 
-void Cws_config2Ex::getAttributes(const std::shared_ptr<EnvironmentNode> &pEnvNode, IArrayOf<IEspAttributeType> &nodeAttributes, bool includeMissing) const
+void Cws_configMgrEx::getAttributes(const std::shared_ptr<EnvironmentNode> &pEnvNode, IArrayOf<IEspAttributeType> &nodeAttributes, bool includeMissing) const
 {
     std::vector<std::shared_ptr<SchemaValue>> schemaValues;
     pEnvNode->getSchemaItem()->getAttributes(schemaValues);
@@ -997,7 +997,7 @@ void Cws_config2Ex::getAttributes(const std::shared_ptr<EnvironmentNode> &pEnvNo
 }
 
 
-void Cws_config2Ex::getNodeDisplayName(const std::shared_ptr<EnvironmentNode> &pNode, std::string &nodeDisplayName) const
+void Cws_configMgrEx::getNodeDisplayName(const std::shared_ptr<EnvironmentNode> &pNode, std::string &nodeDisplayName) const
 {
     const std::shared_ptr<SchemaItem> &pNodeSchemaItem = pNode->getSchemaItem();
     nodeDisplayName = pNodeSchemaItem->getProperty("displayName");
@@ -1012,7 +1012,7 @@ void Cws_config2Ex::getNodeDisplayName(const std::shared_ptr<EnvironmentNode> &p
 }
 
 
-void Cws_config2Ex::getNodeParents(const std::string &nodeId, ConfigMgrSession *pSession, StringArray &parentNodeIds) const
+void Cws_configMgrEx::getNodeParents(const std::string &nodeId, ConfigMgrSession *pSession, StringArray &parentNodeIds) const
 {
     std::shared_ptr<EnvironmentNode> pNode = pSession->m_pEnvMgr->findEnvironmentNodeById(nodeId);
     if (pNode)
@@ -1028,7 +1028,7 @@ void Cws_config2Ex::getNodeParents(const std::string &nodeId, ConfigMgrSession *
     }
 }
 
-void Cws_config2Ex::getNodeTree(const std::shared_ptr<EnvironmentNode> &pNode, IEspTreeElementType &treeElement, int levels, bool includeAttributes) const
+void Cws_configMgrEx::getNodeTree(const std::shared_ptr<EnvironmentNode> &pNode, IEspTreeElementType &treeElement, int levels, bool includeAttributes) const
 {
     //
     // Fill in this element

+ 9 - 9
esp/services/ws_config2/ws_config2Service.hpp

@@ -15,27 +15,27 @@
     limitations under the License.
 ############################################################################## */
 
-#ifndef _WSCONFIG2_HPP_
-#define _WSCONFIG2_HPP_
+#ifndef _WSCONFIGMGR_HPP_
+#define _WSCONFIGMGR_HPP_
 
-#include "ws_config2.hpp"
-#include "ws_config2_esp.ipp"
+#include "ws_configmgr.hpp"
+#include "ws_configmgr_esp.ipp"
 #include <string>
 #include "XSDSchemaParser.hpp"
 #include "EnvironmentMgr.hpp"
 #include "XMLEnvironmentMgr.hpp"
-#include "ws_config2Session.hpp"
+#include "ws_configmgrSession.hpp"
 
 
 class Status;
 
-class Cws_config2Ex : public Cws_config2
+class Cws_configMgrEx : public Cws_configmgr
 {
 public:
     IMPLEMENT_IINTERFACE
 
-    Cws_config2Ex();
-    virtual ~Cws_config2Ex();
+    Cws_configMgrEx();
+    virtual ~Cws_configMgrEx();
 
     virtual bool onGetNode(IEspContext &context, IEspGetNodeRequest &req, IEspGetNodeResponse &resp);
     virtual bool onSetValues(IEspContext &context, IEspSetValuesRequest &req, IEspStatusResponse &resp);
@@ -80,4 +80,4 @@ private:
     unsigned m_sessionKey;
 };
 
-#endif // _WSCONFIG2_HPP_
+#endif // _WSCONFIGMGR_HPP_

+ 2 - 2
esp/services/ws_config2/ws_config2Session.hpp

@@ -16,8 +16,8 @@
 ############################################################################## */
 
 
-#ifndef _CONFIG2SERVICE_SESSION_HPP_
-#define _CONFIG2SERVICE_SESSION_HPP_
+#ifndef _CONFIGMGRSERVICE_SESSION_HPP_
+#define _CONFIGMGRSERVICE_SESSION_HPP_
 
 
 #include "EnvironmentMgr.hpp"

+ 4 - 4
esp/services/ws_config2/ws_config2_binding.hpp

@@ -15,14 +15,14 @@
     limitations under the License.
 ############################################################################## */
 
-#include "ws_config2Service.hpp"
+#include "ws_configmgrService.hpp"
 
 
-class Cws_config2SoapBindingEx : public Cws_config2SoapBinding
+class Cws_configMgrSoapBindingEx : public Cws_configmgrSoapBinding
 {
 public:
-    Cws_config2SoapBindingEx(http_soap_log_level level=hsl_none) : Cws_config2SoapBinding(level)  { }
-    Cws_config2SoapBindingEx(IPropertyTree* cfg, const char *bindname, const char *procname, http_soap_log_level level=hsl_none) : Cws_config2SoapBinding(cfg, bindname, procname, level)   {  }
+    Cws_configMgrSoapBindingEx(http_soap_log_level level=hsl_none) : Cws_configmgrSoapBinding(level)  { }
+    Cws_configMgrSoapBindingEx(IPropertyTree* cfg, const char *bindname, const char *procname, http_soap_log_level level=hsl_none) : Cws_configmgrSoapBinding(cfg, bindname, procname, level)   {  }
     //virtual const char* getRootPage(IEspContext* ctx)  {  return "config2html";  }
 
 

+ 7 - 7
esp/services/ws_config2/ws_config2_plugin.cpp

@@ -17,14 +17,14 @@
 
 #pragma warning (disable : 4786)
 
-#include "ws_config2_esp.ipp"
+#include "ws_configmgr_esp.ipp"
 
 //ESP Bindings
 #include "http/platform/httpprot.hpp"
 
 //ESP Service
-#include "ws_config2Service.hpp"
-#include "ws_config2_binding.hpp"
+#include "ws_configmgrService.hpp"
+#include "ws_configmgr_binding.hpp"
 
 #include "espplugin.hpp"
 
@@ -33,9 +33,9 @@ extern "C"
 
 ESP_FACTORY IEspService * esp_service_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
 {
-   if (strcmp(type, "ws_config2")==0)
+   if (strcmp(type, "ws_configmgr")==0)
    {
-      Cws_config2Ex* service = new Cws_config2Ex;
+      Cws_configMgrEx* service = new Cws_configMgrEx;
       service->init(cfg, process, name);
       return service;
    }
@@ -44,9 +44,9 @@ ESP_FACTORY IEspService * esp_service_factory(const char *name, const char* type
 
 ESP_FACTORY IEspRpcBinding * esp_binding_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
 {
-   if (strcmp(type, "ws_config2SoapBinding")==0)
+   if (strcmp(type, "ws_configMgrSoapBinding")==0)
    {
-        return new Cws_config2SoapBindingEx(cfg, name, process);
+        return new Cws_configMgrSoapBindingEx(cfg, name, process);
    }
 
    return NULL;

+ 48 - 0
initfiles/componentfiles/configschema/xsd/backupnode.xsd

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+################################################################################
+#    HPCC SYSTEMS software Copyright (C) 2018 HPCC Systems®.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+################################################################################
+-->
+
+<xs:schema
+        xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"
+        xmlns:hpcc="someuri">
+    <xs:include schemaLocation="types.xsd"/>
+    <hpcc:insert hpcc:schemaPath="/Environment/Software">
+        <xs:element name="BackupNodeProcess" hpcc:displayName="Backup Node Process" hpcc:itemType="backupnode" minOccurs="0" maxOccurs="unbounded" hpcc:class="component">
+            <xs:complexType>
+                <xs:sequence>
+                    <xs:element name="Instance" maxOccurs="unbounded" hpcc:class="elementSet" hpcc:displayName="Instances" hpcc:requiredInstanceComponents="/Evnironment/Software/[#itemType='dafilesrv']">
+                        <xs:complexType>
+                            <xs:attributeGroup ref="computerNodeReference"/>
+                            <xs:attribute name="directory" type="xs:string" use="optional" hpcc:presetValue="c$\backupnode" hpcc:hidden="true"/>
+                        </xs:complexType>
+                    </xs:element>
+                    <xs:element name="NodeGroup" hpcc:displayName="Thor Node Groups" hpcc:class="elementSet" maxOccurs="unbounded">
+                        <xs:complexType>
+                            <xs:attribute name="name" hpcc:displayName="nodeGroup" type="xs:string" use="required"  hpcc:sourceKey="thornode_name" hpcc:tooltip="Thor node group to backup"/>
+                            <xs:attribute name="interval" hpcc:displayName="Interval (hrs)" type="xs:nonNegativeInteger" hpcc:presetValue="24" hpcc:tooltip="Interval in hours for backup to be run"/>
+                        </xs:complexType>
+                    </xs:element>
+                </xs:sequence>
+                <xs:attributeGroup ref="buildInfo"/>
+                <xs:attribute name="name" type="xs:string" use="required" hpcc:displayName="Name" hpcc:autoGenerateType="prefix_" hpcc:autoGenerateValue="mybackupnode"
+                              hpcc:uniqueKey="backupnodeprocess_name" hpcc:tooltip="Name for this backup node process"/>
+                <xs:attribute name="description" type="xs:string" hpcc:displayName="Description" hpcc:presetValue="BackupNode process" hpcc:tooltip="Description for this process"/>
+            </xs:complexType>
+        </xs:element>
+    </hpcc:insert>
+</xs:schema>

+ 70 - 0
initfiles/componentfiles/configschema/xsd/dfuserver.xsd

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+#    HPCC SYSTEMS software Copyright (C) 2018 HPCC Systems®.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+-->
+
+<xs:schema
+        xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"
+        xmlns:hpcc="someuri">
+    <xs:include schemaLocation="types.xsd"/>
+    <hpcc:insert hpcc:schemaPath="/Environment/Software">
+        <xs:element name="DfuServerProcess" hpcc:displayName="DFU Server Process" hpcc:itemType="dfuserver" minOccurs="0" maxOccurs="unbounded"
+                    hpcc:class="component" hpcc:docid="DF.t1">
+            <xs:complexType>
+                <xs:sequence>
+                    <xs:element name="SSH" hpcc:displayName="SSH Options" hpcc:tooltip="Options for using SSH remote execution"
+                                minOccurs="1" maxOccurs="1" hpcc:docid="DF.t2">
+                        <xs:complexType>
+                            <xs:attribute name="SSHidentityfile" hpcc:displayName="Identity File" type="xs:string"
+                                          hpcc:presetValue="$HOME/.ssh/id_rsa" hpcc:tooltip="location of identity file (private key) on Thor master"/>
+                            <xs:attribute name="SSHusername" hpcc:displayName="Username" type="xs:string"
+                                          hpcc:presetValye="hpcc" hpcc:tooltip="Username to use when running Thor slaves"/>
+                            <xs:attribute name="SSHpassword" hpcc:displayName="Password" type="xs:string" hpcc:modifiers="password"
+                                          hpcc:tooltip="Fixed password - only required if no identity file present NB **insecure**"/>
+                            <xs:attribute name="SSHtimeout" hpcc:displayName="Timeout (s)" type="xs:nonNegativeInteger"
+                                          hpcc:presetVaue="0" hpcc:tooltip="Timeout in seconds for SSH connects"/>
+                            <xs:attribute name="SSHretries" hpcc:displayName="Retries" type="xs:nonNegativeInteger"
+                                          hpcc:presetValue="3" hpcc:tooltip="Number of times to retry failed connect"/>
+                        </xs:complexType>
+                    </xs:element>
+
+                    <xs:element name="Instance" hpcc:itemType="hwinstance" maxOccurs="unbounded" hpcc:class="elementSet" hpcc:requiredInstanceComponents="/Evnironment/Software/[#itemType='dafilesrv']">
+                        <xs:complexType>
+                            <xs:attributeGroup ref="computerNodeReference"/>
+                            <xs:attribute name="directory" type="absolutePath" hpcc:hidden="true"/>
+                        </xs:complexType>
+                    </xs:element>
+
+                    <xs:element name="Notes" hpcc:displayName="Notes" type="usernotes"/>
+
+                </xs:sequence>
+                <xs:attributeGroup ref="buildInfo"/>
+                <xs:attribute name="name" type="xs:string" use="required" hpcc:displayName="Name" hpcc:autoGenerateType="prefix_" hpcc:autoGenerateValue="dfuserver"
+                              hpcc:uniqueKey="dfuserver_name" hpcc:tooltip="Name for this DFU Server process"/>
+                <xs:attribute name="description" type="xs:string" hpcc:displayName="Description" hpcc:presetValue="DFU Server process" hpcc:tooltip="Description for this process"/>
+                <xs:attribute name="daliServers" hpcc:displayName="Dali Server" type="xs:string" hpcc:sourceKey="daliprocess_name"
+                              use="required" hpcc:tooltip="Specifies the dali server to which this DFU server is attached"/>
+                <xs:attribute name="queue" hpcc:displayName="Queue" type="xs:string" use="required" hpcc:presetValue="dfuserver_queue"
+                              hpcc:tooltip="Specifies the queue name to which DFU server jobs are sent"/>
+                <xs:attribute name="monitorqueue" hpcc:displayName="Monitor Queue" type="xs:string" use="required" hpcc:presetValue="dfuserver_monitor_queue"
+                              hpcc:tooltip="Specifies the queue name to which DFU monitoring jobs are sent"/>
+                <xs:attribute name="monitorinterval" hpcc:displayname="Monitor Interval (s)" type="xs:nonNegativeInteger"
+                              hpcc:presetValue="900" hpcc:tooltip="Specifies the polling interval for DFU monitoring (in seconds)"/>
+                <xs:attribute name="transferBufferSize" hpcc:displayName="Transfer Buffer Size (bytes)" type="xs:nonNegativeInteger"
+                              hpcc:presetValue="65536" hpcc:tooltip="Default buffer size used when transferring data"/>
+            </xs:complexType>
+        </xs:element>
+    </hpcc:insert>
+</xs:schema>

+ 34 - 0
initfiles/componentfiles/configschema/xsd/thor.xsd

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+#    HPCC SYSTEMS software Copyright (C) 2018 HPCC Systems®.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+-->
+
+<xs:schema
+        xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"
+        xmlns:hpcc="someuri">
+    <xs:include schemaLocation="types.xsd"/>
+    <hpcc:insert hpcc:schemaPath="/Environment/Software">
+        <xs:element name="ThorCluster" hpcc:displayName="Thor Cluster" hpcc:itemType="" minOccurs="0" maxOccurs="unbounded" hpcc:class="component">
+            <xs:complexType>
+                <xs:sequence>
+                </xs:sequence>
+                <xs:attributeGroup ref="buildInfo"/>
+                <xs:attribute name="name" type="xs:string" use="required" hpcc:displayName="Name" hpcc:autoGenerateType="prefix_" hpcc:autoGenerateValue="mythor"
+                              hpcc:uniqueKey="thornode_name" hpcc:tooltip="Name for this thor node process"/>
+                <xs:attribute name="description" type="xs:string" hpcc:displayName="Description" hpcc:presetValue="Thor process" hpcc:tooltip="Description for this process"/>
+            </xs:complexType>
+        </xs:element>
+    </hpcc:insert>
+</xs:schema>

+ 0 - 2
initfiles/etc/DIR_NAME/config2mgr/CMakeLists.txt

@@ -14,11 +14,9 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 ################################################################################
-configure_file("config2mgr.conf.in" "config2mgr.conf")
 configure_file("esp.xml.in" "esp.xml")
 install(
     FILES ${CMAKE_CURRENT_BINARY_DIR}/esp.xml
-          ${CMAKE_CURRENT_BINARY_DIR}/config2mgr.conf
     DESTINATION etc/${DIR_NAME}/config2mgr
     COMPONENT Runtime
     )

+ 0 - 8
initfiles/etc/DIR_NAME/config2mgr/config2mgr.conf.in

@@ -1,8 +0,0 @@
-## Default configuration file for config2
-
-[components]
-configmgr=esp;${CONFIG_DIR}/config2
-brokenconntimeout=60
-buildset=buildset.xml
-wizardalgorithm=genenvrules.conf
-autodetectipscript=${ADMIN_PATH}/get_ip_address_wiz.sh

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 7
initfiles/etc/DIR_NAME/config2mgr/esp.xml.in