Checkpoint commit for OPENDJ-1536: Rename ErrorResultException to LdapException and remove ErrorResultIOException
| | |
| | | 'import org.forgerock.opendj.config.\1;', |
| | | |
| | | /import org.forgerock.opendj.config.client.AuthorizationException;/, |
| | | 'import org.forgerock.opendj.ldap.ErrorResultException;', |
| | | 'import org.forgerock.opendj.ldap.LdapException;', |
| | | |
| | | /import org.forgerock.opendj.config.client.CommunicationException;$/, |
| | | '', |
| | | |
| | | /catch \(AuthorizationException e\)/, |
| | | 'catch (ErrorResultException e)', |
| | | 'catch (LdapException e)', |
| | | |
| | | /catch \(CommunicationException e\)/, |
| | | 'catch (ErrorResultException e)', |
| | | 'catch (LdapException e)', |
| | | |
| | | # Now bring back removed imports that have no replacement |
| | | /import org.forgerock.opendj.config.client.ldap.JNDIDirContextAdaptor;/, |
| | |
| | | import org.forgerock.opendj.ldap.CancelledResultException; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.forgerock.opendj.ldap.Entry; |
| | | import org.forgerock.opendj.ldap.ErrorResultException; |
| | | import org.forgerock.opendj.ldap.LdapException; |
| | | import org.forgerock.opendj.ldap.Filter; |
| | | import org.forgerock.opendj.ldap.MemoryBackend; |
| | | import org.forgerock.opendj.ldap.RequestContext; |
| | |
| | | /** Handler for LDAP operations. */ |
| | | private static final class ConfigResultHandler implements ResultHandler<Result> { |
| | | |
| | | private ErrorResultException resultError; |
| | | private LdapException resultError; |
| | | |
| | | ErrorResultException getResultError() |
| | | LdapException getResultError() |
| | | { |
| | | return resultError; |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void handleError(ErrorResultException error) |
| | | public void handleError(LdapException error) |
| | | { |
| | | resultError = error; |
| | | } |
| | |
| | | import org.opends.server.util.Base64; |
| | | |
| | | import static org.forgerock.opendj.adapter.server3x.Adapters.*; |
| | | import static org.forgerock.opendj.ldap.LdapException.*; |
| | | import static org.forgerock.util.promise.Promises.*; |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | import static org.opends.server.loggers.AccessLogger.*; |
| | |
| | | ctx.asyncContext = getAsyncContext(request); |
| | | |
| | | newRootConnection().searchSingleEntryAsync(buildSearchRequest(ctx.userName)).thenAsync( |
| | | new AsyncFunction<SearchResultEntry, BindResult, ErrorResultException>() { |
| | | new AsyncFunction<SearchResultEntry, BindResult, LdapException>() { |
| | | @Override |
| | | public Promise<BindResult, ErrorResultException> apply(SearchResultEntry resultEntry) |
| | | throws ErrorResultException |
| | | public Promise<BindResult, LdapException> apply(SearchResultEntry resultEntry) throws LdapException |
| | | { |
| | | final DN bindDN = resultEntry.getName(); |
| | | if (bindDN == null) |
| | | { |
| | | sendAuthenticationFailure(ctx); |
| | | return newFailedPromise(ErrorResultException.newErrorResult(ResultCode.CANCELLED)); |
| | | return newFailedPromise(newErrorResult(ResultCode.CANCELLED)); |
| | | } |
| | | else |
| | | { |
| | |
| | | onFailure(e, ctx); |
| | | } |
| | | } |
| | | }).onFailure(new FailureHandler<ErrorResultException>(){ |
| | | }).onFailure(new FailureHandler<LdapException>(){ |
| | | @Override |
| | | public void handleError(ErrorResultException error) |
| | | public void handleError(LdapException error) |
| | | { |
| | | final ResultCode rc = error.getResult().getResultCode(); |
| | | if (ResultCode.CLIENT_SIDE_NO_RESULTS_RETURNED.equals(rc) |
| | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ErrorResultException; |
| | | import org.forgerock.opendj.ldap.LdapException; |
| | | import org.forgerock.opendj.ldap.FutureResultImpl; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.ldap.SearchResultHandler; |
| | |
| | | import org.opends.server.types.SearchResultReference; |
| | | |
| | | import static org.forgerock.opendj.adapter.server3x.Converters.*; |
| | | import static org.forgerock.opendj.ldap.ErrorResultException.*; |
| | | import static org.forgerock.opendj.ldap.LdapException.*; |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | import static org.opends.server.loggers.AccessLogger.*; |
| | | |
| | |
| | | .getMessageID(), toResponseProtocolOp(operation))); |
| | | } |
| | | } |
| | | catch (ErrorResultException e) |
| | | catch (LdapException e) |
| | | { |
| | | op.futureResult.handleError(e); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | op.futureResult.handleError(ErrorResultException.newErrorResult(ResultCode.CANCELLED)); |
| | | op.futureResult.handleError(newErrorResult(ResultCode.CANCELLED)); |
| | | op.operation.abort(cancelRequest); |
| | | |
| | | if (keepStats) |
| | |
| | | import org.forgerock.opendj.ldap.AbstractAsynchronousConnection; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.ConnectionEventListener; |
| | | import org.forgerock.opendj.ldap.ErrorResultException; |
| | | import org.forgerock.opendj.ldap.FutureResult; |
| | | import org.forgerock.opendj.ldap.FutureResultImpl; |
| | | import org.forgerock.opendj.ldap.IntermediateResponseHandler; |
| | |
| | | |
| | | import static org.forgerock.opendj.adapter.server3x.Converters.*; |
| | | import static org.forgerock.opendj.ldap.ByteString.*; |
| | | import static org.forgerock.opendj.ldap.LdapException.*; |
| | | |
| | | /** |
| | | * Adapter class between LDAP SDK's {@link org.forgerock.opendj.ldap.Connection} |
| | |
| | | logger.traceException(e); |
| | | clientConnection.removeOperationInProgress(operation.getMessageID()); |
| | | // TODO JNR add error message?? |
| | | futureResult.handleError(ErrorResultException.newErrorResult(ResultCode.OPERATIONS_ERROR, e)); |
| | | futureResult.handleError(newErrorResult(ResultCode.OPERATIONS_ERROR, e)); |
| | | } |
| | | |
| | | return futureResult; |
| | |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.AuthorizationException; |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.ErrorResultException; |
| | | import org.forgerock.opendj.ldap.LdapException; |
| | | import org.forgerock.opendj.ldap.LDAPConnectionFactory; |
| | | import org.forgerock.opendj.ldap.LDAPOptions; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | |
| | | connection.bind(bindDN, bindPassword.toCharArray()); |
| | | break; |
| | | } |
| | | catch (ErrorResultException e) |
| | | catch (LdapException e) |
| | | { |
| | | if (ci.isTrustStoreInMemory() && e.getCause() instanceof SSLException |
| | | && e.getCause().getCause() instanceof CertificateException) |
| | |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Copyright 2011-2013 ForgeRock AS |
| | | ! Copyright 2011-2014 ForgeRock AS |
| | | ! --> |
| | | <stax> |
| | | <!-- SDK ldapsearch Function --> |
| | |
| | | |
| | | writer.flush() |
| | | |
| | | except ErrorResultException, e: |
| | | except LdapException, e: |
| | | System.err.println(e.getMessage()) |
| | | System.exit(e.getResult().getResultCode().intValue()) |
| | | |
| | | except ErrorResultIOException, e: |
| | | System.err.println(e.getMessage()) |
| | | System.exit(e.getCause().getResult().getResultCode().intValue()) |
| | | |
| | | except InterruptedException, e: |
| | | System.err.println(e.getMessage()) |
| | | System.exit(ResultCode.CLIENT_SIDE_USER_CANCELLED.intValue()) |