Package org.jboss.as.cli.operation

Examples of org.jboss.as.cli.operation.OperationFormatException


                while (iterator.hasNext()) {
                    OperationRequestAddress.Node node = iterator.next();
                    if (node.getName() != null) {
                        addressNode.add(node.getType(), node.getName());
                    } else if (iterator.hasNext()) {
                        throw new OperationFormatException(
                                "Expected a node name for type '"
                                        + node.getType()
                                        + "' in path '"
                                        + ctx.getNodePathFormatter().format(
                                                address) + "'");
                    }
                }
            }
            steps.add(typesRequest);
        }

        {
            final ModelNode resourceRequest = new ModelNode();
            resourceRequest.get(Util.OPERATION).set(Util.READ_RESOURCE);
            final ModelNode addressNode = resourceRequest.get(Util.ADDRESS);
            if (address.isEmpty()) {
                addressNode.setEmptyList();
            } else {
                Iterator<Node> iterator = address.iterator();
                while (iterator.hasNext()) {
                    OperationRequestAddress.Node node = iterator.next();
                    if (node.getName() != null) {
                        addressNode.add(node.getType(), node.getName());
                    } else if (iterator.hasNext()) {
                        throw new OperationFormatException(
                                "Expected a node name for type '"
                                        + node.getType()
                                        + "' in path '"
                                        + ctx.getNodePathFormatter().format(
                                                address) + "'");
View Full Code Here


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

        DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
        if(isDependsOnProfile() && 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.getParsedCommandLine(), true);
View Full Code Here

        ParsedCommandLine args = ctx.getParsedCommandLine();

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

        builder.addNode("subsystem", "datasources");
View Full Code Here

        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;
        }
View Full Code Here

        final ModelNode steps = composite.get(Util.STEPS);

        final ParsedCommandLine args = ctx.getParsedCommandLine();
        final String name = this.name.getValue(args);
        if(name == null) {
            throw new OperationFormatException("Required argument name are missing.");
        }

        final ModelControllerClient client = ctx.getModelControllerClient();
        DefaultOperationRequestBuilder builder;

        final boolean keepContent;
        try {
            keepContent = this.keepContent.isPresent(args);
        } catch (CommandFormatException e) {
            throw new OperationFormatException(e.getLocalizedMessage());
        }
        if(ctx.isDomainMode()) {
            final List<String> serverGroups;
            if(allRelevantServerGroups.isPresent(args)) {
                if(keepContent) {
                    serverGroups = Util.getAllEnabledServerGroups(name, client);
                } else {
                    serverGroups = Util.getAllReferencingServerGroups(name, client);
                }
            } else {
                final String serverGroupsStr = this.serverGroups.getValue(args);
                if(serverGroupsStr == null) {
                    //throw new OperationFormatException("Either --all-relevant-server-groups or --server-groups must be specified.");
                    serverGroups = Collections.emptyList();
                } else {
                    serverGroups = Arrays.asList(serverGroupsStr.split(","));
                }
            }

            if(serverGroups.isEmpty()) {
                if(keepContent) {
                    throw new OperationFormatException("None server group is specified or available.");
                }
            } else {
                for (String group : serverGroups){
                    ModelNode groupStep = Util.configureDeploymentOperation(DEPLOYMENT_UNDEPLOY_OPERATION, name, group);
                    steps.add(groupStep);
View Full Code Here

    }

    @Override
    public void handle(ParsingContext ctx)
            throws OperationFormatException {
        throw new OperationFormatException(msg);
    }
View Full Code Here

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

        final String name = this.name.getValue(ctx.getParsedCommandLine(), true);
View Full Code Here

        final String path = this.path.getValue(args, true);

        final File archive;
        archive = new File(path);
        if(!archive.exists()) {
            throw new OperationFormatException("Path " + archive.getAbsolutePath() + " doesn't exist.");
        }
        if(archive.isDirectory()) {
            throw new OperationFormatException(archive.getAbsolutePath() + " is a directory.");
        }
        File root;
        try {
            root = extractArchive(archive);
        } catch (IOException e) {
            throw new OperationFormatException("Unable to extract archive '" + archive.getAbsolutePath() + "' to temporary location");
        }

        ctx.setCurrentDir(root);
        String holdbackBatch = activateNewBatch(ctx);
View Full Code Here

        ParsedCommandLine args = ctx.getParsedCommandLine();

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

        final String name = this.name.getValue(args, true);
View Full Code Here

TOP

Related Classes of org.jboss.as.cli.operation.OperationFormatException

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.