Package org.jboss.as.cli

Examples of org.jboss.as.cli.ParsedArguments


        name = new ArgumentWithValue(this, new CommandLineCompleter() {
            @Override
            public int complete(CommandContext ctx, String buffer, int cursor, List<String> candidates) {

                ParsedArguments args = ctx.getParsedArguments();
                try {
                    if(path.isPresent(args)) {
                        return -1;
                    }
                } catch (CommandFormatException e) {
View Full Code Here


    @Override
    protected void doHandle(CommandContext ctx) throws CommandFormatException {

        ModelControllerClient client = ctx.getModelControllerClient();

        ParsedArguments args = ctx.getParsedArguments();
        boolean l = this.l.isPresent(args);
        if (!args.hasArguments() || l) {
            printList(ctx, Util.getDeployments(client), l);
            return;
        }

        final String path = this.path.getValue(args);
View Full Code Here

        }
    }

    public ModelNode buildRequest(CommandContext ctx) throws CommandFormatException {

        ParsedArguments args = ctx.getParsedArguments();
        if (!args.hasArguments()) {
            throw new OperationFormatException("Required arguments are missing.");
        }

        final String filePath = path.getValue(args);
        String name = this.name.getValue(args);
View Full Code Here

    }

    @Override
    public boolean canAppearNext(CommandContext ctx) throws CommandFormatException {

        ParsedArguments args = ctx.getParsedArguments();
        if (exclusive) {
            return !args.hasArguments();
        }

        if (isPresent(args)) {
            return false;
        }
View Full Code Here

    }

    @Override
    protected void setParams(CommandContext ctx, ModelNode request) throws CommandFormatException {

        ParsedArguments args = ctx.getParsedArguments();

        final String profile;
        if(ctx.isDomainMode()) {
            profile = this.profile.getValue(args);
            if(profile == null) {
View Full Code Here

    @Override
    protected void doHandle(CommandContext ctx) throws CommandFormatException {

        ModelControllerClient client = ctx.getModelControllerClient();
        ParsedArguments args = ctx.getParsedArguments();
        boolean l = this.l.isPresent(args);
        if(!args.hasArguments() || l) {
            printList(ctx, Util.getDeployments(client), l);
            return;
        }

        final String name = this.name.getValue(ctx.getParsedArguments());
View Full Code Here

        ModelNode composite = new ModelNode();
        composite.get("operation").set("composite");
        composite.get("address").setEmptyList();
        ModelNode steps = composite.get("steps");

        final ParsedArguments args = ctx.getParsedArguments();
        final String name = this.name.getValue(args);
        if(name == null) {
            throw new OperationFormatException("Required argument name are missing.");
        }
View Full Code Here

            private Map<String, List<CommandArgument>> propsByOp;

            @Override
            protected Iterable<CommandArgument> getAllArguments(CommandContext ctx) {

                ParsedArguments args = ctx.getParsedArguments();

                final String theName = name.getValue(args);
                if(theName == null) {
                    return staticArgs;
                }
View Full Code Here

        ModelNode composite = new ModelNode();
        composite.get("operation").set("composite");
        composite.get("address").setEmptyList();
        ModelNode steps = composite.get("steps");

        ParsedArguments args = ctx.getParsedArguments();

        final String profile;
        if(ctx.isDomainMode()) {
            profile = this.profile.getValue(args);
            if(profile == null) {
                throw new OperationFormatException("--profile argument value is missing.");
            }
        } else {
            profile = null;
        }

        for(String argName : args.getArgumentNames()) {
            if(argName.equals("--profile") || this.name.getFullName().equals(argName)) {
                continue;
            }

            final String valueString = args.getArgument(argName);
            if(valueString == null) {
                continue;
            }

            DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
View Full Code Here

        return composite;
    }

    protected ModelNode buildOperationRequest(CommandContext ctx, final String operation) throws CommandFormatException {

        ParsedArguments args = ctx.getParsedArguments();

        DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
        if(ctx.isDomainMode()) {
            final String profile = this.profile.getValue(args);
            if(profile == null) {
                throw new OperationFormatException("Required argument --profile is missing.");
            }
            builder.addNode("profile", profile);
        }

        final String name = this.name.getValue(ctx.getParsedArguments(), true);

        for(OperationRequestAddress.Node node : nodePath) {
            builder.addNode(node.getType(), node.getName());
        }
        builder.addNode(type, name);

        builder.setOperationName(operation);

        for(String argName : args.getArgumentNames()) {
            if(argName.equals("--profile")) {
                continue;
            }

            final String valueString = args.getArgument(argName);
            if(valueString == null) {
                continue;
            }

            if(argName.charAt(1) == '-') {
View Full Code Here

TOP

Related Classes of org.jboss.as.cli.ParsedArguments

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.