WsDeployService.hpp 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  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 _ESPWIZ_WsDeploy_HPP__
  14. #define _ESPWIZ_WsDeploy_HPP__
  15. #include "WsDeploy_esp.ipp"
  16. #include "environment.hpp"
  17. #include "jmutex.hpp"
  18. #include "dasds.hpp"
  19. #include "deployutils.hpp"
  20. #include "buildset.hpp"
  21. #include "jsocket.hpp"
  22. #include "XMLTags.h"
  23. #include "httpclient.hpp"
  24. #include "jqueue.tpp"
  25. #include "build-config.h"
  26. typedef enum EnvAction_
  27. {
  28. CLOUD_NONE,
  29. CLOUD_LOCK_ENV,
  30. CLOUD_UNLOCK_ENV,
  31. CLOUD_SAVE_ENV,
  32. CLOUD_ROLLBACK_ENV,
  33. CLOUD_NOTIFY_INITSYSTEM,
  34. CLOUD_CHECK_LOCKER
  35. } EnvAction;
  36. #define CLOUD_SOAPCALL_TIMEOUT 10000
  37. #define CONFIG_MONITOR_CHECK_INTERVAL 1000
  38. #define CONFIG_MONITOR_TIMEOUT_PERIOD 6000
  39. class CCloudTask;
  40. class CCloudActionHandler;
  41. class CWsDeployEx;
  42. class CWsDeployExCE;
  43. class CConfigHelper;
  44. interface IConfigFileObserver : extends IObserver
  45. {
  46. public:
  47. virtual const char* getConfigFilePath() = 0;
  48. };
  49. class CWsDeployFileInfo : public CInterface, implements IConfigFileObserver
  50. {
  51. private:
  52. //==========================================================================================
  53. // the following class implements notification handler for subscription to dali for environment
  54. // updates by other clients.
  55. //==========================================================================================
  56. class CSdsSubscription : public CInterface, implements ISDSSubscription
  57. {
  58. public:
  59. CSdsSubscription(CWsDeployFileInfo* pFileInfo)
  60. {
  61. m_pFileInfo.set(pFileInfo);
  62. sub_id = querySDS().subscribe("/Environment", *this);
  63. }
  64. virtual ~CSdsSubscription() { unsubscribe(); }
  65. void unsubscribe()
  66. {
  67. if (sub_id) {
  68. if (sub_id) { querySDS().unsubscribe(sub_id); sub_id = 0; }
  69. }
  70. }
  71. IMPLEMENT_IINTERFACE;
  72. //another client (like configenv) may have updated the environment and we got notified
  73. //(thanks to our subscription) but don't just reload it yet since this notification is sent on
  74. //another thread asynchronously and we may be actively working with the old environment. Just
  75. //invoke handleEnvironmentChange() when we are ready to invalidate cache in environment factory.
  76. //
  77. void notify(SubscriptionId id, const char *xpath, SDSNotifyFlags flags, unsigned valueLen=0, const void *valueData=NULL);
  78. private:
  79. SubscriptionId sub_id;
  80. Owned<CWsDeployFileInfo> m_pFileInfo;
  81. };
  82. //==========================================================================================
  83. // the following class generates JavaScript files required by the service gui, at startup or
  84. // whenever the environment is updated.
  85. //==========================================================================================
  86. class CGenerateJSFactoryThread : public CInterface, implements IThreaded, implements IInterface
  87. {
  88. public:
  89. CGenerateJSFactoryThread(CWsDeployExCE* pService,IConstEnvironment* pConstEnv)
  90. {
  91. m_pService.set(pService);
  92. m_pWorkerThread = NULL;
  93. m_constEnv.set(pConstEnv);
  94. }
  95. virtual ~CGenerateJSFactoryThread()
  96. {
  97. bool joinedOk = m_pWorkerThread->join();
  98. if(NULL != m_pWorkerThread) {
  99. delete m_pWorkerThread;
  100. m_pWorkerThread = NULL;
  101. }
  102. }
  103. IMPLEMENT_IINTERFACE;
  104. virtual void main()
  105. {
  106. generateHeaders(&m_constEnv->getPTree(), m_constEnv);
  107. }
  108. void init()
  109. {
  110. m_pWorkerThread = new CThreaded("CGenerateJSFactoryThread");
  111. IThreaded* pIThreaded = this;
  112. m_pWorkerThread->init(pIThreaded);
  113. }
  114. void refresh(IConstEnvironment* pConstEnv)
  115. {
  116. m_constEnv.set(pConstEnv);
  117. }
  118. private:
  119. CThreaded* m_pWorkerThread;
  120. Linked<CWsDeployExCE> m_pService;
  121. Linked<IConstEnvironment> m_constEnv;
  122. };
  123. public:
  124. class CConfigChangeNotification : implements INotification
  125. {
  126. public:
  127. CConfigChangeNotification(IObservable *pSource) : m_pSource(pSource)
  128. {
  129. };
  130. virtual ~CConfigChangeNotification()
  131. {
  132. };
  133. virtual NotifyAction getAction(void)
  134. {
  135. return NotifyNone;
  136. }
  137. virtual IObservable* querySource(void)
  138. {
  139. return m_pSource;
  140. }
  141. private:
  142. IObservable* m_pSource;
  143. CConfigChangeNotification() {};
  144. };
  145. class CConfigFileMonitorThread
  146. : public CInterface, implements IThreaded, implements IObservable
  147. {
  148. public:
  149. CConfigFileMonitorThread(unsigned int uCheckInterval, unsigned int uTimeout)
  150. : m_pWorkerThread(NULL), m_quitThread(false), m_uCheckInterval(uCheckInterval), m_uTimeout(uTimeout), m_configChangeNotification(this)
  151. {
  152. };
  153. virtual ~CConfigFileMonitorThread()
  154. {
  155. m_quitThread = true;
  156. m_pWorkerThread->join();
  157. delete m_pWorkerThread;
  158. };
  159. IMPLEMENT_IINTERFACE;
  160. virtual void notify(IDirectoryDifferenceIterator *diffIter)
  161. {
  162. if ( diffIter == NULL )
  163. {
  164. return;
  165. }
  166. else
  167. {
  168. CriticalBlock block(m_critsecObserverQueue);
  169. for (unsigned int idxObservers = 0; idxObservers < m_qObservers.ordinality(); idxObservers++)
  170. {
  171. IConfigFileObserver *pConfigFileObserver = m_qObservers.query(idxObservers);
  172. for (diffIter->first(); diffIter->isValid() == true; diffIter->next())
  173. {
  174. bool bDoNotify = true;
  175. if ( diffIter->getFlags() == IDDIunchanged || diffIter->query().queryFilename() == NULL || pConfigFileObserver == NULL || pConfigFileObserver->getConfigFilePath() == NULL || (strcmp( pConfigFileObserver->getConfigFilePath(), diffIter->query().queryFilename() ) != 0) )
  176. {
  177. bDoNotify = false;
  178. }
  179. if (bDoNotify == true)
  180. {
  181. m_qObservers.query(idxObservers)->onNotify(m_configChangeNotification);
  182. }
  183. }
  184. }
  185. }
  186. }
  187. virtual void addObserver( IConfigFileObserver &observer )
  188. {
  189. CriticalBlock block(m_critsecObserverQueue);
  190. //allow observers to register only once
  191. if (m_qObservers.find(&observer) == (unsigned)-1)
  192. {
  193. m_qObservers.enqueue(&observer);
  194. }
  195. }
  196. virtual void removeObserver( IConfigFileObserver &observer )
  197. {
  198. CriticalBlock block(m_critsecObserverQueue);
  199. m_qObservers.dequeue(&observer);
  200. }
  201. virtual void main()
  202. {
  203. Owned<IFile> configFiles = createIFile(CONFIG_SOURCE_DIR);
  204. while ( m_quitThread == false )
  205. {
  206. Owned<IDirectoryDifferenceIterator> diffIter = configFiles->monitorDirectory(NULL, NULL, false, false, m_uCheckInterval, m_uTimeout);
  207. if (diffIter.get() != NULL)
  208. {
  209. notify(diffIter.get());
  210. }
  211. }
  212. };
  213. void init()
  214. {
  215. if ( m_pWorkerThread == NULL)
  216. {
  217. m_pWorkerThread = new CThreaded("CConfigFileMonitorThread");
  218. IThreaded* pIThreaded = this;
  219. m_pWorkerThread->init(pIThreaded);
  220. }
  221. };
  222. static CConfigFileMonitorThread* getInstance()
  223. {
  224. static Owned<CConfigFileMonitorThread> s_configFileMonitorSingleton;
  225. static CSingletonLock slock;
  226. if (slock.lock() == true)
  227. {
  228. if (s_configFileMonitorSingleton.get() == NULL)
  229. {
  230. s_configFileMonitorSingleton.setown(new CWsDeployFileInfo::CConfigFileMonitorThread(CONFIG_MONITOR_CHECK_INTERVAL, CONFIG_MONITOR_TIMEOUT_PERIOD));
  231. s_configFileMonitorSingleton->init();
  232. }
  233. slock.unlock();
  234. }
  235. return s_configFileMonitorSingleton.get();
  236. };
  237. protected:
  238. CThreaded* m_pWorkerThread;
  239. bool m_quitThread;
  240. unsigned int m_uTimeout;
  241. unsigned int m_uCheckInterval;
  242. QueueOf<IConfigFileObserver,false> m_qObservers;
  243. CriticalSection m_critsecObserverQueue;
  244. CConfigChangeNotification m_configChangeNotification;
  245. private:
  246. CConfigFileMonitorThread() : m_configChangeNotification(NULL) {};
  247. CConfigFileMonitorThread(const CConfigFileMonitorThread& configFileThread) : m_configChangeNotification(NULL) {};
  248. CConfigFileMonitorThread& operator=(CConfigFileMonitorThread const&);
  249. };
  250. class CClientAliveThread : public CInterface, implements IThreaded, implements IInterface
  251. {
  252. public:
  253. CClientAliveThread(CWsDeployFileInfo* pFileInfo, unsigned brokenConnTimeout)
  254. {
  255. m_pFileInfo = pFileInfo;
  256. m_pWorkerThread = NULL;
  257. m_quitThread = false;
  258. m_brokenConnTimeout = brokenConnTimeout;
  259. }
  260. virtual ~CClientAliveThread()
  261. {
  262. m_quitThread = true;
  263. m_sem.signal();
  264. bool joinedOk = m_pWorkerThread->join();
  265. m_pFileInfo = NULL;
  266. if(NULL != m_pWorkerThread) {
  267. delete m_pWorkerThread;
  268. m_pWorkerThread = NULL;
  269. }
  270. }
  271. IMPLEMENT_IINTERFACE;
  272. virtual void main()
  273. {
  274. while (!m_quitThread)
  275. {
  276. if (!m_sem.wait(m_brokenConnTimeout))
  277. {
  278. if (m_pFileInfo)
  279. m_pFileInfo->activeUserNotResponding();
  280. break;
  281. }
  282. }
  283. }
  284. void init()
  285. {
  286. m_quitThread = false;
  287. m_pWorkerThread = new CThreaded("CClientAliveThread");
  288. IThreaded* pIThreaded = this;
  289. m_pWorkerThread->init(pIThreaded);
  290. }
  291. void signal()
  292. {
  293. m_sem.signal();
  294. }
  295. private:
  296. CThreaded* m_pWorkerThread;
  297. CWsDeployFileInfo* m_pFileInfo;
  298. Semaphore m_sem;
  299. bool m_quitThread;
  300. unsigned m_brokenConnTimeout;
  301. };
  302. class CLockerAliveThread : public CInterface, implements IThreaded, implements IInterface
  303. {
  304. public:
  305. CLockerAliveThread(CWsDeployFileInfo* pFileInfo, unsigned brokenConnTimeout, const char* uname, const char* ip)
  306. {
  307. m_pFileInfo = pFileInfo;
  308. m_pWorkerThread = NULL;
  309. m_quitThread = false;
  310. m_brokenConnTimeout = brokenConnTimeout;
  311. StringBuffer sb;
  312. sb.appendf("<Computers><Computer netAddress='%s'/></Computers>", ip);
  313. m_pComputers.setown(createPTreeFromXMLString(sb.str()));
  314. m_user.clear().append(uname);
  315. }
  316. virtual ~CLockerAliveThread()
  317. {
  318. m_quitThread = true;
  319. m_sem.signal();
  320. bool joinedOk = m_pWorkerThread->join();
  321. m_pFileInfo = NULL;
  322. if(NULL != m_pWorkerThread) {
  323. delete m_pWorkerThread;
  324. m_pWorkerThread = NULL;
  325. }
  326. }
  327. IMPLEMENT_IINTERFACE;
  328. virtual void main();
  329. void init()
  330. {
  331. m_quitThread = false;
  332. m_pWorkerThread = new CThreaded("CLockerAliveThread");
  333. IThreaded* pIThreaded = this;
  334. m_pWorkerThread->init(pIThreaded);
  335. }
  336. void signal()
  337. {
  338. m_quitThread = true;
  339. m_sem.signal();
  340. }
  341. private:
  342. CThreaded* m_pWorkerThread;
  343. CWsDeployFileInfo* m_pFileInfo;
  344. bool m_quitThread;
  345. unsigned m_brokenConnTimeout;
  346. Owned<IPropertyTree> m_pComputers;
  347. StringBuffer m_user;
  348. Semaphore m_sem;
  349. };
  350. public:
  351. IMPLEMENT_IINTERFACE;
  352. CWsDeployFileInfo(CWsDeployExCE* pService, const char* pEnvFile, bool bCloud) : m_configChanged(false), m_pService(pService),m_bCloud(bCloud)
  353. {
  354. m_envFile.clear().append(pEnvFile);
  355. }
  356. ~CWsDeployFileInfo();
  357. void initFileInfo(bool createFile, bool bClearEnv = true);
  358. void setConfigChanged(bool b)
  359. {
  360. m_configChanged = b;
  361. };
  362. bool getConfigChanged() const
  363. {
  364. return m_configChanged;
  365. };
  366. bool getSkipNotification() const
  367. {
  368. return m_bSkipNotification;
  369. }
  370. void setSkipNotification(bool b)
  371. {
  372. m_bSkipNotification = b;
  373. }
  374. virtual bool onNotify(INotification &notify)
  375. {
  376. if (notify.getAction() == NotifyNone && getSkipNotification() == false)
  377. {
  378. setConfigChanged(true);
  379. }
  380. setSkipNotification(false);
  381. return true;
  382. };
  383. virtual const char* getConfigFilePath()
  384. {
  385. if (m_pFile == NULL)
  386. {
  387. return NULL;
  388. }
  389. return m_pFile->queryFilename();
  390. };
  391. static void setFilePath(StringBuffer &filePath, const char* targetName);
  392. static bool addCopyToPropTree(IPropertyTree* pPropTree, IPropertyTree* pDupTree, const char* tag_name);
  393. virtual void updateConfigFromFile();
  394. virtual bool deploy(IEspContext &context, IEspDeployRequest &req, IEspDeployResponse &resp);
  395. virtual bool graph(IEspContext &context, IEspEmptyRequest& req, IEspGraphResponse& resp);
  396. virtual bool navMenuEvent(IEspContext &context, IEspNavMenuEventRequest &req,
  397. IEspNavMenuEventResponse &resp);
  398. virtual bool displaySettings(IEspContext &context, IEspDisplaySettingsRequest &req, IEspDisplaySettingsResponse &resp);
  399. virtual bool isAlphaNumeric(const char *pstr) const;
  400. virtual bool saveSetting(IEspContext &context, IEspSaveSettingRequest &req, IEspSaveSettingResponse &resp);
  401. virtual bool getBuildSetInfo(IEspContext &context, IEspGetBuildSetInfoRequest &req, IEspGetBuildSetInfoResponse &resp);
  402. virtual bool getDeployableComps(IEspContext &context, IEspGetDeployableCompsRequest &req, IEspGetDeployableCompsResponse &resp);
  403. virtual bool startDeployment(IEspContext &context, IEspStartDeploymentRequest &req, IEspStartDeploymentResponse &resp);
  404. virtual bool getBuildServerDirs(IEspContext &context, IEspGetBuildServerDirsRequest &req, IEspGetBuildServerDirsResponse &resp);
  405. virtual bool importBuild(IEspContext &context, IEspImportBuildRequest &req, IEspImportBuildResponse &resp);
  406. virtual bool getComputersForRoxie(IEspContext &context, IEspGetComputersForRoxieRequest &req, IEspGetComputersForRoxieResponse &resp);
  407. virtual bool handleRoxieOperation(IEspContext &context, IEspHandleRoxieOperationRequest &req, IEspHandleRoxieOperationResponse &resp);
  408. virtual bool handleThorTopology(IEspContext &context, IEspHandleThorTopologyRequest &req, IEspHandleThorTopologyResponse &resp);
  409. virtual bool handleAttributeDelete(IEspContext &context, IEspHandleAttributeDeleteRequest &req, IEspHandleAttributeDeleteResponse &resp);
  410. virtual bool handleAttributeAdd(IEspContext &context, IEspHandleAttributeAddRequest &req, IEspHandleAttributeAddResponse &resp);
  411. virtual bool handleComponent(IEspContext &context, IEspHandleComponentRequest &req, IEspHandleComponentResponse &resp);
  412. virtual bool handleComponentCopy(IPropertyTree *pComponents, IPropertyTree *pEnvRoot);
  413. virtual bool handleHardwareCopy(IPropertyTree *pComponents, IPropertyTree *pEnvRoot);
  414. virtual bool handleInstance(IEspContext &context, IEspHandleInstanceRequest &req, IEspHandleInstanceResponse &resp);
  415. virtual bool handleEspServiceBindings(IEspContext &context, IEspHandleEspServiceBindingsRequest &req, IEspHandleEspServiceBindingsResponse &resp);
  416. virtual bool handleComputer(IEspContext &context, IEspHandleComputerRequest &req, IEspHandleComputerResponse &resp);
  417. virtual bool handleTopology(IEspContext &context, IEspHandleTopologyRequest &req, IEspHandleTopologyResponse &resp);
  418. virtual bool handleRows(IEspContext &context, IEspHandleRowsRequest &req, IEspHandleRowsResponse &resp);
  419. virtual bool handleAccessRules(IEspContext &context, IEspHandleAccessRulesRequest &req, IEspHandleAccessRulesResponse &resp);
  420. virtual bool handleBaseAccessControlList(IEspContext &context, IEspHandleBaseAccessControlListRequest &req, IEspHandleBaseAccessControlListResponse &resp);
  421. virtual bool getNavTreeDefn(IEspContext &context, IEspGetNavTreeDefnRequest &req, IEspGetNavTreeDefnResponse &resp);
  422. virtual bool getValue(IEspContext &context, IEspGetValueRequest &req, IEspGetValueResponse &resp);
  423. virtual bool unlockUser(IEspContext &context, IEspUnlockUserRequest &req, IEspUnlockUserResponse &resp);
  424. virtual bool clientAlive(IEspContext &context, IEspClientAliveRequest &req, IEspClientAliveResponse &resp);
  425. virtual bool getEnvironment(IEspContext &context, IEspGetEnvironmentRequest &req, IEspGetEnvironmentResponse &resp);
  426. virtual bool setEnvironment(IEspContext &context, IEspSetEnvironmentRequest &req, IEspSetEnvironmentResponse &resp);
  427. virtual bool lockEnvironmentForCloud(IEspContext &context, IEspLockEnvironmentForCloudRequest &req, IEspLockEnvironmentForCloudResponse &resp);
  428. virtual bool unlockEnvironmentForCloud(IEspContext &context, IEspUnlockEnvironmentForCloudRequest &req, IEspUnlockEnvironmentForCloudResponse &resp);
  429. virtual bool buildEnvironment(IEspContext &context, IEspBuildEnvironmentRequest &req, IEspBuildEnvironmentResponse &resp);
  430. virtual bool getSubnetIPAddr(IEspContext &context, IEspGetSubnetIPAddrRequest &req, IEspGetSubnetIPAddrResponse &resp);
  431. virtual bool saveEnvironmentForCloud(IEspContext &context, IEspSaveEnvironmentForCloudRequest &req, IEspSaveEnvironmentForCloudResponse &resp);
  432. virtual bool rollbackEnvironmentForCloud(IEspContext &context, IEspRollbackEnvironmentForCloudRequest &req, IEspRollbackEnvironmentForCloudResponse &resp);
  433. virtual bool notifyInitSystemSaveEnvForCloud(IEspContext &context, IEspNotifyInitSystemSaveEnvForCloudRequest &req, IEspNotifyInitSystemSaveEnvForCloudResponse &resp);
  434. virtual bool getSummary(IEspContext &context, IEspGetSummaryRequest &req, IEspGetSummaryResponse &resp);
  435. virtual bool addReqdComps(IEspContext &context, IEspAddReqdCompsRequest &req, IEspAddReqdCompsResponse &resp);
  436. void environmentUpdated()
  437. {
  438. if (m_skipEnvUpdateFromNotification)
  439. return;
  440. synchronized block(m_mutex);
  441. m_pEnvXml.clear();
  442. m_pGraphXml.clear();
  443. m_pNavTree.clear();
  444. Owned<IEnvironmentFactory> factory = getEnvironmentFactory();
  445. m_constEnvRdOnly.set(factory->openEnvironment());
  446. m_constEnvRdOnly->clearCache();
  447. }
  448. void getNavigationData(IEspContext &context, IPropertyTree* pData);
  449. IPropertyTree* queryComputersForCloud();
  450. bool getUserWithLock(StringBuffer& sbUser, StringBuffer& sbIp);
  451. bool updateEnvironment(const char* xml);
  452. bool isLocked(StringBuffer& sbUser, StringBuffer& ip);
  453. void getLastSaved(StringBuffer& sb) { m_lastSaved.getString(sb);}
  454. private:
  455. void generateGraph(IEspContext &context, IConstWsDeployReqInfo *reqInfo);
  456. void addDeployableComponentAndInstances( IPropertyTree* pEnvRoot, IPropertyTree* pComp,
  457. IPropertyTree* pDst, IPropertyTree* pFolder,
  458. const char* displayType);
  459. IPropertyTree* findComponentForFolder(IPropertyTree* pFolder, IPropertyTree* pEnvSoftware);
  460. const char* GetDisplayProcessName(const char* processName, char* buf) const;
  461. void addInstance( IPropertyTree* pDst, const char* comp, const char* displayType,
  462. const char* compName, const char* build, const char* instType,
  463. const char* instName, const char* computer);
  464. void checkForRefresh(IEspContext &context, IConstWsDeployReqInfo *reqInfo, bool checkWriteAccess);
  465. IPropertyTree* getEnvTree(IEspContext &context, IConstWsDeployReqInfo *reqInfo);
  466. void activeUserNotResponding();
  467. void saveEnvironment(IEspContext* pContext, IConstWsDeployReqInfo *reqInfo, StringBuffer& errMsg, bool saveAs = false);
  468. void unlockEnvironment(IEspContext* pContext, IConstWsDeployReqInfo *reqInfo, const char* xmlarg, StringBuffer& sbMsg, bool saveEnv = false);
  469. void setEnvironment(IEspContext &context, IConstWsDeployReqInfo *reqInfo, const char* newEnv, const char* fnName, StringBuffer& sbBackup, bool validate = true, bool updateDali = true);
  470. bool checkForRequiredComponents(IPropertyTree* pEnvRoot, const char* ip, StringBuffer& reqdCompNames, const char* buildSet, bool autoAdd=false);
  471. Owned<CSdsSubscription> m_pSubscription;
  472. Owned<IConstEnvironment> m_constEnvRdOnly;
  473. Owned<SCMStringBuffer> m_pEnvXml;
  474. Owned<IPropertyTree> m_pNavTree;
  475. Owned<SCMStringBuffer> m_pGraphXml;
  476. Mutex m_mutex;
  477. Owned<IEnvironment> m_Environment;
  478. StringBuffer m_userWithLock;
  479. StringBuffer m_userIp;
  480. StringBuffer m_daliServer;
  481. StringBuffer m_envFile;
  482. StringBuffer m_cloudEnvBkupFileName;
  483. StringBuffer m_cloudEnvId;
  484. short m_daliServerPort;
  485. Owned<CGenerateJSFactoryThread> m_pGenJSFactoryThread;
  486. private:
  487. bool m_skipEnvUpdateFromNotification;
  488. bool m_activeUserNotResp;
  489. bool m_configChanged;
  490. bool m_bSkipNotification;
  491. bool m_bCloud;
  492. Owned<IFile> m_pFile;
  493. Owned<IFileIO> m_pFileIO;
  494. MapStringToMyClass<CClientAliveThread> m_keepAliveHTable;
  495. CDateTime m_lastSaved;
  496. Owned<CLockerAliveThread> m_cloudLockerAliveThread;
  497. Owned<IPropertyTree> m_lockedNodesBeforeEnv;
  498. CWsDeployExCE* m_pService;
  499. };
  500. class CCloudTaskThread : public CInterface,
  501. implements IPooledThread
  502. {
  503. public:
  504. IMPLEMENT_IINTERFACE;
  505. CCloudTaskThread()
  506. {
  507. }
  508. virtual ~CCloudTaskThread()
  509. {
  510. }
  511. void init(void *startInfo)
  512. {
  513. m_pTask.set((CCloudTask*)startInfo);
  514. }
  515. void main();
  516. bool canReuse()
  517. {
  518. return true;
  519. }
  520. bool stop()
  521. {
  522. return true;
  523. }
  524. virtual bool getAbort() const { return s_abort; }
  525. virtual void setAbort(bool bAbort) { s_abort = bAbort; }
  526. private:
  527. Owned<CCloudTask> m_pTask;
  528. static bool s_abort;
  529. };
  530. class CCloudTaskThreadFactory : public CInterface, public IThreadFactory
  531. {
  532. public:
  533. IMPLEMENT_IINTERFACE;
  534. IPooledThread *createNew()
  535. {
  536. return new CCloudTaskThread();
  537. }
  538. };
  539. CCloudTask* createCloudTask(CCloudActionHandler* pHandler, EnvAction eA, const char* ip);
  540. void expandRange(IPropertyTree* pComputers);
  541. const char* getFnString(EnvAction ea);
  542. class CCloudActionHandler : public CInterface, implements IInterface
  543. {
  544. public:
  545. CCloudActionHandler(CWsDeployFileInfo* pFileInfo, EnvAction eA, EnvAction cancelEA,
  546. const char* user, const char* port, IPropertyTree* pComputers)
  547. {
  548. m_pFileInfo = pFileInfo;
  549. m_opFailed = false;
  550. m_eA = eA;
  551. m_cancelEA = cancelEA;
  552. m_port.append(port);
  553. m_user.append(user);
  554. m_pComputers = pComputers;
  555. }
  556. virtual ~CCloudActionHandler()
  557. {
  558. m_pFileInfo = NULL;
  559. }
  560. void setSaveActionParams(const char* newEnv, const char* id)
  561. {
  562. m_newEnv.clear().append(newEnv);
  563. m_newEnvId.clear().append(id);
  564. }
  565. void setFailed(bool flag){m_opFailed = flag;}
  566. IMPLEMENT_IINTERFACE;
  567. bool start(StringBuffer& msg)
  568. {
  569. try
  570. {
  571. IPropertyTree* pComputers = m_pComputers;
  572. if (!m_pComputers)
  573. pComputers = m_pFileInfo->queryComputersForCloud();
  574. else if (pComputers && pComputers->hasProp("@hasRange"))
  575. expandRange(pComputers);
  576. if (!pComputers)
  577. throw MakeStringException(-1, "No computers found for Cloud Operation %s", getFnString(m_eA));
  578. if (m_threadPool == NULL)
  579. {
  580. IThreadFactory* pThreadFactory = new CCloudTaskThreadFactory();
  581. m_threadPool.setown(createThreadPool("WsDeploy Cloud Task Thread Pool", pThreadFactory, NULL, pComputers->numChildren()));
  582. pThreadFactory->Release();
  583. }
  584. else
  585. {
  586. int nThreads = m_threadPool->runningCount();
  587. if (nThreads > 0)
  588. throw MakeOsException(-1, "Unfinished threads detected!");
  589. }
  590. Owned<IPropertyTreeIterator> iter = pComputers->getElements(XML_TAG_COMPUTER);
  591. StringBuffer localip;
  592. queryHostIP().getIpText(localip);
  593. ForEach(*iter)
  594. {
  595. IPropertyTree* pComputer = &iter->query();
  596. const char* netAddr = pComputer->queryProp(XML_ATTR_NETADDRESS);
  597. if (!strcmp(netAddr, ".") ||
  598. !strcmp(netAddr, "127.0.0.1") ||
  599. !strcmp(netAddr, "0.0.0.0") ||
  600. !strcmp(netAddr, localip.str()))
  601. continue;
  602. else
  603. {
  604. Owned<CCloudTask> task = createCloudTask(this, m_eA, netAddr);
  605. m_threadPool->start(task);//start a thread for this task
  606. }
  607. }
  608. m_threadPool->joinAll();
  609. if (!m_opFailed && m_eA == CLOUD_SAVE_ENV)
  610. {
  611. ForEach(*iter)
  612. {
  613. IPropertyTree* pComputer = &iter->query();
  614. const char* netAddr = pComputer->queryProp(XML_ATTR_NETADDRESS);
  615. if (!strcmp(netAddr, ".") ||
  616. !strcmp(netAddr, "127.0.0.1") ||
  617. !strcmp(netAddr, "0.0.0.0") ||
  618. !strcmp(netAddr, localip.str()))
  619. continue;
  620. else
  621. {
  622. Owned<CCloudTask> task = createCloudTask(this, CLOUD_NOTIFY_INITSYSTEM, netAddr);
  623. m_threadPool->start(task);//start a thread for this task
  624. }
  625. }
  626. m_threadPool->joinAll();
  627. }
  628. if (m_opFailed)
  629. {
  630. HashIterator iterHash(m_resultMap);
  631. ForEach(iterHash)
  632. {
  633. const char* key = (const char*)iterHash.query().getKey();
  634. String str((m_resultMap.mapToValue(&iterHash.query()))->str());
  635. if (str.startsWith("SOAP Connection error"))
  636. msg.appendf("\nIpAddress: %s\nResult:%s\n", key, "SOAP Connection error - Could not connect to the target");
  637. else
  638. msg.appendf("\nIpAddress: %s\nResult:%s\n", key, str.toCharArray());
  639. }
  640. //Perform the appropriate cancel action
  641. if (m_cancelEA != CLOUD_NONE)
  642. {
  643. ForEach(*iter)
  644. {
  645. IPropertyTree* pComputer = &iter->query();
  646. const char* netAddr = pComputer->queryProp(XML_ATTR_NETADDRESS);
  647. if (!strcmp(netAddr, ".") ||
  648. !strcmp(netAddr, "127.0.0.1") ||
  649. !strcmp(netAddr, "0.0.0.0") ||
  650. !strcmp(netAddr, localip.str()))
  651. continue;
  652. else
  653. {
  654. Owned<CCloudTask> task = createCloudTask(this, m_cancelEA, netAddr);
  655. m_threadPool->start(task);//start a thread for this task
  656. }
  657. }
  658. m_threadPool->joinAll();
  659. }
  660. return false;
  661. }
  662. return true;
  663. }
  664. catch (IException* e)
  665. {
  666. if (m_threadPool)
  667. m_threadPool->joinAll();
  668. StringBuffer sErrMsg;
  669. e->errorMessage(sErrMsg);
  670. e->Release();
  671. msg.appendf("Exception throw during cloud operation %s.\nMessage:%s", getFnString(m_eA), sErrMsg.str());
  672. }
  673. catch (...)
  674. {
  675. if (m_threadPool)
  676. m_threadPool->joinAll();
  677. throw MakeErrnoException("Unknown Exception during cloud operation %s", getFnString(m_eA));
  678. }
  679. return false;
  680. }
  681. void setResult(const char* ip, const char* msg)
  682. {
  683. synchronized block(m_mutex);
  684. StringBuffer* pSb = new StringBuffer(msg);
  685. m_resultMap.setValue(ip, *pSb);
  686. }
  687. const char* getPort() {return m_port.str();}
  688. const char* getUser() {return m_user.str();}
  689. const char* getNewEnv() {return m_newEnv.str();}
  690. const char* getNewEnvId() {return m_newEnvId.str();}
  691. const char* getCurIp(){ if (m_curIp.length() == 0) queryHostIP().getIpText(m_curIp); return m_curIp.str(); }
  692. private:
  693. CWsDeployFileInfo* m_pFileInfo;
  694. Mutex m_mutex;
  695. bool m_opFailed;
  696. EnvAction m_eA;
  697. EnvAction m_cancelEA;
  698. Owned<IThreadPool> m_threadPool;
  699. MapStrToBuf m_resultMap;
  700. StringBuffer m_port;
  701. StringBuffer m_user;
  702. StringBuffer m_newEnv;
  703. StringBuffer m_newEnvId;
  704. StringBuffer m_curIp;
  705. IPropertyTree* m_pComputers;
  706. };
  707. class CCloudTask : public CInterface, implements IInterface
  708. {
  709. public:
  710. IMPLEMENT_IINTERFACE;
  711. CCloudTask(CCloudActionHandler* pHandler, EnvAction eA, const char* ip)
  712. {
  713. m_caHandler.set(pHandler);
  714. m_eA = eA;
  715. m_ip.append(ip);
  716. }
  717. bool makeSoapCall()
  718. {
  719. try
  720. {
  721. Owned<CRpcCall> rpccall;
  722. rpccall.setown(new CRpcCall);
  723. StringBuffer sb("http://");
  724. sb.append(m_ip.str()).append(":").append(m_caHandler->getPort()).append("/WsDeploy");
  725. rpccall->set_url(sb.str());
  726. rpccall->set_name(getFnString(m_eA));
  727. SoapStringParam uName(m_caHandler->getUser());
  728. uName.marshall(*rpccall.get(), "UserName","", "", "");
  729. SoapStringParam ipAddr(m_caHandler->getCurIp());
  730. ipAddr.marshall(*rpccall.get(), "Ip","", "", "");
  731. if (m_eA == CLOUD_SAVE_ENV)
  732. {
  733. SoapStringParam newEnv(m_caHandler->getNewEnv());
  734. newEnv.marshall(*rpccall.get(), "NewEnv","", "", "");
  735. }
  736. if (m_eA == CLOUD_SAVE_ENV || m_eA == CLOUD_ROLLBACK_ENV)
  737. {
  738. SoapStringParam newEnvId(m_caHandler->getNewEnvId());
  739. newEnvId.marshall(*rpccall.get(), "Id","", "", "");
  740. }
  741. Owned<IHttpClientContext> httpctx = getHttpClientContext();
  742. Owned<IHttpClient> httpclient = httpctx->createHttpClient(rpccall->getProxy(), rpccall->get_url());
  743. httpclient->setUserID("soapclient");
  744. httpclient->setPassword("");
  745. httpclient->setTimeOut(CLOUD_SOAPCALL_TIMEOUT);
  746. Owned<ISoapClient> soapclient;
  747. httpclient->Link();
  748. soapclient.setown(new CSoapClient(httpclient));
  749. soapclient->setUsernameToken("soapclient", "", "");
  750. StringBuffer soapAction, resultbuf;
  751. int result = soapclient->postRequest("text/xml","", *rpccall.get(), resultbuf, NULL);
  752. IPropertyTree* pResult = createPTreeFromXMLString(resultbuf);
  753. StringBuffer xpath;
  754. xpath.appendf("soap:Body/%sResponse/Msg", getFnString(m_eA));
  755. const char* msg = pResult->queryProp(xpath.str());
  756. xpath.clear().appendf("soap:Body/%sResponse/ReturnCode", getFnString(m_eA));
  757. int retCode = pResult->getPropInt(xpath.str());
  758. if (retCode != 1)
  759. {
  760. m_caHandler->setFailed(true);
  761. m_caHandler->setResult(m_ip.str(), msg?msg:"");
  762. }
  763. return true;
  764. }
  765. catch(IException* e)
  766. {
  767. StringBuffer sb;
  768. e->errorMessage(sb);
  769. m_caHandler->setFailed(true);
  770. m_caHandler->setResult(m_ip, sb.str());
  771. }
  772. return false;
  773. }
  774. private:
  775. Linked<CCloudActionHandler> m_caHandler;
  776. EnvAction m_eA;
  777. StringBuffer m_ip;
  778. };
  779. class CWsDeployExCE : public CWsDeploy
  780. {
  781. public:
  782. IMPLEMENT_IINTERFACE;
  783. virtual ~CWsDeployExCE();
  784. virtual void init(IPropertyTree *cfg, const char *process, const char *service);
  785. virtual bool onGraph(IEspContext &context, IEspEmptyRequest& req, IEspGraphResponse& resp);
  786. virtual bool onNavMenuEvent(IEspContext &context, IEspNavMenuEventRequest &req,
  787. IEspNavMenuEventResponse &resp);
  788. virtual bool onDisplaySettings(IEspContext &context, IEspDisplaySettingsRequest &req, IEspDisplaySettingsResponse &resp);
  789. virtual bool onSaveSetting(IEspContext &context, IEspSaveSettingRequest &req, IEspSaveSettingResponse &resp);
  790. virtual bool onGetBuildSetInfo(IEspContext &context, IEspGetBuildSetInfoRequest &req, IEspGetBuildSetInfoResponse &resp);
  791. virtual bool onGetDeployableComps(IEspContext &context, IEspGetDeployableCompsRequest &req, IEspGetDeployableCompsResponse &resp);
  792. virtual bool onStartDeployment(IEspContext &context, IEspStartDeploymentRequest &req, IEspStartDeploymentResponse &resp);
  793. virtual bool onGetBuildServerDirs(IEspContext &context, IEspGetBuildServerDirsRequest &req, IEspGetBuildServerDirsResponse &resp);
  794. virtual bool onImportBuild(IEspContext &context, IEspImportBuildRequest &req, IEspImportBuildResponse &resp);
  795. virtual bool onGetComputersForRoxie(IEspContext &context, IEspGetComputersForRoxieRequest &req, IEspGetComputersForRoxieResponse &resp);
  796. virtual bool onHandleRoxieOperation(IEspContext &context, IEspHandleRoxieOperationRequest &req, IEspHandleRoxieOperationResponse &resp);
  797. virtual bool onHandleThorTopology(IEspContext &context, IEspHandleThorTopologyRequest &req, IEspHandleThorTopologyResponse &resp);
  798. virtual bool onHandleAttributeAdd(IEspContext &context, IEspHandleAttributeAddRequest &req, IEspHandleAttributeAddResponse &resp);
  799. virtual bool onHandleAttributeDelete(IEspContext &context, IEspHandleAttributeDeleteRequest &req, IEspHandleAttributeDeleteResponse &resp);
  800. virtual bool onHandleComponent(IEspContext &context, IEspHandleComponentRequest &req, IEspHandleComponentResponse &resp);
  801. virtual bool onHandleInstance(IEspContext &context, IEspHandleInstanceRequest &req, IEspHandleInstanceResponse &resp);
  802. virtual bool onHandleEspServiceBindings(IEspContext &context, IEspHandleEspServiceBindingsRequest &req, IEspHandleEspServiceBindingsResponse &resp);
  803. virtual bool onHandleComputer(IEspContext &context, IEspHandleComputerRequest &req, IEspHandleComputerResponse &resp);
  804. virtual bool onHandleTopology(IEspContext &context, IEspHandleTopologyRequest &req, IEspHandleTopologyResponse &resp);
  805. virtual bool onHandleRows(IEspContext &context, IEspHandleRowsRequest &req, IEspHandleRowsResponse &resp);
  806. virtual bool onHandleAccessRules(IEspContext &context, IEspHandleAccessRulesRequest &req, IEspHandleAccessRulesResponse &resp);
  807. virtual bool onHandleBaseAccessControlList(IEspContext &context, IEspHandleBaseAccessControlListRequest &req, IEspHandleBaseAccessControlListResponse &resp);
  808. virtual bool onGetNavTreeDefn(IEspContext &context, IEspGetNavTreeDefnRequest &req, IEspGetNavTreeDefnResponse &resp);
  809. virtual bool onGetValue(IEspContext &context, IEspGetValueRequest &req, IEspGetValueResponse &resp);
  810. virtual bool onUnlockUser(IEspContext &context, IEspUnlockUserRequest &req, IEspUnlockUserResponse &resp);
  811. virtual bool onClientAlive(IEspContext &context, IEspClientAliveRequest &req, IEspClientAliveResponse &resp);
  812. virtual bool onGetEnvironment(IEspContext &context, IEspGetEnvironmentRequest &req, IEspGetEnvironmentResponse &resp);
  813. virtual bool onSetEnvironment(IEspContext &context, IEspSetEnvironmentRequest &req, IEspSetEnvironmentResponse &resp);
  814. virtual bool onLockEnvironmentForCloud(IEspContext &context, IEspLockEnvironmentForCloudRequest &req, IEspLockEnvironmentForCloudResponse &resp);
  815. virtual bool onUnlockEnvironmentForCloud(IEspContext &context, IEspUnlockEnvironmentForCloudRequest &req, IEspUnlockEnvironmentForCloudResponse &resp);
  816. virtual bool onBuildEnvironment(IEspContext &context, IEspBuildEnvironmentRequest &req, IEspBuildEnvironmentResponse &resp);
  817. virtual bool onGetSubnetIPAddr(IEspContext &context, IEspGetSubnetIPAddrRequest &req, IEspGetSubnetIPAddrResponse &resp);
  818. virtual bool onSaveEnvironmentForCloud(IEspContext &context, IEspSaveEnvironmentForCloudRequest &req, IEspSaveEnvironmentForCloudResponse &resp);
  819. virtual bool onRollbackEnvironmentForCloud(IEspContext &context, IEspRollbackEnvironmentForCloudRequest &req, IEspRollbackEnvironmentForCloudResponse &resp);
  820. virtual bool onNotifyInitSystemSaveEnvForCloud(IEspContext &context, IEspNotifyInitSystemSaveEnvForCloudRequest &req, IEspNotifyInitSystemSaveEnvForCloudResponse &resp);
  821. virtual bool onGetSummary(IEspContext &context, IEspGetSummaryRequest &req, IEspGetSummaryResponse &resp);
  822. virtual bool onAddReqdComps(IEspContext &context, IEspAddReqdCompsRequest &req, IEspAddReqdCompsResponse &resp);
  823. void getNavigationData(IEspContext &context, IPropertyTree* pData);
  824. CWsDeployFileInfo* getFileInfo(const char* fileName, bool addIfNotFound=false, bool createFile = false);
  825. IPropertyTree* getCfg() { return m_pCfg;}
  826. const char* getName() { return m_service.str();}
  827. void getLastStarted(StringBuffer& sb);
  828. const char* getBackupDir() { return m_backupDir.str(); }
  829. const char* getProcessName() { return m_process.str(); }
  830. const char* getSourceDir() { return m_sourceDir.str(); }
  831. CConfigHelper *m_pConfigHelper;
  832. private:
  833. virtual void getWizOptions(StringBuffer& sb);
  834. protected:
  835. Mutex m_mutexSrv;
  836. StringBuffer m_envFile;
  837. StringBuffer m_backupDir;
  838. StringBuffer m_sourceDir;
  839. StringBuffer m_process;
  840. StringBuffer m_service;
  841. typedef MapStringTo<StringBuffer, StringBuffer&> CompHTMLMap;
  842. CompHTMLMap m_compHtmlMap;
  843. bool m_bCloud;
  844. Owned<IPropertyTree> m_pCfg;
  845. CDateTime m_lastStarted;
  846. MapStringToMyClass<CWsDeployFileInfo> m_fileInfos;
  847. };
  848. class CWsDeployEx : public CWsDeployExCE
  849. {
  850. public:
  851. IMPLEMENT_IINTERFACE;
  852. virtual ~CWsDeployEx(){}
  853. virtual bool onGraph(IEspContext &context, IEspEmptyRequest& req, IEspGraphResponse& resp);
  854. virtual bool onNavMenuEvent(IEspContext &context, IEspNavMenuEventRequest &req,
  855. IEspNavMenuEventResponse &resp);
  856. virtual bool onDisplaySettings(IEspContext &context, IEspDisplaySettingsRequest &req, IEspDisplaySettingsResponse &resp);
  857. virtual bool onSaveSetting(IEspContext &context, IEspSaveSettingRequest &req, IEspSaveSettingResponse &resp);
  858. virtual bool onGetBuildSetInfo(IEspContext &context, IEspGetBuildSetInfoRequest &req, IEspGetBuildSetInfoResponse &resp);
  859. virtual bool onGetDeployableComps(IEspContext &context, IEspGetDeployableCompsRequest &req, IEspGetDeployableCompsResponse &resp);
  860. virtual bool onStartDeployment(IEspContext &context, IEspStartDeploymentRequest &req, IEspStartDeploymentResponse &resp);
  861. virtual bool onGetBuildServerDirs(IEspContext &context, IEspGetBuildServerDirsRequest &req, IEspGetBuildServerDirsResponse &resp);
  862. virtual bool onImportBuild(IEspContext &context, IEspImportBuildRequest &req, IEspImportBuildResponse &resp);
  863. virtual bool onGetComputersForRoxie(IEspContext &context, IEspGetComputersForRoxieRequest &req, IEspGetComputersForRoxieResponse &resp);
  864. virtual bool onHandleRoxieOperation(IEspContext &context, IEspHandleRoxieOperationRequest &req, IEspHandleRoxieOperationResponse &resp);
  865. virtual bool onHandleThorTopology(IEspContext &context, IEspHandleThorTopologyRequest &req, IEspHandleThorTopologyResponse &resp);
  866. virtual bool onHandleAttributeDelete(IEspContext &context, IEspHandleAttributeDeleteRequest &req, IEspHandleAttributeDeleteResponse &resp);
  867. virtual bool onHandleAttributeAdd(IEspContext &context, IEspHandleAttributeAddRequest &req, IEspHandleAttributeAddResponse &resp);
  868. virtual bool onHandleComponent(IEspContext &context, IEspHandleComponentRequest &req, IEspHandleComponentResponse &resp);
  869. virtual bool onHandleInstance(IEspContext &context, IEspHandleInstanceRequest &req, IEspHandleInstanceResponse &resp);
  870. virtual bool onHandleEspServiceBindings(IEspContext &context, IEspHandleEspServiceBindingsRequest &req, IEspHandleEspServiceBindingsResponse &resp);
  871. virtual bool onHandleComputer(IEspContext &context, IEspHandleComputerRequest &req, IEspHandleComputerResponse &resp);
  872. virtual bool onHandleTopology(IEspContext &context, IEspHandleTopologyRequest &req, IEspHandleTopologyResponse &resp);
  873. virtual bool onHandleRows(IEspContext &context, IEspHandleRowsRequest &req, IEspHandleRowsResponse &resp);
  874. virtual bool onHandleAccessRules(IEspContext &context, IEspHandleAccessRulesRequest &req, IEspHandleAccessRulesResponse &resp);
  875. virtual bool onHandleBaseAccessControlList(IEspContext &context, IEspHandleBaseAccessControlListRequest &req, IEspHandleBaseAccessControlListResponse &resp);
  876. virtual bool onGetNavTreeDefn(IEspContext &context, IEspGetNavTreeDefnRequest &req, IEspGetNavTreeDefnResponse &resp);
  877. virtual bool onGetValue(IEspContext &context, IEspGetValueRequest &req, IEspGetValueResponse &resp);
  878. virtual bool onLockEnvironmentForCloud(IEspContext &context, IEspLockEnvironmentForCloudRequest &req, IEspLockEnvironmentForCloudResponse &resp);
  879. virtual bool onUnlockEnvironmentForCloud(IEspContext &context, IEspUnlockEnvironmentForCloudRequest &req, IEspUnlockEnvironmentForCloudResponse &resp);
  880. virtual bool onSaveEnvironmentForCloud(IEspContext &context, IEspSaveEnvironmentForCloudRequest &req, IEspSaveEnvironmentForCloudResponse &resp);
  881. virtual bool onRollbackEnvironmentForCloud(IEspContext &context, IEspRollbackEnvironmentForCloudRequest &req, IEspRollbackEnvironmentForCloudResponse &resp);
  882. virtual bool onNotifyInitSystemSaveEnvForCloud(IEspContext &context, IEspNotifyInitSystemSaveEnvForCloudRequest &req, IEspNotifyInitSystemSaveEnvForCloudResponse &resp);
  883. private:
  884. virtual void getWizOptions(StringBuffer& sb);
  885. };
  886. #endif //_ESPWIZ_WsDeploy_HPP__