use of org.jboss.dmr.ModelNode in project wildfly by wildfly.
the class AbstractIDMSubsystemReader method parseJPAStoreConfig.
private void parseJPAStoreConfig(final XMLExtendedStreamReader reader, final ModelNode identityConfigurationNode, final List<ModelNode> addOperations) throws XMLStreamException {
ModelNode jpaStoreNode = parseConfig(reader, JPA_STORE, null, identityConfigurationNode, JPAStoreResourceDefinition.INSTANCE.getAttributes(), addOperations);
parseElement(new ElementParser() {
@Override
public void parse(final XMLExtendedStreamReader reader, final ModelElement element, final ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
switch(element) {
case IDENTITY_STORE_CREDENTIAL_HANDLER:
parseCredentialHandlerConfig(reader, parentNode, addOperations);
break;
case SUPPORTED_TYPES:
parseSupportedTypesConfig(reader, parentNode, addOperations);
break;
}
}
}, JPA_STORE, jpaStoreNode, reader, addOperations);
}
use of org.jboss.dmr.ModelNode in project wildfly by wildfly.
the class AbstractIDMSubsystemReader method parseIdentityManagementConfig.
private void parseIdentityManagementConfig(final XMLExtendedStreamReader reader, final ModelNode parentNode, final List<ModelNode> addOperations) throws XMLStreamException {
ModelNode identityManagementNode = parseConfig(reader, PARTITION_MANAGER, COMMON_NAME.getName(), parentNode, PartitionManagerResourceDefinition.INSTANCE.getAttributes(), addOperations);
parseElement(new ElementParser() {
@Override
public void parse(final XMLExtendedStreamReader reader, final ModelElement element, final ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
switch(element) {
case IDENTITY_CONFIGURATION:
parseIdentityConfigurationConfig(reader, parentNode, addOperations);
break;
}
}
}, PARTITION_MANAGER, identityManagementNode, reader, addOperations);
}
use of org.jboss.dmr.ModelNode in project wildfly by wildfly.
the class IDMSubsystemReader_1_0 method parseLDAPMappingConfig.
@Override
protected void parseLDAPMappingConfig(final XMLExtendedStreamReader reader, final ModelNode identityProviderNode, final List<ModelNode> addOperations) throws XMLStreamException {
String name = reader.getAttributeValue("", COMMON_CLASS_NAME.getName());
if (name == null) {
name = reader.getAttributeValue("", COMMON_CODE.getName());
if (name != null) {
name = AttributedTypeEnum.forType(name);
}
}
ModelNode ldapMappingConfig = parseConfig(reader, LDAP_STORE_MAPPING, name, identityProviderNode, LDAPStoreMappingResourceDefinition.INSTANCE.getAttributes(), addOperations);
parseElement(new ElementParser() {
@Override
public void parse(final XMLExtendedStreamReader reader, final ModelElement element, final ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
switch(element) {
case LDAP_STORE_ATTRIBUTE:
parseConfig(reader, LDAP_STORE_ATTRIBUTE, LDAPStoreAttributeResourceDefinition.NAME.getName(), parentNode, LDAPStoreAttributeResourceDefinition.INSTANCE.getAttributes(), addOperations);
break;
}
}
}, LDAP_STORE_MAPPING, ldapMappingConfig, reader, addOperations);
}
use of org.jboss.dmr.ModelNode in project wildfly by wildfly.
the class IDMSubsystemWriter method writeContent.
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
// Start subsystem
context.startSubsystemElement(Namespace.CURRENT.getUri(), false);
ModelNode subsystemNode = context.getModelNode();
if (subsystemNode.isDefined()) {
List<ModelNode> identityManagement = subsystemNode.asList();
for (ModelNode modelNode : identityManagement) {
writers.get(PARTITION_MANAGER.getName()).write(writer, modelNode);
}
}
// End subsystem
writer.writeEndElement();
}
use of org.jboss.dmr.ModelNode in project wildfly by wildfly.
the class FederationSubsystem_1_0_CertAliasUnsupportedTestCase method failWriteTrustDomainWithCertAlias.
@Test
public void failWriteTrustDomainWithCertAlias() throws Exception {
//Parse the subsystem xml and install into the first controller
String subsystemXml = readResource("federation-subsystem-1.0.xml");
KernelServices servicesA = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT).setSubsystemXml(subsystemXml).build();
PathAddress address = PathAddress.pathAddress(FederationExtension.SUBSYSTEM_PATH).append(ModelElement.FEDERATION.getName(), "federation-without-signatures").append(ModelElement.IDENTITY_PROVIDER.getName(), "idp.war").append(ModelElement.IDENTITY_PROVIDER_TRUST_DOMAIN.getName(), "invalid-trust-domain");
ModelNode operation = Util.getWriteAttributeOperation(address, ModelElement.IDENTITY_PROVIDER_TRUST_DOMAIN_CERT_ALIAS.getName(), new ModelNode("servercert"));
servicesA.executeForFailure(operation);
}
Aggregations