Exemple #1
0
		/// <summary> Build the attribuite list from an LdapEntry.
		/// 
		/// </summary>
		/// <param name="entry">The LdapEntry associated with this add request.
		/// </param>
		private static RfcAttributeList makeRfcAttrList(LdapEntry entry)
		{
			// convert Java-API LdapEntry to RFC2251 AttributeList
			LdapAttributeSet attrSet = entry.getAttributeSet();
			RfcAttributeList attrList = new RfcAttributeList(attrSet.Count);
			System.Collections.IEnumerator itr = attrSet.GetEnumerator();
			while (itr.MoveNext())
			{
				LdapAttribute attr = (LdapAttribute) itr.Current;
				Asn1SetOf vals = new Asn1SetOf(attr.size());
				System.Collections.IEnumerator attrEnum = attr.ByteValues;
				while (attrEnum.MoveNext())
				{
					vals.add(new RfcAttributeValue((sbyte[]) attrEnum.Current));
				}
				attrList.add(new RfcAttributeTypeAndValues(new RfcAttributeDescription(attr.Name), vals));
			}
			return attrList;
		}