1 /******************************************************************************
3 * Copyright (c) 2003 Novell Inc. www.novell.com
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:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
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
22 *******************************************************************************/
24 // Novell.Directory.Ldap.Events.Edir.EventData.SecurityEquivalenceEventData.cs
27 // Anil Bhatia (banil@novell.com)
29 // (C) 2003 Novell, Inc (http://www.novell.com)
32 using System.Collections;
35 using Novell.Directory.Ldap.Asn1;
37 namespace Novell.Directory.Ldap.Events.Edir.EventData
40 /// This class represents the data for Security Equivalence Events.
42 public class SecurityEquivalenceEventData : BaseEdirEventData
44 protected string strEntryDN;
53 protected int retry_count;
62 protected string strValueDN;
71 protected int referral_count;
72 public int ReferralCount
76 return referral_count;
80 protected ArrayList referral_list;
81 public ArrayList ReferralList
89 public SecurityEquivalenceEventData(EdirEventDataType eventDataType, Asn1Object message)
90 : base(eventDataType, message)
92 int[] length = new int[1];
94 strEntryDN = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
95 retry_count = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
96 strValueDN = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
98 Asn1Sequence referalseq = ((Asn1Sequence) decoder.decode(decodedData, length));
100 referral_count = ((Asn1Integer) referalseq.get_Renamed(0)).intValue();
101 referral_list = new ArrayList();
102 if (referral_count > 0)
104 Asn1Sequence referalseqof = ((Asn1Sequence) referalseq.get_Renamed(1));
106 for (int i = 0; i < referral_count; i++)
108 referral_list.Add( new ReferralAddress( (Asn1Sequence) referalseqof.get_Renamed(i) ) );
116 /// Returns a string representation of the object.
118 public override string ToString()
120 StringBuilder buf = new StringBuilder();
121 buf.Append("[SecurityEquivalenceEventData");
122 buf.AppendFormat("(EntryDN={0})", strEntryDN);
123 buf.AppendFormat("(RetryCount={0})", retry_count);
124 buf.AppendFormat("(valueDN={0})", strValueDN);
125 buf.AppendFormat("(referralCount={0})", referral_count);
126 buf.AppendFormat("(Referral Lists={0})", referral_list);
129 return buf.ToString();