/** * Retrieves the diagnostic message returned by the directory server. * * @return The diagnostic message returned by the directory server, or * {@code null} if there is none. */ public String getDiagnosticMessage() { return ldapException.getDiagnosticMessage(); }
/** * Retrieves the diagnostic message returned by the directory server. * * @return The diagnostic message returned by the directory server, or * {@code null} if there is none. */ public String getDiagnosticMessage() { return ldapException.getDiagnosticMessage(); }
private boolean isAuthenticated(LDAPConnection ldapConnection, String userDn, String password) { try { // Binding will stop any LDAP-Injection Attacks since the searched-for user needs to bind to that DN ldapConnection.bind(userDn, password); return true; } catch (LDAPException e) { if (!Strings.isNullOrEmpty(e.getDiagnosticMessage())) { log.error(e.getDiagnosticMessage()); } else { log.error("Error authenticating user", e); } return false; } }
private boolean isAuthenticated(LDAPConnection ldapConnection, String userDn, String password) { try { // Binding will stop any LDAP-Injection Attacks since the searched-for user needs to bind to that DN ldapConnection.bind(userDn, password); return true; } catch (LDAPException e) { if (!Strings.isNullOrEmpty(e.getDiagnosticMessage())) { log.error(e.getDiagnosticMessage()); } else { log.error("Error authenticating user", e); } return false; } }
private SearchResult doSearch(LDAPConnection ldapConnection, String base, boolean dereferenceAliases, String filter, List<String> attributes) { try { SearchRequest searchRequest = new SearchRequest(base, SearchScope.SUB, filter); if (dereferenceAliases) { searchRequest.setDerefPolicy(DereferencePolicy.SEARCHING); } if (attributes != null) { searchRequest.setAttributes(attributes); } return ldapConnection.search(searchRequest); } catch (LDAPException e) { if (!Strings.isNullOrEmpty(e.getDiagnosticMessage())) { log.error(e.getDiagnosticMessage()); } else { log.error("Problem searching LDAP", e); } return null; } }
private SearchResult doSearch(LDAPConnection ldapConnection, String base, boolean dereferenceAliases, String filter, List<String> attributes) { try { SearchRequest searchRequest = new SearchRequest(base, SearchScope.SUB, filter); if (dereferenceAliases) { searchRequest.setDerefPolicy(DereferencePolicy.SEARCHING); } if (attributes != null) { searchRequest.setAttributes(attributes); } return ldapConnection.search(searchRequest); } catch (LDAPException e) { if (!Strings.isNullOrEmpty(e.getDiagnosticMessage())) { log.error(e.getDiagnosticMessage()); } else { log.error("Problem searching LDAP", e); } return null; } }
/** * Convert from {@link LDAPException} to apiman's {@link LdapException} * * @param e the LDAP Exception * @return a new LdapException */ public static LdapException create(LDAPException e) { return new LdapException(DefaultLdapResultCodeFactory.convertResultCode(e.getResultCode()), e.getDiagnosticMessage(), e); }
/** * Convert from {@link LDAPException} to apiman's {@link LdapException} * * @param e the LDAP Exception * @return a new LdapException */ public static LdapException create(LDAPException e) { return new LdapException(DefaultLdapResultCodeFactory.convertResultCode(e.getResultCode()), e.getDiagnosticMessage(), e); }
/** * Creates a new instance of this notice of disconnection extended result from * the provided LDAP exception. * * @param ldapException The LDAP exception to use to create this notice of * disconnection extended result. */ public NoticeOfDisconnectionExtendedResult(final LDAPException ldapException) { this(0, ldapException.getResultCode(), ldapException.getDiagnosticMessage(), ldapException.getMatchedDN(), ldapException.getReferralURLs(), ldapException.getResponseControls()); }
/** * Creates a new instance of this notice of disconnection extended result from * the provided LDAP exception. * * @param ldapException The LDAP exception to use to create this notice of * disconnection extended result. */ public NoticeOfDisconnectionExtendedResult(final LDAPException ldapException) { this(0, ldapException.getResultCode(), ldapException.getDiagnosticMessage(), ldapException.getMatchedDN(), ldapException.getReferralURLs(), ldapException.getResponseControls()); }
log.error("Unable to create SSL Connection", e); } catch (LDAPException e) { if (!Strings.isNullOrEmpty(e.getDiagnosticMessage())) { log.error(e.getDiagnosticMessage()); } else { log.error("Error connecting to LDAP server", e);
log.error("Unable to create SSL Connection", e); } catch (LDAPException e) { if (!Strings.isNullOrEmpty(e.getDiagnosticMessage())) { log.error(e.getDiagnosticMessage()); } else { log.error("Error connecting to LDAP server", e);
/** * Creates a new LDAP exception using the information contained in the * provided LDAP exception. * * @param e The LDAP exception to use to create this exception. */ public LDAPException(final LDAPException e) { super(e.getMessage(), e.getCause()); resultCode = e.getResultCode(); matchedDN = e.getMatchedDN(); diagnosticMessage = e.getDiagnosticMessage(); referralURLs = e.getReferralURLs(); responseControls = e.getResponseControls(); }
/** * Creates a new LDAP exception using the information contained in the * provided LDAP exception. * * @param e The LDAP exception to use to create this exception. */ public LDAPException(final LDAPException e) { super(e.getMessage(), e.getCause()); resultCode = e.getResultCode(); matchedDN = e.getMatchedDN(); diagnosticMessage = e.getDiagnosticMessage(); referralURLs = e.getReferralURLs(); responseControls = e.getResponseControls(); }
return new LDAPMessage(messageID, new SearchResultDoneProtocolOp(le.getResultCode().intValue(), le.getMatchedDN(), le.getDiagnosticMessage(), StaticUtils.toList(le.getReferralURLs())), le.getResponseControls()); return new LDAPMessage(messageID, new SearchResultDoneProtocolOp(le.getResultCode().intValue(), le.getMatchedDN(), le.getDiagnosticMessage(), StaticUtils.toList(le.getReferralURLs())), le.getResponseControls());
le.getMatchedDN(), le.getDiagnosticMessage(), StaticUtils.toList(le.getReferralURLs()), null, null), le.getResponseControls());
return new LDAPMessage(messageID, new DeleteResponseProtocolOp(le.getResultCode().intValue(), le.getMatchedDN(), le.getDiagnosticMessage(), StaticUtils.toList(le.getReferralURLs())), le.getResponseControls());
return new LDAPMessage(messageID, new ModifyResponseProtocolOp(le.getResultCode().intValue(), le.getMatchedDN(), le.getDiagnosticMessage(), StaticUtils.toList(le.getReferralURLs())), le.getResponseControls());
le.getDiagnosticMessage(), le.getMatchedDN(), le.getReferralURLs(), null, null, le.getResponseControls());
le.getDiagnosticMessage(), le.getMatchedDN(), le.getReferralURLs(), null, null, null);