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


Java LdapURL类代码示例

本文整理汇总了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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:ldapURLContextFactory.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:ldapURLContext.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:ldapURLContext.java


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