2009-08-14 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Channels / MsmqBindingElementBase.cs
1 //
2 // MsmqBindingElementBase.cs
3 //
4 // Author: Atsushi Enomoto  <atsushi@ximian.com>
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
28 using System;
29 using System.ServiceModel;
30 using System.ServiceModel.Description;
31
32 namespace System.ServiceModel.Channels
33 {
34         public abstract class MsmqBindingElementBase : TransportBindingElement,
35                 ITransactedBindingElement, IPolicyExportExtension, IWsdlExportExtension
36         {
37                 Uri custom_dead_letter_queue;
38                 DeadLetterQueue dead_letter_queue = DeadLetterQueue.System;
39                 bool durable = true, exactly_once = true, tx_enabled, use_msmq_trace, use_source_journal;
40                 int max_retry_cycles = 2, receive_retry_count = 5;
41                 ReceiveErrorHandling receive_error_handling;
42                 TimeSpan retry_cycle_delay = TimeSpan.FromMinutes (30), ttl = TimeSpan.FromDays (1);
43                 MsmqTransportSecurity transport_security =
44                         new MsmqTransportSecurity ();
45
46                 internal MsmqBindingElementBase ()
47                 {
48                 }
49
50                 public Uri CustomDeadLetterQueue {
51                         get { return custom_dead_letter_queue; }
52                         set { custom_dead_letter_queue = value; }
53                 }
54
55                 public DeadLetterQueue DeadLetterQueue {
56                         get { return dead_letter_queue; }
57                         set { dead_letter_queue = value; }
58                 }
59
60                 public bool Durable {
61                         get { return durable; }
62                         set { durable = value; }
63                 }
64
65                 public bool ExactlyOnce {
66                         get { return exactly_once; }
67                         set { exactly_once = value; }
68                 }
69
70                 public int MaxRetryCycles {
71                         get { return max_retry_cycles; }
72                         set { max_retry_cycles = value; }
73                 }
74
75                 public MsmqTransportSecurity MsmqTransportSecurity {
76                         get { return transport_security; }
77                 }
78
79                 public ReceiveErrorHandling ReceiveErrorHandling {
80                         get { return receive_error_handling; }
81                         set { receive_error_handling = value; }
82                 }
83
84                 public int ReceiveRetryCount {
85                         get { return receive_retry_count; }
86                         set { receive_retry_count = value; }
87                 }
88
89                 public TimeSpan RetryCycleDelay {
90                         get { return retry_cycle_delay; }
91                         set { retry_cycle_delay = value; }
92                 }
93
94                 public TimeSpan TimeToLive {
95                         get { return ttl; }
96                         set { ttl = value; }
97                 }
98
99                 public bool TransactedReceiveEnabled {
100                         get { return tx_enabled; }
101                 }
102
103                 public bool UseMsmqTracing {
104                         get { return use_msmq_trace; }
105                         set { use_msmq_trace = value; }
106                 }
107
108                 public bool UseSourceJournal {
109                         get { return use_source_journal; }
110                         set { use_source_journal = value; }
111                 }
112
113                 public override T GetProperty<T> (BindingContext context)
114                 {
115                         if (typeof (T) is IBindingDeliveryCapabilities)
116                                 throw new NotImplementedException ();
117                         if (typeof (T) is ISecurityCapabilities)
118                                 throw new NotImplementedException ();
119                         return base.GetProperty<T> (context);
120                 }
121
122                 [MonoTODO]
123                 void IPolicyExportExtension.ExportPolicy (MetadataExporter exporter, PolicyConversionContext context)
124                 {
125                         throw new NotImplementedException ();
126                 }
127
128                 [MonoTODO]
129                 void IWsdlExportExtension.ExportContract (WsdlExporter exporter, WsdlContractConversionContext context)
130                 {
131                         throw new NotImplementedException ();
132                 }
133
134                 [MonoTODO]
135                 void IWsdlExportExtension.ExportEndpoint (WsdlExporter exporter, WsdlEndpointConversionContext endpointContext)
136                 {
137                         throw new NotImplementedException ();
138                 }
139         }
140 }