GUIConsole_server_g.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. #ifndef __GUICONSOLE_SERVER_G_H
  2. #define __GUICONSOLE_SERVER_G_H
  3. #pragma once
  4. // This code is generated by spgen tool!
  5. #include "GUIConsole_def_g.h"
  6. namespace GUIConsole {
  7. class GUIConsoleService_ServerSessionBase : public CServerSessionBase
  8. {
  9. public:
  10. GUIConsoleService_ServerSessionBase()
  11. {
  12. /// override by user
  13. }
  14. virtual ~GUIConsoleService_ServerSessionBase()
  15. {
  16. /// override by user
  17. }
  18. virtual bool IsExclusive() { return false; }
  19. virtual bool IsSessionOverlap() { return true; }
  20. virtual ErrorCodeEnum GetMessageAttr(DWORD dwMessageID, DWORD dwSignature, bool &bOverlap)
  21. {
  22. ErrorCodeEnum Error = Error_Succeed;
  23. switch (dwMessageID) {
  24. case GUIConsoleService_Method_OpenLogSender:
  25. if (dwSignature == GUIConsoleService_MethodSignature_OpenLogSender) {
  26. bOverlap = true;
  27. } else {
  28. Error = Error_MethodSignatureFailed;
  29. }
  30. break;
  31. case GUIConsoleService_Method_CloseLogSender:
  32. if (dwSignature == GUIConsoleService_MethodSignature_CloseLogSender) {
  33. bOverlap = true;
  34. } else {
  35. Error = Error_MethodSignatureFailed;
  36. }
  37. break;
  38. case GUIConsoleService_Method_OpenEntityMonitor:
  39. if (dwSignature == GUIConsoleService_MethodSignature_OpenEntityMonitor) {
  40. bOverlap = true;
  41. } else {
  42. Error = Error_MethodSignatureFailed;
  43. }
  44. break;
  45. case GUIConsoleService_Method_CloseEntityMonitor:
  46. if (dwSignature == GUIConsoleService_MethodSignature_CloseEntityMonitor) {
  47. bOverlap = true;
  48. } else {
  49. Error = Error_MethodSignatureFailed;
  50. }
  51. break;
  52. case GUIConsoleService_Method_OpenPerformanceSender:
  53. if (dwSignature == GUIConsoleService_MethodSignature_OpenPerformanceSender) {
  54. bOverlap = true;
  55. } else {
  56. Error = Error_MethodSignatureFailed;
  57. }
  58. break;
  59. case GUIConsoleService_Method_ClosePerformanceSender:
  60. if (dwSignature == GUIConsoleService_MethodSignature_ClosePerformanceSender) {
  61. bOverlap = true;
  62. } else {
  63. Error = Error_MethodSignatureFailed;
  64. }
  65. break;
  66. case GUIConsoleService_Method_VTMSystemControl:
  67. if (dwSignature == GUIConsoleService_MethodSignature_VTMSystemControl) {
  68. bOverlap = true;
  69. } else {
  70. Error = Error_MethodSignatureFailed;
  71. }
  72. break;
  73. case GUIConsoleService_Method_VTM_controlEntity:
  74. if (dwSignature == GUIConsoleService_MethodSignature_VTM_controlEntity) {
  75. bOverlap = true;
  76. } else {
  77. Error = Error_MethodSignatureFailed;
  78. }
  79. break;
  80. case GUIConsoleService_Method_GetAllEntityList:
  81. if (dwSignature == GUIConsoleService_MethodSignature_GetAllEntityList) {
  82. bOverlap = true;
  83. } else {
  84. Error = Error_MethodSignatureFailed;
  85. }
  86. break;
  87. case GUIConsoleService_Method_GetBasicInformation:
  88. if (dwSignature == GUIConsoleService_MethodSignature_GetBasicInformation) {
  89. bOverlap = true;
  90. } else {
  91. Error = Error_MethodSignatureFailed;
  92. }
  93. break;
  94. case GUIConsoleService_Method_GetHelpInformationArr:
  95. if (dwSignature == GUIConsoleService_MethodSignature_GetHelpInformationArr) {
  96. bOverlap = true;
  97. } else {
  98. Error = Error_MethodSignatureFailed;
  99. }
  100. break;
  101. case GUIConsoleService_Method_GetHelpDetail:
  102. if (dwSignature == GUIConsoleService_MethodSignature_GetHelpDetail) {
  103. bOverlap = true;
  104. } else {
  105. Error = Error_MethodSignatureFailed;
  106. }
  107. break;
  108. case GUIConsoleService_Method_OpenCommonPage:
  109. if (dwSignature == GUIConsoleService_MethodSignature_OpenCommonPage) {
  110. bOverlap = true;
  111. } else {
  112. Error = Error_MethodSignatureFailed;
  113. }
  114. break;
  115. case GUIConsoleService_Method_CloseCommonPage:
  116. if (dwSignature == GUIConsoleService_MethodSignature_CloseCommonPage) {
  117. bOverlap = true;
  118. } else {
  119. Error = Error_MethodSignatureFailed;
  120. }
  121. break;
  122. default:
  123. Error = Error_MethodNotFound;
  124. break;
  125. }
  126. return Error;
  127. }
  128. int CheckMessageSignature(DWORD dwMessageID, DWORD dwSignature)
  129. {
  130. ErrorCodeEnum Error = Error_Succeed;
  131. switch (dwMessageID) {
  132. case GUIConsoleService_Method_OpenLogSender:
  133. if (dwSignature != GUIConsoleService_MethodSignature_OpenLogSender) {
  134. Error = Error_MethodSignatureFailed;
  135. }
  136. break;
  137. case GUIConsoleService_Method_CloseLogSender:
  138. if (dwSignature != GUIConsoleService_MethodSignature_CloseLogSender) {
  139. Error = Error_MethodSignatureFailed;
  140. }
  141. break;
  142. case GUIConsoleService_Method_OpenEntityMonitor:
  143. if (dwSignature != GUIConsoleService_MethodSignature_OpenEntityMonitor) {
  144. Error = Error_MethodSignatureFailed;
  145. }
  146. break;
  147. case GUIConsoleService_Method_CloseEntityMonitor:
  148. if (dwSignature != GUIConsoleService_MethodSignature_CloseEntityMonitor) {
  149. Error = Error_MethodSignatureFailed;
  150. }
  151. break;
  152. case GUIConsoleService_Method_OpenPerformanceSender:
  153. if (dwSignature != GUIConsoleService_MethodSignature_OpenPerformanceSender) {
  154. Error = Error_MethodSignatureFailed;
  155. }
  156. break;
  157. case GUIConsoleService_Method_ClosePerformanceSender:
  158. if (dwSignature != GUIConsoleService_MethodSignature_ClosePerformanceSender) {
  159. Error = Error_MethodSignatureFailed;
  160. }
  161. break;
  162. case GUIConsoleService_Method_VTMSystemControl:
  163. if (dwSignature != GUIConsoleService_MethodSignature_VTMSystemControl) {
  164. Error = Error_MethodSignatureFailed;
  165. }
  166. break;
  167. case GUIConsoleService_Method_VTM_controlEntity:
  168. if (dwSignature != GUIConsoleService_MethodSignature_VTM_controlEntity) {
  169. Error = Error_MethodSignatureFailed;
  170. }
  171. break;
  172. case GUIConsoleService_Method_GetAllEntityList:
  173. if (dwSignature != GUIConsoleService_MethodSignature_GetAllEntityList) {
  174. Error = Error_MethodSignatureFailed;
  175. }
  176. break;
  177. case GUIConsoleService_Method_GetBasicInformation:
  178. if (dwSignature != GUIConsoleService_MethodSignature_GetBasicInformation) {
  179. Error = Error_MethodSignatureFailed;
  180. }
  181. break;
  182. case GUIConsoleService_Method_GetHelpInformationArr:
  183. if (dwSignature != GUIConsoleService_MethodSignature_GetHelpInformationArr) {
  184. Error = Error_MethodSignatureFailed;
  185. }
  186. break;
  187. case GUIConsoleService_Method_GetHelpDetail:
  188. if (dwSignature != GUIConsoleService_MethodSignature_GetHelpDetail) {
  189. Error = Error_MethodSignatureFailed;
  190. }
  191. break;
  192. case GUIConsoleService_Method_OpenCommonPage:
  193. if (dwSignature != GUIConsoleService_MethodSignature_OpenCommonPage) {
  194. Error = Error_MethodSignatureFailed;
  195. }
  196. break;
  197. case GUIConsoleService_Method_CloseCommonPage:
  198. if (dwSignature != GUIConsoleService_MethodSignature_CloseCommonPage) {
  199. Error = Error_MethodSignatureFailed;
  200. }
  201. break;
  202. default:
  203. Error = Error_MethodNotFound;
  204. break;
  205. }
  206. return Error;
  207. }
  208. virtual void Handle_OpenLogSender(SpReqAnsContext<GUIConsoleService_OpenLogSender_Req, GUIConsoleService_OpenLogSender_Ans>::Pointer ctx)
  209. {
  210. /// override by user
  211. }
  212. virtual void Handle_CloseLogSender(SpReqAnsContext<GUIConsoleService_CloseLogSender_Req, GUIConsoleService_CloseLogSender_Ans>::Pointer ctx)
  213. {
  214. /// override by user
  215. }
  216. virtual void Handle_OpenEntityMonitor(SpReqAnsContext<GUIConsoleService_OpenEntityMonitor_Req, GUIConsoleService_OpenEntityMonitor_Ans>::Pointer ctx)
  217. {
  218. /// override by user
  219. }
  220. virtual void Handle_CloseEntityMonitor(SpReqAnsContext<GUIConsoleService_CloseEntityMonitor_Req, GUIConsoleService_CloseEntityMonitor_Ans>::Pointer ctx)
  221. {
  222. /// override by user
  223. }
  224. virtual void Handle_OpenPerformanceSender(SpReqAnsContext<GUIConsoleService_OpenPerformanceSender_Req, GUIConsoleService_OpenPerformanceSender_Ans>::Pointer ctx)
  225. {
  226. /// override by user
  227. }
  228. virtual void Handle_ClosePerformanceSender(SpReqAnsContext<GUIConsoleService_ClosePerformanceSender_Req, GUIConsoleService_ClosePerformanceSender_Ans>::Pointer ctx)
  229. {
  230. /// override by user
  231. }
  232. virtual void Handle_VTMSystemControl(SpReqAnsContext<GUIConsoleService_VTMSystemControl_Req, GUIConsoleService_VTMSystemControl_Ans>::Pointer ctx)
  233. {
  234. /// override by user
  235. }
  236. virtual void Handle_VTM_controlEntity(SpReqAnsContext<GUIConsoleService_VTM_controlEntity_Req, GUIConsoleService_VTM_controlEntity_Ans>::Pointer ctx)
  237. {
  238. /// override by user
  239. }
  240. virtual void Handle_GetAllEntityList(SpReqAnsContext<GUIConsoleService_GetAllEntityList_Req, GUIConsoleService_GetAllEntityList_Ans>::Pointer ctx)
  241. {
  242. /// override by user
  243. }
  244. virtual void Handle_GetBasicInformation(SpReqAnsContext<GUIConsoleService_GetBasicInformation_Req, GUIConsoleService_GetBasicInformation_Ans>::Pointer ctx)
  245. {
  246. /// override by user
  247. }
  248. virtual void Handle_GetHelpInformationArr(SpReqAnsContext<GUIConsoleService_GetHelpInformationArr_Req, GUIConsoleService_GetHelpInformationArr_Ans>::Pointer ctx)
  249. {
  250. /// override by user
  251. }
  252. virtual void Handle_GetHelpDetail(SpReqAnsContext<GUIConsoleService_GetHelpDetail_Req, GUIConsoleService_GetHelpDetail_Ans>::Pointer ctx)
  253. {
  254. /// override by user
  255. }
  256. virtual void Handle_OpenCommonPage(SpReqAnsContext<GUIConsoleService_OpenCommonPage_Req, GUIConsoleService_OpenCommonPage_Ans>::Pointer ctx)
  257. {
  258. /// override by user
  259. }
  260. virtual void Handle_CloseCommonPage(SpReqAnsContext<GUIConsoleService_CloseCommonPage_Req, GUIConsoleService_CloseCommonPage_Ans>::Pointer ctx)
  261. {
  262. /// override by user
  263. }
  264. virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
  265. {
  266. CAutoBuffer Buf;
  267. DWORD dwMessageID;
  268. DWORD dwMessageSignature;
  269. ErrorCodeEnum Error = pTransactionContext->GetReceiveBuffer(dwMessageID, dwMessageSignature, Buf);
  270. if (Error == Error_Succeed) {
  271. #ifdef DEBUG
  272. assert(CheckMessageSignature(dwMessageID, dwMessageSignature) == Error_Succeed);
  273. #else
  274. if (CheckMessageSignature(dwMessageID, dwMessageSignature) != Error_Succeed) {
  275. pTransactionContext->SendAnswer(Error_MethodSignatureFailed);
  276. return;
  277. }
  278. #endif
  279. switch (dwMessageID) {
  280. case GUIConsoleService_Method_OpenLogSender:
  281. {
  282. SpReqAnsContext<GUIConsoleService_OpenLogSender_Req,GUIConsoleService_OpenLogSender_Ans>::Pointer ctx;
  283. ctx.Attach(new SpReqAnsContext<GUIConsoleService_OpenLogSender_Req,GUIConsoleService_OpenLogSender_Ans>(pTransactionContext));
  284. SpBuffer2Object(Buf, ctx->Req);
  285. pTransactionContext->GetLinkContext(ctx->link);
  286. EntityResource::setLink(ctx->link);
  287. Handle_OpenLogSender(ctx);
  288. }
  289. break;
  290. case GUIConsoleService_Method_CloseLogSender:
  291. {
  292. SpReqAnsContext<GUIConsoleService_CloseLogSender_Req,GUIConsoleService_CloseLogSender_Ans>::Pointer ctx;
  293. ctx.Attach(new SpReqAnsContext<GUIConsoleService_CloseLogSender_Req,GUIConsoleService_CloseLogSender_Ans>(pTransactionContext));
  294. SpBuffer2Object(Buf, ctx->Req);
  295. pTransactionContext->GetLinkContext(ctx->link);
  296. EntityResource::setLink(ctx->link);
  297. Handle_CloseLogSender(ctx);
  298. }
  299. break;
  300. case GUIConsoleService_Method_OpenEntityMonitor:
  301. {
  302. SpReqAnsContext<GUIConsoleService_OpenEntityMonitor_Req,GUIConsoleService_OpenEntityMonitor_Ans>::Pointer ctx;
  303. ctx.Attach(new SpReqAnsContext<GUIConsoleService_OpenEntityMonitor_Req,GUIConsoleService_OpenEntityMonitor_Ans>(pTransactionContext));
  304. SpBuffer2Object(Buf, ctx->Req);
  305. pTransactionContext->GetLinkContext(ctx->link);
  306. EntityResource::setLink(ctx->link);
  307. Handle_OpenEntityMonitor(ctx);
  308. }
  309. break;
  310. case GUIConsoleService_Method_CloseEntityMonitor:
  311. {
  312. SpReqAnsContext<GUIConsoleService_CloseEntityMonitor_Req,GUIConsoleService_CloseEntityMonitor_Ans>::Pointer ctx;
  313. ctx.Attach(new SpReqAnsContext<GUIConsoleService_CloseEntityMonitor_Req,GUIConsoleService_CloseEntityMonitor_Ans>(pTransactionContext));
  314. SpBuffer2Object(Buf, ctx->Req);
  315. pTransactionContext->GetLinkContext(ctx->link);
  316. EntityResource::setLink(ctx->link);
  317. Handle_CloseEntityMonitor(ctx);
  318. }
  319. break;
  320. case GUIConsoleService_Method_OpenPerformanceSender:
  321. {
  322. SpReqAnsContext<GUIConsoleService_OpenPerformanceSender_Req,GUIConsoleService_OpenPerformanceSender_Ans>::Pointer ctx;
  323. ctx.Attach(new SpReqAnsContext<GUIConsoleService_OpenPerformanceSender_Req,GUIConsoleService_OpenPerformanceSender_Ans>(pTransactionContext));
  324. SpBuffer2Object(Buf, ctx->Req);
  325. pTransactionContext->GetLinkContext(ctx->link);
  326. EntityResource::setLink(ctx->link);
  327. Handle_OpenPerformanceSender(ctx);
  328. }
  329. break;
  330. case GUIConsoleService_Method_ClosePerformanceSender:
  331. {
  332. SpReqAnsContext<GUIConsoleService_ClosePerformanceSender_Req,GUIConsoleService_ClosePerformanceSender_Ans>::Pointer ctx;
  333. ctx.Attach(new SpReqAnsContext<GUIConsoleService_ClosePerformanceSender_Req,GUIConsoleService_ClosePerformanceSender_Ans>(pTransactionContext));
  334. SpBuffer2Object(Buf, ctx->Req);
  335. pTransactionContext->GetLinkContext(ctx->link);
  336. EntityResource::setLink(ctx->link);
  337. Handle_ClosePerformanceSender(ctx);
  338. }
  339. break;
  340. case GUIConsoleService_Method_VTMSystemControl:
  341. {
  342. SpReqAnsContext<GUIConsoleService_VTMSystemControl_Req,GUIConsoleService_VTMSystemControl_Ans>::Pointer ctx;
  343. ctx.Attach(new SpReqAnsContext<GUIConsoleService_VTMSystemControl_Req,GUIConsoleService_VTMSystemControl_Ans>(pTransactionContext));
  344. SpBuffer2Object(Buf, ctx->Req);
  345. pTransactionContext->GetLinkContext(ctx->link);
  346. EntityResource::setLink(ctx->link);
  347. Handle_VTMSystemControl(ctx);
  348. }
  349. break;
  350. case GUIConsoleService_Method_VTM_controlEntity:
  351. {
  352. SpReqAnsContext<GUIConsoleService_VTM_controlEntity_Req,GUIConsoleService_VTM_controlEntity_Ans>::Pointer ctx;
  353. ctx.Attach(new SpReqAnsContext<GUIConsoleService_VTM_controlEntity_Req,GUIConsoleService_VTM_controlEntity_Ans>(pTransactionContext));
  354. SpBuffer2Object(Buf, ctx->Req);
  355. pTransactionContext->GetLinkContext(ctx->link);
  356. EntityResource::setLink(ctx->link);
  357. Handle_VTM_controlEntity(ctx);
  358. }
  359. break;
  360. case GUIConsoleService_Method_GetAllEntityList:
  361. {
  362. SpReqAnsContext<GUIConsoleService_GetAllEntityList_Req,GUIConsoleService_GetAllEntityList_Ans>::Pointer ctx;
  363. ctx.Attach(new SpReqAnsContext<GUIConsoleService_GetAllEntityList_Req,GUIConsoleService_GetAllEntityList_Ans>(pTransactionContext));
  364. SpBuffer2Object(Buf, ctx->Req);
  365. pTransactionContext->GetLinkContext(ctx->link);
  366. EntityResource::setLink(ctx->link);
  367. Handle_GetAllEntityList(ctx);
  368. }
  369. break;
  370. case GUIConsoleService_Method_GetBasicInformation:
  371. {
  372. SpReqAnsContext<GUIConsoleService_GetBasicInformation_Req,GUIConsoleService_GetBasicInformation_Ans>::Pointer ctx;
  373. ctx.Attach(new SpReqAnsContext<GUIConsoleService_GetBasicInformation_Req,GUIConsoleService_GetBasicInformation_Ans>(pTransactionContext));
  374. SpBuffer2Object(Buf, ctx->Req);
  375. pTransactionContext->GetLinkContext(ctx->link);
  376. EntityResource::setLink(ctx->link);
  377. Handle_GetBasicInformation(ctx);
  378. }
  379. break;
  380. case GUIConsoleService_Method_GetHelpInformationArr:
  381. {
  382. SpReqAnsContext<GUIConsoleService_GetHelpInformationArr_Req,GUIConsoleService_GetHelpInformationArr_Ans>::Pointer ctx;
  383. ctx.Attach(new SpReqAnsContext<GUIConsoleService_GetHelpInformationArr_Req,GUIConsoleService_GetHelpInformationArr_Ans>(pTransactionContext));
  384. SpBuffer2Object(Buf, ctx->Req);
  385. pTransactionContext->GetLinkContext(ctx->link);
  386. EntityResource::setLink(ctx->link);
  387. Handle_GetHelpInformationArr(ctx);
  388. }
  389. break;
  390. case GUIConsoleService_Method_GetHelpDetail:
  391. {
  392. SpReqAnsContext<GUIConsoleService_GetHelpDetail_Req,GUIConsoleService_GetHelpDetail_Ans>::Pointer ctx;
  393. ctx.Attach(new SpReqAnsContext<GUIConsoleService_GetHelpDetail_Req,GUIConsoleService_GetHelpDetail_Ans>(pTransactionContext));
  394. SpBuffer2Object(Buf, ctx->Req);
  395. pTransactionContext->GetLinkContext(ctx->link);
  396. EntityResource::setLink(ctx->link);
  397. Handle_GetHelpDetail(ctx);
  398. }
  399. break;
  400. case GUIConsoleService_Method_OpenCommonPage:
  401. {
  402. SpReqAnsContext<GUIConsoleService_OpenCommonPage_Req,GUIConsoleService_OpenCommonPage_Ans>::Pointer ctx;
  403. ctx.Attach(new SpReqAnsContext<GUIConsoleService_OpenCommonPage_Req,GUIConsoleService_OpenCommonPage_Ans>(pTransactionContext));
  404. SpBuffer2Object(Buf, ctx->Req);
  405. pTransactionContext->GetLinkContext(ctx->link);
  406. EntityResource::setLink(ctx->link);
  407. Handle_OpenCommonPage(ctx);
  408. }
  409. break;
  410. case GUIConsoleService_Method_CloseCommonPage:
  411. {
  412. SpReqAnsContext<GUIConsoleService_CloseCommonPage_Req,GUIConsoleService_CloseCommonPage_Ans>::Pointer ctx;
  413. ctx.Attach(new SpReqAnsContext<GUIConsoleService_CloseCommonPage_Req,GUIConsoleService_CloseCommonPage_Ans>(pTransactionContext));
  414. SpBuffer2Object(Buf, ctx->Req);
  415. pTransactionContext->GetLinkContext(ctx->link);
  416. EntityResource::setLink(ctx->link);
  417. Handle_CloseCommonPage(ctx);
  418. }
  419. break;
  420. default:
  421. assert(0);
  422. break;
  423. }
  424. } else {
  425. pTransactionContext->SendAnswer(Error);
  426. }
  427. }
  428. };
  429. ///////////////////////////
  430. } // namespace GUIConsole
  431. #endif // __GUICONSOLE_SERVER_G_H