2008-12-21 Michael Barker <mike@middlesoft.co.uk>
[mono.git] / mcs / class / Mono.Messaging / Mono.Messaging / IMessageQueue.cs
1 //
2 // Mono.Messaging
3 //
4 // Authors:
5 //              Michael Barker (mike@middlesoft.co.uk)
6 //
7 // (C) 2008 Michael Barker
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System;
32 using System.ComponentModel;
33
34 namespace Mono.Messaging {
35
36         public interface IMessageQueue {
37                 
38                 bool Authenticate {
39                         get; set;
40                 }
41
42                 short BasePriority {
43                         get; set;
44                 }
45
46                 bool CanRead {
47                         get;
48                 }
49
50                 bool CanWrite {
51                         get;
52                 }
53
54                 Guid Category {
55                         get; set;
56                 }
57
58                 DateTime CreateTime {
59                         get;
60                 }
61
62                 bool DenySharedReceive {
63                         get; set;
64                 }
65
66                 EncryptionRequired EncryptionRequired {
67                         get; set;
68                 }
69
70                 Guid Id {
71                         get;
72                 }
73
74                 DateTime LastModifyTime {
75                         get;
76                 }
77
78                 long MaximumJournalSize {
79                         get; set;
80                 }
81
82                 long MaximumQueueSize {
83                         get; set;
84                 }
85
86                 IntPtr ReadHandle {
87                         get;
88                 }
89
90                 ISynchronizeInvoke SynchronizingObject {
91                         get; set;
92                 }
93
94                 bool Transactional {
95                         get;
96                 }
97
98                 bool UseJournalQueue {
99                         get; set;
100                 }
101
102                 IntPtr WriteHandle {
103                         get;
104                 }
105                 
106                 QueueReference QRef {
107                         get; set;
108                 }
109                 
110                 void Close ();
111                 
112                 void Purge ();
113                 
114                 void Send (IMessage message);
115                 
116                 void Send (IMessage message, IMessageQueueTransaction transaction);
117                 
118                 void Send (IMessage message, MessageQueueTransactionType transactionType);
119                 
120                 IMessage Peek ();
121                 
122                 IMessage Peek (TimeSpan timeout);
123                 
124                 IMessage PeekById (string id);
125                 
126                 IMessage PeekById (string id, TimeSpan timeout);
127                 
128                 IMessage PeekByCorrelationId (string correlationId);
129                 
130                 IMessage PeekByCorrelationId (string correlationId, TimeSpan timeout);
131                 
132                 IMessage Receive ();
133                 
134                 IMessage Receive (TimeSpan timeout);
135                 
136                 IMessage Receive (IMessageQueueTransaction transaction);
137                 
138                 IMessage Receive (TimeSpan timeout, IMessageQueueTransaction transaction);
139                 
140                 IMessage Receive (MessageQueueTransactionType transactionType);
141                 
142                 IMessage Receive (TimeSpan timeout, MessageQueueTransactionType transactionType);
143                 
144                 IMessage ReceiveById (string id);
145                 
146                 IMessage ReceiveById (string id, TimeSpan timeout);
147                 
148                 IMessage ReceiveById (string id, IMessageQueueTransaction transaction);
149                 
150                 IMessage ReceiveById (string id, MessageQueueTransactionType transactionType);
151                 
152                 IMessage ReceiveById (string id, TimeSpan timeout, IMessageQueueTransaction transaction);
153                 
154                 IMessage ReceiveById (string id, TimeSpan timeout, MessageQueueTransactionType transactionType);
155                         
156                 IMessage ReceiveByCorrelationId (string correlationId);
157                 
158                 IMessage ReceiveByCorrelationId (string correlationId, TimeSpan timeout);
159                 
160                 IMessage ReceiveByCorrelationId (string correlationId, IMessageQueueTransaction transaction);
161
162                 IMessage ReceiveByCorrelationId (string correlationId, MessageQueueTransactionType transactionType);
163                 
164                 IMessage ReceiveByCorrelationId (string correlationId, TimeSpan timeout, IMessageQueueTransaction transaction);
165                         
166                 IMessage ReceiveByCorrelationId (string correlationId, TimeSpan timeout, MessageQueueTransactionType transactionType);
167                 
168                 IAsyncResult BeginPeek ();
169
170                 IAsyncResult BeginPeek (TimeSpan timeout);
171
172                 IAsyncResult BeginPeek (TimeSpan timeout, object stateObject);
173
174                 IAsyncResult BeginPeek (TimeSpan timeout, object stateObject, AsyncCallback callback);
175                 
176                 IMessage EndPeek (IAsyncResult asyncResult);
177                 
178                 IAsyncResult BeginReceive ();
179
180                 IAsyncResult BeginReceive (TimeSpan timeout);
181
182                 IAsyncResult BeginReceive (TimeSpan timeout, object stateObject);
183
184                 IAsyncResult BeginReceive (TimeSpan timeout, object stateObject, AsyncCallback callback);
185                 
186                 IMessage EndReceive (IAsyncResult asyncResult);
187                 
188                 IMessageEnumerator GetMessageEnumerator ();
189
190                 event CompletedEventHandler PeekCompleted;
191                 
192                 event CompletedEventHandler ReceiveCompleted;
193                 
194                 void SendReceiveCompleted (IAsyncResult result);
195                 
196                 void SendPeekCompleted (IAsyncResult result);
197         }
198
199 }