| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS |
| | | * Portions copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | |
| | | package com.forgerock.opendj.ldap.tools; |
| | |
| | | import static com.forgerock.opendj.ldap.tools.ToolConstants.*; |
| | | import static com.forgerock.opendj.ldap.tools.ToolsMessages.*; |
| | | import static com.forgerock.opendj.ldap.tools.Utils.filterExitCode; |
| | | import static org.forgerock.opendj.ldap.ErrorResultException.newErrorResult; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.FileNotFoundException; |
| | |
| | | request.getAssertionValueAsString(), request.getName().toString())); |
| | | if (connection != null) { |
| | | try { |
| | | Result result; |
| | | try { |
| | | result = connection.compare(request); |
| | | } catch (final InterruptedException e) { |
| | | // This shouldn't happen because there are no other threads |
| | | // to |
| | | // interrupt this one. |
| | | throw newErrorResult(ResultCode.CLIENT_SIDE_USER_CANCELLED, e |
| | | .getLocalizedMessage(), e); |
| | | } |
| | | |
| | | Result result = connection.compare(request); |
| | | if (result.getResultCode() == ResultCode.COMPARE_FALSE) { |
| | | println(INFO_COMPARE_OPERATION_RESULT_FALSE.get(request.getName().toString())); |
| | | } else { |
| | |
| | | } catch (final ErrorResultException ere) { |
| | | println(LocalizableMessage.raw(ere.getMessage())); |
| | | return ere.getResult().getResultCode().intValue(); |
| | | } catch (final InterruptedException e) { |
| | | // This shouldn't happen because there are no other threads to |
| | | // interrupt this one. |
| | | println(LocalizableMessage.raw(e.getLocalizedMessage())); |
| | | return ResultCode.CLIENT_SIDE_USER_CANCELLED.intValue(); |
| | | } |
| | | } |
| | | |