ShareLog.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. ///**
  2. // * Autogenerated by Thrift Compiler (0.12.0)
  3. // *
  4. // * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  5. // * @generated
  6. // */
  7. //using System;
  8. //using System.Collections;
  9. //using System.Collections.Generic;
  10. //using System.Text;
  11. //using System.IO;
  12. //using Thrift;
  13. //using Thrift.Collections;
  14. //using System.Runtime.Serialization;
  15. //using Thrift.Protocol;
  16. //using Thrift.Transport;
  17. //public partial class ShareLog
  18. //{
  19. // public interface ISync
  20. // {
  21. // string SendMessage(string message, string type = "");
  22. // }
  23. // public interface Iface : ISync
  24. // {
  25. //#if SILVERLIGHT
  26. // IAsyncResult Begin_SendMessage(AsyncCallback callback, object state, string message);
  27. // string End_SendMessage(IAsyncResult asyncResult);
  28. //#endif
  29. // }
  30. // public class Client : IDisposable, Iface
  31. // {
  32. // public Client(TProtocol prot) : this(prot, prot)
  33. // {
  34. // }
  35. // public Client(TProtocol iprot, TProtocol oprot)
  36. // {
  37. // iprot_ = iprot;
  38. // oprot_ = oprot;
  39. // }
  40. // protected TProtocol iprot_;
  41. // protected TProtocol oprot_;
  42. // protected int seqid_;
  43. // public TProtocol InputProtocol
  44. // {
  45. // get { return iprot_; }
  46. // }
  47. // public TProtocol OutputProtocol
  48. // {
  49. // get { return oprot_; }
  50. // }
  51. // #region " IDisposable Support "
  52. // private bool _IsDisposed;
  53. // // IDisposable
  54. // public void Dispose()
  55. // {
  56. // Dispose(true);
  57. // }
  58. // protected virtual void Dispose(bool disposing)
  59. // {
  60. // if (!_IsDisposed)
  61. // {
  62. // if (disposing)
  63. // {
  64. // if (iprot_ != null)
  65. // {
  66. // ((IDisposable)iprot_).Dispose();
  67. // }
  68. // if (oprot_ != null)
  69. // {
  70. // ((IDisposable)oprot_).Dispose();
  71. // }
  72. // }
  73. // }
  74. // _IsDisposed = true;
  75. // }
  76. // #endregion
  77. //#if SILVERLIGHT
  78. // public IAsyncResult Begin_SendMessage(AsyncCallback callback, object state, string message)
  79. // {
  80. // return send_SendMessage(callback, state, message);
  81. // }
  82. // public string End_SendMessage(IAsyncResult asyncResult)
  83. // {
  84. // oprot_.Transport.EndFlush(asyncResult);
  85. // return recv_SendMessage();
  86. // }
  87. //#endif
  88. // public string SendMessage(string message)
  89. // {
  90. //#if SILVERLIGHT
  91. // var asyncResult = Begin_SendMessage(null, null, message);
  92. // return End_SendMessage(asyncResult);
  93. //#else
  94. // return "ok";
  95. //#endif
  96. // }
  97. //#if SILVERLIGHT
  98. // public IAsyncResult send_SendMessage(AsyncCallback callback, object state, string message)
  99. // {
  100. // oprot_.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Call, seqid_));
  101. // SendMessage_args args = new SendMessage_args();
  102. // args.Message = message;
  103. // args.Write(oprot_);
  104. // oprot_.WriteMessageEnd();
  105. // return oprot_.Transport.BeginFlush(callback, state);
  106. // }
  107. //#else
  108. // public void send_SendMessage(string message, string type)
  109. // {
  110. // oprot_.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Call, seqid_));
  111. // SendMessage_args args = new SendMessage_args();
  112. // args.Message = message;
  113. // args.Type = type;
  114. // args.Write(oprot_);
  115. // oprot_.WriteMessageEnd();
  116. // oprot_.Transport.Flush();
  117. // }
  118. //#endif
  119. // public string recv_SendMessage()
  120. // {
  121. // TMessage msg = iprot_.ReadMessageBegin();
  122. // if (msg.Type == TMessageType.Exception)
  123. // {
  124. // TApplicationException x = TApplicationException.Read(iprot_);
  125. // iprot_.ReadMessageEnd();
  126. // throw x;
  127. // }
  128. // SendMessage_result result = new SendMessage_result();
  129. // result.Read(iprot_);
  130. // iprot_.ReadMessageEnd();
  131. // if (result.__isset.success)
  132. // {
  133. // return result.Success;
  134. // }
  135. // throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "SendMessage failed: unknown result");
  136. // }
  137. // public string SendMessage(string message, string type = "")
  138. // {
  139. // send_SendMessage(message, type);
  140. // return "ok";
  141. // }
  142. // }
  143. // public class Processor : TProcessor
  144. // {
  145. // public Processor(ISync iface)
  146. // {
  147. // iface_ = iface;
  148. // processMap_["SendMessage"] = SendMessage_Process;
  149. // }
  150. // protected delegate void ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot);
  151. // private ISync iface_;
  152. // protected Dictionary<string, ProcessFunction> processMap_ = new Dictionary<string, ProcessFunction>();
  153. // public bool Process(TProtocol iprot, TProtocol oprot)
  154. // {
  155. // try
  156. // {
  157. // TMessage msg = iprot.ReadMessageBegin();
  158. // ProcessFunction fn;
  159. // processMap_.TryGetValue(msg.Name, out fn);
  160. // if (fn == null)
  161. // {
  162. // TProtocolUtil.Skip(iprot, TType.Struct);
  163. // iprot.ReadMessageEnd();
  164. // TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.UnknownMethod, "Invalid method name: '" + msg.Name + "'");
  165. // oprot.WriteMessageBegin(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID));
  166. // x.Write(oprot);
  167. // oprot.WriteMessageEnd();
  168. // oprot.Transport.Flush();
  169. // return true;
  170. // }
  171. // fn(msg.SeqID, iprot, oprot);
  172. // }
  173. // catch (IOException)
  174. // {
  175. // return false;
  176. // }
  177. // return true;
  178. // }
  179. // public void SendMessage_Process(int seqid, TProtocol iprot, TProtocol oprot)
  180. // {
  181. // SendMessage_args args = new SendMessage_args();
  182. // args.Read(iprot);
  183. // iprot.ReadMessageEnd();
  184. // SendMessage_result result = new SendMessage_result();
  185. // try
  186. // {
  187. // result.Success = iface_.SendMessage(args.Message);
  188. // //oprot.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Reply, seqid));
  189. // //result.Write(oprot);
  190. // }
  191. // catch (TTransportException)
  192. // {
  193. // throw;
  194. // }
  195. // catch (Exception ex)
  196. // {
  197. // Console.Error.WriteLine("Error occurred in processor:");
  198. // Console.Error.WriteLine(ex.ToString());
  199. // TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
  200. // oprot.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Exception, seqid));
  201. // x.Write(oprot);
  202. // }
  203. // oprot.WriteMessageEnd();
  204. // oprot.Transport.Flush();
  205. // }
  206. // }
  207. //#if !SILVERLIGHT
  208. // [Serializable]
  209. //#endif
  210. // public partial class SendMessage_args : TBase
  211. // {
  212. // private string _message;
  213. // private string _type;
  214. // public string Message
  215. // {
  216. // get
  217. // {
  218. // return _message;
  219. // }
  220. // set
  221. // {
  222. // __isset.message = true;
  223. // this._message = value;
  224. // }
  225. // }
  226. // public string Type
  227. // {
  228. // get
  229. // {
  230. // return _type;
  231. // }
  232. // set
  233. // {
  234. // __isset.type = true;
  235. // this._type = value;
  236. // }
  237. // }
  238. // public Isset __isset;
  239. //#if !SILVERLIGHT
  240. // [Serializable]
  241. //#endif
  242. // public struct Isset
  243. // {
  244. // public bool message;
  245. // public bool type;
  246. // }
  247. // public SendMessage_args()
  248. // {
  249. // }
  250. // public void Read(TProtocol iprot)
  251. // {
  252. // iprot.IncrementRecursionDepth();
  253. // try
  254. // {
  255. // TField field;
  256. // iprot.ReadStructBegin();
  257. // while (true)
  258. // {
  259. // field = iprot.ReadFieldBegin();
  260. // if (field.Type == TType.Stop)
  261. // {
  262. // break;
  263. // }
  264. // switch (field.ID)
  265. // {
  266. // case 1:
  267. // if (field.Type == TType.String)
  268. // {
  269. // Message = iprot.ReadString();
  270. // }
  271. // else
  272. // {
  273. // TProtocolUtil.Skip(iprot, field.Type);
  274. // }
  275. // break;
  276. // case 2:
  277. // if (field.Type == TType.String)
  278. // {
  279. // Type = iprot.ReadString();
  280. // }
  281. // else
  282. // {
  283. // TProtocolUtil.Skip(iprot, field.Type);
  284. // }
  285. // break;
  286. // default:
  287. // TProtocolUtil.Skip(iprot, field.Type);
  288. // break;
  289. // }
  290. // iprot.ReadFieldEnd();
  291. // }
  292. // iprot.ReadStructEnd();
  293. // }
  294. // finally
  295. // {
  296. // iprot.DecrementRecursionDepth();
  297. // }
  298. // }
  299. // public void Write(TProtocol oprot)
  300. // {
  301. // oprot.IncrementRecursionDepth();
  302. // try
  303. // {
  304. // TStruct struc = new TStruct("SendMessage_args");
  305. // oprot.WriteStructBegin(struc);
  306. // TField field = new TField();
  307. // if (Message != null && __isset.message)
  308. // {
  309. // field.Name = "message";
  310. // field.Type = TType.String;
  311. // field.ID = 1;
  312. // oprot.WriteFieldBegin(field);
  313. // oprot.WriteString(Message);
  314. // oprot.WriteFieldEnd();
  315. // }
  316. // if (Type != null && __isset.type)
  317. // {
  318. // field.Name = "type";
  319. // field.Type = TType.String;
  320. // field.ID = 2;
  321. // oprot.WriteFieldBegin(field);
  322. // oprot.WriteString(Type);
  323. // oprot.WriteFieldEnd();
  324. // }
  325. // oprot.WriteFieldStop();
  326. // oprot.WriteStructEnd();
  327. // }
  328. // finally
  329. // {
  330. // oprot.DecrementRecursionDepth();
  331. // }
  332. // }
  333. // public override string ToString()
  334. // {
  335. // StringBuilder __sb = new StringBuilder("SendMessage_args(");
  336. // bool __first = true;
  337. // if (Message != null && __isset.message)
  338. // {
  339. // if (!__first) { __sb.Append(", "); }
  340. // __first = false;
  341. // __sb.Append("Message: ");
  342. // __sb.Append(Message);
  343. // }
  344. // if (Type != null && __isset.type)
  345. // {
  346. // if (!__first) { __sb.Append(", "); }
  347. // __first = false;
  348. // __sb.Append("Type: ");
  349. // __sb.Append(Type);
  350. // }
  351. // __sb.Append(")");
  352. // return __sb.ToString();
  353. // }
  354. // }
  355. //#if !SILVERLIGHT
  356. // [Serializable]
  357. //#endif
  358. // public partial class SendMessage_result : TBase
  359. // {
  360. // private string _success;
  361. // public string Success
  362. // {
  363. // get
  364. // {
  365. // return _success;
  366. // }
  367. // set
  368. // {
  369. // __isset.success = true;
  370. // this._success = value;
  371. // }
  372. // }
  373. // public Isset __isset;
  374. //#if !SILVERLIGHT
  375. // [Serializable]
  376. //#endif
  377. // public struct Isset
  378. // {
  379. // public bool success;
  380. // }
  381. // public SendMessage_result()
  382. // {
  383. // }
  384. // public void Read(TProtocol iprot)
  385. // {
  386. // iprot.IncrementRecursionDepth();
  387. // try
  388. // {
  389. // TField field;
  390. // iprot.ReadStructBegin();
  391. // while (true)
  392. // {
  393. // field = iprot.ReadFieldBegin();
  394. // if (field.Type == TType.Stop)
  395. // {
  396. // break;
  397. // }
  398. // switch (field.ID)
  399. // {
  400. // case 0:
  401. // if (field.Type == TType.String)
  402. // {
  403. // Success = iprot.ReadString();
  404. // }
  405. // else
  406. // {
  407. // TProtocolUtil.Skip(iprot, field.Type);
  408. // }
  409. // break;
  410. // default:
  411. // TProtocolUtil.Skip(iprot, field.Type);
  412. // break;
  413. // }
  414. // iprot.ReadFieldEnd();
  415. // }
  416. // iprot.ReadStructEnd();
  417. // }
  418. // finally
  419. // {
  420. // iprot.DecrementRecursionDepth();
  421. // }
  422. // }
  423. // public void Write(TProtocol oprot)
  424. // {
  425. // oprot.IncrementRecursionDepth();
  426. // try
  427. // {
  428. // TStruct struc = new TStruct("SendMessage_result");
  429. // oprot.WriteStructBegin(struc);
  430. // TField field = new TField();
  431. // if (this.__isset.success)
  432. // {
  433. // if (Success != null)
  434. // {
  435. // field.Name = "Success";
  436. // field.Type = TType.String;
  437. // field.ID = 0;
  438. // oprot.WriteFieldBegin(field);
  439. // oprot.WriteString(Success);
  440. // oprot.WriteFieldEnd();
  441. // }
  442. // }
  443. // oprot.WriteFieldStop();
  444. // oprot.WriteStructEnd();
  445. // }
  446. // finally
  447. // {
  448. // oprot.DecrementRecursionDepth();
  449. // }
  450. // }
  451. // public override string ToString()
  452. // {
  453. // StringBuilder __sb = new StringBuilder("SendMessage_result(");
  454. // bool __first = true;
  455. // if (Success != null && __isset.success)
  456. // {
  457. // if (!__first) { __sb.Append(", "); }
  458. // __first = false;
  459. // __sb.Append("Success: ");
  460. // __sb.Append(Success);
  461. // }
  462. // __sb.Append(")");
  463. // return __sb.ToString();
  464. // }
  465. // }
  466. //}