Search in sources :

Example 11 with ModelElement

use of org.wildfly.extension.picketlink.common.model.ModelElement in project wildfly by wildfly.

the class AbstractIDMSubsystemReader method parseSupportedTypesConfig.

private ModelNode parseSupportedTypesConfig(final XMLExtendedStreamReader reader, final ModelNode identityStoreNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode supportedTypesNode = parseConfig(reader, SUPPORTED_TYPES, null, identityStoreNode, SupportedTypesResourceDefinition.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 SUPPORTED_TYPE:
                    parseSupportedTypeConfig(reader, parentNode, addOperations);
                    break;
            }
        }
    }, SUPPORTED_TYPES, supportedTypesNode, reader, addOperations);
    return supportedTypesNode;
}
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 ModelElement

use of org.wildfly.extension.picketlink.common.model.ModelElement in project wildfly by wildfly.

the class AbstractFederationSubsystemReader method parseFederation.

private void parseFederation(final XMLExtendedStreamReader reader, final ModelNode subsystemNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode federationNode = parseConfig(reader, FEDERATION, COMMON_NAME.getName(), subsystemNode, Arrays.asList(FederationResourceDefinition.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 KEY_STORE:
                    parseKeyStore(reader, parentNode, addOperations);
                    break;
                case SAML:
                    parseConfig(reader, SAML, null, parentNode, SAMLResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                case IDENTITY_PROVIDER:
                    parseIdentityProviderConfig(reader, parentNode, addOperations);
                    break;
                case SERVICE_PROVIDER:
                    parseServiceProviderConfig(reader, parentNode, addOperations);
                    break;
                default:
                    throw unexpectedElement(reader);
            }
        }
    }, FEDERATION, federationNode, 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 ModelElement

use of org.wildfly.extension.picketlink.common.model.ModelElement 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 14 with ModelElement

use of org.wildfly.extension.picketlink.common.model.ModelElement 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 15 with ModelElement

use of org.wildfly.extension.picketlink.common.model.ModelElement 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)

Aggregations

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