Package org.jboss.as.controller.client

Examples of org.jboss.as.controller.client.ModelControllerClient.execute()


            ModelNode operation = new ModelNode();
            operation.get(OP_ADDR).setEmptyList();
            operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
            operation.get(NAME).set("server-state");
            try {
                ModelNode result = client.execute(operation);
                boolean normal = "running".equals(result.get(RESULT).asString());
                if (normal) {
                    return;
                }
            } catch (Exception e) {
View Full Code Here


        add.get(OP_ADDR).set(addr);
        add.get("path").set(deployDir.getAbsolutePath());
        add.get("scan-enabled").set(true);
        add.get("scan-interval").set(1000);

        ModelNode result = client.execute(add);
        Assert.assertEquals(ModelDescriptionConstants.SUCCESS, result.require(ModelDescriptionConstants.OUTCOME).asString());
    }

    @After
    public void removeDeploymentScanner() throws Exception {
View Full Code Here

            addr.add("subsystem", "deployment-scanner");
            addr.add("scanner", "rbac-check");
            ModelNode op = new ModelNode();
            op.get(OP).set(REMOVE);
            op.get(OP_ADDR).set(addr);
            client.execute(op);
        } finally {
            if (deployDir != null) {
                cleanFile(deployDir);
                deployDir = null;
            }
View Full Code Here

    private void removeResource(String address) throws IOException {
        ModelControllerClient client = getManagementClient().getControllerClient();

        ModelNode op = createOpNode(address, READ_RESOURCE_OPERATION);
        ModelNode result = client.execute(op);
        if (SUCCESS.equals(result.get(OUTCOME).asString())) {
            op = createOpNode(address, REMOVE);
            result = client.execute(op);
            assertEquals(result.asString(), SUCCESS, result.get(OUTCOME).asString());
        }
View Full Code Here

        ModelNode op = createOpNode(address, READ_RESOURCE_OPERATION);
        ModelNode result = client.execute(op);
        if (SUCCESS.equals(result.get(OUTCOME).asString())) {
            op = createOpNode(address, REMOVE);
            result = client.execute(op);
            assertEquals(result.asString(), SUCCESS, result.get(OUTCOME).asString());
        }
    }
}
View Full Code Here

            operation.get(VALUE).set(readSensitive);
        } else {
            operation = createOpNode(VAULT_EXPRESSION_SENSITIVITY, UNDEFINE_ATTRIBUTE_OPERATION);
            operation.get(NAME).set(CONFIGURED_REQUIRES_READ);
        }
        client.execute(operation);

        if (writeSensitive != null) {
            operation = createOpNode(VAULT_EXPRESSION_SENSITIVITY, WRITE_ATTRIBUTE_OPERATION);
            operation.get(NAME).set(CONFIGURED_REQUIRES_WRITE);
            operation.get(VALUE).set(writeSensitive);
View Full Code Here

            operation.get(VALUE).set(writeSensitive);
        } else {
            operation = createOpNode(VAULT_EXPRESSION_SENSITIVITY, UNDEFINE_ATTRIBUTE_OPERATION);
            operation.get(NAME).set(CONFIGURED_REQUIRES_WRITE);
        }
        client.execute(operation);
    }
}
View Full Code Here

                .build();

        final ModelControllerClient client = getModelControllerClient();
        try {
            // Deploy
            final ModelNode overallResult = client.execute(operation);
            Assert.assertTrue(overallResult.asString(), SUCCESS.equals(overallResult.get(OUTCOME).asString()));

            final ModelNode result = overallResult.get(RESULT, "step-1");
            Assert.assertTrue(result.asString(), SUCCESS.equals(result.get(OUTCOME).asString()));
View Full Code Here

        try {
            ctx.connectController();

            // Add the mod_cluster extension first (not in this profile by default)
            ModelNode request = ctx.buildRequest("/extension=org.jboss.as.modcluster:add");
            ModelNode response = controllerClient.execute(request);
            String outcome = response.get("outcome").asString();
            Assert.assertEquals("Adding mod_cluster extension failed! " + request.toJSONString(false), "success", outcome);

            // Now lets execute subsystem add operation but we need to specify a connector
            ctx.getBatchManager().activateNewBatch();
View Full Code Here

            b.add(ctx.toBatchedCommand("/subsystem=modcluster/mod-cluster-config=configuration:add(connector=http,advertise-socket=modcluster)"));
            request = b.toRequest();
            b.clear();
            ctx.getBatchManager().discardActiveBatch();

            response = controllerClient.execute(request);
            outcome = response.get("outcome").asString();
            Assert.assertEquals("Adding mod_cluster subsystem failed! " + request.toJSONString(false), "success", outcome);
        } finally {
            ctx.terminateSession();
        }
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.