org.apache.directory.ldap.client.api.LdapConnection.bind()方法的使用及代码示例

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

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

LdapConnection.bind介绍

[英]Anonymous Bind on a server.
[中]服务器上的匿名绑定。

代码示例

代码示例来源:origin: HubSpot/Singularity

@Override
public com.google.common.base.Optional<Boolean> isHealthy() {
 try {
  final LdapConnection connection = connectionPool.getConnection();
  try {
   if (connection.isConnected() && connection.isAuthenticated()) {
    connection.bind();
    try {
     return com.google.common.base.Optional.of(true);
    } finally {
     connection.unBind();
    }
   }
  } finally {
   connectionPool.releaseConnection(connection);
  }
 } catch (LdapException e) {
  LOG.warn("LdapException caught when checking health", e);
  exceptionNotifier.notify(String.format("LdapException caught when checking health (%s)", e.getMessage()), e);
 }
 return com.google.common.base.Optional.of(false);
}

代码示例来源:origin: HubSpot/Singularity

checkState(connection.isConnected(), "not connected");
checkState(connection.isAuthenticated(), "not authenticated");
connection.bind();

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * {@inheritDoc}
 */
@Override
public void bind( Dn name ) throws LdapException
{
  connection.bind( name );
  bindCalled = true;
}

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * {@inheritDoc}
 */
@Override
public BindResponse bind( BindRequest bindRequest ) throws LdapException
{
  BindResponse response = connection.bind( bindRequest );
  bindCalled = true;
  return response;
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-api

/**
 * {@inheritDoc}
 */
@Override
public void bind() throws LdapException
{
  connection.bind();
  bindCalled = true;
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-api

/**
 * {@inheritDoc}
 */
@Override
public void bind( String name, String credentials ) throws LdapException
{
  connection.bind( name, credentials );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-api

/**
 * {@inheritDoc}
 */
@Override
public void bind( Dn name, String credentials ) throws LdapException
{
  connection.bind( name, credentials );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-api

/**
 * {@inheritDoc}
 */
@Override
public BindResponse bind( BindRequest bindRequest ) throws LdapException
{
  return connection.bind( bindRequest );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

/**
 * {@inheritDoc}
 */
@Override
public void bind( String name ) throws LdapException
{
  connection.bind( name );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

/**
 * {@inheritDoc}
 */
@Override
public BindResponse bind( BindRequest bindRequest ) throws LdapException
{
  return connection.bind( bindRequest );
}

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * {@inheritDoc}
 */
@Override
public void bind( String name ) throws LdapException
{
  connection.bind( name );
  bindCalled = true;
}

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * {@inheritDoc}
 */
@Override
public void bind( Dn name, String credentials ) throws LdapException
{
  connection.bind( name, credentials );
  bindCalled = true;
}

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * {@inheritDoc}
 */
@Override
public void bind() throws LdapException
{
  connection.bind();
}

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * {@inheritDoc}
 */
@Override
public void bind( String name ) throws LdapException
{
  connection.bind( name );
}

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * {@inheritDoc}
 */
@Override
public BindResponse bind( BindRequest bindRequest ) throws LdapException
{
  return connection.bind( bindRequest );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-api

/**
 * {@inheritDoc}
 */
@Override
public void bind() throws LdapException
{
  connection.bind();
}

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * {@inheritDoc}
 */
@Override
public void bind( String name, String credentials ) throws LdapException
{
  connection.bind( name, credentials );
}

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * {@inheritDoc}
 */
@Override
public void bind( Dn name, String credentials ) throws LdapException
{
  connection.bind( name, credentials );
}

代码示例来源:origin: org.apache.directory.client.ldap/ldap-client-api

/**
 * {@inheritDoc}
 */
public Object makeObject() throws Exception
{
  LOG.debug( "creating a LDAP connection" );
  LdapConnection connection = new LdapConnection( config );
  connection.bind( config.getName(), config.getCredentials() );
  return connection;
}

代码示例来源:origin: com.qwazr/qwazr-library-ldap

@JsonIgnore
public Entry getEntry(final LdapConnection connection, final String filter, final String... attributes)
    throws LdapException, CursorException, IOException {
  connection.bind();
  try (final EntryCursor cursor = connection.search(baseDn, filter, SearchScope.SUBTREE, attributes)) {
    if (!cursor.next())
      return null;
    return cursor.get();
  }
}

相关文章