Package org.jboss.dmr.client

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


            public void onSuccess(DMRResponse result) {

                ModelNode response = result.get();
                ModelNode payload = response.get("result").asObject();

                List<ModelNode> socketDescriptions= payload.asList();

                String defaultInterface = payload.get("default-interface").asString();
                List<SocketBinding> bindings = new ArrayList<SocketBinding>();
                for(ModelNode socket : socketDescriptions)
                {
View Full Code Here


                        value = "";
                }
                else if ("java.util.List".equals(propBinding.getJavaTypeName()))
                {
                    ModelNode list = actualPayload.get(splitDetypedName);
                    if (list.isDefined() && propValue.isDefined() && !list.asList().isEmpty()) {
                        if (list.asList().get(0).getType().equals(ModelType.PROPERTY)) {
                            value = propBinding.getEntityAdapterForList().fromDMRPropertyList(list.asPropertyList());
                        } else {
                            value = propBinding.getEntityAdapterForList().fromDMRList(list.asList());
                        }
View Full Code Here

                }
                else if ("java.util.List".equals(propBinding.getJavaTypeName()))
                {
                    ModelNode list = actualPayload.get(splitDetypedName);
                    if (list.isDefined() && propValue.isDefined() && !list.asList().isEmpty()) {
                        if (list.asList().get(0).getType().equals(ModelType.PROPERTY)) {
                            value = propBinding.getEntityAdapterForList().fromDMRPropertyList(list.asPropertyList());
                        } else {
                            value = propBinding.getEntityAdapterForList().fromDMRList(list.asList());
                        }
                    }
View Full Code Here

                    ModelNode list = actualPayload.get(splitDetypedName);
                    if (list.isDefined() && propValue.isDefined() && !list.asList().isEmpty()) {
                        if (list.asList().get(0).getType().equals(ModelType.PROPERTY)) {
                            value = propBinding.getEntityAdapterForList().fromDMRPropertyList(list.asPropertyList());
                        } else {
                            value = propBinding.getEntityAdapterForList().fromDMRList(list.asList());
                        }
                    }
                    else
                    {
                        value = new LinkedList();
View Full Code Here

                } else {
                    ModelNode stepsResult = result.get(RESULT);
                    ModelNode historyStep = stepsResult.get("step-1");
                    ModelNode historyNode = historyStep.get(RESULT);
                    if (historyNode.isDefined()) {
                        for (ModelNode node : historyNode.asList()) {
                            patches.add(historyToPatchInfo(node));
                        }
                    }

                    ModelNode latestPatchStep = stepsResult.get("step-2");
View Full Code Here

                    ModelNode latestPatchNode = latestPatchStep.get(RESULT);
                    if (latestPatchNode.isDefined()) {
                        String id = null;
                        ModelNode patchesNode = latestPatchNode.get("patches");
                        if (patchesNode.isDefined()) {
                            List<ModelNode> idList = patchesNode.asList();
                            if (!idList.isEmpty()) {
                                id = idList.get(0).asString(); // TODO first == latest?
                            }
                        }
                        if (id == null) {
View Full Code Here

                        } else {

                            ModelNode desc = null;
                            ModelNode result = response.get(RESULT);
                            if (ModelType.LIST.equals(result.getType()))
                                desc = result.asList().get(0).get(RESULT).asObject();
                            else {
                                // workaround ...
                                if (!result.hasDefined(RESULT)) {
                                    Console.warning("Failed to read resource description" + address);
                                } else {
View Full Code Here

                    // the result is either a single resource or a collection
                    ModelNode result = response.get(RESULT);

                    if(ModelType.LIST==result.getType())
                    {
                        List<ModelNode> collection = result.asList();
                        List normalized = new ArrayList<ModelNode>(collection.size());
                        for(ModelNode model : collection)
                        {
                            ModelNode payload = model.get(RESULT).asObject();
                            assignKeyFromAddressNode(payload, model.get(ADDRESS));
View Full Code Here

                            extensionMap.put(subsystemName, new int[] {major, minor, micro});
                        }
                    }

                    ModelNode subsystemResult = response.get(RESULT).get("step-2").get(RESULT);
                    List<ModelNode> subsystems = subsystemResult.asList();
                    List<SubsystemRecord> records = new ArrayList<SubsystemRecord>(subsystems.size());
                    for(int i=0; i<subsystems.size(); i++)
                    {
                        ModelNode model = subsystems.get(i);
                        String subsystemName = model.asString();
View Full Code Here

                    } else {
                        ModelNode stepsResult = result.get(RESULT);
                        ModelNode historyStep = stepsResult.get("step-1");
                        ModelNode historyNode = historyStep.get(RESULT);
                        if (historyNode.isDefined()) {
                            for (ModelNode node : historyNode.asList()) {
                                patches.add(historyToPatchInfo(node));
                            }
                        }

                        ModelNode latestPatchStep = stepsResult.get("step-2");
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.