/** * Executes the command with the command parameters passed as Properties * where the keys are paramter names and the values the parameter values * * @param context information */ public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); try { domainPasswordAliasStore.remove(aliasName); } catch (Exception ex) { ex.printStackTrace(); reportFailure(report, ex); return; } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); /*report.setMessage(localStrings.getLocalString( "delete.password.alias.success", "Password alias for the alias {0} deleted successfully", aliasName));*/ }
@Override public boolean preAuthorization(AdminCommandContext context) { final ActionReport report = context.getActionReport(); try { if ( ! domainPasswordAliasStore.containsKey(aliasName)) { report.setMessage(localStrings.getLocalString( "delete.password.alias.notfound", "Password alias for the alias {0} does not exist.", aliasName)); report.setActionExitCode(ActionReport.ExitCode.FAILURE); return false; } } catch (Exception ex) { reportFailure(context.getActionReport(), ex); return false; } return true; }