@Override public int execute(String[] operationArgs) throws Exception { boolean retryNeeded = true; boolean performOperation = true; ConnectOperationOptions operationOptions = parseOptions(operationArgs); while (retryNeeded && performOperation) { ConnectOperationResult operationResult = new ConnectOperation(operationOptions, this).execute(); printResults(operationResult); retryNeeded = operationResult.getResultCode() != ConnectResultCode.OK && operationResult.getResultCode() != ConnectResultCode.NOK_DECRYPT_ERROR; if (retryNeeded) { performOperation = isInteractive && askRetryConnection(); if (performOperation) { updateTransferSettings(operationOptions.getConfigTO().getTransferSettings()); } } } return 0; }
logger.log(Level.INFO, "- Connecting to the repo failed, repo already exists or cannot be created: " + result.getResultCode()); return result;
@Override public void run() { try { ConnectOperation initOperation = new ConnectOperation(concreteRequest.getOptions(), new EventUserInteractionListener()); ConnectOperationResult operationResult = initOperation.execute(); switch (operationResult.getResultCode()) { case OK: eventBus.post(new ConnectManagementResponse(ConnectManagementResponse.OK, operationResult, request.getId())); break; case NOK_TEST_FAILED: eventBus.post(new ConnectManagementResponse(ConnectManagementResponse.NOK_FAILED_TEST, operationResult, request.getId())); break; default: eventBus.post(new ConnectManagementResponse(ConnectManagementResponse.NOK_FAILED_UNKNOWN, operationResult, request.getId())); break; } } catch (Exception e) { logger.log(Level.WARNING, "Error adding watch to daemon config.", e); eventBus.post(new ConnectManagementResponse(ConnectManagementResponse.NOK_OPERATION_FAILED, new ConnectOperationResult(), request .getId())); } } }, "ConRq/" + concreteRequest.getOptions().getLocalDir().getName());
ConnectOperationResult concreteOperationResult = (ConnectOperationResult) operationResult; if (concreteOperationResult.getResultCode() == ConnectResultCode.OK) { out.println(); out.println("Repository connected, and local folder initialized."); else if (concreteOperationResult.getResultCode() == ConnectResultCode.NOK_TEST_FAILED) { StorageTestResult testResult = concreteOperationResult.getTestResult(); out.println(); printTestResult(testResult); else if (concreteOperationResult.getResultCode() == ConnectResultCode.NOK_DECRYPT_ERROR) { out.println(); out.println("ERROR: Invalid password or corrupt ciphertext.");