Search in sources :

Example 6 with SectionResultData

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);
}
Also used : CompositeResultData(org.apache.geode.management.internal.cli.result.CompositeResultData) SectionResultData(org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData)

Example 7 with SectionResultData

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);
}
Also used : CompositeResultData(org.apache.geode.management.internal.cli.result.CompositeResultData) SectionResultData(org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData)

Example 8 with SectionResultData

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);
}
Also used : CompositeResultData(org.apache.geode.management.internal.cli.result.CompositeResultData) SectionResultData(org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData)

Example 9 with SectionResultData

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);
}
Also used : CompositeResultData(org.apache.geode.management.internal.cli.result.CompositeResultData) SectionResultData(org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData)

Example 10 with SectionResultData

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);
}
Also used : CompositeResultData(org.apache.geode.management.internal.cli.result.CompositeResultData) SectionResultData(org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData) CommandResult(org.apache.geode.management.internal.cli.result.CommandResult)

Aggregations

SectionResultData (org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData)44 CompositeResultData (org.apache.geode.management.internal.cli.result.CompositeResultData)38 TabularResultData (org.apache.geode.management.internal.cli.result.TabularResultData)22 CommandResult (org.apache.geode.management.internal.cli.result.CommandResult)10 InternalCache (org.apache.geode.internal.cache.InternalCache)9 Result (org.apache.geode.management.cli.Result)9 DistributedMember (org.apache.geode.distributed.DistributedMember)8 CliMetaData (org.apache.geode.management.cli.CliMetaData)8 ResourceOperation (org.apache.geode.management.internal.security.ResourceOperation)8 CliCommand (org.springframework.shell.core.annotation.CliCommand)8 ArrayList (java.util.ArrayList)7 HashSet (java.util.HashSet)7 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)7 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)7 Test (org.junit.Test)7 ObjectName (javax.management.ObjectName)6 SystemManagementService (org.apache.geode.management.internal.SystemManagementService)6 CacheServerMXBean (org.apache.geode.management.CacheServerMXBean)5 HashMap (java.util.HashMap)4 List (java.util.List)4