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


Java LDAPAttribute.getByteValue方法代码示例

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

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

示例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);
		}
		
	}

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

示例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);
		
		
	}

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


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