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


Java LDAPAttribute.getName方法代码示例

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


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

示例1: search

import com.novell.ldap.LDAPAttribute; //导入方法依赖的package包/类
@Override
public void search(SearchInterceptorChain chain, DistinguishedName base,
		Int scope, Filter filter, ArrayList<Attribute> attributes,
		Bool typesOnly, Results results, LDAPSearchConstraints constraints)
		throws LDAPException {
	
	LDAPAttributeSet attribs = new LDAPAttributeSet();
	LDAPAttributeSet ldifAttribs = this.schemaEntry.getAttributeSet();
	
	boolean allAttribs = attributes.size() == 0 || attributes.contains(ALL_ATTRIBS);
	
	Iterator<LDAPAttribute> it = ldifAttribs.iterator();
	while (it.hasNext()) {
		LDAPAttribute ldifAttrib = it.next();
		Attribute attribName = new Attribute(ldifAttrib.getName());
		if (allAttribs || attributes.contains(attribName)) {
			LDAPAttribute newAttrib = new LDAPAttribute(ldifAttrib.getName());
			Enumeration enumer = ldifAttrib.getByteValues();
			while (enumer.hasMoreElements()) {
				byte[] val = (byte[]) enumer.nextElement();
				newAttrib.addValue(val);
			}
			
			attribs.add(newAttrib);
		}
	}
	
	LDAPEntry toret = new LDAPEntry(this.schemaEntry.getDN(),attribs);
	ArrayList<Entry> list = new ArrayList<Entry>();
	list.add(new Entry(toret));
	
	chain.addResult(results,new IteratorEntrySet(list.iterator()),base,scope,filter,attributes,typesOnly,constraints);

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:35,代码来源:SchemaInsert.java

示例2: get

import com.novell.ldap.LDAPAttribute; //导入方法依赖的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.LDAPAttribute.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。