connection = ldapConnector.connect(config); } catch (LdapException e) { return LdapTestConfigResponse.create(false, false, false, Collections.<String, String>emptyMap(), Collections.<String>emptySet(), e.getMessage());
@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); }
/** * {@inheritDoc} */ @Override public Entry lookup( Dn dn, Control[] controls, String... attributes ) throws LdapException { messageId.incrementAndGet(); Entry entry = null; try { entry = session.lookup( dn, controls, attributes ); } catch ( LdapException e ) { LOG.warn( e.getMessage(), e ); } return entry; }
/** * {@inheritDoc} */ @Override public boolean hasDescendants( String ancestorId ) throws LdapException { try { String oid = getOidByName( ancestorId ); Set<AttributeType> descendants = oidToDescendantSet.get( oid ); return ( descendants != null ) && !descendants.isEmpty(); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @Override public boolean hasDescendants( String ancestorId ) throws LdapException { try { String oid = getOidByName( ancestorId ); Set<ObjectClass> descendants = oidToDescendants.get( oid ); return ( descendants != null ) && !descendants.isEmpty(); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @Override public boolean hasDescendants( String ancestorId ) throws LdapException { try { String oid = getOidByName( ancestorId ); Set<ObjectClass> descendants = oidToDescendants.get( oid ); return ( descendants != null ) && !descendants.isEmpty(); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @Override public boolean hasDescendants( String ancestorId ) throws LdapException { try { String oid = getOidByName( ancestorId ); Set<ObjectClass> descendants = oidToDescendants.get( oid ); return ( descendants != null ) && !descendants.isEmpty(); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @Override public boolean hasDescendants( String ancestorId ) throws LdapException { try { String oid = getOidByName( ancestorId ); Set<AttributeType> descendants = oidToDescendantSet.get( oid ); return ( descendants != null ) && !descendants.isEmpty(); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @Override public boolean hasDescendants( String ancestorId ) throws LdapException { try { String oid = getOidByName( ancestorId ); Set<AttributeType> descendants = oidToDescendantSet.get( oid ); return ( descendants != null ) && !descendants.isEmpty(); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public Iterator<AttributeType> descendants( String ancestorId ) throws LdapException { try { String oid = getOidByName( ancestorId ); Set<AttributeType> descendants = oidToDescendantSet.get( oid ); if ( descendants == null ) { return Collections.EMPTY_SET.iterator(); } return descendants.iterator(); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public Iterator<ObjectClass> descendants( String ancestorId ) throws LdapException { try { String oid = getOidByName( ancestorId ); Set<ObjectClass> descendants = oidToDescendants.get( oid ); if ( descendants == null ) { return Collections.EMPTY_SET.iterator(); } return descendants.iterator(); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @Override public String getOidByName( String name ) throws LdapException { try { return immutableAttributeTypeRegistry.getOidByName( name ); } catch ( LdapException le ) { throw new LdapNoSuchAttributeException( le.getMessage(), le ); } }
/** * {@inheritDoc} */ @Override public String getOidByName( String name ) throws LdapException { try { return immutableAttributeTypeRegistry.getOidByName( name ); } catch ( LdapException le ) { throw new LdapNoSuchAttributeException( le.getMessage(), le ); } }
/** * {@inheritDoc} */ @Override public AttributeType lookup( String oid ) throws LdapException { try { return super.lookup( oid ); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @Override public AttributeType lookup( String oid ) throws LdapException { try { return super.lookup( oid ); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @Override public AttributeType lookup( String oid ) throws LdapException { try { return super.lookup( oid ); } catch ( LdapException ne ) { throw new LdapNoSuchAttributeException( ne.getMessage(), ne ); } }
/** * {@inheritDoc} */ @Override public String getOidByName( String name ) throws LdapException { try { return immutableAttributeTypeRegistry.getOidByName( name ); } catch ( LdapException le ) { throw new LdapNoSuchAttributeException( le.getMessage(), le ); } }
/** * Attempts to resolve the SyntaxChecker associated with a Syntax. * * @param syntax the LdapSyntax to resolve the SyntaxChecker of */ private void resolve( LdapSyntax syntax ) { // A LdapSyntax must point to a valid SyntaxChecker // or to the OctetString SyntaxChecker try { LdapSyntaxHelper.addToRegistries( syntax, errorHandler, this ); } catch ( LdapException e ) { errorHandler.handle( LOG, e.getMessage(), e ); } }
/** * Attempts to resolve the SyntaxChecker associated with a Syntax. * * @param syntax the LdapSyntax to resolve the SyntaxChecker of */ private void resolve( LdapSyntax syntax ) { // A LdapSyntax must point to a valid SyntaxChecker // or to the OctetString SyntaxChecker try { LdapSyntaxHelper.addToRegistries( syntax, errorHandler, this ); } catch ( LdapException e ) { errorHandler.handle( LOG, e.getMessage(), e ); } }
/** * Attempts to resolve the SyntaxChecker associated with a Syntax. * * @param syntax the LdapSyntax to resolve the SyntaxChecker of */ private void resolve( LdapSyntax syntax ) { // A LdapSyntax must point to a valid SyntaxChecker // or to the OctetString SyntaxChecker try { LdapSyntaxHelper.addToRegistries( syntax, errorHandler, this ); } catch ( LdapException e ) { errorHandler.handle( LOG, e.getMessage(), e ); } }