Package org.jboss.dmr

Examples of org.jboss.dmr.ModelNode.toJSONString()


      if (!Operations.isSuccessfulOutcome(result)) {
        logger.log(
                Type.ERROR,
                String.format("Could not %s %s:\nInput:\n%s\nOutput:\n%s", opName, getAppName(),
                        operation.toJSONString(false), result.toJSONString(false)));
        throw new UnableToCompleteException();
      }

      logger.log(Type.INFO, String.format("%s %sed", getAppName(), opName));
      logger.unbranch();
View Full Code Here


public class ManagementUtil {

    public static void reportRolesAsJSON(OperationContext context, String rolesAsJSON) {
        ModelNode camelCase = ModelNode.fromJSONString(rolesAsJSON);
        ModelNode converted = convertSecurityRole(camelCase);
        String json = converted.toJSONString(true);
        context.getResult().set(json);
    }

    public static void reportRoles(OperationContext context, String rolesAsJSON) {
        ModelNode camelCase = ModelNode.fromJSONString(rolesAsJSON);
View Full Code Here

        readResourceWithRuntime = getOperation("pooled-connection-factory", "*", "read-resource-description");
        readResourceWithRuntime.get("include-runtime").set(true);
        readResourceWithRuntime.get("operations").set(true);
        ModelNode result = execute(readResourceWithRuntime, true);
        System.out.println("result = " + result.toJSONString(false));

        readResourceWithRuntime = getOperation("pooled-connection-factory", "JMSResourceDefinitionsTestCase_JMSResourceDefinitionsTestCase_java_module/myFactory1", "read-resource");
        readResourceWithRuntime.get("include-runtime").set(true);
        result = execute(readResourceWithRuntime, true);
        System.out.println("result = " + result.toJSONString(false));
View Full Code Here

        System.out.println("result = " + result.toJSONString(false));

        readResourceWithRuntime = getOperation("pooled-connection-factory", "JMSResourceDefinitionsTestCase_JMSResourceDefinitionsTestCase_java_module/myFactory1", "read-resource");
        readResourceWithRuntime.get("include-runtime").set(true);
        result = execute(readResourceWithRuntime, true);
        System.out.println("result = " + result.toJSONString(false));
        assertEquals(1, result.get("min-pool-size").asInt());
        assertEquals(2, result.get("max-pool-size").asInt());
        assertEquals(3, result.get("initial-connect-attempts").asInt());
        assertEquals("guest", result.get("user").asString());
        assertEquals("guest", result.get("password").asString());
View Full Code Here

        assertEquals("myClientID1", result.get("client-id").asString());

        readResourceWithRuntime = getOperation("pooled-connection-factory", "JMSResourceDefinitionsTestCase_MessagingBean_java_comp/env/myFactory2", "read-resource");
        readResourceWithRuntime.get("include-runtime").set(true);
        result = execute(readResourceWithRuntime, true);
        System.out.println("result = " + result.toJSONString(false));
        assertEquals(-1, result.get("min-pool-size").asInt());
        assertEquals(-1, result.get("max-pool-size").asInt());
        assertFalse(result.toJSONString(false), result.hasDefined("user"));
        assertFalse(result.hasDefined("password"));
        assertFalse(result.hasDefined("client-id"));
View Full Code Here

        readResourceWithRuntime.get("include-runtime").set(true);
        result = execute(readResourceWithRuntime, true);
        System.out.println("result = " + result.toJSONString(false));
        assertEquals(-1, result.get("min-pool-size").asInt());
        assertEquals(-1, result.get("max-pool-size").asInt());
        assertFalse(result.toJSONString(false), result.hasDefined("user"));
        assertFalse(result.hasDefined("password"));
        assertFalse(result.hasDefined("client-id"));

        readResourceWithRuntime = getOperation("pooled-connection-factory", "JMSResourceDefinitionsTestCase_JMSResourceDefinitionsTestCase_java_global/myFactory3", "read-resource");
        readResourceWithRuntime.get("include-runtime").set(true);
View Full Code Here

        assertFalse(result.hasDefined("client-id"));

        readResourceWithRuntime = getOperation("pooled-connection-factory", "JMSResourceDefinitionsTestCase_JMSResourceDefinitionsTestCase_java_app/myFactory4", "read-resource");
        readResourceWithRuntime.get("include-runtime").set(true);
        result = execute(readResourceWithRuntime, true);
        System.out.println("result = " + result.toJSONString(false));
        assertEquals(4, result.get("min-pool-size").asInt());
        assertEquals(5, result.get("max-pool-size").asInt());
        assertEquals(6, result.get("initial-connect-attempts").asInt());
        assertEquals("guest", result.get("user").asString());
        assertEquals("guest", result.get("password").asString());
View Full Code Here

public class ManagementUtil {

    public static void reportRolesAsJSON(OperationContext context, String rolesAsJSON) {
        ModelNode camelCase = ModelNode.fromJSONString(rolesAsJSON);
        ModelNode converted = convertSecurityRole(camelCase);
        String json = converted.toJSONString(true);
        context.getResult().set(json);
    }

    public static void reportRoles(OperationContext context, String rolesAsJSON) {
        ModelNode camelCase = ModelNode.fromJSONString(rolesAsJSON);
View Full Code Here

        op.get("operation").set("add");
        op.get("address").add("deployment", "test-http-deployment.sar");
        op.get("content").get(0).get("hash").set(hash);
        op.get("enabled").set(true);

        os.write(op.toJSONString(true).getBytes());
        os.flush();
    }

    private void writeRemoveRequest(BufferedOutputStream os) throws IOException {
View Full Code Here

        ModelNode op = new ModelNode();
        op.get("operation").set("remove");
        op.get("address").add("deployment", "test-http-deployment.sar");

        os.write(op.toJSONString(true).getBytes());
        os.flush();
    }

    private ModelNode readResult(final InputStream is) throws IOException, NoSuchElementException {
        return ModelNode.fromJSONStream(is);
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.