MsmqMessage.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. //
  2. // MsmqMessage.cs
  3. //
  4. // Author: Atsushi Enomoto <[email protected]>
  5. //
  6. // Copyright (C) 2007 Novell, Inc (http://www.novell.com)
  7. //
  8. // Permission is hereby granted, free of charge, to any person obtaining
  9. // a copy of this software and associated documentation files (the
  10. // "Software"), to deal in the Software without restriction, including
  11. // without limitation the rights to use, copy, modify, merge, publish,
  12. // distribute, sublicense, and/or sell copies of the Software, and to
  13. // permit persons to whom the Software is furnished to do so, subject to
  14. // the following conditions:
  15. //
  16. // The above copyright notice and this permission notice shall be
  17. // included in all copies or substantial portions of the Software.
  18. //
  19. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  20. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  21. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  22. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  23. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  24. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  25. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  26. //
  27. using System;
  28. using System.Messaging;
  29. using System.ServiceModel;
  30. namespace System.ServiceModel.MsmqIntegration
  31. {
  32. [MessageContract]
  33. public sealed class MsmqMessage<T>
  34. {
  35. AcknowledgeTypes? ack_type;
  36. Acknowledgment? ack;
  37. Uri adm_queue, dst_queue, res_queue;
  38. int? app_specific, body_type;
  39. DateTime? arrived_time, sent_time;
  40. bool? authenticated;
  41. T body;
  42. string correlation_id, id, label;
  43. byte [] extension, sender_id;
  44. MessageType? msg_type;
  45. MessagePriority? priority;
  46. TimeSpan? ttrq;
  47. public MsmqMessage (T body)
  48. {
  49. this.body = body;
  50. }
  51. public AcknowledgeTypes? AcknowledgeType {
  52. get { return ack_type; }
  53. set { ack_type = value; }
  54. }
  55. public Acknowledgment? Acknowledgment {
  56. get { return ack; }
  57. }
  58. public Uri AdministrationQueue {
  59. get { return adm_queue; }
  60. set { adm_queue = value; }
  61. }
  62. public int? AppSpecific {
  63. get { return app_specific; }
  64. set { app_specific = value; }
  65. }
  66. public DateTime? ArrivedTime {
  67. get { return arrived_time; }
  68. }
  69. public bool? Authenticated {
  70. get { return authenticated; }
  71. }
  72. public T Body {
  73. get { return body; }
  74. set { body = value; }
  75. }
  76. public int? BodyType {
  77. get { return body_type; }
  78. set { body_type = value; }
  79. }
  80. public string CorrelationId {
  81. get { return correlation_id; }
  82. set { correlation_id = value; }
  83. }
  84. public Uri DestinationQueue {
  85. get { return dst_queue; }
  86. }
  87. public byte [] Extension {
  88. get { return extension; }
  89. set { extension = value; }
  90. }
  91. public string Id {
  92. get { return id; }
  93. }
  94. public string Label {
  95. get { return label; }
  96. set { label = value; }
  97. }
  98. public MessageType? MessageType {
  99. get { return msg_type; }
  100. }
  101. public MessagePriority? Priority {
  102. get { return priority; }
  103. set { priority = value; }
  104. }
  105. public Uri ResponseQueue {
  106. get { return res_queue; }
  107. set { res_queue = value; }
  108. }
  109. public byte [] SenderId {
  110. get { return sender_id; }
  111. }
  112. public DateTime? SentTime {
  113. get { return sent_time; }
  114. }
  115. public TimeSpan? TimeToReachQueue {
  116. get { return ttrq; }
  117. set { ttrq = value; }
  118. }
  119. }
  120. }