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

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

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

LdapConnection.lookup介绍

[英]Searches for an entry having the given distinguished name.
[中]搜索具有给定可分辨名称的条目。

代码示例

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( String dn, String... attributes ) throws LdapException
{
  return connection.lookup( dn, attributes );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( Dn dn ) throws LdapException
{
  return connection.lookup( dn );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( String dn, String... attributes ) throws LdapException
{
  return connection.lookup( dn, attributes );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( Dn dn, Control[] controls, String... attributes ) throws LdapException
{
  return connection.lookup( dn, controls, attributes );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( String dn, Control[] controls, String... attributes ) throws LdapException
{
  return connection.lookup( dn, controls, attributes );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( String dn, Control[] controls, String... attributes ) throws LdapException
{
  return connection.lookup( dn, controls, attributes );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( Dn dn, String... attributes ) throws LdapException
{
  return connection.lookup( dn, attributes );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( String dn, String... attributes ) throws LdapException
{
  return connection.lookup( dn, attributes );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( Dn dn ) throws LdapException
{
  return connection.lookup( dn );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( String dn ) throws LdapException
{
  return connection.lookup( dn );
}

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

/**
 * @see #lookup(String, String...)
 */
public SearchResponse lookup( String dn ) throws LdapException
{
  return lookup( dn, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( String dn ) throws LdapException
{
  return connection.lookup( dn );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( Dn dn, Control[] controls, String... attributes ) throws LdapException
{
  return connection.lookup( dn, controls, attributes );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( Dn dn ) throws LdapException
{
  return connection.lookup( dn );
}

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

/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( String dn ) throws LdapException
{
  return connection.lookup( dn );
}

代码示例来源:origin: org.openengsb.infrastructure/org.openengsb.infrastructure.ldap

/**
 * Returns the {@link Entry} with given {@link Dn}. If dn does not exist but its parent does, a
 * {@link NoSuchNodeException} is thrown. If one of dn's ancestors does not exist, a {@link MissingParentException}
 * is thrown.
 */
public Entry lookup(Dn dn) throws NoSuchNodeException, MissingParentException {
  existsCheck(dn);
  try {
    return connection.lookup(dn);
  } catch (LdapException e) {
    throw new LdapDaoException(e);
  }
}

代码示例来源:origin: apache/jackrabbit-oak

@Test
  public void testValidate() throws Exception {
    LdapConnection connection = Mockito.mock(LdapConnection.class);
    when(connection.isConnected()).thenReturn(true);
    when(connection.lookup(Dn.ROOT_DSE, SchemaConstants.NO_ATTRIBUTE)).thenReturn(Mockito.mock(Entry.class));

    assertTrue(validator.validate(connection));
  }
}

代码示例来源:origin: apache/jackrabbit-oak

@Test
public void testValidateThrowsException() throws Exception {
  LdapConnection connection = Mockito.mock(LdapConnection.class);
  doThrow(LdapException.class).when(connection).lookup(Dn.ROOT_DSE, SchemaConstants.NO_ATTRIBUTE);
  assertFalse(validator.validate(connection));
}

代码示例来源:origin: apache/jackrabbit-oak

@Test
public void testValidateLookupReturnsNull() throws Exception {
  LdapConnection connection = Mockito.mock(LdapConnection.class);
  when(connection.isConnected()).thenReturn(true);
  when(connection.lookup(Dn.ROOT_DSE, SchemaConstants.NO_ATTRIBUTE)).thenReturn(null);
  assertFalse(validator.validate(connection));
}

代码示例来源:origin: apache/jackrabbit-oak

@Test
public void testValidateNotConnectedLookupReturnsNull() throws Exception {
  LdapConnection connection = Mockito.mock(LdapConnection.class);
  when(connection.isConnected()).thenReturn(false);
  when(connection.lookup(Dn.ROOT_DSE, SchemaConstants.NO_ATTRIBUTE)).thenReturn(null);
  assertFalse(validator.validate(connection));
}

相关文章