Package org.jboss.dmr

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


                                                            getAsString(childDescr, Util.MIN_OCCURS),
                                                            getAsString(childDescr, Util.MAX_OCCURS)
                                                            });
*/
                                                    childrenTable.addCell("CHILD", prop.getName());
                                                    for(String name : childDescr.keys()) {
                                                        if(!Util.DESCRIPTION.equals(name) &&
                                                                !Util.HEAD_COMMENT_ALLOWED.equals(name) &&
                                                                !Util.TAIL_COMMENT_ALLOWED.equals(name)) {
                                                            childrenTable.addCell(name, childDescr.get(name).asString());
                                                        }
View Full Code Here


        for (String paramName : actualParams.keySet()) {
            final ModelNode param = actualParams.get(paramName);
            if(! param.isDefined()) {
                continue;
            }
            if(param.getType() == ModelType.OBJECT && param.keys().isEmpty()) {
                return;
            }
            if (!describedProperties.containsKey(paramName)) {
                throw MESSAGES.validationFailedActualParameterNotDescribed(paramName, describedProperties.keySet(), formatOperationForMessage(operation));
            }
View Full Code Here

        for (String paramName : actualParams.keySet()) {
            final ModelNode value = actualParams.get(paramName);
            if(!value.isDefined()) {
                continue;
            }
            if(value.getType() == ModelType.OBJECT && value.keys().isEmpty()) {
                return;
            }
            final ModelNode typeNode = describedProperties.get(paramName).get(TYPE);
            if (!typeNode.isDefined()) {
                throwOrWarnAboutDescriptorProblem(MESSAGES.invalidDescriptionNoParamTypeInDescription(paramName, getPathAddress(operation), description));
View Full Code Here

        final Map<String, Set<String>> childrenByType = registry != null ? GlobalOperationHandlers.getChildAddresses(context, address, registry, resource, null) : Collections.<String, Set<String>>emptyMap();
        final ModelNode model = resource.getModel();

        if (model.isDefined()) {
            // Store direct attributes first
            for (String key : model.keys()) {
                // In case someone put some garbage in it
                if (!childrenByType.containsKey(key)) {
                    directAttributes.put(key, model.get(key));
                }
            }
View Full Code Here

        this.domainController = domainController;
        // start servers
        final ModelNode rawModel = getHostModel();
        if(rawModel.hasDefined(SERVER_CONFIG)) {
            final ModelNode servers = rawModel.get(SERVER_CONFIG).clone();
            for(final String serverName : servers.keys()) {
                if(servers.get(serverName, AUTO_START).asBoolean(true)) {
                    try {
                        startServer(serverName);
                    } catch (Exception e) {
                        log.errorf(e, "failed to start server (%s)", serverName);
View Full Code Here

        final ModelNode rawModel = getHostModel();
        this.domainController = null;
        // stop servers
        if(rawModel.hasDefined(SERVER_CONFIG) ) {
            final ModelNode servers = rawModel.get(SERVER_CONFIG).clone();
            for(final String serverName : servers.keys()) {
                if(servers.get(serverName, AUTO_START).asBoolean(true)) {
                    try {
                        stopServer(serverName);
                    } catch (Exception e) {
                        log.errorf(e, "failed to stop server (%s)", serverName);
View Full Code Here

        }
        ModelNode rolloutPlan1 = plan.get(ROLLOUT_PLAN);

        final Set<String> keys;
        try {
            keys = rolloutPlan1.keys();
        } catch (IllegalArgumentException e) {
            throw new OperationFailedException(MESSAGES.requiredChildIsMissing(ROLLOUT_PLAN, IN_SERIES, plan.toString()));
        }
        if(!keys.contains(IN_SERIES)) {
            throw new OperationFailedException(MESSAGES.requiredChildIsMissing(ROLLOUT_PLAN, IN_SERIES, plan.toString()));
View Full Code Here

        for(ModelNode group : groups) {
            if(group.hasDefined(SERVER_GROUP)) {
                final ModelNode serverGroup = group.get(SERVER_GROUP);
                final Set<String> groupKeys;
                try {
                    groupKeys = serverGroup.keys();
                } catch(IllegalArgumentException e) {
                    throw new OperationFailedException(MESSAGES.serverGroupExpectsSingleChild(plan.toString()));
                }
                if(groupKeys.size() != 1) {
                    throw new OperationFailedException(MESSAGES.serverGroupExpectsSingleChild(plan.toString()));
View Full Code Here

                ModelNode configuration = node.get(CONFIGURATION);
                writer.writeStartElement(Element.CONFIGURATION.getLocalName());
                writeAttribute(writer, Attribute.PID, configuration.require(PID));
                if (has(configuration, CONFIGURATION_PROPERTIES)) {
                    ModelNode configurationProperties = configuration.get(CONFIGURATION_PROPERTIES);
                    Set<String> keys = configurationProperties.keys();
                    for (String current : keys) {
                        String value = configurationProperties.get(current).asString();
                        writer.writeStartElement(Element.PROPERTY.getLocalName());
                        writer.writeAttribute(Attribute.NAME.getLocalName(), current);
                        writer.writeCharacters(value);
View Full Code Here

            }

            if (has(node, PROPERTIES)) {
                ModelNode properties = node.get(PROPERTIES);
                writer.writeStartElement(Element.PROPERTIES.getLocalName());
                Set<String> keys = properties.keys();
                for (String current : keys) {
                    String value = properties.get(current).asString();
                    writer.writeStartElement(Element.PROPERTY.getLocalName());
                    writer.writeAttribute(Attribute.NAME.getLocalName(), current);
                    writer.writeCharacters(value);
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.