本文整理汇总了Java中com.sun.jndi.ldap.LdapURL类的典型用法代码示例。如果您正苦于以下问题:Java LdapURL类的具体用法?Java LdapURL怎么用?Java LdapURL使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LdapURL类属于com.sun.jndi.ldap包,在下文中一共展示了LdapURL类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUsingURLIgnoreRootDN
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
static ResolveResult getUsingURLIgnoreRootDN(String url, Hashtable<?,?> env)
throws NamingException {
LdapURL ldapUrl = new LdapURL(url);
DirContext ctx = new LdapCtx("", ldapUrl.getHost(), ldapUrl.getPort(),
env, ldapUrl.useSsl());
String dn = (ldapUrl.getDN() != null ? ldapUrl.getDN() : "");
// Represent DN as empty or single-component composite name.
CompositeName remaining = new CompositeName();
if (!"".equals(dn)) {
// if nonempty, add component
remaining.add(dn);
}
return new ResolveResult(ctx, remaining);
}
示例2: getURLSuffix
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
/**
* Return the suffix of an ldap url.
* prefix parameter is ignored.
*/
protected Name getURLSuffix(String prefix, String url)
throws NamingException {
LdapURL ldapUrl = new LdapURL(url);
String dn = (ldapUrl.getDN() != null? ldapUrl.getDN() : "");
// Represent DN as empty or single-component composite name.
CompositeName remaining = new CompositeName();
if (!"".equals(dn)) {
// if nonempty, add component
remaining.add(dn);
}
return remaining;
}
示例3: lookup
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public Object lookup(String name) throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
throw new InvalidNameException(name);
} else {
return super.lookup(name);
}
}
示例4: bind
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public void bind(String name, Object obj) throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
throw new InvalidNameException(name);
} else {
super.bind(name, obj);
}
}
示例5: createSubcontext
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public DirContext createSubcontext(Name name, Attributes attrs)
throws NamingException {
if (LdapURL.hasQueryComponents(name.get(0))) {
throw new InvalidNameException(name.toString());
} else {
return super.createSubcontext(name, attrs);
}
}
示例6: destroySubcontext
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public void destroySubcontext(String name) throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
throw new InvalidNameException(name);
} else {
super.destroySubcontext(name);
}
}
示例7: unbind
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public void unbind(String name) throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
throw new InvalidNameException(name);
} else {
super.unbind(name);
}
}
示例8: rename
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public void rename(String oldName, String newName) throws NamingException {
if (LdapURL.hasQueryComponents(oldName)) {
throw new InvalidNameException(oldName);
} else if (LdapURL.hasQueryComponents(newName)) {
throw new InvalidNameException(newName);
} else {
super.rename(oldName, newName);
}
}
示例9: list
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public NamingEnumeration<NameClassPair> list(String name)
throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
throw new InvalidNameException(name);
} else {
return super.list(name);
}
}
示例10: getSchemaClassDefinition
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public DirContext getSchemaClassDefinition(String name)
throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
throw new InvalidNameException(name);
} else {
return super.getSchemaClassDefinition(name);
}
}
示例11: listBindings
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public NamingEnumeration<Binding> listBindings(Name name)
throws NamingException {
if (LdapURL.hasQueryComponents(name.get(0))) {
throw new InvalidNameException(name.toString());
} else {
return super.listBindings(name);
}
}
示例12: lookup
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public Object lookup(Name name) throws NamingException {
if (LdapURL.hasQueryComponents(name.get(0))) {
throw new InvalidNameException(name.toString());
} else {
return super.lookup(name);
}
}
示例13: destroySubcontext
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public void destroySubcontext(Name name) throws NamingException {
if (LdapURL.hasQueryComponents(name.get(0))) {
throw new InvalidNameException(name.toString());
} else {
super.destroySubcontext(name);
}
}
示例14: getAttributes
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public Attributes getAttributes(Name name, String[] attrIds)
throws NamingException {
if (LdapURL.hasQueryComponents(name.get(0))) {
throw new InvalidNameException(name.toString());
} else {
return super.getAttributes(name, attrIds);
}
}
示例15: search
import com.sun.jndi.ldap.LdapURL; //导入依赖的package包/类
public NamingEnumeration<SearchResult> search(String name,
String filter,
SearchControls cons)
throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
return searchUsingURL(name);
} else {
return super.search(name, filter, cons);
}
}