use of org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData in project geode by apache.
the class CLIMultiStepHelper method createSimpleStepResult.
public static Result createSimpleStepResult(String nextStep) {
CompositeResultData result = ResultBuilder.createCompositeResultData();
SectionResultData section = result.addSection(STEP_SECTION);
section.addData(NEXT_STEP_NAME, nextStep);
return ResultBuilder.buildResult(result);
}
use of org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData in project geode by apache.
the class CLIMultiStepHelper method createStepSeqResult.
public static Result createStepSeqResult(CLIStep[] steps) {
CompositeResultData result = ResultBuilder.createCompositeResultData();
SectionResultData section = result.addSection(STEP_SECTION);
section.addData(NEXT_STEP_NAME, steps[0].getName());
String[] array = new String[steps.length];
for (int i = 0; i < steps.length; i++) {
array[i] = steps[i++].getName();
}
section.addData(NEXT_STEP_NAMES, array);
return ResultBuilder.buildResult(result);
}
use of org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData in project geode by apache.
the class CLIMultiStepHelper method createEmptyResult.
public static Result createEmptyResult(String step) {
CompositeResultData result = ResultBuilder.createCompositeResultData();
SectionResultData section = result.addSection(STEP_SECTION);
section.addData(NEXT_STEP_NAME, step);
return ResultBuilder.buildResult(result);
}
use of org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData in project geode by apache.
the class CLIMultiStepHelper method createPageResult.
public static Result createPageResult(String[] fields, Object[] values, String step, String[] header, Object[][] table) {
CompositeResultData result = ResultBuilder.createCompositeResultData();
SectionResultData section = result.addSection(STEP_SECTION);
section.addData(NEXT_STEP_NAME, step);
SectionResultData page = result.addSection(ARG_SECTION);
if (fields.length != values.length)
throw new RuntimeException("Fields array and its value arraylength dont match");
for (int i = 0; i < fields.length; i++) {
page.addData(fields[i], values[i]);
}
createPageTableAndBanner(page, header, table);
return ResultBuilder.buildResult(result);
}
use of org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData in project geode by apache.
the class CLIMultiStepHelper method getDisplayResultFromArgs.
public static CommandResult getDisplayResultFromArgs(GfJsonObject args) {
SectionResultData sectionData = new SectionResultData(args);
CompositeResultData data = ResultBuilder.createCompositeResultData();
data.addSection(sectionData);
return (CommandResult) ResultBuilder.buildResult(data);
}
Aggregations