Examples of toRequest()


Examples of org.jboss.as.cli.batch.Batch.toRequest()

        CommandLineException catchError = null;
        if(!Util.isSuccess(response)) {
            ctx.printLine("try block failed: " + Util.getFailureDescription(response));
            ModelNode catchRequest = tryBlock.getCatchRequest();
            if(catchRequest == null && tryBlock.isInCatch() && batch.size() > 0) {
                catchRequest = batch.toRequest();
            }
            if(catchRequest != null) {
                try {
                    response = client.execute(catchRequest);
                } catch (IOException e) {
View Full Code Here

Examples of org.jboss.as.cli.batch.Batch.toRequest()

                }
            }
        }

        if(tryBlock.isInFinally() && batch.size() > 0) {
            final ModelNode finallyRequest = batch.toRequest();
            try {
                response = client.execute(finallyRequest);
            } catch (IOException e) {
                throw new CommandLineException("finally request failed", e);
            }
View Full Code Here

Examples of org.jboss.as.cli.batch.Batch.toRequest()

            List<BatchedCommand> currentBatch = batch.getCommands();
            if(currentBatch.isEmpty()) {
                batchManager.discardActiveBatch();
                throw new CommandFormatException("The batch is empty.");
            }
            return batch.toRequest();
        }

        if(path != null) {
            final File f = new File(path);
            if(!f.exists()) {
View Full Code Here

Examples of org.jboss.as.cli.batch.Batch.toRequest()

                final Batch batch = batchManager.getActiveBatch();
                while(line != null) {
                    batch.add(ctx.toBatchedCommand(line));
                    line = reader.readLine();
                }
                return batch.toRequest();
            } catch(IOException e) {
                throw new CommandFormatException("Failed to read file " + f.getAbsolutePath(), e);
            } catch(CommandFormatException e) {
                throw new CommandFormatException("Failed to create batch from " + f.getAbsolutePath(), e);
            } finally {
View Full Code Here

Examples of org.jboss.as.cli.batch.Batch.toRequest()

            ModelNode ifRequest = ifBlock.getIfRequest();
            if(ifRequest == null) {
                if(batch.size() == 0) {
                    throw new CommandLineException("if request is missing.");
                }
                ifRequest = batch.toRequest();
            }
            try {
                final ModelNode response = client.execute(ifRequest);
                if(!Util.isSuccess(response)) {
                    new CommandLineException("if request failed: " + Util.getFailureDescription(response));
View Full Code Here

Examples of org.jboss.as.cli.batch.Batch.toRequest()

        } else if(ifBlock.isInElse()) {
            if(batch.size() == 0) {
                throw new CommandLineException("else block is empty.");
            }
            try {
                final ModelNode response = client.execute(batch.toRequest());
                if(!Util.isSuccess(response)) {
                    throw new CommandLineException("else request failed: " + Util.getFailureDescription(response));
                }
            } catch (IOException e) {
                throw new CommandLineException("else request failed", e);
View Full Code Here

Examples of org.jboss.as.cli.batch.Batch.toRequest()

        final Batch ifBatch = batchManager.getActiveBatch();
        if(ifBatch.size() == 0) {
            throw new CommandLineException("if block is empty.");
        }

        ifBlock.setIfRequest(ifBatch.toRequest());
        ifBlock.setInElse();

        batchManager.discardActiveBatch();
        if(!batchManager.activateNewBatch()) {
            IfElseBlock.remove(ctx);
View Full Code Here

Examples of org.jboss.as.cli.batch.Batch.toRequest()

            List<BatchedCommand> currentBatch = batch.getCommands();
            if(currentBatch.isEmpty()) {
                batchManager.discardActiveBatch();
                throw new CommandFormatException("The batch is empty.");
            }
            return batch.toRequest();
        }

        if(path != null) {
            final File f = new File(path);
            if(!f.exists()) {
View Full Code Here

Examples of org.jboss.as.cli.batch.Batch.toRequest()

                final Batch batch = batchManager.getActiveBatch();
                while(line != null) {
                    batch.add(ctx.toBatchedCommand(line));
                    line = reader.readLine();
                }
                return batch.toRequest();
            } catch(IOException e) {
                throw new CommandFormatException("Failed to read file " + f.getAbsolutePath(), e);
            } catch(CommandFormatException e) {
                throw new CommandFormatException("Failed to create batch from " + f.getAbsolutePath(), e);
            } finally {
View Full Code Here

Examples of org.jboss.as.cli.batch.Batch.toRequest()

            ctx.error("The batch is empty.");
            batchManager.discardActiveBatch();
            return;
        }

        final ModelNode composite = batch.toRequest();
        try {
            ModelNode result = ctx.getModelControllerClient().execute(composite);
            if(Util.isSuccess(result)) {
                batchManager.discardActiveBatch();
                ctx.printLine("The batch executed successfully.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.