use of org.jboss.dmr.ModelNode in project wildfly by wildfly.
the class WebSubsystemParser method addDefaultContainerConfig.
static void addDefaultContainerConfig(final PathAddress parent, List<ModelNode> list) {
final ModelNode config = new ModelNode();
PathAddress containerPath = PathAddress.pathAddress(parent, WebExtension.CONTAINER_PATH);
config.get(OP).set(ADD);
config.get(OP_ADDR).set(containerPath.toModelNode());
list.add(config);
addDefaultStaticConfiguration(parent, list);
addDefaultJSPConfiguration(parent, list);
}
use of org.jboss.dmr.ModelNode in project wildfly by wildfly.
the class WebSubsystemParser method parseJSPConfiguration.
static void parseJSPConfiguration(XMLExtendedStreamReader reader, final PathAddress parent, List<ModelNode> list) throws XMLStreamException {
final PathAddress address = PathAddress.pathAddress(parent, WebExtension.JSP_CONFIGURATION_PATH);
final ModelNode jsp = new ModelNode();
jsp.get(OP).set(ADD);
jsp.get(OP_ADDR).set(address.toModelNode());
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
requireNoNamespaceAttribute(reader, i);
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch(attribute) {
case DEVELOPMENT:
case DISABLED:
case KEEP_GENERATED:
case TRIM_SPACES:
case TAG_POOLING:
case MAPPED_FILE:
case CHECK_INTERVAL:
case MODIFICATION_TEST_INTERVAL:
case RECOMPILE_ON_FAIL:
case SMAP:
case DUMP_SMAP:
case GENERATE_STRINGS_AS_CHAR_ARRAYS:
case ERROR_ON_USE_BEAN_INVALID_CLASS_ATTRIBUTE:
case SCRATCH_DIR:
case SOURCE_VM:
case TARGET_VM:
case JAVA_ENCODING:
case X_POWERED_BY:
case DISPLAY_SOURCE_FRAGMENT:
WebJSPDefinition.ATTRIBUTES_MAP.get(attribute.getLocalName()).parseAndSetParameter(value, jsp, reader);
break;
default:
throw unexpectedAttribute(reader, i);
}
}
requireNoContent(reader);
list.add(jsp);
}
use of org.jboss.dmr.ModelNode in project wildfly by wildfly.
the class WebSubsystemParser method parseStaticResources.
static void parseStaticResources(XMLExtendedStreamReader reader, PathAddress parent, List<ModelNode> list) throws XMLStreamException {
PathAddress address = PathAddress.pathAddress(parent, WebExtension.STATIC_RESOURCES_PATH);
final ModelNode resources = new ModelNode();
resources.get(OP).set(ADD);
resources.get(OP_ADDR).set(address.toModelNode());
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
requireNoNamespaceAttribute(reader, i);
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch(attribute) {
case LISTINGS:
WebStaticResources.LISTINGS.parseAndSetParameter(value, resources, reader);
break;
case SENDFILE:
WebStaticResources.SENDFILE.parseAndSetParameter(value, resources, reader);
break;
case FILE_ENCODING:
WebStaticResources.FILE_ENCODING.parseAndSetParameter(value, resources, reader);
break;
case READ_ONLY:
WebStaticResources.READ_ONLY.parseAndSetParameter(value, resources, reader);
break;
case WEBDAV:
WebStaticResources.WEBDAV.parseAndSetParameter(value, resources, reader);
break;
case SECRET:
WebStaticResources.SECRET.parseAndSetParameter(value, resources, reader);
break;
case MAX_DEPTH:
WebStaticResources.MAX_DEPTH.parseAndSetParameter(value, resources, reader);
break;
case DISABLED:
WebStaticResources.DISABLED.parseAndSetParameter(value, resources, reader);
break;
default:
throw unexpectedAttribute(reader, i);
}
}
requireNoContent(reader);
list.add(resources);
}
use of org.jboss.dmr.ModelNode in project wildfly by wildfly.
the class MigrateOperation method migrateConnectorAttribute.
private void migrateConnectorAttribute(ModelNode addOperation) {
ModelNode connector = addOperation.get(CONNECTOR);
if (connector.isDefined()) {
// legacy connector is a property list where the name is the connector and the value is undefined
List<Property> connectorProps = connector.asPropertyList();
for (Property connectorProp : connectorProps) {
addOperation.get("connectors").add(connectorProp.getName());
}
addOperation.remove(CONNECTOR);
}
}
use of org.jboss.dmr.ModelNode in project wildfly by wildfly.
the class MigrateOperation method migrateDiscoveryGroupNameAttribute.
private void migrateDiscoveryGroupNameAttribute(ModelNode addOperation) {
ModelNode discoveryGroup = addOperation.get(DISCOVERY_GROUP_NAME);
if (discoveryGroup.isDefined()) {
// discovery-group-name attribute has been renamed to discovery-group
addOperation.get("discovery-group").set(discoveryGroup);
addOperation.remove(DISCOVERY_GROUP_NAME);
}
}
Aggregations