123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- /*#############################################################################
- Copyright (C) 2011 HPCC Systems.
- All rights reserved. This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #############################################################################*/
- /////////////////////////////////////////////////////////////////////////////
- //
- // WizardInputs.h : interface of the WizardInputs class
- //
- /////////////////////////////////////////////////////////////////////////////
- #ifndef WIZARDINPUTS_HPP_INCL
- #define WIZARDINPUTS_HPP_INCL
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include <string>
- #include <vector>
- #include <map>
- #include "jptree.hpp"
- #include "jliball.hpp"
- #include "jiface.hpp"
- #include "computerpicker.hpp"
- #include "deployutils.hpp"
- interface IPropertyTree;
- using std::string;
- using std::map;
- typedef enum GenOptional_
- {
- GENOPTIONAL_ALL,
- GENOPTIONAL_NONE,
- GENOPTIONAL_COMPS
- } GenOptional;
- class CInstDetails : public CInterface, implements IInterface
- {
- public:
- CInstDetails(){};
- CInstDetails(StringBuffer compName, StringBuffer ipAssigned):m_compName(compName)
- {
- m_ipAssigned.append(ipAssigned.str());
- };
- virtual ~CInstDetails(){};
- IMPLEMENT_IINTERFACE;
- StringArray& getIpAssigned() { return m_ipAssigned;}
- StringBuffer getCompName() { return m_compName; }
- void setParams(const char* compName, const char* value)
- {
- m_compName.clear().append(compName);
- if(m_ipAssigned.length() > 0)
- m_ipAssigned.kill();
- m_ipAssigned.append(value);
- }
- private :
- StringArray m_ipAssigned;
- StringBuffer m_compName;
- };
- //CInstDetails* getInstDetails(const char* buildSetName, const char* compName);
- //---------------------------------------------------------------------------
- // WizardInputs class declaration
- //---------------------------------------------------------------------------
- class CWizardInputs : public CInterface, implements IInterface
- {
- // Construction
- public:
- CWizardInputs(){};
- CWizardInputs(const char* xmlArg, const char* service, IPropertyTree* cfg, MapStringTo<StringBuffer>* dirMap);
- virtual ~CWizardInputs();
-
- void setEnvironment();
- void setWizardIPList(const StringArray ipArray);
- void setWizardRules();
- CInstDetails* getServerIPMap(const char* compName, const char* buildSetName,const IPropertyTree* pEnvTree, unsigned numOfNode = 1);
- void applyOverlappingRules(const char* compName, const char* buildSetName);
- count_t getNumOfInstForIP(StringBuffer ip);
- void generateSoftwareTree(IPropertyTree* pTree);
- void addInstanceToTree(IPropertyTree* pTree, StringBuffer attrName, const char* processName, const char* buildSetName, const char* instName);
- void getDefaultsForWizard(IPropertyTree* pTree);
- void addRoxieThorClusterToEnv(IPropertyTree* pNewEnvTree, CInstDetails* pInstDetails, const char* buildSetName, bool genRoxieOnDemand = false);
- unsigned getCntForAlreadyAssignedIPS();
- void addToCompIPMap(const char* buildSetName, const char* value, const char* compName);
- void getEspBindingInformation(IPropertyTree* pNewEnvTree);
- StringBuffer& getDbUser() { return m_dbuser;}
- StringBuffer& getDbPassword() { return m_dbpassword;}
- void addTopology(IPropertyTree* pNewEnvTree);
- IPropertyTree* createTopologyForComp(IPropertyTree* pNewEnvTree, const char* component);
- IPropertyTree* getConfig() { return m_cfg;}
- StringBuffer& getService() { return m_service;}
- void checkForDependencies();
- void checkAndAddDependComponent(const char* key);
- unsigned getNumOfNodes(const char* compName);
- void setTopologyParam();
-
- IMPLEMENT_IINTERFACE;
- bool generateEnvironment(StringBuffer& envXml);
- IPropertyTree* createEnvironment();
- private:
- typedef StringArray* StringArrayPtr;
- typedef MapStringTo<StringArrayPtr> MapStringToStringArray;
-
- //for rules
- count_t m_maxCompOnNode;
- StringArray m_doNotGenComp;
- StringArray m_compOnAllNodes;
- StringArray m_doNotGenOptOnComps;
- StringArray m_clusterForTopology;
- MapStringToStringArray m_compForTopology;
- GenOptional m_genOptForAllComps;
- MapStringToStringArray m_invalidServerCombo;
- unsigned m_roxieNodes;
- unsigned m_thorNodes;
- unsigned m_thorSlavesPerNode;
- unsigned m_roxieAgentRedChannels;
- unsigned m_roxieAgentRedOffset;
- bool m_roxieOnDemand;
-
- StringArray m_ipaddress;
- MapStringToMyClass<CInstDetails> m_compIpMap;
- Owned<IPropertyTree> m_pXml;
- IPropertyTree* m_cfg;
- StringBuffer m_service;
- StringBuffer m_dbuser;
- StringBuffer m_dbpassword;
- StringBuffer m_roxieAgentRedType;
- Owned<IPropertyTree> m_buildSetTree;
- Owned<IProperties> m_algProp;
- MapStringTo<StringBuffer>* m_overrideDirs;
- };
- #endif // !defined(WIZARDINPUTS_HPP__INCLUDED_)
|