Package org.jboss.as.controller.client

Examples of org.jboss.as.controller.client.OperationBuilder.build()


                    is = new FileInputStream(f);
                    ModelNode request = builder.buildRequest();
                    OperationBuilder op = new OperationBuilder(request);
                    op.addInputStream(is);
                    request.get(Util.CONTENT).get(0).get(Util.INPUT_STREAM_INDEX).set(0);
                    result = client.execute(op.build());
                } catch(Exception e) {
                    ctx.printLine("Failed to replace the deployment: " + e.getLocalizedMessage());
                    return;
                } finally {
                    StreamUtils.safeClose(is);
View Full Code Here


                try {
                    is = new FileInputStream(f);
                    OperationBuilder op = new OperationBuilder(request);
                    op.addInputStream(is);
                    request.get(Util.CONTENT).get(0).get(Util.INPUT_STREAM_INDEX).set(0);
                    result = client.execute(op.build());
                } catch (Exception e) {
                    ctx.printLine("Failed to add the deployment content to the repository: " + e.getLocalizedMessage());
                    return;
                } finally {
                    StreamUtils.safeClose(is);
View Full Code Here

            dmr.get("address").setEmptyList();
            dmr.get("input-stream-index").set(0);

            OperationBuilder operation = new OperationBuilder(dmr);
            operation.addInputStream(result.stream);
            response = modelController.execute(operation.build());
            drain(http.getRequestBody());
        } catch (Throwable t) {
            // TODO Consider draining input stream
            ROOT_LOGGER.uploadError(t);
            sendError(http,false,t);
View Full Code Here

        ModelNode compositeOp = ModelUtil.createCompositeNode(steps);

        OperationBuilder ob = new OperationBuilder(compositeOp, true);
        ob.addInputStream(new FileInputStream(getBrokenWar()));

        return getModelControllerClient().execute(ob.build());
    }

    protected void remove(final ModelNode address) throws IOException, MgmtOperationException {
        final ModelNode operation = new ModelNode();
        operation.get(OP).set("remove");
View Full Code Here

            dmr.get("address").setEmptyList();
            dmr.get("input-stream-index").set(0);

            OperationBuilder operation = new OperationBuilder(dmr);
            operation.addInputStream(result.stream);
            response = modelController.execute(operation.build());
            drain(http.getRequestBody());
        } catch (Throwable t) {
            // TODO Consider draining input stream
            ROOT_LOGGER.uploadError(t);
            http.sendResponseHeaders(INTERNAL_SERVER_ERROR, -1);
View Full Code Here

            }
            }
            steps.add(step);
        }

        return builder.build();
    }

    private void configureDeploymentOperation(ModelNode op, String operationName, String uniqueName) {
        op.get(OP).set(operationName);
        op.get(OP_ADDR).add(DEPLOYMENT, uniqueName);
View Full Code Here

            for (ModelNode actionStep : actionSteps) {
                steps.add(actionStep);
            }
        }

        return builder.build();
    }

    private Set<String> getCurrentDomainDeployments() {
        ModelNode op = new ModelNode();
        op.get("operation").set("read-children-names");
View Full Code Here

        content.get(INPUT_STREAM_INDEX).set(0);
        ModelNode composite = createDeploymentOperation(content, MAIN_SERVER_GROUP_DEPLOYMENT_ADDRESS, getOtherServerGroupDeploymentAddress());
        OperationBuilder builder = new OperationBuilder(composite, true);
        builder.addInputStream(webArchive.as(ZipExporter.class).exportAsInputStream());

        executeOnMaster(builder.build());

        performHttpCall(DomainTestSupport.slaveAddress, 8080);

    }
View Full Code Here

        content.get(INPUT_STREAM_INDEX).set(0);
        ModelNode op = createDeploymentReplaceOperation(content, MAIN_SERVER_GROUP_ADDRESS, getOtherServerGroupAddress());
        OperationBuilder builder = new OperationBuilder(op, true);
        builder.addInputStream(webArchive.as(ZipExporter.class).exportAsInputStream());

        executeOnMaster(builder.build());

        performHttpCall(DomainTestSupport.slaveAddress, 8080);
    }

    @Test
View Full Code Here

        //Just be lazy here and deploy the jsf-test.war with the same name as the other deployments we tried
        ModelNode composite = createDeploymentOperation(content, MAIN_SERVER_GROUP_DEPLOYMENT_ADDRESS, getOtherServerGroupDeploymentAddress());
        OperationBuilder builder = new OperationBuilder(composite, true);
        builder.addInputStream(jsfTestArchive.as(ZipExporter.class).exportAsInputStream());

        executeOnMaster(builder.build());

        performHttpCall(DomainTestSupport.slaveAddress, 8080, "test/home.jsf", "Bean Works");
    }

    private void redeployTest() throws IOException {
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.