5 // Peter Van Isacker (sclytrack@planetinternet.be)
\r
6 // Rafael Teixeira (rafaelteixeirabr@hotmail.com)
\r
8 // (C) 2003 Peter Van Isacker
\r
11 using System.Collections;
\r
12 using System.ComponentModel;
\r
14 namespace System.Messaging
\r
16 public class MessageQueue: Component, IEnumerable
\r
21 public static readonly long InfiniteQueueSize;
\r
22 public static readonly TimeSpan InfiniteTimeout;
\r
24 private bool isPrivate = false;
\r
25 private string queueName;
\r
26 private string machineName;
\r
35 public MessageQueue()
\r
37 throw new NotImplementedException();
\r
41 public MessageQueue(string path)
\r
44 this.isPrivate= false;
\r
48 private MessageQueue(string queueName, string machineName, bool isPrivate)
\r
50 this.queueName = queueName;
\r
51 this.machineName = machineName;
\r
52 this.isPrivate= isPrivate;
\r
56 public MessageQueue(string path, bool sharedModeDenyReceive)
\r
58 throw new NotImplementedException();
\r
61 #endregion //Constructor
\r
65 public bool Authenticate {
\r
67 get {throw new NotImplementedException();}
\r
69 set {throw new NotImplementedException();}
\r
71 public short BasePriority {
\r
73 get {throw new NotImplementedException();}
\r
75 set {throw new NotImplementedException();}
\r
77 public bool CanRead {
\r
79 get {throw new NotImplementedException();}
\r
81 public bool CanWrite {
\r
83 get {throw new NotImplementedException();}
\r
85 public Guid Category {
\r
87 get {throw new NotImplementedException();}
\r
89 set {throw new NotImplementedException();}
\r
91 public DateTime CreateTime {
\r
93 get {throw new NotImplementedException();}
\r
95 public DefaultPropertiesToSend DefaultPropertiesToSend {
\r
97 get {throw new NotImplementedException();}
\r
99 set {throw new NotImplementedException();}
\r
101 public bool DenySharedReceive {
\r
103 get {throw new NotImplementedException();}
\r
105 set {throw new NotImplementedException();}
\r
107 public static bool EnableConnectionCache {
\r
109 get {throw new NotImplementedException();}
\r
111 set {throw new NotImplementedException();}
\r
113 public EncryptionRequired EncryptionRequired {
\r
115 get {throw new NotImplementedException();}
\r
117 set {throw new NotImplementedException();}
\r
119 public string FormatName {
\r
121 get {throw new NotImplementedException();}
\r
123 public IMessageFormatter Formatter {
\r
125 get {throw new NotImplementedException();}
\r
127 set {throw new NotImplementedException();}
\r
131 get {throw new NotImplementedException();}
\r
133 public string Label {
\r
135 get {throw new NotImplementedException();}
\r
137 set {throw new NotImplementedException();}
\r
139 public DateTime LastModifyTime {
\r
141 get {throw new NotImplementedException();}
\r
143 public string MachineName {
\r
144 get { return machineName; }
\r
145 set { machineName = value; }
\r
147 public long MaximumJournalSize {
\r
149 get {throw new NotImplementedException();}
\r
151 set {throw new NotImplementedException();}
\r
153 public long MaximumQueueSize {
\r
155 get {throw new NotImplementedException();}
\r
157 set {throw new NotImplementedException();}
\r
159 public MessagePropertyFilter MessageReadPropertyFilter {
\r
161 get {throw new NotImplementedException();}
\r
163 set {throw new NotImplementedException();}
\r
165 public string Path {
\r
166 get { return machineName + ":" + queueName; }
\r
167 [MonoTODO("split input")]
\r
168 set {throw new NotImplementedException();}
\r
170 public string QueueName {
\r
171 get { return queueName; }
\r
172 set { queueName = value; }
\r
174 public IntPtr ReadHandle {
\r
176 get {throw new NotImplementedException();}
\r
178 public ISynchronizeInvoke SynchronizingObject {
\r
180 get {throw new NotImplementedException();}
\r
182 set {throw new NotImplementedException();}
\r
184 public bool Transactional {
\r
186 get {throw new NotImplementedException();}
\r
188 public bool UseJournalQueue {
\r
190 get {throw new NotImplementedException();}
\r
192 set {throw new NotImplementedException();}
\r
195 #endregion //Properties
\r
199 public IntPtr WriteHandle {
\r
201 get {throw new NotImplementedException();}
\r
204 public IAsyncResult BeginPeek()
\r
206 throw new NotImplementedException();
\r
209 public IAsyncResult BeginPeek(TimeSpan timeout)
\r
211 throw new NotImplementedException();
\r
214 public IAsyncResult BeginPeek(TimeSpan timeout, object stateObject)
\r
216 throw new NotImplementedException();
\r
219 public IAsyncResult BeginPeek(TimeSpan timeout,
\r
220 object stateObject,
\r
221 AsyncCallback callback)
\r
223 throw new NotImplementedException();
\r
226 public IAsyncResult BeginReceive()
\r
228 throw new NotImplementedException();
\r
231 public IAsyncResult BeginReceive(TimeSpan timeout)
\r
233 throw new NotImplementedException();
\r
236 public IAsyncResult BeginReceive(TimeSpan timeout, object stateObject)
\r
238 throw new NotImplementedException();
\r
241 public IAsyncResult BeginReceive(TimeSpan timeout, object stateObject, AsyncCallback callback)
\r
243 throw new NotImplementedException();
\r
246 public static void ClearConnectionCache()
\r
248 throw new NotImplementedException();
\r
251 public void Close()
\r
253 throw new NotImplementedException();
\r
256 public static MessageQueue Create(string path)
\r
258 throw new NotImplementedException();
\r
261 public static MessageQueue Create(string path, bool transactional)
\r
263 throw new NotImplementedException();
\r
266 public static void Delete(string path)
\r
268 throw new NotImplementedException();
\r
271 public Message EndPeek(IAsyncResult asyncResult)
\r
273 throw new NotImplementedException();
\r
276 public Message EndReceive(IAsyncResult asyncResult)
\r
278 throw new NotImplementedException();
\r
281 public static bool Exists(string path)
\r
283 throw new NotImplementedException();
\r
286 public Message[] GetAllMessages()
\r
288 throw new NotImplementedException();
\r
291 public IEnumerator GetEnumerator()
\r
293 throw new NotImplementedException();
\r
296 public static Guid GetMachiIdneId(string machineName)
\r
298 throw new NotImplementedException();
\r
301 public MessageEnumerator GetMessageEnumerator()
\r
303 throw new NotImplementedException();
\r
306 private static ArrayList currentQueueList;
\r
308 static MessageQueue()
\r
310 currentQueueList = new ArrayList();
\r
311 // for testing purposes
\r
312 currentQueueList.Add(new MessageQueue(@"localhost:\public\TestQueue"));
\r
313 currentQueueList.Add(new MessageQueue(@"\private\AnotherTestQueue", "localhost", true));
\r
316 public static MessageQueueEnumerator GetMessageQueueEnumerator()
\r
318 return new MessageQueueEnumerator(currentQueueList);
\r
321 private static ArrayList filteredQueueList(MessageQueueCriteria criteria)
\r
323 ArrayList list = new ArrayList();
\r
324 foreach(MessageQueue queue in currentQueueList)
\r
325 if (criteria.Match(queue.Id, queue.CreateTime, queue.Label, queue.MachineName, queue.LastModifyTime))
\r
330 public static MessageQueueEnumerator GetMessageQueueEnumerator(MessageQueueCriteria criteria)
\r
332 return new MessageQueueEnumerator(filteredQueueList(criteria));
\r
335 public static MessageQueue[] GetPrivateQueuesByMachine(string machineName)
\r
337 if (machineName == null || machineName.Length == 0)
\r
338 throw new ArgumentException();
\r
339 ArrayList list = new ArrayList();
\r
340 foreach(MessageQueue queue in currentQueueList)
\r
341 if (queue.machineName == machineName && queue.isPrivate)
\r
343 return (MessageQueue[])list.ToArray(typeof(MessageQueue));
\r
347 public static MessageQueue[] GetPublicQueues()
\r
349 throw new NotImplementedException();
\r
352 public static MessageQueue[] GetPublicQueues(MessageQueueCriteria criteria)
\r
354 throw new NotImplementedException();
\r
357 public static MessageQueue[] GetPublicQueuesByCategory(Guid category)
\r
359 throw new NotImplementedException();
\r
362 public static MessageQueue[] GetPublicQueuesByLabel(string label)
\r
364 throw new NotImplementedException();
\r
367 public static MessageQueue[] GetPublicQueuesByMachine(string machineName)
\r
369 throw new NotImplementedException();
\r
372 public Message Peek()
\r
374 throw new NotImplementedException();
\r
377 public Message Peek(TimeSpan timeout)
\r
379 throw new NotImplementedException();
\r
382 public Message PeekByCorrelationId(string correlationId)
\r
384 throw new NotImplementedException();
\r
387 public Message PeekByCorrelationId(string correlationId, TimeSpan timeout)
\r
389 throw new NotImplementedException();
\r
392 public Message PeekById(string id)
\r
394 throw new NotImplementedException();
\r
397 public Message PeekById(string id, TimeSpan timeout)
\r
399 throw new NotImplementedException();
\r
402 public void Purge()
\r
404 throw new NotImplementedException();
\r
407 public Message Receive()
\r
409 throw new NotImplementedException();
\r
412 public Message Receive(MessageQueueTransaction transaction)
\r
414 throw new NotImplementedException();
\r
417 public Message Receive(MessageQueueTransactionType transactionType)
\r
419 throw new NotImplementedException();
\r
422 public Message Receive(TimeSpan timeout)
\r
424 throw new NotImplementedException();
\r
427 public Message Receive(TimeSpan timeout, MessageQueueTransaction transaction)
\r
429 throw new NotImplementedException();
\r
432 public Message Receive(TimeSpan timeout, MessageQueueTransactionType transactionType)
\r
434 throw new NotImplementedException();
\r
437 public Message ReceiveByCorrelationId(string correlationId)
\r
439 throw new NotImplementedException();
\r
442 public Message ReceiveByCorrelationId(string correlationId, MessageQueueTransaction transaction)
\r
444 throw new NotImplementedException();
\r
447 public Message ReceiveByCorrelationId(string correlationId, MessageQueueTransactionType transactionType)
\r
449 throw new NotImplementedException();
\r
452 public Message ReceiveByCorrelationId(string correlationId, TimeSpan timeout)
\r
454 throw new NotImplementedException();
\r
457 public Message ReceiveByCorrelationId(string correlationId, TimeSpan timeout, MessageQueueTransaction transaction)
\r
459 throw new NotImplementedException();
\r
462 public Message ReceiveByCorrelationId(string correlationId, TimeSpan timeout, MessageQueueTransactionType transactionType)
\r
464 throw new NotImplementedException();
\r
467 public Message ReceiveById(string id)
\r
469 throw new NotImplementedException();
\r
472 public Message ReceiveById(string id,MessageQueueTransaction transaction)
\r
474 throw new NotImplementedException();
\r
477 public Message ReceiveById(string id,MessageQueueTransactionType transactionType)
\r
479 throw new NotImplementedException();
\r
482 public Message ReceiveById(string id,TimeSpan timeout)
\r
484 throw new NotImplementedException();
\r
487 public void Refresh()
\r
489 throw new NotImplementedException();
\r
492 public void ResetPermissions()
\r
494 throw new NotImplementedException();
\r
497 #endregion //Methods
\r
499 //TODO: Use these events.
\r
501 public event PeekCompletedEventHandler PeekCompleted;
\r
503 public event ReceiveCompletedEventHandler ReceiveCompleted;
\r
506 protected override void Dispose(bool disposing)
\r