com.novell.ldap.LDAPConnection.getHost()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中com.novell.ldap.LDAPConnection.getHost()方法的一些代码示例,展示了LDAPConnection.getHost()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LDAPConnection.getHost()方法的具体详情如下:
包路径:com.novell.ldap.LDAPConnection
类名称:LDAPConnection
方法名:getHost

LDAPConnection.getHost介绍

[英]Returns the host name of the LDAP server to which the object is or was last connected, in the format originally specified.
[中]以最初指定的格式返回对象当前或上次连接到的LDAP服务器的主机名。

代码示例

代码示例来源:origin: com.novell.ldap/jldap

/**
 * Returns the host name of the LDAP server to which the object is or
 * was last connected, in the format originally specified.
 *
 * @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#getHost()">
    com.novell.ldap.LDAPConnection.getHost()</a>
 */
public String getHost()
{
  return conn.getHost();
}

代码示例来源:origin: sakaiproject/sakai

/**
 * {@inheritDoc}
 */
public LDAPConnection getConnection() throws LDAPException {
  
  if ( log.isDebugEnabled() ) {
    log.debug("getConnection()");
  }
  LDAPConnection conn = newConnection();
  if ( config.isAutoBind() ) {
    if ( log.isDebugEnabled() ) {
      log.debug("getConnection(): auto-binding");
    }
    try {
      bind(conn, config.getLdapUser(), config.getLdapPassword());
    } catch (LDAPException ldape) {
      if (ldape.getResultCode() == LDAPException.INVALID_CREDENTIALS) {
        log.warn("Failed to bind against: "+ conn.getHost()+ " with user: "+ config.getLdapUser()+ " password: "+ config.getLdapPassword().replaceAll(".", "*"));
      }
      throw ldape;
    }
  }
  return conn;
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-ldap-authenticator

String cacheKey = getUidAttributeName() + "." + this.connection.getConnection().getHost() + ":"
  + this.connection.getConnection().getPort();

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
 * Get the cache with the provided name for a particular LDAP server.
 * 
 * @param configuration the configuration to use to create the cache and to find it if it's already created.
 * @param context the XWiki context.
 * @return the cache.
 * @throws CacheException error when creating the cache.
 */
public Cache<Map<String, String>> getCache(CacheConfiguration configuration, XWikiContext context)
  throws CacheException
{
  Cache<Map<String, String>> cache;
  String cacheKey = getUidAttributeName() + "." + this.connection.getConnection().getHost() + ":"
    + this.connection.getConnection().getPort();
  Map<String, Cache<Map<String, String>>> cacheMap;
  if (cachePool.containsKey(cacheKey)) {
    cacheMap = cachePool.get(cacheKey);
  } else {
    cacheMap = new HashMap<String, Cache<Map<String, String>>>();
    cachePool.put(cacheKey, cacheMap);
  }
  cache = cacheMap.get(configuration.getConfigurationId());
  if (cache == null) {
    cache = Utils.getComponent(CacheManager.class).createNewCache(configuration);
    cacheMap.put(configuration.getConfigurationId(), cache);
  }
  return cache;
}

代码示例来源:origin: com.novell.ldap/jldap

"getReferralConnection: " +
        "Compare host port " +
        url.getHost() + "-" + rconn.getHost() +
        " & " +
        url.getPort() + "-" + rconn.getPort());
if( url.getHost().equalsIgnoreCase(rconn.getHost()) &&
    (url.getPort() == rconn.getPort())) {
  refInfo = new ReferralInfo(rconn, referrals, url);

代码示例来源:origin: com.novell.ldap/jldap

authzId,
"ldap",
this.getHost(),
props,
(CallbackHandler)cbh);

相关文章