use of fish.payara.asadmin.recorder.AsadminRecorderConfiguration in project Payara by payara.
the class GetAsadminRecorderConfiguration method execute.
@Override
public void execute(AdminCommandContext context) {
Config config = targetUtil.getConfig(target);
if (config == null) {
context.getActionReport().setMessage("No such config named: " + target);
context.getActionReport().setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
AsadminRecorderConfiguration asadminRecorderConfiguration = config.getExtensionByType(AsadminRecorderConfiguration.class);
final ActionReport actionReport = context.getActionReport();
ColumnFormatter columnFormatter = new ColumnFormatter(headers);
Object[] values = { asadminRecorderConfiguration.isEnabled(), asadminRecorderConfiguration.filterCommands(), asadminRecorderConfiguration.getOutputLocation(), asadminRecorderConfiguration.getFilteredCommands(), asadminRecorderConfiguration.prependEnabled(), asadminRecorderConfiguration.getPrependedOptions() };
columnFormatter.addRow(values);
Map<String, Object> map = new HashMap<String, Object>();
Properties extraProps = new Properties();
map.put("enabled", values[0]);
map.put("filterCommands", values[1]);
map.put("outputLocation", values[2]);
map.put("filteredCommands", values[3]);
map.put("prependEnabled", values[4]);
map.put("prependedOptions", values[5]);
extraProps.put("getAsadminRecorderConfiguration", map);
actionReport.setExtraProperties(extraProps);
actionReport.setMessage(columnFormatter.toString());
actionReport.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
Aggregations