Couple more 'bockbuild split' mixups
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Security.Tokens / CommunicationSecurityTokenAuthenticator.cs
1 //
2 // CommunicationSecurityTokenAuthenticator.cs
3 //
4 // Author:
5 //      Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // Copyright (C) 2007 Novell, Inc.  http://www.novell.com
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
16 // 
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 // 
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28
29 using System.Collections.ObjectModel;
30 using System.IdentityModel.Policy;
31 using System.IdentityModel.Selectors;
32 using System.IdentityModel.Tokens;
33
34 namespace System.ServiceModel.Security.Tokens
35 {
36         abstract class CommunicationSecurityTokenAuthenticator
37                 : SecurityTokenAuthenticator, ICommunicationObject,
38                   IIssuanceSecurityTokenAuthenticator
39         {
40                 protected CommunicationSecurityTokenAuthenticator ()
41                 {
42                 }
43
44                 IssuedSecurityTokenHandler issuance_handler;
45                 RenewedSecurityTokenHandler renew_handler;
46
47                 public IssuedSecurityTokenHandler IssuedSecurityTokenHandler { 
48                         get { return issuance_handler; }
49                         set { issuance_handler = value; }
50                 }
51
52                 public RenewedSecurityTokenHandler RenewedSecurityTokenHandler { 
53                         get { return renew_handler; }
54                         set { renew_handler = value; }
55                 }
56
57                 public abstract AuthenticatorCommunicationObject Communication { get; }
58
59                 [MonoTODO]
60                 protected override bool CanValidateTokenCore (SecurityToken token)
61                 {
62                         throw new NotImplementedException ();
63                 }
64
65                 [MonoTODO]
66                 protected override ReadOnlyCollection<IAuthorizationPolicy> ValidateTokenCore (SecurityToken token)
67                 {
68                         throw new NotImplementedException ();
69                 }
70
71                 public CommunicationState State {
72                         get { return Communication.State; }
73                 }
74
75                 public void Abort ()
76                 {
77                         Communication.Abort ();
78                 }
79
80                 public void Open ()
81                 {
82                         Communication.Open ();
83                 }
84
85                 public void Open (TimeSpan timeout)
86                 {
87                         Communication.Open (timeout);
88                 }
89
90                 public IAsyncResult BeginOpen (AsyncCallback callback, object state)
91                 {
92                         return Communication.BeginOpen (callback, state);
93                 }
94
95                 public IAsyncResult BeginOpen (TimeSpan timeout, AsyncCallback callback, object state)
96                 {
97                         return Communication.BeginOpen (timeout, callback, state);
98                 }
99
100                 public void EndOpen (IAsyncResult result)
101                 {
102                         Communication.EndOpen (result);
103                 }
104
105                 public void Close ()
106                 {
107                         Communication.Close ();
108                 }
109
110                 public void Close (TimeSpan timeout)
111                 {
112                         Communication.Close (timeout);
113                 }
114
115                 public IAsyncResult BeginClose (AsyncCallback callback, object state)
116                 {
117                         return Communication.BeginClose (callback, state);
118                 }
119
120                 public IAsyncResult BeginClose (TimeSpan timeout, AsyncCallback callback, object state)
121                 {
122                         return Communication.BeginClose (timeout, callback, state);
123                 }
124
125                 public void EndClose (IAsyncResult result)
126                 {
127                         Communication.EndClose (result);
128                 }
129
130                 public event EventHandler Opening {
131                         add { Communication.Opening += value; }
132                         remove { Communication.Opening -= value; }
133                 }
134
135                 public event EventHandler Opened {
136                         add { Communication.Opened += value; }
137                         remove { Communication.Opened -= value; }
138                 }
139
140                 public event EventHandler Closing {
141                         add { Communication.Closing += value; }
142                         remove { Communication.Closing -= value; }
143                 }
144
145                 public event EventHandler Closed {
146                         add { Communication.Closed += value; }
147                         remove { Communication.Closed -= value; }
148                 }
149
150                 public event EventHandler Faulted {
151                         add { Communication.Faulted += value; }
152                         remove { Communication.Faulted -= value; }
153                 }
154         }
155 }