本文整理汇总了Java中com.novell.ldap.LDAPAttribute.getByteValue方法的典型用法代码示例。如果您正苦于以下问题:Java LDAPAttribute.getByteValue方法的具体用法?Java LDAPAttribute.getByteValue怎么用?Java LDAPAttribute.getByteValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.novell.ldap.LDAPAttribute
的用法示例。
在下文中一共展示了LDAPAttribute.getByteValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postSearchEntry
import com.novell.ldap.LDAPAttribute; //导入方法依赖的package包/类
@Override
public void postSearchEntry(PostSearchEntryInterceptorChain chain,
Entry entry, DistinguishedName base, Int scope, Filter filter,
ArrayList<Attribute> attributes, Bool typesOnly,
LDAPSearchConstraints constraints) throws LDAPException {
chain.nextPostSearchEntry(entry, base, scope, filter, attributes, typesOnly, constraints);
LDAPAttribute attr = entry.getEntry().getAttribute(this.attrName);
if (attr != null) {
String strUUID = this.bin2txt.get(entry.getEntry().getDN());
if (strUUID == null) {
byte[] uuid = attr.getByteValue();
//BigInteger bi = new BigInteger(uuid);
//strUUID = bi.toString(16);
strUUID = this.convertToDashedString(uuid);
this.bin2txt.put(entry.getEntry().getDN(), strUUID);
}
attr.removeValue(attr.getByteValue());
attr.addValue(strUUID);
}
}
示例2: postSearchEntry
import com.novell.ldap.LDAPAttribute; //导入方法依赖的package包/类
@Override
public void postSearchEntry(PostSearchEntryInterceptorChain chain,
Entry entry, DistinguishedName base, Int scope, Filter filter,
ArrayList<Attribute> attributes, Bool typesOnly,
LDAPSearchConstraints constraints) throws LDAPException {
chain.nextPostSearchEntry(entry, base, scope, filter, attributes, typesOnly, constraints);
if (! this.dns.contains(entry.getEntry().getDN())) {
LDAPAttribute attr = entry.getEntry().getAttribute("objectGUID");
if (attr != null) {
this.dns.add(entry.getEntry().getDN());
byte[] val = attr.getByteValue();
StringBuilder sb = new StringBuilder(val.length * 2);
for (int i=0; i< val.length; i++) {
sb.append(String.format("\\%02x", val[i]));
}
String goodFilter = sb.toString();
String badFilter = new String(val);
this.g2c.put(goodFilter, badFilter);
this.c2g.put(badFilter, goodFilter);
}
}
}
示例3: postSearchEntry
import com.novell.ldap.LDAPAttribute; //导入方法依赖的package包/类
public void postSearchEntry(PostSearchEntryInterceptorChain chain,
Entry entry, DistinguishedName base, Int scope, Filter filter,
ArrayList<Attribute> attributes, Bool typesOnly,
LDAPSearchConstraints constraints) throws LDAPException {
chain.nextPostSearchEntry(entry, base, scope, filter, attributes, typesOnly, constraints);
LDAPAttribute attrib = entry.getEntry().getAttribute("objectguid");
if (attrib != null) {
byte[] bytes = attrib.getByteValue();
StringBuffer byteStr = new StringBuffer();
for (int i = 0; i < bytes.length; i++) {
byteStr.append("\\").append(byteToHex(bytes[i]));
}
StringBuffer buf = new StringBuffer();
buf.append(byteToHex(bytes[3]));
buf.append(byteToHex(bytes[2]));
buf.append(byteToHex(bytes[1]));
buf.append(byteToHex(bytes[0]));
buf.append('-');
buf.append(byteToHex(bytes[5]));
buf.append(byteToHex(bytes[4]));
buf.append('-');
buf.append(byteToHex(bytes[7]));
buf.append(byteToHex(bytes[6]));
buf.append('-');
buf.append(byteToHex(bytes[8]));
buf.append(byteToHex(bytes[9]));
buf.append('-');
buf.append(byteToHex(bytes[10]));
buf.append(byteToHex(bytes[11]));
buf.append(byteToHex(bytes[12]));
buf.append(byteToHex(bytes[13]));
buf.append(byteToHex(bytes[14]));
buf.append(byteToHex(bytes[15]));
attrib.removeValue(bytes);
attrib.addValue(buf.toString());
this.binaryToString.put(buf.toString(), byteStr.toString());
}
attrib = entry.getEntry().getAttribute("objectsid");
if (attrib != null) {
byte[] sidBytes = attrib.getByteValue();
attrib.removeValue(sidBytes);
String strSid = this.getSIDasStringOfBytes(sidBytes);
attrib.addValue(strSid);
}
}