context.getActionReport().setActionDescription("Configuration already present in the domain.xml"); return;
public void execute(AdminCommandContext context) { report.setActionDescription("List of modules"); report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
report.setActionDescription(model.getCommandName() + " AdminCommand");
report.setActionDescription(model.getCommandName() + " AdminCommand");
public void getHelp(AdminCommand command, ActionReport report) { CommandModel model = getModel(command); report.setActionDescription(model.getCommandName() + " help"); // XXX - this is a hack for now. if the request mapped to an // XMLContentActionReporter, that means we want the command metadata. if (report instanceof XMLContentActionReporter) { getMetadata(command, model, report); } else { report.setMessage(model.getCommandName() + " - " + model.getLocalizedDescription()); report.getTopMessagePart().addProperty("SYNOPSIS", encodeManPage(new BufferedReader(new StringReader( getUsageText(model))))); for (CommandModel.ParamModel param : model.getParameters()) { addParamUsage(report, param); } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); } }
public static void fillActionReport(final ActionReport ar, final JSONObject json) throws JSONException { ar.setActionExitCode(ActionReport.ExitCode.valueOf(json.getString("exit_code"))); ar.setActionDescription(json.optString("command")); String failure = json.optString("failure_cause"); if (failure != null && !failure.isEmpty()) { ar.setFailureCause(new Exception(failure)); } ar.setExtraProperties((Properties) extractMap(json.optJSONObject("extraProperties"), new Properties())); ar.getTopMessagePart().setMessage(json.optString("top_message", json.optString("message"))); Properties props = (Properties) extractMap(json.optJSONObject("properties"), new Properties()); for (Map.Entry entry : props.entrySet()) { ar.getTopMessagePart().addProperty(String.valueOf(entry.getKey()), String.valueOf(entry.getValue())); } //Sub messages fillSubMessages(ar.getTopMessagePart(), json.optJSONArray("children")); //Sub action reports JSONArray subJsons = json.optJSONArray("subReports"); if (subJsons != null) { for (int i = 0; i < subJsons.length(); i++) { JSONObject subJson = subJsons.getJSONObject(i); fillActionReport(ar.addSubActionsReport(), subJson); } } }
public void getHelp(AdminCommand command, ActionReport report) { CommandModel model = getModel(command); report.setActionDescription(model.getCommandName() + " help"); // XXX - this is a hack for now. if the request mapped to an // XMLContentActionReporter, that means we want the command metadata. if (report instanceof XMLContentActionReporter) { getMetadata(command, model, report); } else { report.setMessage(model.getCommandName() + " - " + model.getLocalizedDescription()); report.getTopMessagePart().addProperty("SYNOPSIS", encodeManPage(new BufferedReader(new StringReader( getUsageText(model))))); for (CommandModel.ParamModel param : model.getParameters()) { addParamUsage(report, param); } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); } }
report.setFailureCause(t); report.setMessage(t.getLocalizedMessage()); report.setActionDescription("Last-chance exception handler");
private void reportAuthFailure(final Response res, final ActionReport report, final String msgKey, final String msg, final int httpStatus, final String headerName, final String headerValue) throws IOException { report.setActionExitCode(ActionReport.ExitCode.FAILURE); final String messageForResponse = adminStrings.getLocalString(msgKey, msg); report.setMessage(messageForResponse); report.setActionDescription("Authentication error"); res.setStatus(httpStatus, messageForResponse); if (headerName != null) { res.setHeader(headerName, headerValue); } res.setContentType(report.getContentType()); report.writeReport(res.getOutputStream()); res.getOutputStream().flush(); res.finish(); }
report.setFailureCause(t); report.setMessage(t.getLocalizedMessage()); report.setActionDescription("Last-chance AdminAdapter exception handler");
ActionReport report = inv.report(); if (!fromCheckpoint) { report.setActionDescription(model.getCommandName() + " command"); report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
ActionReport report = inv.report(); if (!fromCheckpoint) { report.setActionDescription(model.getCommandName() + " command"); report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
public void execute(AdminCommandContext context) { report.setActionDescription(localStrings.getLocalString("list.containers.command", "List of Containers")); report.setActionExitCode(ActionReport.ExitCode.SUCCESS);