if (removeResult.getResultCode() == PluginResultCode.NOK) { logger.log(Level.SEVERE, "Unable to remove " + pluginId + " during the update process"); erroneousPlugins.add(pluginId); PluginOperationResult installResult = executeInstallFromApiHost(pluginId); if (installResult.getResultCode() == PluginResultCode.NOK) { logger.log(Level.SEVERE, "Unable to install " + pluginId + " during the update process"); erroneousPlugins.add(pluginId);
private void printResultRemove(PluginOperationResult operationResult) { // Print minimal result if (minimalOutput) { if (operationResult.getResultCode() == PluginResultCode.OK) { out.println("OK"); } else { out.println("NOK"); } } // Print regular result else { if (operationResult.getResultCode() == PluginResultCode.OK) { out.printf("Plugin successfully removed.\n"); out.printf("Original local was %s\n", operationResult.getSourcePluginPath()); out.println(); } else { out.println("Plugin removal failed."); out.println(); out.println("Note: Plugins shipped with the application or additional packages"); out.println(" cannot be removed. These plugin are marked 'Global' in the list."); out.println(); } } }
private void printResultInstall(PluginOperationResult operationResult) { // Print minimal result if (minimalOutput) { if (operationResult.getResultCode() == PluginResultCode.OK) { out.println("OK"); } else { out.println("NOK"); } } // Print regular result else { if (operationResult.getResultCode() == PluginResultCode.OK) { out.printf("Plugin successfully installed from %s\n", operationResult.getSourcePluginPath()); out.printf("Install location: %s\n", operationResult.getTargetPluginPath()); out.println(); printPluginDetails(operationResult.getAffectedPluginInfo()); printPluginConflictWarning(operationResult); } else { out.println("Plugin installation failed. Try -d to get more details."); out.println(); } } }
private void printResultUpdate(final PluginOperationResult operationResult) { // Print regular result if (operationResult.getResultCode() == PluginResultCode.OK) { if (operationResult.getUpdatedPluginIds().size() == 0) { out.println("All plugins are up to date."); } else { Iterables.removeAll(operationResult.getUpdatedPluginIds(), operationResult.getErroneousPluginIds()); Iterables.removeAll(operationResult.getUpdatedPluginIds(), operationResult.getDelayedPluginIds()); if (operationResult.getDelayedPluginIds().size() > 0) { out.printf("Plugins to be updated: %s\n", StringUtil.join(operationResult.getDelayedPluginIds(), ", ")); } if (operationResult.getUpdatedPluginIds().size() > 0) { out.printf("Plugins successfully updated: %s\n", StringUtil.join(operationResult.getUpdatedPluginIds(), ", ")); } if (operationResult.getErroneousPluginIds().size() > 0) { out.printf("Failed to update %s. Try -d to get more details\n", StringUtil.join(operationResult.getErroneousPluginIds(), ", ")); } out.println(); } } else { out.println("Plugin update failed. Try -d to get more details."); out.println(); } }
@Override public void run() { try { PluginOperation pluginOperation = new PluginOperation(null, concreteRequest.getOptions()); PluginOperationResult operationResult = pluginOperation.execute(); switch (operationResult.getResultCode()) { case OK: eventBus.post(new PluginManagementResponse(PluginManagementResponse.OK, operationResult, request.getId())); break; case NOK: eventBus.post(new PluginManagementResponse(PluginManagementResponse.NOK_FAILED_UNKNOWN, operationResult, request.getId())); break; } } catch (Exception e) { logger.log(Level.WARNING, "Error executing plugin management request.", e); eventBus.post(new PluginManagementResponse(PluginManagementResponse.NOK_OPERATION_FAILED, new PluginOperationResult(), request.getId())); } } }, "PlugRq/" + concreteRequest.getOptions().getAction());
private void printResultList(PluginOperationResult operationResult) { if (operationResult.getResultCode() == PluginResultCode.OK) { List<String[]> tableValues = new ArrayList<String[]>();