Package org.jboss.dmr

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


    @Override
    public void marshallAsElement(ModelNode resourceModel, XMLStreamWriter writer) throws XMLStreamException {
      if (resourceModel.hasDefined(getName()) && resourceModel.asInt() > 0) {
            final ModelNode modules = resourceModel.get(getName());
            for (ModelNode module : modules.asList()) {
                writer.writeStartElement(getXmlName());
                writer.writeAttribute(Attribute.CODE.getLocalName(), module.get(CODE).asString());

                if (module.hasDefined(Constants.MODULE_OPTIONS)) {
                    for (ModelNode option : module.get(Constants.MODULE_OPTIONS).asList()) {
View Full Code Here


        op.get("operation").set("read-children-names");
        op.get("child-type").set("deployment");
        ModelNode rsp = client.executeForResult(new OperationBuilder(op).build());
        Set<String> deployments = new HashSet<String>();
        if (rsp.isDefined()) {
            for (ModelNode node : rsp.asList()) {
                deployments.add(node.asString());
            }
        }
        return deployments;
    }
View Full Code Here

        op.get(CHILD_TYPE).set(DEPLOYMENT);
        final ModelNode response = serverController.execute(OperationBuilder.Factory.create(op).build());
        final ModelNode result = response.get(RESULT);
        final Set<String> deploymentNames = new HashSet<String>();
        if (result.isDefined()) {
            final List<ModelNode> deploymentNodes = result.asList();
            for (ModelNode node : deploymentNodes) {
                deploymentNames.add(node.asString());
            }
        }
        return deploymentNames;
View Full Code Here

        op = Util.getEmptyOperation(READ_CHILDREN_NAMES_OPERATION, ROLLOUT_PLANS_ADDRESS);
        op.get(CHILD_TYPE).set(ROLLOUT_PLAN);
        response = masterClient.execute(op);
        returnVal = validateResponse(response);
        List<ModelNode> plans = returnVal.asList();
        assertEquals(2, plans.size());
        for (ModelNode node : plans) {
            if (!planA.equals(node.asString())) {
                assertEquals(planB, node.asString());
            }
View Full Code Here

    public HashSet<String> getConnectorList() throws Exception {
        ModelNode op = createOpNode("subsystem=web", "read-children-names");
        op.get("child-type").set("connector");
        ModelNode result = executeOperation(op);
        List<ModelNode> connectors = result.asList();
        HashSet<String> connNames = new HashSet<String>();
        for (ModelNode n : connectors) {
            connNames.add(n.asString());
        }
View Full Code Here

        ModelNode op = getSubsystemOperation("read-children-types");
        op.get("child-type").set("core-address");
        ModelNode result = execute(op, true);
        Assert.assertTrue(result.isDefined());
        boolean found = false;
        for (ModelNode type : result.asList()) {
            if ("core-address".equals(type.asString())) {
                found = true;
                break;
            }
        }
View Full Code Here

        op = getSubsystemOperation("read-children-names");
        op.get("child-type").set("core-address");
        result = execute(op, true);
        Assert.assertTrue(result.isDefined());
        found = false;
        for (ModelNode address : result.asList()) {
            if (getAddress().equals(address.asString())) {
                found = true;
                break;
            }
        }
View Full Code Here

        session.createDurableSubscriber(topic, "testListAllSubscriptions", "foo=bar", false);
        session.createSubscriber(topic);

        final ModelNode result = execute(getTopicOperation("list-all-subscriptions"), true);
        Assert.assertTrue(result.isDefined());
        Assert.assertEquals(2, result.asList().size());
    }

    @Test
    public void testListAllSubscriptionsAsJSON() throws Exception {
        session.createDurableSubscriber(topic, "testListAllSubscriptionsAsJSON", "foo=bar", false);
View Full Code Here

        session.createDurableSubscriber(topic, "testListDurableSubscriptions", "foo=bar", false);
        session.createSubscriber(topic);

        final ModelNode result = execute(getTopicOperation("list-durable-subscriptions"), true);
        Assert.assertTrue(result.isDefined());
        Assert.assertEquals(1, result.asList().size());
    }

    @Test
    public void testListDurableSubscriptionsAsJSON() throws Exception {
        session.createDurableSubscriber(topic, "testListDurableSubscriptionsAsJSON", "foo=bar", false);
View Full Code Here

        session.createDurableSubscriber(topic, "testListNonDurableSubscriptions", "foo=bar", false);
        session.createSubscriber(topic, "foo=bar", false);

        final ModelNode result = execute(getTopicOperation("list-non-durable-subscriptions"), true);
        Assert.assertTrue(result.isDefined());
        Assert.assertEquals(1, result.asList().size());
    }

    @Test
    public void testListNonDurableSubscriptionsAsJSON() throws Exception {
        session.createDurableSubscriber(topic, "testListNonDurableSubscriptionsAsJSON", "foo=bar", false);
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.