本文整理汇总了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);
}
示例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);
}
}