Add licensing info
[mono.git] / mcs / class / Novell.Directory.Ldap / Novell.Directory.Ldap / LdapResponseQueue.cs
1
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining
4 // a copy of this software and associated documentation files (the
5 // "Software"), to deal in the Software without restriction, including
6 // without limitation the rights to use, copy, modify, merge, publish,
7 // distribute, sublicense, and/or sell copies of the Software, and to
8 // permit persons to whom the Software is furnished to do so, subject to
9 // the following conditions:
10 // 
11 // The above copyright notice and this permission notice shall be
12 // included in all copies or substantial portions of the Software.
13 // 
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 /******************************************************************************
23 * The MIT License
24 * Copyright (c) 2003 Novell Inc.  www.novell.com
25
26 * Permission is hereby granted, free of charge, to any person obtaining  a copy
27 * of this software and associated documentation files (the Software), to deal
28 * in the Software without restriction, including  without limitation the rights
29 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
30 * copies of the Software, and to  permit persons to whom the Software is 
31 * furnished to do so, subject to the following conditions:
32
33 * The above copyright notice and this permission notice shall be included in 
34 * all copies or substantial portions of the Software.
35
36 * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
37 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
38 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
39 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
40 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
41 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
42 * SOFTWARE.
43 *******************************************************************************/
44 //
45 // Novell.Directory.Ldap.LdapResponseQueue.cs
46 //
47 // Author:
48 //   Sunil Kumar (Sunilk@novell.com)
49 //
50 // (C) 2003 Novell, Inc (http://www.novell.com)
51 //
52
53 using System;
54
55 namespace Novell.Directory.Ldap
56 {
57         
58         /// <summary>  A mechanism for processing asynchronous messages received from a server.
59         /// It represents the message queue associated with a particular asynchronous
60         /// Ldap operation or operations.
61         /// </summary>
62         public class LdapResponseQueue:LdapMessageQueue
63         {
64                 /// <summary> Constructs a response queue using the specified message agent
65                 /// 
66                 /// </summary>
67                 /// <param name="agent">The message agent to associate with this queue
68                 /// </param>
69                 /* package */
70                 internal LdapResponseQueue(MessageAgent agent):base("LdapResponseQueue", agent)
71                 {
72                         return ;
73                 }
74                 
75                 /// <summary> Merges two message queues.  It appends the current and
76                 /// future contents from another queue to this one.
77                 /// 
78                 /// After the operation, queue2.getMessageIDs()
79                 /// returns an empty array, and its outstanding responses
80                 /// have been removed and appended to this queue.
81                 /// 
82                 /// </summary>
83                 /// <param name="queue2">   The queue that is merged from.  Following
84                 /// the merge, this queue object will no
85                 /// longer receive any data, and calls made
86                 /// to its methods will fail with a RuntimeException.
87                 /// The queue can be reactivated by using it in an 
88                 /// Ldap request, after which it will receive responses
89                 /// for that request..
90                 /// </param>
91                 public virtual void  merge(LdapMessageQueue queue2)
92                 {
93                         LdapResponseQueue q = (LdapResponseQueue) queue2;
94                         agent.merge(q.MessageAgent);
95                         
96                         return ;
97                 }
98         }
99 }