当前位置: 首页>>代码示例>>Java>>正文


Java LDAPEntry.getAttributeSet方法代码示例

本文整理汇总了Java中com.novell.ldap.LDAPEntry.getAttributeSet方法的典型用法代码示例。如果您正苦于以下问题:Java LDAPEntry.getAttributeSet方法的具体用法?Java LDAPEntry.getAttributeSet怎么用?Java LDAPEntry.getAttributeSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.novell.ldap.LDAPEntry的用法示例。


在下文中一共展示了LDAPEntry.getAttributeSet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mapEntry

import com.novell.ldap.LDAPEntry; //导入方法依赖的package包/类
public LDAPEntry mapEntry(LDAPEntry origEntry,boolean outbound) {
	NamingUtils util = new NamingUtils();
	
	LDAPAttributeSet nattribs = new LDAPAttributeSet();
	
	LDAPAttributeSet origAttribs = origEntry.getAttributeSet();
	Iterator it = origAttribs.iterator();
	while (it.hasNext()) {
		LDAPAttribute origAttrib = (LDAPAttribute) it.next();
		LDAPAttribute nattrib = mapAttribute(outbound, util, origAttrib);
		
		nattribs.add(nattrib);
	}
	
	return new LDAPEntry(origEntry.getDN(),nattribs);
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:17,代码来源:DNAttributeMapper.java

示例2: toLDIF

import com.novell.ldap.LDAPEntry; //导入方法依赖的package包/类
public static String toLDIF(LDAPEntry entry) {
	StringBuffer buf = new StringBuffer();
	
	buf.append("dn: ").append(entry.getDN()).append('\n');
	
	LDAPAttributeSet attrs = entry.getAttributeSet();
	Iterator<LDAPAttribute> it = attrs.iterator();
	
	while (it.hasNext()) {
		LDAPAttribute attr = it.next();
		
		Enumeration enumer = attr.getStringValues();
		while (enumer.hasMoreElements()) {
			buf.append(attr.getName()).append(": ").append(enumer.nextElement()).append('\n');
		}
	}
	
	return buf.toString();
	
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:21,代码来源:Util.java

示例3: compareEntry

import com.novell.ldap.LDAPEntry; //导入方法依赖的package包/类
public static boolean compareEntry(LDAPEntry entry1,LDAPEntry entry2)  {
	if (! entry1.getDN().equalsIgnoreCase(entry2.getDN())) {
		return false;
	}
	
	LDAPAttributeSet attribs1 = entry1.getAttributeSet();
	LDAPAttributeSet attribs2 = entry2.getAttributeSet();
	
	Iterator<?> it = attribs1.iterator();
	int size = attribs2.size();
	while (it.hasNext()) {
		LDAPAttribute attrib1 = (LDAPAttribute) it.next();
		LDAPAttribute attrib2 = attribs2.getAttribute(attrib1.getName());
		
		if (attrib2 == null ) {
			System.err.println("not found: " + attrib1.getName() + "\n" + "In Compare: Entries don't match : \nFrom Server\n" + toLDIF(entry1) + "\n\nFrom LDIF\n" + toLDIF(entry2));
			return false;
			
		}
		
		size--;
		
		String[] vals1 = attrib1.getStringValueArray();
		String[] vals2 = attrib2.getStringValueArray();
		
		if (vals2.length != vals1.length) {
			System.err.println(attrib1.getName() + "\n" + "In Compare: Entries don't match : \nFrom Server\n" + toLDIF(entry1) + "\n\nFrom LDIF\n" + toLDIF(entry2));
			return false;
		}
		
		for (int i=0,m=vals1.length;i<m;i++) {
			boolean found = false;
			for (int j=0,n=vals2.length;j<n;j++) {
				if (vals1[i].equalsIgnoreCase(vals2[j])) {
					found = true;
				}
			}
			
			if (! found) {
				System.err.println(attrib1.getName() + "/" + vals1[i] + "\n" + "In Compare: Entries don't match : \nFrom Server\n" + toLDIF(entry1) + "\n\nFrom LDIF\n" + toLDIF(entry2));
				return false;
			}
		}
	}
	
	if (size != 0) {
		return false;
	}
	
	return true;
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:52,代码来源:Util.java

示例4: get

import com.novell.ldap.LDAPEntry; //导入方法依赖的package包/类
@Override
public Entry get() throws CursorException {
	
	try {
		LDAPEntry nentry = null;
		
		if (buffer != null) {
			nentry = buffer.getEntry();
			buffer = null;
		} else {
			nentry = res.next().getEntry();
		}
		
		Entry entry = new DefaultEntry();
		
		entry.setDn(nentry.getDN());
		LDAPAttributeSet attrs = nentry.getAttributeSet();
		for (Object o : attrs) {
			LDAPAttribute a = (LDAPAttribute) o;
			String oid = "";
			
			AttributeType at;
			
			
			
			
			
			byte[][] vals = a.getByteValueArray();
			DefaultAttribute attr = new DefaultAttribute(a.getName());
			attr.add(vals);
			entry.add(attr);
			
		}
		
		return entry;
	} catch (Exception e) {
		throw new CursorException(e);
	} 
	
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:41,代码来源:MyVDCursor.java


注:本文中的com.novell.ldap.LDAPEntry.getAttributeSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。