Package org.jboss.dmr.client

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


                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());
                        }
                    }
                    else
View Full Code Here


    public void onAdd(T entity) {
        String name = getName(entity);
        ModelNode operation = getResourceAddress(name);
        operation.get(OP).set(ADD);
        ModelNode attributes = this.entityAdapter.fromEntity(entity);
        for (Property prop : attributes.asPropertyList()) {
            operation.get(prop.getName()).set(prop.getValue());
        }
        execute(operation, name, Console.MESSAGES.added(name));
    }
View Full Code Here

                    ModelNode childDesc = childrenModel.get(child);
                    ModelNode desc = childDesc.get(MODEL_DESCRIPTION);

                    if(desc.isDefined()) // TOOD: How can this happen?
                    {
                        for (Property modDescProp : desc.asPropertyList()) {

                            matchSubElements(childDesc.get(MODEL_DESCRIPTION, modDescProp.getName()), fieldNames, fields);

                            // exit early
                            if(fieldNames.isEmpty())
View Full Code Here

            // identify the target node, in some cases exceptions override the dfefault behaviour
            ModelNode model = null;
            ModelNode exceptionModel = accessControl.get(EXCEPTIONS);
            if(exceptionModel.keys().size()>0// TODO: fix the actual representation, should not be ModelType.Object
            {
                List<Property> exceptions = exceptionModel.asPropertyList();
                model = exceptions.get(0).getValue();
            }
            else
            {
                model = accessControl.get(DEFAULT);
View Full Code Here

            // identify the target node, in some cases exceptions override the dfefault behaviour
            ModelNode model = null;
            ModelNode exceptionModel = accessControl.get(EXCEPTIONS);
            if(exceptionModel.keys().size()>0// TODO: fix the actual representation, should not be ModelType.Object
            {
                List<Property> exceptions = exceptionModel.asPropertyList();
                model = exceptions.get(0).getValue();
            }
            else
            {
                model = accessControl.get(DEFAULT);
View Full Code Here

                    ModelNode childDesc = child.getValue();
                    ModelNode desc = childDesc.get(MODEL_DESCRIPTION);

                    if(desc.isDefined()) // TOOD: How can this happen?
                    {
                        for (Property modDescProp : desc.asPropertyList()) {

                            matchSubElements(childDesc.get(MODEL_DESCRIPTION, modDescProp.getName()), fieldNames, fields);

                            // exit early
                            if(fieldNames.isEmpty())
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());
                        }
                    }
                    else
View Full Code Here

                            ModelNode accessControl = stepResult.hasDefined(RESULT) ?
                                    stepResult.get(RESULT).get("access-control") : stepResult.get("access-control");

                            List<Property> properties = accessControl.isDefined() ?
                                    accessControl.asPropertyList() : Collections.EMPTY_LIST;

                            if(!properties.isEmpty())
                            {
                                Property acl = properties.get(0);
                                assert acl.getName().equals("default");   //TODO: overrides ...
View Full Code Here

            // identify the target node, in some cases exceptions override the dfefault behaviour
            ModelNode model = null;
            ModelNode exceptionModel = accessControl.get(EXCEPTIONS);
            if(exceptionModel.keys().size()>0// TODO: fix the actual representation, should not be ModelType.Object
            {
                List<Property> exceptions = exceptionModel.asPropertyList();
                model = exceptions.get(0).getValue();
            }
            else
            {
                model = accessControl.get(DEFAULT);
View Full Code Here

    public void onAdd(T entity) {
        String name = getName(entity);
        ModelNode operation = getResourceAddress(name);
        operation.get(OP).set(ADD);
        ModelNode attributes = this.entityAdapter.fromEntity(entity);
        for (Property prop : attributes.asPropertyList()) {
            operation.get(prop.getName()).set(prop.getValue());
        }
        execute(operation, name, Console.MESSAGES.added(name));
    }
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.