| | |
| | | |
| | | import static org.forgerock.opendj.adapter.server3x.Converters.*; |
| | | import static org.forgerock.opendj.ldap.ByteString.*; |
| | | import static org.forgerock.opendj.ldap.LdapException.*; |
| | | import static org.forgerock.util.promise.Promises.*; |
| | | |
| | | /** |
| | |
| | | try { |
| | | return newConnection(new InternalClientConnection(to(dn))); |
| | | } catch (DirectoryException e) { |
| | | throw LdapException.newErrorResult(Responses.newResult(ResultCode.NO_SUCH_OBJECT)); |
| | | throw newLdapException(Responses.newResult(ResultCode.NO_SUCH_OBJECT)); |
| | | } |
| | | } |
| | | |
| | |
| | | bindClient.dispose(); |
| | | |
| | | } else { // not supported |
| | | throw LdapException.newErrorResult(Responses |
| | | .newResult(ResultCode.AUTH_METHOD_NOT_SUPPORTED)); |
| | | throw newLdapException(Responses.newResult(ResultCode.AUTH_METHOD_NOT_SUPPORTED)); |
| | | } |
| | | BindResult result = Responses.newBindResult(bindOperation.getResultCode()); |
| | | result.setServerSASLCredentials(bindOperation.getSASLCredentials()); |
| | |
| | | if (result.isSuccess()) { |
| | | return result; |
| | | } else { |
| | | throw LdapException.newErrorResult(result); |
| | | throw newLdapException(result); |
| | | } |
| | | } |
| | | |