Search in sources :

Example 1 with XMLExtendedStreamReader

use of org.jboss.staxmapper.XMLExtendedStreamReader 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);
}
Also used : ModelElement(org.wildfly.extension.picketlink.common.model.ModelElement) XMLStreamException(javax.xml.stream.XMLStreamException) ModelNode(org.jboss.dmr.ModelNode) XMLExtendedStreamReader(org.jboss.staxmapper.XMLExtendedStreamReader)

Example 2 with XMLExtendedStreamReader

use of org.jboss.staxmapper.XMLExtendedStreamReader 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);
}
Also used : ModelElement(org.wildfly.extension.picketlink.common.model.ModelElement) XMLStreamException(javax.xml.stream.XMLStreamException) ModelNode(org.jboss.dmr.ModelNode) XMLExtendedStreamReader(org.jboss.staxmapper.XMLExtendedStreamReader)

Example 3 with XMLExtendedStreamReader

use of org.jboss.staxmapper.XMLExtendedStreamReader 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);
}
Also used : ModelElement(org.wildfly.extension.picketlink.common.model.ModelElement) XMLStreamException(javax.xml.stream.XMLStreamException) ModelNode(org.jboss.dmr.ModelNode) XMLExtendedStreamReader(org.jboss.staxmapper.XMLExtendedStreamReader)

Example 4 with XMLExtendedStreamReader

use of org.jboss.staxmapper.XMLExtendedStreamReader in project wildfly by wildfly.

the class AbstractFederationSubsystemReader method parseIdentityProviderConfig.

private void parseIdentityProviderConfig(final XMLExtendedStreamReader reader, final ModelNode federationNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode identityProviderNode = parseConfig(reader, IDENTITY_PROVIDER, COMMON_NAME.getName(), federationNode, Arrays.asList(IdentityProviderResourceDefinition.ATTRIBUTE_DEFINITIONS), 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_PROVIDER_TRUST_DOMAIN:
                    parseConfig(reader, IDENTITY_PROVIDER_TRUST_DOMAIN, COMMON_NAME.getName(), parentNode, TrustDomainResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                case IDENTITY_PROVIDER_ROLE_GENERATOR:
                    parseConfig(reader, IDENTITY_PROVIDER_ROLE_GENERATOR, COMMON_NAME.getName(), parentNode, RoleGeneratorResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                case IDENTITY_PROVIDER_ATTRIBUTE_MANAGER:
                    parseConfig(reader, IDENTITY_PROVIDER_ATTRIBUTE_MANAGER, COMMON_NAME.getName(), parentNode, AttributeManagerResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                case COMMON_HANDLER:
                    parseHandlerConfig(reader, parentNode, addOperations);
                    break;
                default:
                    throw unexpectedElement(reader);
            }
        }
    }, IDENTITY_PROVIDER, identityProviderNode, reader, addOperations);
}
Also used : ModelElement(org.wildfly.extension.picketlink.common.model.ModelElement) XMLStreamException(javax.xml.stream.XMLStreamException) ModelNode(org.jboss.dmr.ModelNode) XMLExtendedStreamReader(org.jboss.staxmapper.XMLExtendedStreamReader)

Example 5 with XMLExtendedStreamReader

use of org.jboss.staxmapper.XMLExtendedStreamReader in project wildfly by wildfly.

the class AbstractFederationSubsystemReader method parseServiceProviderConfig.

private void parseServiceProviderConfig(final XMLExtendedStreamReader reader, ModelNode federationNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode serviceProviderNode = parseConfig(reader, SERVICE_PROVIDER, COMMON_NAME.getName(), federationNode, Arrays.asList(ServiceProviderResourceDefinition.ATTRIBUTE_DEFINITIONS), 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 COMMON_HANDLER:
                    parseHandlerConfig(reader, parentNode, addOperations);
                    break;
            }
        }
    }, SERVICE_PROVIDER, serviceProviderNode, reader, addOperations);
}
Also used : ModelElement(org.wildfly.extension.picketlink.common.model.ModelElement) XMLStreamException(javax.xml.stream.XMLStreamException) ModelNode(org.jboss.dmr.ModelNode) XMLExtendedStreamReader(org.jboss.staxmapper.XMLExtendedStreamReader)

Aggregations

XMLStreamException (javax.xml.stream.XMLStreamException)15 ModelNode (org.jboss.dmr.ModelNode)15 XMLExtendedStreamReader (org.jboss.staxmapper.XMLExtendedStreamReader)15 ModelElement (org.wildfly.extension.picketlink.common.model.ModelElement)15