2 // MsmqIntegrationMessageProperty.cs
4 // Author: Atsushi Enomoto <atsushi@ximian.com>
6 // Copyright (C) 2007 Novell, Inc (http://www.novell.com)
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:
16 // The above copyright notice and this permission notice shall be
17 // included in all copies or substantial portions of the Software.
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.
29 using System.Messaging;
30 using System.ServiceModel;
31 using System.ServiceModel.Channels;
33 using SMessage = System.ServiceModel.Channels.Message;
34 using MQMessage = System.Messaging.Message;
35 using MQMessageType = System.Messaging.MessageType;
37 namespace System.ServiceModel.MsmqIntegration
39 public sealed class MsmqIntegrationMessageProperty
41 public const string Name = "MsmqIntegrationMessageProperty";
43 public MsmqIntegrationMessageProperty ()
48 public static MsmqIntegrationMessageProperty Get (SMessage message)
50 throw new NotImplementedException ();
53 // not verified / consider queue property filter
54 internal static MsmqIntegrationMessageProperty Get (MQMessage message)
57 throw new ArgumentNullException ("message");
58 var p = new MsmqIntegrationMessageProperty ();
60 p.Label = message.Label;
61 p.CorrelationId = message.CorrelationId;
62 p.Body = message.Body;
63 p.Extension = message.Extension;
64 p.SenderId = message.SenderId;
66 p.DestinationQueue = CreateUriFromQueue (message.DestinationQueue);
67 if (message.AdministrationQueue != null)
68 p.AdministrationQueue = CreateUriFromQueue (message.AdministrationQueue);
69 if (message.ResponseQueue != null)
70 p.ResponseQueue = CreateUriFromQueue (message.ResponseQueue);
72 // FIXME: check property filter in the queue
73 p.AppSpecific = message.AppSpecific;
74 p.ArrivedTime = message.ArrivedTime;
75 p.Authenticated = message.Authenticated;
76 p.Priority = message.Priority;
77 p.SentTime = message.SentTime;
78 p.TimeToReachQueue = message.TimeToReachQueue;
80 switch (message.MessageType) {
81 case MQMessageType.Acknowledgment:
82 p.AcknowledgeType = message.AcknowledgeType;
83 p.Acknowledgment = message.Acknowledgment;
85 case MQMessageType.Normal:
86 case MQMessageType.Report:
94 static Uri CreateUriFromQueue (MessageQueue queue)
97 throw new NotImplementedException ();
100 public AcknowledgeTypes? AcknowledgeType { get; set; }
102 public Acknowledgment? Acknowledgment { get; private set; }
104 public Uri AdministrationQueue { get; set; }
106 public int? AppSpecific { get; set; }
108 public DateTime? ArrivedTime { get; private set; }
110 public bool? Authenticated { get; private set; }
112 public object Body { get; set; }
114 public int? BodyType { get; set; }
116 public string CorrelationId { get; set; }
118 public Uri DestinationQueue { get; private set; }
120 public byte [] Extension { get; set; }
122 public string Id { get; private set; }
124 public string Label { get; set; }
126 public MessageType? MessageType { get; private set; }
128 public MessagePriority? Priority { get; set; }
130 public Uri ResponseQueue { get; set; }
132 public byte [] SenderId { get; private set; }
134 public DateTime? SentTime { get; private set; }
136 public TimeSpan? TimeToReachQueue { get; set; }