Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / class / Novell.Directory.Ldap / Novell.Directory.Ldap / LdapCompareRequest.cs
1 /******************************************************************************
2 * The MIT License
3 * Copyright (c) 2003 Novell Inc.  www.novell.com
4
5 * Permission is hereby granted, free of charge, to any person obtaining  a copy
6 * of this software and associated documentation files (the Software), to deal
7 * in the Software without restriction, including  without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
9 * copies of the Software, and to  permit persons to whom the Software is 
10 * furnished to do so, subject to the following conditions:
11
12 * The above copyright notice and this permission notice shall be included in 
13 * all copies or substantial portions of the Software.
14
15 * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 *******************************************************************************/
23 //
24 // Novell.Directory.Ldap.LdapCompareRequest.cs
25 //
26 // Author:
27 //   Sunil Kumar (Sunilk@novell.com)
28 //
29 // (C) 2003 Novell, Inc (http://www.novell.com)
30 //
31
32 using System;
33 using Novell.Directory.Ldap.Rfc2251;
34
35 namespace Novell.Directory.Ldap
36 {
37         
38         /// <summary> Represents an Ldap Compare Request.
39         /// 
40         /// </summary>
41         /// <seealso cref="LdapConnection.SendRequest">
42         /// </seealso>
43    /*
44         *       CompareRequest ::= [APPLICATION 14] SEQUENCE {
45         *               entry           LdapDN,
46         *               ava             AttributeValueAssertion }
47         */
48         public class LdapCompareRequest:LdapMessage
49         {
50                 /// <summary> Returns the LdapAttribute associated with this request.
51                 /// 
52                 /// </summary>
53                 /// <returns> the LdapAttribute
54                 /// </returns>
55                 virtual public System.String AttributeDescription
56                 {
57                         get
58                         {
59                                 RfcCompareRequest req = (RfcCompareRequest) Asn1Object.getRequest();
60                                 return req.AttributeValueAssertion.AttributeDescription;
61                         }
62                         
63                 }
64                 /// <summary> Returns the LdapAttribute associated with this request.
65                 /// 
66                 /// </summary>
67                 /// <returns> the LdapAttribute
68                 /// </returns>
69                 [CLSCompliantAttribute(false)]
70                 virtual public sbyte[] AssertionValue
71                 {
72                         get
73                         {
74                                 RfcCompareRequest req = (RfcCompareRequest) Asn1Object.getRequest();
75                                 return req.AttributeValueAssertion.AssertionValue;
76                         }
77                         
78                 }
79                 /// <summary> Returns of the dn of the entry to compare in the directory
80                 /// 
81                 /// </summary>
82                 /// <returns> the dn of the entry to compare
83                 /// </returns>
84                 virtual public System.String DN
85                 {
86                         get
87                         {
88                                 return Asn1Object.RequestDN;
89                         }
90                         
91                 }
92                 /// <summary> Constructs an LdapCompareRequest Object.
93                 /// 
94                 /// </summary>
95                 /// <param name="dn">     The distinguished name of the entry containing an
96                 /// attribute to compare.
97                 /// 
98                 /// </param>
99                 /// <param name="name">   The name of the attribute to compare.
100                 /// 
101                 /// </param>
102                 /// <param name="value">   The value of the attribute to compare.
103                 /// 
104                 /// 
105                 /// </param>
106                 /// <param name="cont">Any controls that apply to the compare request,
107                 /// or null if none.
108                 /// </param>
109                 [CLSCompliantAttribute(false)]
110                 public LdapCompareRequest(System.String dn, System.String name, sbyte[] value_Renamed, LdapControl[] cont):base(LdapMessage.COMPARE_REQUEST, new RfcCompareRequest(new RfcLdapDN(dn), new RfcAttributeValueAssertion(new RfcAttributeDescription(name), new RfcAssertionValue(value_Renamed))), cont)
111                 {
112                         return ;
113                 }
114         }
115 }