Package org.jboss.dmr

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


        this.description = modelDescription.get(ModelDescriptionConstants.MODEL_DESCRIPTION);
        ModelNode attributes = description.has(ModelDescriptionConstants.ATTRIBUTES) ? description.get(ModelDescriptionConstants.ATTRIBUTES) : new ModelNode();
        address = PathAddress.pathAddress(modelDescription.get(ModelDescriptionConstants.ADDRESS));

        if (attributes.isDefined()) {
            for (Property property : attributes.asPropertyList()) {
                String name = property.getName();
                SimpleAttributeDefinition def = SimpleAttributeDefinitionBuilder.create(name, property.getValue()).build();
                this.attributes.put(name, new AttributeAccess(
                        AttributeAccess.AccessType.READ_ONLY, AttributeAccess.Storage.CONFIGURATION, null, null, def, null)
                );
View Full Code Here


            ImmutableManagementResourceRegistration sub = reg.getSubModel(PathAddress.pathAddress(path));
            if (path.isWildcard()) {
                ModelNode subModel = model.get(path.getKey());
                if (subModel.isDefined()) {
                    for (Property p : subModel.asPropertyList()) {
                        if (p.getValue().isDefined()) {
                            res.registerChild(PathElement.pathElement(path.getKey(), p.getName()), modelToResource(startAddress,sub, p.getValue(), includeUndefined, fullPath.append(path)));
                        }
                    }
                }
View Full Code Here

        if (!model.hasDefined(getName())) {
            return new HashMap<String, String>();
        }
        ModelNode modelProps = model.get(getName());
        Map<String, String> props = new HashMap<String, String>();
        for (Property p : modelProps.asPropertyList()) {
            props.put(p.getName(), context.resolveExpressions(p.getValue()).asString());
        }
        return props;
    }
View Full Code Here

                return Collections.emptySet();
            }
            final String hostName = model.get(HOST).keys().iterator().next();
            final ModelNode serverConfig = model.get(HOST, hostName).get(SERVER_CONFIG);
            final Set<String> servers = new HashSet<String>();
            for (Property config : serverConfig.asPropertyList()) {
                if (groupName.equals(config.getValue().get(GROUP).asString())) {
                    servers.add(config.getName());
                }
            }
            return servers;
View Full Code Here

                @Override
                public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                    final String hostName = model.get(HOST).keys().iterator().next();
                    final ModelNode serverConfig = model.get(HOST, hostName).get(SERVER_CONFIG);
                    final Set<String> serversInGroup = getServersForGroup(model, group);
                    for (Property config : serverConfig.asPropertyList()) {
                        final ServerStatus status = serverInventory.determineServerStatus(config.getName());
                        if (status != ServerStatus.STARTING && status != ServerStatus.STARTED) {
                            if (group == null || serversInGroup.contains(config.getName())) {
                                if (status != ServerStatus.STOPPED) {
                                    serverInventory.stopServer(config.getName(), TIMEOUT);
View Full Code Here

            final ModelNode endPaths = endRoot.get(PATH);
            final Map<String, ModelNode> existingPaths = new HashMap<String, ModelNode>();
            if (startPaths.isDefined()) for (Property property : startPaths.asPropertyList()) {
                existingPaths.put(property.getName(), property.getValue());
            }
            if (endPaths.isDefined()) for (Property path : endPaths.asPropertyList()) {
                final String pathName = path.getName();
                if (existingPaths.containsKey(pathName)) {
                    if (!path.getValue().equals(existingPaths.get(pathName))) {
                        affectedServers.addAll(getServersAffectedByPath(pathName, hostModel, true));
                    }
View Full Code Here

            final ModelNode endSysProps = endRoot.get(SYSTEM_PROPERTY);
            final Map<String, ModelNode> existingProps = new HashMap<String, ModelNode>();
            if (startSysProps.isDefined()) for (Property property : startSysProps.asPropertyList()) {
                existingProps.put(property.getName(), property.getValue());
            }
            if (endSysProps.isDefined()) for (Property property : endSysProps.asPropertyList()) {
                if (existingProps.containsKey(property.getName())) {
                    if (!property.getValue().equals(existingProps.get(property.getName()))) {
                        affectedServers.addAll(getServerAffectedBySystemProperty(property.getName(), true, endRoot, null, hostModel));
                    }
                    existingProps.remove(property.getName());
View Full Code Here

            final ModelNode endProfiles = endRoot.get(PROFILE);
            final Map<String, ModelNode> existingProfiles = new HashMap<String, ModelNode>();
            if (startProfiles.isDefined()) for (Property profile : startProfiles.asPropertyList()) {
                existingProfiles.put(profile.getName(), profile.getValue());
            }
            if (endProfiles.isDefined()) for (Property profile : endProfiles.asPropertyList()) {
                if (existingProfiles.containsKey(profile.getName())) {
                    if (!profile.getValue().equals(existingProfiles.get(profile.getName()))) {
                        affectedServers.addAll(getServerAffectedByProfile(profile.getName(), endRoot, hostModel, serverProxies));
                    }
                    existingProfiles.remove(profile.getName());
View Full Code Here

            final ModelNode endInterfaces = endRoot.get(INTERFACE);
            final Map<String, ModelNode> existingInterfaces = new HashMap<String, ModelNode>();
            if (startInterfaces.isDefined()) for (Property interfaceProp : startInterfaces.asPropertyList()) {
                existingInterfaces.put(interfaceProp.getName(), interfaceProp.getValue());
            }
            if (endInterfaces.isDefined()) for (Property interfaceProp : endInterfaces.asPropertyList()) {
                if (existingInterfaces.containsKey(interfaceProp.getName())) {
                    if (!interfaceProp.getValue().equals(existingInterfaces.get(interfaceProp.getName()))) {
                        affectedServers.addAll(getServersAffectedByInterface(interfaceProp.getName(), hostModel, true));
                    }
                    existingInterfaces.remove(interfaceProp.getName());
View Full Code Here

            final ModelNode endBindingGroups = endRoot.get(SOCKET_BINDING_GROUP);
            final Map<String, ModelNode> existingBindingGroups = new HashMap<String, ModelNode>();
            if (startBindingGroups.isDefined()) for (Property bindingGroup : startBindingGroups.asPropertyList()) {
                existingBindingGroups.put(bindingGroup.getName(), bindingGroup.getValue());
            }
            if (endBindingGroups.isDefined()) for (Property bindingGroup : endBindingGroups.asPropertyList()) {
                if (existingBindingGroups.containsKey(bindingGroup.getName())) {
                    if (!bindingGroup.getValue().equals(existingBindingGroups.get(bindingGroup.getName()))) {
                        affectedServers.addAll(getServersAffectedBySocketBindingGroup(bindingGroup.getName(), endRoot, hostModel, serverProxies));
                    }
                    existingBindingGroups.remove(bindingGroup.getName());
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.