Search in sources :

Example 11 with XMLExtendedStreamReader

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

the class FederationSubsystemReader_2_0 method parseKeyStore.

protected void parseKeyStore(XMLExtendedStreamReader reader, ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode identityProviderNode = parseConfig(reader, KEY_STORE, null, parentNode, KeyStoreProviderResourceDefinition.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 KEY:
                    parseConfig(reader, KEY, COMMON_NAME.getName(), parentNode, KeyResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                default:
                    throw unexpectedElement(reader);
            }
        }
    }, KEY_STORE, 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 12 with XMLExtendedStreamReader

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

the class AbstractFederationSubsystemReader method parseHandlerConfig.

protected void parseHandlerConfig(final XMLExtendedStreamReader reader, final ModelNode entityProviderNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode handlerNode = parseConfig(reader, COMMON_HANDLER, COMMON_NAME.getName(), entityProviderNode, HandlerResourceDefinition.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 COMMON_HANDLER_PARAMETER:
                    parseConfig(reader, COMMON_HANDLER_PARAMETER, COMMON_NAME.getName(), parentNode, HandlerParameterResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                default:
                    throw unexpectedElement(reader);
            }
        }
    }, COMMON_HANDLER, handlerNode, 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 13 with XMLExtendedStreamReader

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

the class AbstractFederationSubsystemReader method parseKeyStore.

protected void parseKeyStore(XMLExtendedStreamReader reader, ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode identityProviderNode = parseConfig(reader, KEY_STORE, null, parentNode, KeyStoreProviderResourceDefinition.INSTANCE.getAttributes(), addOperations);
    parseElement(new ElementParser() {

        @Override
        public void parse(final XMLExtendedStreamReader reader, final ModelElement element, final ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
            throw unexpectedElement(reader);
        }
    }, KEY_STORE, 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 14 with XMLExtendedStreamReader

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

the class AbstractIDMSubsystemReader method parseLDAPMappingConfig.

protected void parseLDAPMappingConfig(final XMLExtendedStreamReader reader, final ModelNode identityProviderNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode ldapMappingConfig = parseConfig(reader, LDAP_STORE_MAPPING, COMMON_NAME.getName(), 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 15 with XMLExtendedStreamReader

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

the class AbstractIDMSubsystemReader method parseLDAPStoreConfig.

private void parseLDAPStoreConfig(final XMLExtendedStreamReader reader, final List<ModelNode> addOperations, final ModelNode identityManagementNode) throws XMLStreamException {
    ModelNode ldapStoreNode = parseConfig(reader, LDAP_STORE, null, identityManagementNode, LDAPStoreResourceDefinition.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 LDAP_STORE_MAPPING:
                    parseLDAPMappingConfig(reader, parentNode, addOperations);
                    break;
                case SUPPORTED_TYPES:
                    parseSupportedTypesConfig(reader, parentNode, addOperations);
                    break;
            }
        }
    }, LDAP_STORE, ldapStoreNode, 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